Spotlight script [SELECT ONLY VIA USERS IN DATABASE]
Right, I was bored and got "inspired" by Jack's thread.. This collects the image from Habbo still, but spotlights a random Habbo inserted into the database table.
PHP Code:
<?php
// MySQL Connect code.
$grab = mysql_query("select * from `habbos`");
$amount = mysql_num_rows($grab);
$random = rand(1, $amount);
$getusers = mysql_query("SELECT * FROM `habbos` WHERE `id`='$random'");
$showuser = mysql_fetch_array($getusers);
$showusername = $showuser['username'];
echo '<img border="0" src="http://www.habbo.' . $showuser['habbohotel'] . '/habbo-imaging/avatarimage?user='. $showuser['habboname'] .'&action=&direction=4&head_direction=3&gesture=sml&size=l&img_format=png"><br />Hello, '.$showuser['habboname'] .' plays Habbo.' . $showuser['habbohotel'] . '</a>';
?>
MySQL Code:
Code:
CREATE TABLE IF NOT EXISTS `habbos` (
`id` int(3) NOT NULL auto_increment,
`habboname` varchar(30) NOT NULL,
`habbohotel` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
If you wish to insert users, here's the SQL code;
Code:
INSERT INTO `habbos` (`id`, `habboname`, `habbohotel`) VALUES
(1, 'Xedon', 'co.uk'),
(2, 'Nooblah', 'co.uk');
Like that..
Hope this helps, I'd have made a inserter as well but I'm not sure if people would have wanted that, this is best for staff pages, like "Random staff".
I'll make an inserter file if you request it.
I know this is badly coded, but I made it in 10mins.
Edit: This may show the same image twice, but after another refresh it shouldnt.