User Can Add Their Own Background Image

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

    User Can Add Their Own Background Image

    Hey guys. I have been try this whole time to create a code that will allow each user to add their own image in the background of the site but can get it to work. can anyone help me with this please? I was trying to get ideas from the avatar but it aint working.

    I use this code in the xhtmlhead
    PHP Code:
    function xhtmlhead($page_title$page_style="")
    {
        
    $ret "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
        
    $ret .= "\n<head>\n<title>$page_title</title>\n";
        
    $ret .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />";
        
    $ret .= "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
            
    $ret .= "<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>";
        
    $ret .= "\n".$page_style;
            
    $uid getuid_sid($sid);
            
    $thinfo mysql_fetch_array(mysql_query("SELECT background FROM ibwf_users WHERE id='".$uid."'"));
         
    $ret .="<body background=\"$thinfo[0]\" bgproperties=\"fixed\">";
            
    $ret .= "<link href=\"http://dj-marc.wen.ru/web/fav2.gif\" rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\"> </link>";
            
    //$ret = "<LINK REL="SHORTCUT ICON" HREF="http://dj-marc.wen.ru/web/fav2.gif">";
        
    $ret .= "\n</head>\n<body>";
        return 
    $ret;

    I just cant retrieve the info for the body background image
    Last edited by Dj-marc; 17.07.10, 17:01.

    WapCHAT Forum Currenltly changing over to xhtml

    My Dowloads Site

    #2
    Does this work?

    PHP Code:
    function xhtmlhead($page_title$page_style="")
    {   
        
    $sid $_GET["sid"];
        
    $uid getuid_sid($sid);

        
    $ret "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
        
    $ret .= "\n<head>\n<title>$page_title</title>\n";
        
    $ret .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />";
        
    $ret .= "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
            
    $ret .= "<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>";
        
    $ret .= "\n".$page_style;
            
            
    $thinfo mysql_fetch_array(mysql_query("SELECT background FROM ibwf_users WHERE id='".$uid."'"));
         
    $ret .="<body background=\"$thinfo[0]\" bgproperties=\"fixed\">";
            
    $ret .= "<link href=\"http://dj-marc.wen.ru/web/fav2.gif\" rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\"> </link>";
            
    //$ret = "<LINK REL="SHORTCUT ICON" HREF="http://dj-marc.wen.ru/web/fav2.gif">";
        
    $ret .= "\n</head>\n<body>"
        return 
    $ret;

    Comment


      #3
      Originally posted by Dj-marc View Post
      Hey guys. I have been try this whole time to create a code that will allow each user to add their own image in the background of the site but can get it to work. can anyone help me with this please? I was trying to get ideas from the avatar but it aint working.

      I use this code in the xhtmlhead
      PHP Code:
      function xhtmlhead($page_title$page_style="")
      {
          
      $ret "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
          
      $ret .= "\n<head>\n<title>$page_title</title>\n";
          
      $ret .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />";
          
      $ret .= "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
              
      $ret .= "<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>";
          
      $ret .= "\n".$page_style;
              
      $uid getuid_sid($sid);
              
      $thinfo mysql_fetch_array(mysql_query("SELECT background FROM ibwf_users WHERE id='".$uid."'"));
           
      $ret .="<body background=\"$thinfo[0]\" bgproperties=\"fixed\">";
              
      $ret .= "<link href=\"http://dj-marc.wen.ru/web/fav2.gif\" rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\"> </link>";
              
      //$ret = "<LINK REL="SHORTCUT ICON" HREF="http://dj-marc.wen.ru/web/fav2.gif">";
          
      $ret .= "\n</head>\n<body>";
          return 
      $ret;

      I just cant retrieve the info for the body background image
      just use it in css ok....

      ?>
      $url = "image/haha.gif";
      background-image:url("$url");
      <?php
      sigpic
      Visit my WEBSITE Project: http://www.aspirewap.net

      Comment


        #4
        Im not too familiar with css

        Added after 25 minutes:

        bro I use sql too. i want it so that user can change the image in control panel to there likes
        Last edited by Dj-marc; 17.07.10, 19:02.

        WapCHAT Forum Currenltly changing over to xhtml

        My Dowloads Site

        Comment


          #5
          u can add



          Code:
          echo "<style type=\"text/css\">";
          background-image:url("$url");
          echo "</style>";
          on the page u want the image.

          Before <body>
          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...
          _______
          Info & Tips
          php.net
          w3schools.com

          Comment


            #6
            I know that one bro but have it on all pages but like how a user can change their profile pic I want them to be able to change the background image also using sql.

            WapCHAT Forum Currenltly changing over to xhtml

            My Dowloads Site

            Comment


              #7
              add it to all pages then ..

              with sql to there pic is hold
              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...
              _______
              Info & Tips
              php.net
              w3schools.com

              Comment


                #8
                allow users to either upload image or ad a image link to the control panel
                fetch the sql data for the particular user and get the image link in $bg_url n below that use the following code

                body
                {
                background-image:
                url('<?php echo $bg_url ?>);
                background-repeat:
                no-repeat;
                background-attachment:
                fixed
                }

                Comment


                  #9
                  Originally posted by riderz
                  do u already have the code that u can upload the images or is it what u want now

                  coz the above codes given u add on all pages then u make ur uploader and it will display ur uploaded images
                  Code:
                  echo "<style type=\"text/css\">";
                       $bg = mysql_fetch_array(mysql_query("SELECT background FROM ibwf_users WHERE id='".$uid."'"));
                  background-image:url("$bg");
                  echo "</style>";
                  then u can use the avatar uploader just modify it to upload it to background
                  slight error
                  change:
                  background-image:url("$bg");
                  to
                  background-image:url("$bg[0]");

                  Comment

                  Working...
                  X