Profile background

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

    Profile background

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

    #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.!

    Comment


      #3
      No thats easy lol i know that code i want a code like
      Code:
      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

      Comment


        #4
        in viewuser change
        PHP Code:
        <link rel="StyleSheet" type="text/css" href="style.css"/> 
        to
        PHP Code:
        $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.!

        Comment


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

          Comment


            #6
            Code:
            //////////////////////////////////////////////////////////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&amp;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&amp;sid=$sid\">&#187;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&amp;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&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
            echo "Pagina inicial</a>";
              echo "</p>";
            
            }
            
            
            //////////////////////////////////////////////////////////usage
              echo "<a href=\"index.php?action=sitethms&amp;sid=$sid\">&#187;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>";
            ?>
            Attached Files

            Comment


              #7
              Genproc.php
              Code:
              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&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
                echo "</p>";
                echo "</body>";
                echo "</html>";
                exit();
              }
              index.php
              Code:
              ////////////////////////////////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&amp;sid=$sid\">&#187;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&amp;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&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
              echo "Home</a>";
                echo "</p>";
              
              }
              this is english

              Comment


                #8
                Thanks Mate..
                LESS TALK. LESS MISTAKE.

                HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

                Comment


                  #9
                  ok so what code should go in the viewuser part ?

                  Comment


                    #10
                    @wap_king, review the post of Vayne

                    Comment


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

                      Comment

                      Working...
                      X