Random Galley For Index Page

Started on the old forum in November 2008 · view the original in the archive · old links redirect here

12 replies · 847 views · started 18 years ago · 1 min read

4 participants
djsammy Junior · 43 posts #1

has any one got ramdom galley coding please one that works please i am after it for my site toptunes i looked on ere and tryed over ome and not one of them works so if you could helo i would be very greatful

ionutxp Developer · 137 posts #2
$sql = "SELECT DISTINCT uid, itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 0, 1";
$items = mysql_query($sql);
echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
$who = $item[0];
$user=getnick_uid($who);
//$simbol = getsimbol($who);
$no = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'"));
//$xp = "$simbol$user($no[0] pics)";
$xp = "$user($no[0] pics)";
$ionutxp = $item[1];
       echo "<img src=\"max2.php?filename=$ionutxp\" alt=\"$xp\"/>
"; 
    }
    }

try this and max2.php

Hate romains that take codes from here and tell to all that they had made that External image (may be gone)

Attachments: max2.php
djsammy Junior · 43 posts #3

QUOTE (ionutxp @ Nov 20 2008, 05:12 AM) <{POST_SNAPBACK}>

CODE $sql = "SELECT DISTINCT uid, itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 0, 1"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $who = $item[0]; $user=getnick_uid($who); //$simbol = getsimbol($who); $no = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'")); //$xp = "$simbol$user($no[0] pics)"; $xp = "$user($no[0] pics)"; $ionutxp = $item[1]; echo "<img src="max2.php?filename=$ionutxp" alt="$xp"/> "; } } try this and max2.php tryed it dont work

djsammy Junior · 43 posts #5

QUOTE (ionutxp @ Nov 21 2008, 06:05 AM) <{POST_SNAPBACK}>

w have errors ? i'm not getting errors it not showing any thing at all

marwin29 Junior · 35 posts #6

LOL check ur ibwf_gallery table it might imageurl or imagescr ... Try to use this other way $randomm = mysql_fetch_array(mysql_query("SELECT itemurl, uid FROM baz_gallery WHERE id ORDER BY RAND() LIMIT 1")); echo "<img src="$randomm[0]" height="40" width="40" alt="$randomm[1]"/>"; change the table..

djsammy Junior · 43 posts #7

QUOTE (marwin29 @ Nov 22 2008, 02:21 AM) <{POST_SNAPBACK}>

LOL check ur ibwf_gallery table it might imageurl or imagescr ... Try to use this other way $randomm = mysql_fetch_array(mysql_query("SELECT itemurl, uid FROM baz_gallery WHERE id ORDER BY RAND() LIMIT 1")); echo "<img src="$randomm[0]" height="40" width="40" alt="$randomm[1]"/>"; change the table..

CODE$sql = "SELECT DISTINCT uid, itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 0, 1"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $who = $item[0]; $user=getnick_uid($who); $simbol = getsimbol($who); $no = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'")); $xp = "$simbol$user($no[0] pics)"; $xp = "$user($no[0] pics)"; $ionutxp = $item[1]; echo "<img src="max2.php?filename=$ionutxp" alt="$xp"/> "; } } can some one sort this out so i can use it on my site please some one help please my site dont use ibwf_gallery

marwin29 Junior · 35 posts #8

sorry mate i'm just a n0ob.. Try other way random user avatar might work but i dont kn0w how to code..

metulj Super moderator Principal · 1,726 posts #9

QUOTE (djsammy @ Nov 22 2008, 04:20 AM) <{POST_SNAPBACK}>

CODE $sql = "SELECT DISTINCT uid, itemurl FROM ibwf_gallery ORDER BY RAND() LIMIT 0, 1"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $who = $item[0]; $user=getnick_uid($who); $simbol = getsimbol($who); $no = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'")); $xp = "$simbol$user($no[0] pics)"; $xp = "$user($no[0] pics)"; $ionutxp = $item[1]; echo "<img src="max2.php?filename=$ionutxp" alt="$xp"/> "; } } can some one sort this out so i can use it on my site please some one help please my site dont use ibwf_gallery

then what do you use instead ibwf_gallery ?

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

djsammy Junior · 43 posts #10

QUOTE (metulj @ Nov 22 2008, 05:39 AM) <{POST_SNAPBACK}>

then what do you use instead ibwf_gallery ?

its in the script some please help

ionutxp Developer · 137 posts #11

ur crazy ..:| post ur sql ....u want 2 much ...but u dont ofer infos

Hate romains that take codes from here and tell to all that they had made that External image (may be gone)

djsammy Junior · 43 posts #12

QUOTE (ionutxp @ Nov 22 2008, 03:06 PM) <{POST_SNAPBACK}>

ur crazy ..:| post ur sql ....u want 2 much ...but u dont ofer infos

sent u inbox

metulj Super moderator Principal · 1,726 posts #13

QUOTE (djsammy @ Nov 22 2008, 04:23 PM) <{POST_SNAPBACK}>

sent u inbox

inbox? then you dont need this topic so.. CLOSED

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close