Profile background

Started on the old forum in July 2009 · view the original in the archive · old links redirect here

10 replies · 988 views · started 17 years ago · 1 min read

5 participants
riderz Lead · 975 posts #1

Who can help me i want to add a code where members can choose a background theme for theire profile


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

Vayne Developer · 106 posts #2

$style = mysql_fetch_array(mysql_query("SELECT style FROM table WHERE uid='".$id."'"));

<link rel="StyleSheet" type="text/css" href="$style[0]"/>

something like this? 🙂

Nous Ne Dansos Pas, Nous Sommes Le Danse.!

riderz Lead · 975 posts #3

No thats easy lol i know that code i want a code like

boxstart ("Theme");
    echo "<small>Theme:</small> <select name=\"theme\" value=\"$theme[0]\">";
    if (strstr($_SERVER['HTTP_USER_AGENT'], "MOT-")) {
        echo "<optgroup>";
        }
    if($theme[0]=="1"){
    echo "<option value=\"1\" selected=\"1\">$stitle</option>";
    }else{
    echo "<option value=\"1\">$stitle</option>";
    }
    if($theme[0]=="2"){
    echo "<option value=\"2\" selected=\"2\">Blue</option>";
    }else{
    echo "<option value=\"2\">Blue</option>";
    }
    if($theme[0]=="3"){
    echo "<option value=\"3\" selected=\"3\">Black to White</option>";
    }else{
    echo "<option value=\"3\">Black to White</option>";
    }
    if($theme[0]=="4"){
    echo "<option value=\"4\"  selected=\"4\">Red</option>";
    }else{
    echo "<option value=\"4\">Red</option>";
    }
    if($theme[0]=="5"){
    echo "<option value=\"5\"  selected=\"5\">Green</option>";
    }else{
    echo "<option value=\"5\">Green</option>";
    }
    if($theme[0]=="6"){
    echo "<option value=\"6\"  selected=\"6\">Goth</option>";
    }else{
    echo "<option value=\"6\">Goth</option>";
    }
    if($theme[0]=="7"){
    echo "<option value=\"7\"  selected=\"7\">Opera WML</option>";
    }else{
    echo "<option value=\"7\">Opera WML</option>";
    }
    if($theme[0]=="8"){
    echo "<option value=\"8\"  selected=\"8\">Error</option>";
    }else{
    echo "<option value=\"8\">Error</option>";
    }
    if($theme[0]=="9"){
    echo "<option value=\"9\"  selected=\"9\">Grey Orange</option>";
    }else{
    echo "<option value=\"9\">Grey Orange</option>";
    }
    if($theme[0]=="10"){
    echo "<option value=\"10\"  selected=\"10\">Pinky</option>";
    }else{
    echo "<option value=\"10\">Pinky</option>";
    }
    if($theme[0]=="11"){
    echo "<option value=\"11\"  selected=\"11\">Matrix</option>";
    }else{
    echo "<option value=\"11\">Matrix</option>";
    }
    if($theme[0]=="12"){
    echo "<option value=\"12\"  selected=\"12\">windows</option>";
    }else{
    echo "<option value=\"12\">windows</option>";
    }
    if($theme[0]=="13"){
    echo "<option value=\"13\"  selected=\"13\">Night Pink</option>";
    }else{
    echo "<option value=\"13\">Night Pink</option>";
    }
    if (strstr($_SERVER['HTTP_USER_AGENT'], "MOT-")) {
        echo "</optgroup>";
        }
    echo "</select><br/><br/>";
boxend();

except it must not be for the site it must be for the profile where everyone see it


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

Vayne Developer · 106 posts #4

in viewuser change

<link rel="StyleSheet" type="text/css" href="style.css"/>

to

$style = mysql_fetch_array(mysql_query("SELECT style FROM table WHERE uid='".$id."'"));
<link rel="StyleSheet" type="text/css" href="$style[0]"/>

Nous Ne Dansos Pas, Nous Sommes Le Danse.!

riderz Lead · 975 posts #5

