Not Solved Latest posts in template
#11
Not Solved
Never mind, I fixed it.
[Image: hdoE.png]
m1ne.net - coming soon
Reply
#12
Not Solved
^ :oops: I forgot about this ... could you post the code you have used ..
Reply
#13
Not Solved
    <?php
    define("IN_MYBB", 1);
    require_once "./global.php";
     
	//Vars
	$limit = 15; 	//How many characters do you want displayed default 15
	$var1 = 29;		//FID 29
	$var2 = 57;		//FID 57
	$var3 = 30;		//FID 30
	$lastpost_date = my_date($mybb->settings['dateformat'], $thread['lastpost']);
	$lastpost_time = my_date($mybb->settings['timeformat'], $thread['lastpost']);


	$query = $db->query("
		SELECT t.*
		FROM ".TABLE_PREFIX."threads t
		WHERE fid != ".$var1." AND fid != ".$var2." AND fid != ".$var3." ORDER BY t.lastpost DESC
		LIMIT 0,5"
	);
	while($thread = $db->fetch_array($query))
	{
		$thread['subject'] = htmlspecialchars_uni($thread['subject']);
		$thread['threadlink'] = get_thread_link($thread['tid']);
		echo "<tr><td class=\"trow2\"><img src=\"images/iv/tier.gif\" alt=\"Tier\" />&nbsp; <span class=\"smalltext\">";
		echo "<a href=\"http://www.gfxforums.net/".$thread['threadlink']."\">".substr($thread['subject'], 0, $limit)."</a>"; 
                echo ".. by ".$thread['lastposter'];
		echo "</span></td></tr>";
	}
     
    ?>

Then I use this in the template.

<?php include($_SERVER['DOCUMENT_ROOT'].'/latestposts.php') ?>
[Image: hdoE.png]
m1ne.net - coming soon
Reply
#14
Not Solved
This can be used outside mybb right?

It looks very useful, thanks for sharing Solidus Smile
Soporte en Español

[Image: signature.png]

Discord at omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)