vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - LBmtb's Recent Topics on Non-VB Pages (https://vborg.vbsupport.ru/showthread.php?t=134320)

ahmedbehiry 10-17-2007 09:42 AM

grate hack.. but I also can't use it to show posts from specific forums.. hopefully this will be fixed soon as I really need to install it :(

Tomzl 10-22-2007 07:03 PM

I recently updated the script from 1.02 to 1.03 and some problems occured.

I changed the default code to suit my needs (utf-8, different style, max 30 chars in topic title etc.). I applied the same changes that worked in 1.02 to 1.03 but now every once in a while there are two arrows in front of one topic title. I added an arrow .gif in front of every topic title so it links to the newpost in that topic. For some reason this arrow is doubled by one of the topics on the list. It is not always the same topic and I can't find a rule that triggers this behaviour.

Below is my modified code. Help would be much appreciated.

Code:

## NO NEED TO TOUCH ANYTHING BELOW    #####################################
#############################################################################

if (!($recent_topics_connection = mysql_connect("$db_host", "$db_user", "$db_pw")))
die ("could not connect"); 
if (!(mysql_select_db("$db_name", $recent_topics_connection)))
mysql_error();
mysql_query('set names utf8');
mysql_query('set character set utf8');
$fid_array = explode (',', $fid_raw);
if ($fid_raw)  {
    $fid_final .= "AND (";
    foreach( $fid_array as $key => $value){
        if ($key == 0) { $fid_final .= "t.forumid=".$value; }
        else { $fid_final .= " OR t.forumid=".$value; }
    }
    $fid_final .= ")";
}
$fidx_array = explode (',', $fidx_raw);
if ($fidx_raw)  {
    $fidx_final .= "AND NOT (";
    foreach( $fidx_array as $key => $value){
        if ($key == 0) { $fidx_final .= "t.forumid=".$value; }
        else { $fidx_final .= " OR t.forumid=".$value; }
    }
    $fidx_final .= ")";
}
$thread_sql = mysql_query("SELECT SQL_CACHE t.threadid,t.title,t.lastpost,t.lastposter,t.forumid,substring(p.pagetext,1,200) as post_text
    FROM ".$GLOBALS['db_prefix']."thread t
    INNER JOIN ".$GLOBALS['db_prefix']."post p
    ON t.firstpostid = p.postid
    WHERE t.visible=1 
    AND t.open=1 $fidi_final $fidx_final 
    ORDER BY t.lastpost desc 
    LIMIT $limit");
while($thread_get=@mysql_fetch_array($thread_sql))
{
    $lastpost = $thread_get['lastpost'];
    $poster = $thread_get['lastposter'];
    $tid = $thread_get['threadid'];
$text = $thread_get['post_text'];
    if ($post_date_format == "1") { $date2 = date ("m/d/y h:i A" ,$lastpost); }
    elseif ($post_date_format == "2") { $date2 = date ("h:i A" ,$lastpost); }
    else { $date2 = date ("m/d/y h:i A" ,$lastpost); }
        echo "&nbsp;<a href=\"$forum_url/showthread.php?t=$tid&goto=newpost\" class=\"povezava\" target=\"_parent\"><img src=\"arrow.gif\" border=\"0\" align=\"absmiddle\">&nbsp;</a>";
                echo "&nbsp;<a href=\"$forum_url/showthread.php?t=$tid\" class=\"povezava\" target=\"_parent\" title=\"".$text."\">";
                if (strlen($thread_get[title])>30) echo substr($thread_get[title],0,30)."...";
                else echo $thread_get[title];
                echo "</a><br />\n";
}
mysql_close($recent_topics_connection);
?>


Tomzl 10-22-2007 07:32 PM

The problem occurs when the preview text of the topic includes " in the text. This seems to mess up the output.

ceint 02-26-2008 08:45 AM

How do I go about making the the links to the topics SEO friendly? My forum is using Zoints SEO.

martinc126 02-26-2008 04:24 PM

Hi,

How would i make it so the time is GMT, The forum is set to us GMT but the script wont show the time the forum is showing.

Martin

tspore 03-08-2008 09:05 PM

A very nice script - I was wondering it looks like - ORDER BY t.lastpost desc
shows the last comments. Can I change it so that it would order by the original post time in the thread. So that the order is from what I post time, and when people comment on an item it doesn't mess up the ordering that I had them in.

umusic2000 03-13-2008 07:32 AM

This works well but how do you get the links to open up in a new window or the parent window using an iframe?

LBmtb 09-09-2008 07:49 AM

Posted an update here: https://vborg.vbsupport.ru/showthread.php?t=190425

thanks,

microdot 09-13-2008 08:14 AM

Hi this is a great mod, thank you! I have to use this one because my site is php4 so I wonder.. is there anyway to give it an offset, so it can exclude the most recent 5 topics?

This is will allow for a 2 or 3 column layout.

Thanks again

microdot 09-26-2008 02:36 PM

OK.. so offset then.

Is it possible to display a group of boards.. for example I have board 5 with sub boards inside it.. it is possible to display the main board AND the sub boards?

Thanks for your help, looking forward to using this.


All times are GMT. The time now is 05:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01176 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete