Random picture!
Started on the old forum in June 2009 · view the original in the archive · old links redirect here
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
guys i have this code how can i change the random image to a one user pic
$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&sid=$sid&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&sid=$sid&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&sid=$sid&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&sid=$sid&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&sid=$sid&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
Ghetto888 wrote: 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
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&who=$sql[0]&sid=$sid\">$nick</a><br/>-----<br/>";
here is wml gallery
with sql
use this ghetto
-- --------------------------------------------------------
--
-- Table structure for table `fun_galcomments`
--
CREATE TABLE IF NOT EXISTS `fun_galcomments` (
`id` int(99) NOT NULL auto_increment,
`pid` int(99) NOT NULL default '0',
`text` varchar(200) NOT NULL default '',
`byuser` varchar(100) NOT NULL default '',
`time` varchar(99) NOT 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` (
`id` int(100) NOT NULL auto_increment,
`uid` int(100) NOT NULL default '0',
`sex` varchar(255) NOT NULL default '',
`itemurl` varchar(255) NOT 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` (
`id` int(100) NOT NULL auto_increment,
`pid` int(100) NOT NULL default '0',
`uid` int(100) NOT NULL default '0',
`prate` char(1) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `fun_prate`
--
-- --------------------------------------------------------
--
-- Table structure for table `gallery`
--
CREATE TABLE IF NOT EXISTS `gallery` (
`id` int(100) NOT NULL auto_increment,
`uid` varchar(100) NOT NULL default '',
`file` varchar(250) NOT NULL default '',
`sex` char(1) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `gallery`
--
echo " Random Image: "; $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]"/> <a href="index.php?action=viewuser&who=$sql[0]&sid=$sid">$nick</a>
";
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?