Random Thread Link
#1
Question 
Anyone know how I could create a Random Thread link

Like in Wikipedia where you push "Random Article". Members would push Random Thread and it takes you to a, Well a random thread from the forum. Big Grin

Thank you.
Reply
#2
This user has been denied support. This user has been denied support.
You would need a plugin - if you want the link to work anyway.
Reply
#3
This may work:
http://mybbhacks.zingaburga.com/showthread.php?tid=28
Reply
#4
(2012-09-22, 05:15 PM)Omar G. Wrote: This may work:
http://mybbhacks.zingaburga.com/showthread.php?tid=28

Thanks but that's a bit old, I gave a quick try but got SQL Error: 1146
Reply
#5
Maybe if you post the full error message we can help you to get it working.
Reply
#6
Oops sorry didn't think of that.

[Image: 14tklf.jpg]
Reply
#7
Open plugin file and find;
$threadcount = $db->fetch_field($db->simple_select(TABLE_PREFIX.'threads', 'COUNT(*) AS threadcount', $where), 'threadcount');
and Change it into;
$threadcount = $db->fetch_field($db->simple_select('threads', 'COUNT(*) AS threadcount', $where), 'threadcount');

Next, find;
$rndtid = $db->fetch_field($db->simple_select(TABLE_PREFIX.'threads', 'tid', $where, array('limit' => 1, 'limit_start' => $rndnum)), 'tid');
and Change it into;
$rndtid = $db->fetch_field($db->simple_select('threads', 'tid', $where, array('limit' => 1, 'limit_start' => $rndnum)), 'tid');
Reply
#8
(2012-09-22, 09:09 PM)Yaldaram Wrote: Open plugin file and find;
$threadcount = $db->fetch_field($db->simple_select(TABLE_PREFIX.'threads', 'COUNT(*) AS threadcount', $where), 'threadcount');
and Change it into;
$threadcount = $db->fetch_field($db->simple_select('threads', 'COUNT(*) AS threadcount', $where), 'threadcount');

Next, find;
$rndtid = $db->fetch_field($db->simple_select(TABLE_PREFIX.'threads', 'tid', $where, array('limit' => 1, 'limit_start' => $rndnum)), 'tid');
and Change it into;
$rndtid = $db->fetch_field($db->simple_select('threads', 'tid', $where, array('limit' => 1, 'limit_start' => $rndnum)), 'tid');

Thanks Yaldaram, close it works when logged in, but for guests I get a blank page with "There are no threads on this board."
Reply
#9
Find:
$where = "closed NOT LIKE 'moved|%' AND visible <> 0$us";

Replace with:
$where = "closed NOT LIKE 'moved|%' AND visible!='0'$us";
Reply
#10
(2012-09-23, 01:45 AM)Omar G. Wrote: Find:
$where = "closed NOT LIKE 'moved|%' AND visible <> 0$us";

Replace with:
$where = "closed NOT LIKE 'moved|%' AND visible!='0'$us";

Hello, Didn't work still got the same result. Blank page with "There are no threads on this board."
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)