Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
LBmtb's Recent Topics on Non-VB Pages (vbSEO edition) Details »»
LBmtb's Recent Topics on Non-VB Pages (vbSEO edition)
Version: 1.00, by LBmtb LBmtb is offline
Developer Last Online: Aug 2015 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.4 Rating:
Released: 12-21-2006 Last Update: Never Installs: 22
 
No support by the author.

This mod does the same thing as my original recent topics mod but vbSEO'izes the URL's. You MUST have vbSEO installed for this one to work. Otherwise use the original one.

RECENT TOPICS (vbSEO edition) by LBmtb
Version 1.00
Last updated: Dec 21th 2006

DESCRIPTION
This script will display the topics with the most recent posts on a non-vb page (any HTML page). The page it's on must have a .php extension or you should setup apache to parse the page correctly. The threads with the latest posts are on top. The output is a clean list in this format:

HTML Code:
<ul class="vb_topics">
<li><a href="http://www.yourdomain.com/forum/general-discussion/4150-a-thread.html">This is the latest thread</a> <span class="vb_last_post">(user1 @ 12/18/06 05:58 PM)</span></li>
<li><a href="http://www.yourdomain.com/forum/general-discussion/4152-another-thread.html">Another recent thread</a> <span class="vb_last_post">(user2 @ 12/18/06 05:58 PM)</span></li>
</ul>
Customizable options include:
* forum ID - choose to only include or exclude certain forums
* number of topics displayed
* CSS class names for the topic name/url and last poster/date
* and a few others

COPYRIGHT
There is a copyright line. I am releasing this script on the condition that you do not remove this line unless you send $5 via paypal to webmaster@socaltrailriders.org. Thanks in advance for understanding.

NEED CUSTOMIZATION OR PROFESSIONAL INSTALLATION?
Email me at webmaster@socaltrailriders.org, PM me on vbulletin.org, or aim me at "lbmtb" to inquire about customizing this script or installation.

REVISION HISTORY
Version 1.0: Initial Release

INSTRUCTIONS:
1) Copy and paste the following code where you want the list to appear and adjust the values in the section "CUSTOMIZE THE FOLLOWING":

PHP Code:
<?php 
##########################################################################
// RECENT TOPICS (vbSEO edition) by LBmtb
// webmaster@socaltrailriders.org OR aim: LBmtb
//
// Do not remove copyright unless you donate $5 via paypal
// to the above email address, thanks
// CUSTOMIZED from a www.phase1media.com script found here:
// https://vborg.vbsupport.ru/showpost.php?p=589067&postcount=7
##########################################################################

## CUSTOMIZE THE FOLLOWING    ##############################################

// DATABASE & URL SETTINGS
$db_host "localhost"// Change this if your MySQL database host is different.
$db_name "db_name"// Change this to the name of your database.
$db_user "db_username"// Change this to your database username.
$db_pw "db_password"// Change this to your database password.
$db_prefix "vb_"// Change to your tables' prefix. Usually vb_
$forum_url "http://www.yourdomain.com/forum"// Change this to reflect to your forum's URL.
 
// APPEARANCE OPTIONS
$separator "@"// this goes between last poster and date
$limit "10"// Number of posts displayed
$post_date_format "1"// leave as 1 for "12/18/06 05:26 PM" or change to 2 for "05:26 PM"

// FORUM SOURCES FOR TOPICS
// use one or the other, not both. if left blank the script will return threads from any forum
$fidi_raw ""// ONLY include threads from these forums. seperate each ID with a comma
$fidx_raw ""// Exclude threads from these forum. seperate each ID with a comma

// CSS CLASSES    
$recent_topics "vb_topics"// you can use CSS to adjust the presentation of the list 
$recent_poster "vb_last_post";  // you can use CSS to adjust the presentation the last poster and date

## VBSEO SETTINGS  #####################################################
include_once "forum/includes/functions_vbseo.php"// change this path to reflect where your forum is
vbseo_startup(); // if you have a vbSEO version under 3, comment this line and uncomment the next three
// vbseo_get_options();
// vbseo_prepare_seo_replace();
// get_forum_info();

## 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(); 
echo 
"<ul class=\"$recent_topics\">\n";
$fidi_array explode (','$fidi_raw);
$fidx_array explode (','$fidx_raw);
function 
forum_where($f_array,$which){
    if (
$which == "i") { $f_final .= "AND ("; }
    if (
$which == "x") { $f_final .= "AND NOT ("; }
    foreach( 
$f_array as $key => $value){
        if (
$key == 0) { $f_final .= "forumid=".$value; }
        else { 
$f_final .= " OR forumid=".$value; }
    }
    
$f_final .= ")";
    return 
$f_final;
}
if (
$fidi_raw)  { $fidi_final forum_where($fidi_array,"i"); }
if (
$fidx_raw)  { $fidx_final forum_where($fidx_array,"x"); }
$thread_sql mysql_query("SELECT threadid,title,lastpost,lastposter,forumid FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fidi_final $fidx_final ORDER BY lastpost desc LIMIT $limit");
while(
$thread_get=@mysql_fetch_array($thread_sql))
{
    
$lastpost $thread_get['lastpost'];
    
$poster $thread_get['lastposter'];
    
$tid $thread_get['threadid'];
    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); }    
    
    
