MyBB Community Forums

Full Version: Code Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I see, i don't suppose you have time to elaborate sort of where...and when. Smile
After you have
$vidload = $db->simple_select();
you need to do what I posted above.
So i did this :

$vidload = $db->simple_select(TABLE_PREFIX."tube_video", "id, title", array("order_by" => RAND(), "", "", "limit 1"));
while($vid = $db->fetch_array($vidload))
{
$vidlink['id'] = $vid['id'];
$vidlink['title'] = $vid['title'];
} 

(this is in functions.php)

header template has this :

<b>Random Immortal Technique Video :</b> <a href="vgallery.php?&file=read&id={$vidlink['id']}#video_content">{$vidlink['title']}</a>

Still nothing appearing.
I'm not too familiar with how MyBB does templates, but I know you need to do something with ereg() function. I'll let someone else assist you with this as I've gotten you this far.
Okay, thanks for all the help so far.
No problem, mate. I wish I could help you more.
Ooops, I had it in the middle of another if statement, the error has now changed once i moved the code.

Also realised you dont need TABLE_PREFIX. in simple_select

$vidload = $db->simple_select("tube_video", "id, title", array("order_by" => RAND(), "", "", "limit 1"));
while($vid = $db->fetch_array($vidload))
{
$vidlink['id'] = $vid['id'];
$vidlink['title'] = $vid['title'];
} 

^^

the new error is


Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/immortaltechnique.co.uk/httpdocs/inc/functions.php on line 1358

line is :
$vidload = $db->simple_select(TABLE_PREFIX."tube_video", "id, title", array("order_by" => "title", "", "", "limit 1"));
Where did you move it to?
Above the function is_moderator
What file, though? You need to do it in a file besides function_*.php, or any file in inc.php. Try to keep it in the plugin file(if this is for a plugin)
Pages: 1 2 3