2012-05-12, 07:12 AM
I'm trying to place latest threads from portal globally on footer template. Obviously {$latestthreads} won't work so how could I go about generating the table list of latest threads global by placing on the footer template?
My current code:
I tried pasting the following where <!--Latest Threads go here --> is
But that was a no go.
Help would be much appreciated, thank you.
Edit:
I found these which may be helpful but
But I'm wanting to put the latest threads in a sidebox which is located in the footer template ... so I'm not yet sure how to proceed?
My current code:
<div class="tborder">
<div class="thead"><strong>{$lang->forumbit_forum} {$lang->toplinks_portal}<strong>
</div>
<div class="tcat cell-padding">{$lang->latest_threads}</div>
<div class="trow1 cell-padding" align="center">
<!--Latest Threads go here -->
</div>
</div>
I tried pasting the following where <!--Latest Threads go here --> is
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="300">
{$latestthreads}
</td></tr>
</table>
But that was a no go.
Help would be much appreciated, thank you.
Edit:
I found these which may be helpful but
(2012-05-01, 07:13 PM)Yaldaram Wrote: [ -> ]AdminCP > Templates > Your theme's templates > Portal Templates > portal_announcement > and search for;
and Change it into;<td class="thead"><strong>{$icon} <a href="{$mybb->settings['bburl']}/{$announcement['threadlink']}">{$announcement['subject']}</a></strong></td>
<td class="thead"><strong>{$icon} <a href="{$mybb->settings['bburl']}/{$announcement['threadlink']}&action=lastpost">{$announcement['subject']}</a></strong></td>
(2012-03-14, 01:32 AM)cwindham Wrote: [ -> ]<?php
define("IN_MYBB", 1);
require_once("./global.php"); // Change this if needed
$tlimit = 5; // How many titles you want
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BYtid
DESC LIMIT $tlimit");
while($fetch = $db->fetch_array($query)){
echo '<a href="./showthread.php?tid='.$fetch['tid'].'">'.$fetch['subject'].'</a><br />' . "\n";
}
?>
(2011-12-29, 03:11 AM)Dennis Tsang Wrote: [ -> ]Give this a try (make copies of the files before you change them as backup):
In index.php, find:
After that, add:$plugins->run_hooks("index_start");
// get forums user cannot view $unviewable = get_unviewable_forums(true); if($unviewable) { $unviewwhere = " AND fid NOT IN ($unviewable)"; } $altbg = alt_trow(); $threadlist = ''; $query = $db->query(" SELECT t.*, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%' ORDER BY t.lastpost DESC LIMIT 0, 10" ); while($thread = $db->fetch_array($query)) { $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); // Don't link to guest's profiles (they have no profile). if($thread['lastposteruid'] == 0) { $lastposterlink = $thread['lastposter']; } else { $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']); } if(my_strlen($thread['subject']) > 25) { $thread['subject'] = my_substr($thread['subject'], 0, 25) . "..."; } $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $thread['threadlink'] = get_thread_link($thread['tid']); $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost"); eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";"); $altbg = alt_trow(); } if($threadlist) { // Show the table only if there are threads eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";"); }
And in your index template add{$latestthreads}
But I'm wanting to put the latest threads in a sidebox which is located in the footer template ... so I'm not yet sure how to proceed?