Cant get user profile background to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cant get user profile background to work

    Hey guys been working on this one all day and cant get it to work, its for wapdesire v2, everytime i view a profile it shows the profile theme that i chose and not the theme that the user has...

    heres what i have.. cant fix it

    PROTHEME.PHP
    PHP Code:
    <?php 
    define
    ('WCS',true); 
    include(
    './core/main.inc'); 
    header_type(); 
    cleardata(); 
    if(
    ipbanned(ip(),browser())){ 
    if(!
    shield(getuid_sid($sid))){ 
    echo 
    head_tag("Ip Blocked!!!",0,0); 
    echo 
    ipbanned_msg(); 
    echo 
    foot_tag(); 
    exit(); 


    if(!
    islogged($sid)){ 
    echo 
    head_tag("Error!!!",0,0); 
    echo 
    session_expired(); 
    echo 
    foot_tag(); 
    exit(); 

    if(
    banned(getuid_sid($sid))){ 
    echo 
    head_tag("Error!!!",1,getnick_sid($sid)); 
    echo 
    banned_msg($sid); 
    echo 
    foot_tag(); 
    exit(); 

    mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); 


    ////////////////////////////////Profile Theme

    if($action=="sitethms")
    {
        
    addonline(getuid_sid($sid),"Rate",""); 
    $nick=getnick_sid($sid); 
    echo 
    head_tag($nick."@Rate",1,getnick_sid($sid)); 
    $title="<b>Rate</b>"
    //boxstart("Theme");
        
    $main.="<p align=\"center\">";
             
    $main.="</p>";
         
       
    //$tmsg = getpmcount(getuid_sid($sid));
      //$umsg = getunreadpm(getuid_sid($sid));
      
    $main.="<a href=\"../inbox/inbox.php?sid=$sid\">Inbox</a><br/>";
      
    $uid =getuid_sid($sid);
      
    //$new_gm = getnewgml($uid);
       
    $main.="<p align=\"center\">";
      
    $main.="<form action=\"genproc.php?action=updtthme&amp;sid=$sid\" method=\"post\">";
      include(
    "set.php");
      
    $main.="<input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>";
       
    $main.="</p>";

       
    $main.="</p>";

        
    $main.="<p align=\"center\">";

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

    $main.="<p align=".align()."><a href=\"online.php?sid=$sid\">Online menu</a>| 
    <a href=\"extras.php?sid=
    $sid\">Extras</a>| 
    <a href=\"../inbox/inbox.php?sid=
    $sid\">Inbox</a>| 
    <a href=\"../buds/buds.php?sid=
    $sid\">BuddyList</a>| 
    <a href=\"../chat/public.php?sid=
    $sid\">Chat</a>| 
    <a href=\"../forums/forums.php?sid=
    $sid\">Forums</a><br/> 
    <a href=\"main.php?sid=
    $sid\"><imgsrc=\"../images/home.gif\"alt=\"\"/>Main Menu</a></p>"
    echo 
    xhtml($sid,$title,1,$L1,$L2,$L3,$L4,0,0,0,0,$main); 
    echo 
    foot_tag(); 
    exit; 
    }
    SET.PHP
    PHP Code:
    <?php
    $main
    .="<select name=\"thms\">";
    $main.="<option value=\"style\">Default</option>";
    $main.="<option value=\"barbie\">Barbie</option>";
    $main.="<option value=\"blue\">Blue</option>";
    $main.="<option value=\"hell\">Hell</option>";
    $main.="<option value=\"lime\">Lima</option>";
    $main.="<option value=\"love\">Love</option>";
    $main.="<option value=\"matrix\">Matrix</option>";
    $main.="<option value=\"stalker\">Stalker</option>";
    $main.="<option value=\"strike\">Strike</option>";
    $main.="<option value=\"wanted\">NFS Most Wanted</option>";
    $main.="<option value=\"white\">White</option>";
    $main.="</select>";
    ?>
    GENPROC.PHP
    PHP Code:
    <?php 
    define
    ('WCS',true); 
    include(
    './core/main.inc'); 
    header_type(); 
    cleardata(); 
    if(
    ipbanned(ip(),browser())){ 
    if(!
    shield(getuid_sid($sid))){ 
    echo 
    head_tag("Ip Blocked!!!",0,0); 
    echo 
    ipbanned_msg(); 
    echo 
    foot_tag(); 
    exit(); 


    if(!
    islogged($sid)){ 
    echo 
    head_tag("Error!!!",0,0); 
    echo 
    session_expired(); 
    echo 
    foot_tag(); 
    exit(); 

    if(
    banned(getuid_sid($sid))){ 
    echo 
    head_tag("Error!!!",1,getnick_sid($sid)); 
    echo 
    banned_msg($sid); 
    echo 
    foot_tag(); 
    exit(); 

    mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); 

    //////////////Update/////////////////

    if($action=="updtthme")
    {

      
    addonline(getuid_sid($sid),"Comments",""); 
    $nick=getnick_sid($sid); 
    echo 
    head_tag($nick."@Comments",1,getnick_sid($sid)); 
    $title.="<b>Comments</b>"
      
    $theme $_POST["thms"];
      
    $size $_POST["size"];
      
    $uid getuid_sid($sid);
      
    $exist mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE id='".$uid."'"));
    if (
    $exist[0]>0)
      {
      
    $res mysql_query("UPDATE users SET theme='".$theme.".css' WHERE id='".$uid."'");
      }else{
      
    $res mysql_query("UPDATE users SET theme='".$theme.".css' WHERE id='".$uid."'");
      }
      
    $main.="<p align=\"center\">";
      echo 
    mysql_error();
    if(
    $res)
      {
      
    $main.="<img src=\"images/ok.gif\" alt=\"o\"/>Updated<br/><br/><br/>";
      }else{
      
    $main.="<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/><br/>";
      }
      
    $main.="<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      
    $main.="</p>";
      
    $main.="</body>";
      
    $main.="</html>";
     
    $main.="<p align=".align()."><a href=\"online.php?sid=$sid\">Online menu</a>| 
    <a href=\"extras.php?sid=
    $sid\">Extras</a>| 
    <a href=\"../inbox/inbox.php?sid=
    $sid\">Inbox</a>| 
    <a href=\"../buds/buds.php?sid=
    $sid\">BuddyList</a>| 
    <a href=\"../chat/public.php?sid=
    $sid\">Chat</a>| 
    <a href=\"../forums/forums.php?sid=
    $sid\">Forums</a><br/> 
    <a href=\"main.php?sid=
    $sid\"><imgsrc=\"../images/home.gif\"alt=\"\"/>Main Menu</a></p>"
    echo 
    xhtml($sid,$title,1,$L1,$L2,$L3,$L4,0,0,0,0,$main); 
    echo 
    foot_tag(); 
    exit; 
    }
    IN PROFILE.PHP I ADDED THIS
    PHP Code:
     $theme1 mysql_fetch_array(mysql_query("SELECT theme FROM users WHERE id='".$who."'"));
         
    $main.="<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme1[0]\" />";
          
    $main.="<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
          
    $main.="<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
          
    $main.="<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n"
    and in database users i added
    PHP Code:
    theme varcher100 as defined matrix 

    I dont know whats gone wrong here..

    I think the database is wrong and the part on profiles, i actually helped mzdisires out on here and she has this BUT wouldnt share it, people were right, shes a scrounger so never again will i help her.

    Many thanks in advance for any help gave
    Last edited by DeViLzHeLpEr; 24.05.12, 17:56. Reason: wrong spelling

    #2
    this works bud, ive added to a few sites using v2
    put this in settings folder

    protheme.php
    Code:
    <?php
    define('WCS',true);
    include('../core/main.inc');
    header_type();
    cleardata();
    if(ipbanned(ip(),browser())){
    if(!shield(getuid_sid($sid))){
    echo head_tag("Ip Blocked!!!",0,0);
    echo ipbanned_msg();
    echo foot_tag();
    exit();
    }
    }
    if(!islogged($sid)){
    echo head_tag("Error!!!",0,0);
    echo session_expired();
    echo foot_tag();
    exit();
    }
    if(banned(getuid_sid($sid))){
    echo head_tag("Error!!!",1,getnick_sid($sid));
    echo banned_msg($sid);
    echo foot_tag();
    exit();
    }
    mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'");
    
    ///////////////////////// PROFILE THEMES/////////////////////////
    
    if($update==2)
    {
    addonline(getuid_sid($sid),"Changing Theme","");
    echo head_tag(getnick_sid($sid)."@Changing Theme",1,getnick_sid($sid));
    $title="<b>Changing Theme</b>";
    $theme1 = $_POST["thms"];
      $size = $_POST["size"];
      //$uid = getuid_sid($sid);
    $main="<p align=".align().">";
    
    $res=mysql_query("UPDATE users SET profiletheme='".$theme1."_".$size.".css' WHERE id='".getuid_sid($sid)."'");
    if($res){$main.="<img src=\"../images/ok.gif\" alt=\"o\"/><br/>Profile Theme Updated";}
    else{$main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>".mysql_error()."<br/>Error Cannot Update Profile Theme!";}
    $main.="<br/>
    <br/>$fivekey<a $key5 href=\"./settings.php?sid=$sid\">Settings</a>
    </p>\n";
    $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";
    $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";
    $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";
    $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";
    $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>";
    echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    echo foot_tag();
    exit;
    }
    
    addonline(getuid_sid($sid),"Profile Themes","");
    echo head_tag(getnick_sid($sid)."@Themes",1,getnick_sid($sid));
    $title="<b>Select your Profile Theme</b>";
    $main="<p align=".align().">
    Here you can change your Profile Theme <br/>
    u can always change things back if you dont like it :o)
    </p>\n";
    $main.="<div class=".align().">
    
    <form action=\"protheme.php?update=2&amp;sid=$sid\" method=\"post\">
    <select name=\"thms\">
    <option value=\"fullcircle\">Fullcircle</option>
    </select>
    <select name=\"size\">
    <option value=\"small\">Small</option>
    <option value=\"medium\">Medium</option>
    <option value=\"large\">Large</option>
    </select>
    <input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>
    
    </div>
    <p align=".align().">
    $fivekey<a $key5 href=\"./settings.php?sid=$sid\">Settings</a>
    </p>\n";
    $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";
    $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";
    $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";
    $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";
    $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>";
    echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    echo foot_tag();
    exit;
    ?>
    create new field in users
    profiletheme` varchar(100) NOT NULL DEFAULT 'fullcircle_medium.css'

    create a themes folder and upload background and themes to it.

    add this in profile.php (not the one in settings folder)
    $theme1 = mysql_fetch_array(mysql_query("SELECT profiletheme FROM users WHERE id='".$who."'"));
    $main="<link rel=\"stylesheet\" type=\"text/css\" href=\"./themes/$theme1[0]\">\n";
    Last edited by fullcircle; 24.05.12, 21:59.

    Comment


      #3
      mate, you are trying to get uid from session id so its showing your own uid.. get uid of the user whose profiile you want to wish likewise done by previous replier!!

      Comment


        #4
        Thanks

        Thanks guys, i now have this done thanks to the fullcircle who gave his version.
        Last edited by DeViLzHeLpEr; 25.05.12, 09:03.

        Comment

        Working...
        X