Help With Adding Themes In Lavalair.

Started on the old forum in February 2007 · view the original in the archive · old links redirect here

16 replies · 1,565 views · started 19 years ago · 1 min read

4 participants
Guest #1

I need help in adding themes (CSS) in the lavalair xhtml version. What i did was.... Added this code in index.php....

else if($action=="css")
{
  addonline(getuid_sid($sid),"Updating StyleSheet!","");
    echo "<div align='center'>
";
    echo "[b][u]StyleSheet[/u][/b]

";
    echo "<form action=\"genproc.php?action=css\" method=\"get\">";
        echo "View: <select name=\"thms\">";
  echo "<option value=\"1\">1</option>";
  echo "<option value=\"2\">2</option>";
  echo "<option value=\"3\">3</option>";
    echo "</select>";

    
echo "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
echo "<input type=\"submit\" value=\"GO\"/>";
echo "</form>";
}

Added this in genproc.php...

else if($action=="css")
{
    addonline(getuid_sid($sid),"Selecting StyleSheet","");
    $thms = $_GET["thms"];
  echo "<div align=\"center\">";
  $uid = getuid_sid($sid);
  $res = mysql_query("UPDATE fun_users SET css='".$thms."' WHERE id='".$uid."'");
  if($res)
  {
    echo "<img src=\"images/ok.gif\" alt=\"o\"/>Style Selected successfully!
";
  }else{
    echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Selecting Style!
";
  }
    if ($thms=='1')
        { echo "[b]Sheet 1 selected[/b]";
        }
    else if ($thms=='2')
        { echo "[b]Sheet 2 selected[/b]";
        }
    else if ($thms=='3')
        { echo "[b]Sheet 3 selected[/b]";
        }
    else  {
                echo "[b]ERROR!!![/b]";
                }
            
  echo "
<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</div>";
}

And finally added this on top of index.php......

echo "<head>";
    echo "<title>$stitle</title>";
    
      $style=mysql_query("SELECT css FROM fun_users WHERE id='".$uid."'");
        
    if ($style[0]=='1')
      {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }
    else if ($style[0]=='2')
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style2.css\" />";    
    }
    else if ($style[0]=='3')
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style3.css\" />";    
    }
    else 
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }

    echo "</head>";

But its not working, its showing the default theme....... Can anyone tell me whats wrong where????/ Thanx.

Guest #2

I need help in adding themes (CSS) in the lavalair xhtml version. What i did was.... Added this code in index.php....

else if($action=="css") { addonline(getuid_sid($sid),"Updating StyleSheet!",""); echo " "; echo "StyleSheet

"; echo "<form action="genproc.php?action=css&sid=$sid" method="post">"; echo "View: <select name="thms">"; echo "<option value="1">1</option>"; echo "<option value="2">2</option>"; echo "<option value="3">3</option>"; echo "</select>";

REMOVE THIS: echo "<input type="hidden" name="action" value="$action"/>"; echo "<input type="hidden" name="sid" value="$sid"/>"; echo "<input type="submit" value="GO"/>"; echo "</form>"; }

Added this in genproc.php... else if($action=="css") { addonline(getuid_sid($sid),"Selecting StyleSheet",""); $thms = $_POST["thms"]; echo ""; $uid = getuid_sid($sid); $res = mysql_query("UPDATE fun_users SET css='".$thms."' WHERE id='".$uid."'"); if($res) { echo "<img src="images/ok.gif" alt="o"/>Style Selected successfully! "; }else{ echo "<img src="images/notok.gif" alt="x"/>Error Selecting Style! "; } if ($thms=='1') { echo "Sheet 1 selected"; } else if ($thms=='2') { echo "Sheet 2 selected"; } else if ($thms=='3') { echo "Sheet 3 selected"; } else { echo "ERROR!!!"; }

echo " <a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; }

This is how i did mine. Hope it works!

subzero Super moderator Fellow · 3,954 posts #5
echo "</div>"; [error]
echo "</body";
echo "</html>";
exit();
}

exit(); close door off script no other may past this point

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #6

should i remove this line??

echo "</div>"; [error]

And add exit(); at the bottom?

subzero Super moderator Fellow · 3,954 posts #7

any script must a good head

<?php
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
echo "
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
";
echo "<head>";
<style>
   span { font-size: 11pt; font-family: arial; color: red; font-weight: bold }
   p { font-size: 11pt; font-family: arial; color: red; font-weight: bold }
   select { font-size: 11pt; font-family: arial; color: red; }
   a { font-size: 11pt; font-family: arial; color: navy; font-weight: bold }
   td { font-size: 11pt; font-family: arial; color: brown; font-weight: normal;}
</style> 
<body bgcolor=black>
?>
<title>SITE NAME ??</title></head>

blah your stuff here


echo "</body";
echo "</html>";
exit();
}

thats xhtml format

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #8

try the index no need to chane all title only add </head>

and </body>

more better and saver add </body></html> exit(); etc etc

demo: http://grim-reaper.ws/web/

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #9

haha sub i already have all that, i only posted the main code as that was needed only. lol havnt posted the whole index.php its complete with headers and closing tags etc...

Guest #10

WAHEY!!! I DID IT! Thanx everyone who tried to help. BTW the only line i was missing was **``` $uid = getuid_sid($sid);

thanatos Senior · 261 posts #11

WAHEY!!! I DID IT! Thanx everyone who tried to help. BTW the only line i was missing was **``` $uid = getuid_sid($sid);

does this need sql table? if yes pls post it..

Guest #12

good for yall. i'm still yet to get the site started!