$threadurl vbseo_thread_url_row($thread_get$pagenum);
    echo 
"<li><a href=\"$forum_url/$threadurl\">$thread_get[title]</a> <span class=\"$recent_poster\">($poster $separator $date2)</span></li>\n";
}
echo 
"</ul>\n<div style=\"font-size: .9em;\">recent topics by <a href=\"http://www.socaltrailriders.org/\"><acronym title=\"Southern California Trail Riders\">SocalTrailRiders.org</acronym></a></div>";
mysql_close($recent_topics_connection);
?>
2) Go back to the vbulletin.org thread where you found this and click on "Mark as Installed"
3) Enjoy!


NOTES:
This is my first (second now?) mod/script so be nice, please .

DEMO's:
"Stock" script: http://www.socaltrailriders.org/latest_posts.php
with vbSEO URL's: http://www.socaltrailriders.org/latest_posts_vbseo.php

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-27-2006, 07:20 AM
cobradude cobradude is offline
 
Join Date: Nov 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LBmtb, this looks great, though my needs might not fit the great work you've done here. Do you know a way to do this?

I have category > sub forum > sub forum. So basically I have forum areas that in forumdisplay have additional sub forums. I would like to show latest threads for just those particular sub forums....thoughts?
Reply With Quote
  #13  
Old 12-27-2006, 03:51 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pmed you yesterday.
Reply With Quote
  #14  
Old 12-27-2006, 04:09 PM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cobradude View Post
LBmtb, this looks great, though my needs might not fit the great work you've done here. Do you know a way to do this?

I have category > sub forum > sub forum. So basically I have forum areas that in forumdisplay have additional sub forums. I would like to show latest threads for just those particular sub forums....thoughts?
Go into your vBulletin adminCP > forums and moderators > forum manager. Then click on the subforum you're talking about. At the top of the page it'll say something like "Forum: General Discussion (id: 48)." Write down the ID #'s for the forums you want to include.

Now in the CUSTOMIZE THE FOLLOWING section of the script find
PHP Code:
// FORUM SOURCES FOR TOPICS
// use one or the other, not both. if left blank the script will return threads from any forum
$fidi_raw ""// ONLY include threads from these forums. seperate each ID with a comma
$fidx_raw ""// Exclude threads from these forum. seperate each ID with a comma 
Insert your forum ID's into fidi_raw. If your ID's were 10 and 15 your line would be
PHP Code:
$fidi_raw "10,15"// ONLY include threads from these forums. seperate each ID with a comma 
This will make it pull threads from only those forums you want.
Reply With Quote
  #15  
Old 12-27-2006, 07:51 PM
cobradude cobradude is offline
 
Join Date: Nov 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LBmtb, I was actually hoping to use this in the forumdisplay area for those forums which have only subforums....I'll have to tinker a bit.
Reply With Quote
  #16  
Old 12-31-2006, 12:09 AM
Brew's Avatar
Brew Brew is offline
 
Join Date: Sep 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone tell me where to get vbSEO for this?

Thanks!
Reply With Quote
  #17  
Old 12-31-2006, 12:31 AM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brew View Post
Can someone tell me where to get vbSEO for this?

Thanks!
http://www.vbseo.com/ It's not free, btw. But a lot of people have said it's well worth it. I've only had it on my boards for a short period of time so I haven't noticed a HUGE difference in traffic yet.
Reply With Quote
  #18  
Old 12-31-2006, 01:59 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this hack work fine if embedded under another portal system templates ?
Reply With Quote
  #19  
Old 12-31-2006, 04:26 PM
category category is offline
 
Join Date: Jul 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I kinda dont understand lets say i set it up right on .php page but how do i use it on .html page?
Reply With Quote
  #20  
Old 12-31-2006, 04:56 PM
smoknz28's Avatar
smoknz28 smoknz28 is offline
 
Join Date: Sep 2005
Location: SoCal
Posts: 257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not a coder by any means....but is there a higher potential of being hacked or someone getting your database password using this code on pages?
Reply With Quote
  #21  
Old 12-31-2006, 08:38 PM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by category View Post
I kinda dont understand lets say i set it up right on .php page but how do i use it on .html page?
Try this thread: http://www.vbulletin.com/forum/showthread.php?t=3006
Or you can also google "parse php htaccess html" for more info.
Quote:
Originally Posted by smoknz28 View Post
I'm not a coder by any means....but is there a higher potential of being hacked or someone getting your database password using this code on pages?
Sort of but not really. PHP stuff get processed on the server so as long as you don't insert "echo $db_pw" or something along those lines a user won't see it. The only way someone can see it is if they have FTP or SSH access to your server, then they can just download the actual file and look at it. But if someone already has FTP or SSH access they can also go into your vB directory and download includes/config.php and get that info there.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07162 seconds
  • Memory Usage 2,351KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete