praveen1980
11-06-2015, 07:54 AM
Hi,
I am trying to show the recent posts from a specific forum.
All posts in this forum have pictures as attachments.
How do i show them on a custom page or on the sidebar?
I am trying to show them as
<img thumbnail> Title
<img thumbnail> Title
<img thumbnail> Title
<img thumbnail> Title
I managed to get the recent posts using the below code, but i do not know how to modify this to include the thumbs too.
Can you please help?
$latest_threads_god = $vbulletin->db->query_read("SELECT threadid, title, dateline FROM " . TABLE_PREFIX . "thread WHERE title not like 'Article:%' AND visible='1' AND forumid='97' ORDER BY dateline DESC LIMIT 10");
$msltg = "";
while($thread = $vbulletin->db->fetch_array($latest_threads_god)){
$replacer = "...";
if(strlen($thread[title]) > 45){
$thread[title] = substr($thread[title], 0, 44).$replacer;
}
$msltg .="<li><a href=\"showthread.php?t=".$thread[threadid]."\">".$thread[title]."</a></li>";
vB_Template::preRegister('navbar',array('msltg' => $msltg));
}
I am trying to show the recent posts from a specific forum.
All posts in this forum have pictures as attachments.
How do i show them on a custom page or on the sidebar?
I am trying to show them as
<img thumbnail> Title
<img thumbnail> Title
<img thumbnail> Title
<img thumbnail> Title
I managed to get the recent posts using the below code, but i do not know how to modify this to include the thumbs too.
Can you please help?
$latest_threads_god = $vbulletin->db->query_read("SELECT threadid, title, dateline FROM " . TABLE_PREFIX . "thread WHERE title not like 'Article:%' AND visible='1' AND forumid='97' ORDER BY dateline DESC LIMIT 10");
$msltg = "";
while($thread = $vbulletin->db->fetch_array($latest_threads_god)){
$replacer = "...";
if(strlen($thread[title]) > 45){
$thread[title] = substr($thread[title], 0, 44).$replacer;
}
$msltg .="<li><a href=\"showthread.php?t=".$thread[threadid]."\">".$thread[title]."</a></li>";
vB_Template::preRegister('navbar',array('msltg' => $msltg));
}