Guest #13

this is a file i just now created to share it with a friend, i see you guys also discussing about the same thing here, so i desided to share the whole thing here..

CODE<?php

include("config.php"); include("core.php");

header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo("<?xml version=\"1.0\"?>"); echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

$brws = explode(" ",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $who = $_GET["who"];

$uid = getuid_sid($sid);

?>

<wml> <?php

/*
Just add themes from AdminCP, this all content is of 'Personal Wap Site' i have used the same codings, now what you have to do is just copy and paste the following header codes to all your xhtml pages. */

/*From here

header("Content-type: text/html; charset=ISO-8859-1"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";

include("config.php"); include("core.php"); connectdb(); $action=$_GET["action"]; $id=$_GET["id"]; $sid = $_GET["sid"]; $rid=$_GET["rid"]; $rpw=$_GET["rpw"]; $brws = explode(" ",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $who = $_GET["who"];

$uid = getuid_sid($sid);

echo "<html xmlns="http://www.w3.org/1999/xhtml">\n"; echo "<head>\n"; echo "<meta http-equiv="Cache-Control" content="max-age=0">\n";

$thid = mysql_fetch_array(mysql_query("SELECT thid FROM ibwf_mypage WHERE uid='".$uid."'")); if($thid[0]==""||$thid[0]==0)$thid[0]=1; $thinfo = mysql_fetch_array(mysql_query("SELECT bgc, txc, lnk, hdc, hbg FROM ibwf_themes WHERE id='".$thid[0]."'")); echo "<style type="text/css">"; echo "body {background-color:#$thinfo[0]; color:#$thinfo[1]}"; echo "h3 {background-color:#$thinfo[4]; color:#$thinfo[3]}"; echo "a:link {color:#$thinfo[2]}"; echo "a:visited {color:#$thinfo[2]}"; echo "</style>";

echo "</head>\n"; echo "<body>\n"; */ /////////////////////////////////////////////////////////////////////// JUST UPTO here!!!!!!

// upload this whole file to server and link it. this is used to change themes.. name it anything.php

addonline(getuid_sid($sid),"Changing Themes","");
echo " "; echo " Select any theme, this will change the whole colours of the site. "; echo "<select name="thms">"; $themes = mysql_query("SELECT id, name FROM ibwf_themes"); while ($theme = mysql_fetch_array($themes)) { echo "<option value="$theme[0]">".htmlspecialchars($theme[1])."</option>"; } echo "</select> "; echo "<anchor>Update"; echo "<go href="genproc.php?action=pws&sid=$sid" method="post">"; echo "<postfield name="thms" value="$(thms)"/>"; echo "</go></anchor>"; echo "

"; echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; // //to be frank i have no idea of codings, this is not my coding, all credit goes to IrisBlaze! //i have edited codes prprerly so it can be used on all pages. Hope this would be useful // to all wapmasters to make their site look something new n unique. // if you do any further updates Please do send me at ( sanghya.sagar@gmail.com ) // to see a demo of this visit my chatrooms at ( http://chat.wapside.net/chat ) // Oh you can also download the chat.php which i have edited with this themes at // ( http://chat.wapside.net/chat/chat.zip ) ?> </wml> very easy ne? hehe.. this took me almost months to do this, any questions ask me through Email or pm me (sagar3) at my site http://chat.wapside.net/chat

khan1 Developer · 101 posts #15

I need help in adding themes (CSS) in the lavalair xhtml version. What i did was.... Added this code in index.php....

else if($action=="css")
{
  addonline(getuid_sid($sid),"Updating StyleSheet!","");
    echo "<div align='center'>
";
    echo "StyleSheet

";
    echo "<form action=\"genproc.php?action=css\" method=\"get\">";
        echo "View: <select name=\"thms\">";
  echo "<option value=\"1\">1</option>";
  echo "<option value=\"2\">2</option>";
  echo "<option value=\"3\">3</option>";
    echo "</select>";

    
echo "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
echo "<input type=\"submit\" value=\"GO\"/>";
echo "</form>";
}

Added this in genproc.php...

else if($action=="css")
{
    addonline(getuid_sid($sid),"Selecting StyleSheet","");
    $thms = $_GET["thms"];
  echo "<div align=\"center\">";
  $uid = getuid_sid($sid);
  $res = mysql_query("UPDATE fun_users SET css='".$thms."' WHERE id='".$uid."'");
  if($res)
  {
    echo "<img src=\"images/ok.gif\" alt=\"o\"/>Style Selected successfully!
";
  }else{
    echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Selecting Style!
";
  }
    if ($thms=='1')
        { echo "Sheet 1 selected";
        }
    else if ($thms=='2')
        { echo "Sheet 2 selected";
        }
    else if ($thms=='3')
        { echo "Sheet 3 selected";
        }
    else  {
                echo "ERROR!!!";
                }
            
  echo "
<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</div>";
}

And finally added this on top of index.php......

echo "<head>";
    echo "<title>$stitle</title>";
    
      $style=mysql_query("SELECT css FROM fun_users WHERE id='".$uid."'");
        
    if ($style[0]=='1')
      {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }
    else if ($style[0]=='2')
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style2.css\" />";    
    }
    else if ($style[0]=='3')
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style3.css\" />";    
    }
    else 
    {
    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }

    echo "</head>";

But its not working, its showing the default theme....... Can anyone tell me whats wrong where????/ Thanx.

need sql table for this script

khan1 Developer · 101 posts #17

sorry to ask but i am gettting error adding row please if possiblle please give sql table as

INSERT css into ibwf_users...... code

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close