Random picture!

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

    Random picture!

    I need random 5 photo gallery code for lavalair wml version.. Please coders help me with this code.. Thanks

    #2
    its already posted

    Comment


      #3
      please share the code in user profile to see 5 pics of the sertain user please
      ________________
      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

      Comment


        #4
        guys i have this code how can i change the random image to a one user pic

        Code:
        $user = getnick_uid($pic[0]);
        $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1"));
        $user = getnick_uid($pic[0]);
        $user = getnick_uid($pic[0]);
        echo "<a href=\"gallery2.php?action=viewuser&amp;sid=$sid&amp;who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
        $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1"));
        $user = getnick_uid($pic[0]);
        echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
        $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1"));
        $user = getnick_uid($pic[0]);
        echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
        $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1"));
        $user = getnick_uid($pic[0]);
        echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
        $pic = mysql_fetch_array(mysql_query("SELECT uid, imageurl FROM ibwf_usergallery ORDER BY RAND() LIMIT 1"));
        $user = getnick_uid($pic[0]);
        echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$pic[0]\"/><img src=\"$pic[1]\" width=\"30\" height=\"30\"/></a>";
        ________________
        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

        Comment


          #5
          Originally posted by Ghetto888 View Post
          I need random 5 photo gallery code for lavalair wml version.. Please coders help me with this code.. Thanks
          use this.

          if u have other sql of gallery then change according to it


          PHP Code:
          echo "<br/><b><u><i>Random Image:</i></u></b><br/>";
          $sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl  FROM fun_gallery ORDER BY RAND() LIMIT 1"));
          $nick getnick_uid($sql[0]);
          echo 
          "<img src=\"$sql[1]\" alt=\"$sql[0]\"/><br/><a href=\"index.php?action=viewuser&amp;who=$sql[0]&amp;sid=$sid\">$nick</a><br/>-----<br/>"

          Comment


            #6
            Thanks, ))

            Comment


              #7
              if u want five random gallery photo then change its limit from 1 to 5

              Comment


                #8
                i use

                PHP Code:
                $query=query("*",gallery,"type='I' ORDER BY RAND() LIMIT 5");
                if(
                mysql_num_rows($query)>0){
                while(
                $row=mysql_fetch_array($query)){
                $user=UserFromId($row['uid']);
                $random.="<img src=\"/phpThumb/phpThumb.php?src=$row[path]&amp;h=50&amp;f=gif\" alt=\"$user\"/>\n";
                }

                Comment


                  #9
                  any0ne here wh0 c0uld help me make a new wapsite? 0ur server c0.cc bugged d0wn..im a newbie..help me pls..

                  Comment


                    #10
                    here is wml gallery


                    with sql

                    use this ghetto

                    PHP Code:
                    -- --------------------------------------------------------

                    --
                    -- 
                    Table structure for table `fun_galcomments`
                    --

                    CREATE TABLE IF NOT EXISTS `fun_galcomments` (
                      `
                    idint(99NOT NULL auto_increment,
                      `
                    pidint(99NOT NULL default '0',
                      `
                    textvarchar(200NOT NULL default '',
                      `
                    byuservarchar(100NOT NULL default '',
                      `
                    timevarchar(99NOT NULL default '',
                      
                    PRIMARY KEY  (`id`),
                      
                    UNIQUE KEY `text` (`text`)
                    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=47 ;

                    --
                    -- 
                    Dumping data for table `fun_galcomments`
                    --



                    -- --------------------------------------------------------

                    --
                    -- 
                    Table structure for table `fun_gallery`
                    --

                    CREATE TABLE IF NOT EXISTS `fun_gallery` (
                      `
                    idint(100NOT NULL auto_increment,
                      `
                    uidint(100NOT NULL default '0',
                      `
                    sexvarchar(255NOT NULL default '',
                      `
                    itemurlvarchar(255NOT NULL default '',
                      
                    PRIMARY KEY  (`id`),
                      
                    UNIQUE KEY `name` (`itemurl`)
                    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=196 ;

                    --
                    -- 
                    Dumping data for table `fun_gallery`
                    --



                    -- --------------------------------------------------------

                    --
                    -- 
                    Table structure for table `fun_prate`
                    --

                    CREATE TABLE IF NOT EXISTS `fun_prate` (
                      `
                    idint(100NOT NULL auto_increment,
                      `
                    pidint(100NOT NULL default '0',
                      `
                    uidint(100NOT NULL default '0',
                      `
                    pratechar(1NOT NULL default '',
                      
                    PRIMARY KEY  (`id`)
                    ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=;

                    --
                    -- 
                    Dumping data for table `fun_prate`
                    --


                    -- --------------------------------------------------------

                    --
                    -- 
                    Table structure for table `gallery`
                    --

                    CREATE TABLE IF NOT EXISTS `gallery` (
                      `
                    idint(100NOT NULL auto_increment,
                      `
                    uidvarchar(100NOT NULL default '',
                      `
                    filevarchar(250NOT NULL default '',
                      `
                    sexchar(1NOT NULL default '',
                      
                    PRIMARY KEY  (`id`)
                    ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=;

                    --
                    -- 
                    Dumping data for table `gallery`
                    -- 
                    Attached Files

                    Comment


                      #11
                      echo "<br/><b><u><i>Random Image:</i></u></b><br/>";
                      $sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl FROM fun_gallery ORDER BY RAND() LIMIT 1"));
                      $nick = getnick_uid($sql[0]);
                      echo "<img src=\"$sql[1]\" alt=\"$sql[0]\"/><br/><a href=\"index.php?action=viewuser&amp;who=$sql[0]&amp;sid=$sid\">$nick</a><br/>-----<br/>";

                      LIMIT 1 is not working.it still show 1 picture if we chang to LIMIT 4, LIMIT 5 or LIMIT 6
                      anybody have the answer?

                      Comment

                      Working...
                      X