mirror of
https://github.com/psenough/pouet.net.git
synced 2025-01-16 20:58:27 +01:00
Let's not crap out if we don't specify a user, find a random one
This commit is contained in:
parent
fffdb6d566
commit
894877084d
15
demoblog.php
15
demoblog.php
@ -5,6 +5,13 @@ require("include/libbb.php");
|
||||
require("recaptchalib.php");
|
||||
|
||||
$who = (int)$_GET["who"];
|
||||
if(!$who) {
|
||||
$result = mysql_query("SELECT id FROM users");
|
||||
while($tmp = mysql_fetch_row($result)) {
|
||||
$ids[]=$tmp[0];
|
||||
}
|
||||
$who=$ids[mt_rand(0,count($ids)-1)];
|
||||
}
|
||||
|
||||
$usercustom=$user;
|
||||
|
||||
@ -16,14 +23,6 @@ $nbmsg=mysql_result($result,0);
|
||||
|
||||
if(!$page) $page=1;
|
||||
|
||||
if(!is_numeric($who)) {
|
||||
$result = mysql_query("SELECT id FROM users");
|
||||
while($tmp = mysql_fetch_row($result)) {
|
||||
$ids[]=$tmp[0];
|
||||
}
|
||||
$who=$ids[mt_rand(0,count($ids)-1)];
|
||||
}
|
||||
|
||||
$result = mysql_query_debug("SELECT * FROM users WHERE id=".$who);
|
||||
$user = mysql_fetch_array($result);
|
||||
|
||||
|
16
demoglop.php
16
demoglop.php
@ -4,7 +4,13 @@ require("include/top.php");
|
||||
require("include/libbb.php");
|
||||
|
||||
$who = (int)$_GET["who"];
|
||||
//$linebypage = $_GET["lines"];
|
||||
if(!$who) {
|
||||
$result = mysql_query("SELECT id FROM users");
|
||||
while($tmp = mysql_fetch_row($result)) {
|
||||
$ids[]=$tmp[0];
|
||||
}
|
||||
$who=$ids[mt_rand(0,count($ids)-1)];
|
||||
}
|
||||
|
||||
$usercustom=$user;
|
||||
|
||||
@ -16,14 +22,6 @@ $nbmsg=mysql_result($result,0);
|
||||
|
||||
if(!$page) $page=1;
|
||||
|
||||
if(!is_numeric($who)) {
|
||||
$result = mysql_query("SELECT id FROM users");
|
||||
while($tmp = mysql_fetch_row($result)) {
|
||||
$ids[]=$tmp[0];
|
||||
}
|
||||
$who=$ids[mt_rand(0,count($ids)-1)];
|
||||
}
|
||||
|
||||
$result = mysql_query_debug("SELECT * FROM users WHERE id=".$who);
|
||||
$user = mysql_fetch_array($result);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user