Forums / WEB Development
Chatter of the day
Started on the old forum in September 2009 · view the original in the archive · old links redirect here
27 replies · 1,237 views · started 17 years ago · 1 min read
TL;DR · summary of 27 replies
$sql=mysql_fetch_array(mysql_query(""SELECT uid, avatar FROM ibwf_users ORDER BY RAND() LIMIT 1"")); should be used to fetch user profile photos. The extra sql for changing the photo every 24 hours needs to be added in ibwf_settings with name= pod and value = 1. $sid = $_GET["sid"]; should be placed above the code that uses sid for session handling.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
Sort replies:
Oldest
Top voted
Newest
LE
KU
3 participants
LE
Hello to everyone, why do not you see the photo and profile of users?
echo "<small>Random Gallery Pics</small><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT uid, itemurl FROM ibwf_users ORDER BY RAND() LIMIT 1"));
$nick = getnick_uid($sql[0]);
echo "<small><img src=\"$sql[1]\" width=\"100\" height=\"100\" alt=\"$sql[0]\"/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a></small><br/><br/><br/>";
what does right click copy image address say?
probably:
$sql = mysql_fetch_array ( mysql_query ( "SELECT uid, itemurl FROM ibwf_users ORDER BY RAND() LIMIT 1" ));
is wrong
sure its not avatar instead of itemurl ?
LE
and what is the right function so that you can see the photo and profile of users?
I dont know what your sql is but most peoples sites its:
$sql=mysql_fetch_array(mysql_query("SELECT uid, avatar FROM ibwf_users ORDER BY RAND() LIMIT 1"));
but you have also put its a random gallery pic and that sql is from ibwf_users not gallery?
LE
is Lavalair! All photos in the folder pics_original, but there are also other photos that do not centered with the profile. If the address is in the folder pics_original you see all the photos, but I wish you could see only the profile photos of users who have..
it should be ok as u had it above just replace the line i put above 🙂
LE
not understand, what do I do??
echo "<small>Random Gallery Pics</small><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT uid, avatar FROM ibwf_users ORDER BY RAND() LIMIT 1"));
$nick = getnick_uid($sql[0]);
echo "<small><img src=\"$sql[1]\" width=\"100\" height=\"100\" alt=\"$sql[0]\"/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a></small><br/><br/><br/>";
LE
I did copy paste, but the picture is loaded, you can not see: (
Small error:
echo "<small>Random Gallery Pics</small><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT id, avatar FROM ibwf_users ORDER BY RAND() LIMIT 1"));
$nick = getnick_uid($sql[0]);
echo "<small><img src=\"$sql[1]\" width=\"100\" height=\"100\" alt=\"$sql[0]\"/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a></small><br/><br/><br/>";
LE
lol thanks you see:). Now when you click the nick says you are not logged in or your session has expired! you should see the profile..
LE
Sorry, the pictures change every page load. How do you change them every 24 hours?
you need extra sql for that maybe put it in ibwf_settings 😛
LE
and give me extra sql, please???? and how it fits in ibwf_settings?? 😛
KU
i think youre using old lava gallery script that dont use sql...
Sql
INSERT INTO `ibwf_settings` ( `id` , `name` , `value` )
VALUES (
NULL , 'pod', '1'
);
script
$pod = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='pod'"));
echo "<small>Random Gallery Pics</small><br/>";
$sql=mysql_fetch_array(mysql_query("SELECT id, avatar FROM ibwf_users WHERE id='".$pod[0]."'"));
$nick = getnick_uid($sql[0]);
echo "<small><img src=\"$sql[1]\" width=\"100\" height=\"100\" alt=\"$sql[0]\"/><a href=\"index.php?action=viewuser&who=$sql[0]&sid=$sid\">$nick</a></small><br/><br/><br/>";
then u will have to update pod in ibwf_settings when you want to adjust the user id 🙂
LE
This SQL where to put? here?
CREATE TABLE `ibwf_settings` (
`id` int(10) NOT NULL auto_increment,
`name` varchar(30) NOT NULL default '',
`value` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;--
-- Dumping data for table `ibwf_settings`
and how?
run this in your database:
[COLOR=#000000][COLOR=#0000BB]INSERT INTO [/COLOR][COLOR=#007700]`[/COLOR][COLOR=#0000BB]ibwf_settings[/COLOR][COLOR=#007700]` ( `[/COLOR][COLOR=#0000BB]id[/COLOR][COLOR=#007700]` , `[/COLOR][COLOR=#0000BB]name[/COLOR][COLOR=#007700]` , `[/COLOR][COLOR=#0000BB]value[/COLOR][COLOR=#007700]` )
[/COLOR][COLOR=#0000BB]VALUES [/COLOR][COLOR=#007700](
[/COLOR][COLOR=#0000BB]NULL [/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]'pod'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]'1'
[/COLOR][COLOR=#007700]);
LE
I am in my database, I must add a new row, or what?
yeah add a new row in ibwf_settings name= pod and value = 1