I got the code right now my users can change their profile theme


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #6
//////////////////////////////////////////////////////////genproc.php
            
               else if($action=="updtthme")
{

  addonline(getuid_sid($sid),"Actualizando Perfil","");
  $theme = $_POST["thms"];
  $size = $_POST["size"];
  $uid = getuid_sid($sid);
  $exist = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fun_users WHERE id='".$uid."'"));
if ($exist[0]>0)
  {
  $res = mysql_query("UPDATE fun_users SET theme='".$theme.".css' WHERE id='".$uid."'");
  }else{
  $res = mysql_query("UPDATE fun_users SET theme='".$theme.".css' WHERE id='".$uid."'");
  }
  echo "<p align=\"center\">";
  echo mysql_error();
if($res)
  {
  echo "<img src=\"images/ok.gif\" alt=\"o\"/>Tema Actualizado<br/><br/><br/>";
  }else{
  echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/><br/>";
  }
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Página Inicial</a>";
  echo "</p>";
  echo "</body>";
  echo "</html>";
  exit();
}

//////////////////////////////////////////////////////////index.php
else if($action=="sitethms")
{
    addonline(getuid_sid($sid),"Tema do Perfil","");

    echo "<p align=\"center\">";
        echo "</p>";
    echo "<p>";
    $tmsg = getpmcount(getuid_sid($sid));
  $umsg = getunreadpm(getuid_sid($sid));
  echo "<a href=\"inbox.php?action=main&sid=$sid\">»Torpedo's($umsg/$tmsg)</a><br/>";
  $uid =getuid_sid($sid);
  //$new_gm = getnewgml($uid);
  echo "<p align=\"center\">";
  echo "<form action=\"genproc.php?action=updtthme&sid=$sid\" method=\"post\">";
  include("set.php");
  echo "<input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>";
  echo "</p>";

  echo "</p>";

    echo "<p align=\"center\">";

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

}

//////////////////////////////////////////////////////////usage
  echo "<a href=\"index.php?action=sitethms&sid=$sid\">»Site Themes</a><br/>";
  
//////////////////////////////////////////////////////////in profile
   $theme1 = mysql_fetch_array(mysql_query("SELECT theme FROM fun_users WHERE id='".$who."'"));
      echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme1[0]\" />";
	  echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
      echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
      
/////////////////////////////////////////////////////////set.php
<?php
echo "<select name=\"thms\">";
echo "<option value=\"style\">Default</option>";
echo "<option value=\"barbie\">Barbie</option>";
echo "<option value=\"blue\">Blue</option>";
echo "<option value=\"hell\">Hell</option>";
echo "<option value=\"lime\">Lima</option>";
echo "<option value=\"love\">Love</option>";
echo "<option value=\"matrix\">Matrix</option>";
echo "<option value=\"stalker\">Stalker</option>";
echo "<option value=\"strike\">Strike</option>";
echo "<option value=\"wanted\">NFS Most Wanted</option>";
echo "<option value=\"white\">White</option>";
echo "</select>";
?>

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

Attachments: style.zip
riderz Lead · 975 posts #7

Genproc.php

else if($action=="updtthme")
{

  addonline(getuid_sid($sid),"Update Profile theme","");
  $theme = $_POST["thms"];
  $size = $_POST["size"];
  $uid = getuid_sid($sid);
  $exist = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$uid."'"));
if ($exist[0]>0)
  {
  $res = mysql_query("UPDATE ibwf_users SET theme='".$theme.".css' WHERE id='".$uid."'");
  }else{
  $res = mysql_query("UPDATE ibwf_users SET theme='".$theme.".css' WHERE id='".$uid."'");
  }
  echo "<p align=\"center\">";
  echo mysql_error();
if($res)
  {
  echo "<img src=\"images/ok.gif\" alt=\"o\"/>Updated<br/><br/><br/>";
  }else{
  echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/><br/>";
  }
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p>";
  echo "</body>";
  echo "</html>";
  exit();
}

index.php

////////////////////////////////Profile Theme
else if($action=="sitethms")
{
    addonline(getuid_sid($sid),"Profile Theme","");
boxstart("Theme");
    echo "<p align=\"center\">";
        echo "</p>";
    echo "<p>";
    $tmsg = getpmcount(getuid_sid($sid));
  $umsg = getunreadpm(getuid_sid($sid));
  echo "<a href=\"inbox.php?action=main&sid=$sid\">»Pm's($umsg/$tmsg)</a><br/>";
  $uid =getuid_sid($sid);
  //$new_gm = getnewgml($uid);
  echo "<p align=\"center\">";
  echo "<form action=\"genproc.php?action=updtthme&sid=$sid\" method=\"post\">";
  include("set.php");
  echo "<input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>";
  echo "</p>";

  echo "</p>";

    echo "<p align=\"center\">";

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

}

this is english


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

wap_king Developer · 126 posts #9

ok so what code should go in the viewuser part ?

wap_king Developer · 126 posts #11

oh damn didnt notice......any one try it n it works

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