Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Last X Posts Titles on Non-VB page Details »»
Last X Posts Titles on Non-VB page
Version: 1.00, by RobinHood RobinHood is offline
Developer Last Online: Mar 2007 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-17-2004 Last Update: Never Installs: 92
 
No support by the author.

Hi everyone,

Well, here is my first full release to the vB.org community. It's a small little script I just whipped up a few minutes ago. I already have this on my webpage for months now and thought I'd share it with the rest of you.

Description:
This script will display the titles, poster's names, and times of the last X's posts. It's fully customizable. Should be very easy to understand so enjoy!

Instructions:
1) Download the script below.
2) Change the settings in the script.
3) Insert include("/path/to/lastposts3.php"); anywhere in a non-VB page.

If you like to check out a live demo, you may go visit one of my sites: http://www.generazn.com.

If you have any problems, questions, or comments regarding this, feel free to post them here or send me an email to tre@phase1media.com.

Show Your Support

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

Comments
  #2  
Old 03-18-2004, 09:03 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't see it on your site, screenie?
Reply With Quote
  #3  
Old 03-18-2004, 12:00 PM
mr_fox mr_fox is offline
 
Join Date: Sep 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's work!
Thenks
Reply With Quote
  #4  
Old 03-18-2004, 01:43 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

heah, thanks ...
Reply With Quote
  #5  
Old 03-18-2004, 03:34 PM
Owen Owen is offline
 
Join Date: Jan 2002
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to limit the number of characters displayed?
Reply With Quote
  #6  
Old 03-18-2004, 05:07 PM
bluecat's Avatar
bluecat bluecat is offline
 
Join Date: Apr 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool, I've been waiting for one for vb3. Thanks!
Reply With Quote
  #7  
Old 03-19-2004, 11:42 AM
Q8vbhacks Q8vbhacks is offline
 
Join Date: Mar 2002
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks

i get this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/XXX/public_html/lastposts3.php on line 43
Reply With Quote
  #8  
Old 03-20-2004, 10:09 AM
accyroy accyroy is offline
 
Join Date: Nov 2003
Location: Moscow
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i offset the time, my forum and server are different and this hack displays server time...?
Reply With Quote
  #9  
Old 03-20-2004, 07:29 PM
Buddha Buddha is offline
 
Join Date: Jan 2002
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a way to set this up so that it can display threads from a forum that is installed on another subdomain? say i've got a forum on a.domain.com and i want to display the latest threads on b.domain.com/index.php... how would i go about this?

thanks
Reply With Quote
  #10  
Old 03-21-2004, 06:16 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice...this is what I've been waiting for.
Reply With Quote
  #11  
Old 03-21-2004, 11:51 PM
SmasherMaster's Avatar
SmasherMaster SmasherMaster is offline
 
Join Date: Feb 2004
Location: Florida
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works...prefectly!

[high]* SmasherMaster hits install[/high]
Reply With Quote
  #12  
Old 03-22-2004, 05:57 AM
RobinHood RobinHood is offline
 
Join Date: Sep 2002
Location: Philly
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Q8vbhacks
thanks

i get this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/XXX/public_html/lastposts3.php on line 43
Make sure you set the $limit variable.
Reply With Quote
  #13  
Old 03-22-2004, 05:59 AM
RobinHood RobinHood is offline
 
Join Date: Sep 2002
Location: Philly
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Buddha
is there a way to set this up so that it can display threads from a forum that is installed on another subdomain? say i've got a forum on a.domain.com and i want to display the latest threads on b.domain.com/index.php... how would i go about this?

thanks
As long as it's on the same server, you sure can.

All you have to do is change the original include to:

include("/path/to/lastpost3.php");

Also, make sure you change the $forum_url variable to forum A.
Reply With Quote
  #14  
Old 03-22-2004, 06:14 AM
RobinHood RobinHood is offline
 
Join Date: Sep 2002
Location: Philly
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Owen
Is it possible to limit the number of characters displayed?
It sure is. Just download the updated version of the script.
Reply With Quote
  #15  
Old 03-22-2004, 06:36 PM
Buddha Buddha is offline
 
Join Date: Jan 2002
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RobinHood
As long as it's on the same server, you sure can.

All you have to do is change the original include to:

include("/path/to/lastpost3.php");

Also, make sure you change the $forum_url variable to forum A.
thanks for the quick reply, robinhood... and i may seem like a complete dunce here, so bear with me, ok.

first, i'm assuming i upload the lastposts3.php file to the same directory as my forum... which is on subdomain A. then, on my index.php on subdomain B, i would put
PHP Code:
<? include("/public_html/A/lastpost3.php"); ?>
if this is right, then i'm curious why it isn't working... i've changed the script so it points to the proper forum directory...
Reply With Quote
  #16  
Old 03-22-2004, 07:23 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How could I make this check multiple forums? I changed $forum_id =(x,y), but that doesnt work
Reply With Quote
  #17  
Old 03-24-2004, 02:56 PM
Buddha Buddha is offline
 
Join Date: Jan 2002
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any chance getting some support on this, as i would really love to use this hack, but i cannot get it to work with the sub-domains.
thanks.
Reply With Quote
  #18  
Old 03-26-2004, 02:12 PM
pablo pablo is offline
 
Join Date: Apr 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why not use the RSS feeds for this ?

is this capable of giving the last replies that people have replied to, almost like a last 10 active topics.
Reply With Quote
  #19  
Old 03-28-2004, 02:08 PM
pablo pablo is offline
 
Join Date: Apr 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*bump*
anyone ?
Reply With Quote
  #20  
Old 04-01-2004, 06:28 AM
Dok[AB] Dok[AB] is offline
 
Join Date: Mar 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]
Quote:
Originally Posted by Ian Cunningham
How could I make this check multiple forums? I changed $forum_id =(x,y), but that doesnt work
:cry: :cry:
Reply With Quote
  #21  
Old 04-02-2004, 05:36 AM
sammyman sammyman is offline
 
Join Date: Mar 2004
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am with Buddha. I am trying everything but it doesn't like me much. Where do I install this file, and what do I do for the include.

Any help for a beginer?
Reply With Quote
  #22  
Old 04-02-2004, 06:13 AM
sammyman sammyman is offline
 
Join Date: Mar 2004
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I realized that the file lastposts3.php works, but it is not importing correctly into the non-VB page. I guess the import file is not right.
Reply With Quote
  #23  
Old 04-02-2004, 06:17 AM
sammyman sammyman is offline
 
Join Date: Mar 2004
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok- I am an idiot. Don't answer my questions. I forgot the "s" in "lastposts". IDIOT.
Reply With Quote
  #24  
Old 04-03-2004, 08:08 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's an addon to exclude forums that I've quickly thrown together..

Find:
Code:
$limit = "10"; // Number of posts displayed.
Add below:
Code:
$excludeforums = ""; // The forums you want to exclude from being displayed, put their ID here.
Find:
Code:
if ($limit) {
	$limited = "LIMIT $limit";
}
Add below:
Code:
if ($excludeforums == "" or $excludeforums <= "0") {
	$quarter = "no";
} else {
	$excfid = explode(",",$excludeforums); $i = 0; $a = count($excfid);
	while ($i < $a) {
		$wheresql .= " AND thread.forumid!='$excfid[$i]'";	++$i;
	}
}
Find:
Code:
SELECT threadid,title,lastpost,lastposter
Add on the same line:
Code:
,forumid
Find:
Code:
WHERE visible=1
Add on the same line:
Code:
$wheresql
All done..
Reply With Quote
  #25  
Old 04-03-2004, 02:18 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice add-on, when i get round to installing this i'll try and write a truncating threadname add-on
Reply With Quote
  #26  
Old 04-09-2004, 08:44 PM
krohnathlonman krohnathlonman is offline
 
Join Date: Feb 2004
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody using this on a higher traffic site? I'll do about 50k pageviews today... I'm using turk mmcache and the load didn't seem to jump very much, but it was noticeable.
Reply With Quote
  #27  
Old 04-14-2004, 12:35 AM
TYorke TYorke is offline
 
Join Date: Dec 2001
Location: Toronto, ON
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alternating Row Colours

I added "outside" of the WHILE loop:

$color1 = "#DEDFDF";
$color2 = "#F7F7F7";
$rowcolorcount = 0;

"Inside" of the WHILE loop:

$rowcolor = ($rowcolorcount % 2) ? $color1 : $color2;

-- "Before" the final '}' at the end of the WHILE loop:

$rowcolorcount++;

add <tr bgcolor=\"$rowcolor\"> where you want your rows to change colours

Add Thread Replies and Views

Replace the entire line that starts with $thread_sql with:

Code:
$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter,replycount,views FROM thread WHERE visible=1 AND open=1 $forumid ORDER BY lastpost DESC $limited");
Find:

$tid = $thread_get['threadid'];

Add underneath:

$view = $thread_get['views'];
$reply = $thread_get['replycount'];

Use something like <br />Replies: $reply | Views: $view where you want the counts to display

For an example check out http://www.cchl.ca/web/scripts/last.php
Reply With Quote
  #28  
Old 04-18-2004, 10:23 AM
nektar nektar is offline
 
Join Date: Apr 2004
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi!

If I could include the forum name of the post in the output this would be what I was looking for :squareeyed:

Any ideas?
Reply With Quote
  #29  
Old 04-22-2004, 07:33 AM
nektar nektar is offline
 
Join Date: Apr 2004
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi!

Thank you for the hack!

However, I would like to see a more advanced Top X posts on my homepage like I do now whith phpbb2.

What I would like to see is the forum name of each post + an icon next to each post showing if the post has been read or not by the visitor.

I know this is available for phpbb2 because I'm using it. Now I want to move to vbulletin but my visitors have used to see the last posts (and if they have read them or not) on my homepage.

Is this possible?

I think this would make the hack perfect.

Thanks.
Reply With Quote
  #30  
Old 04-26-2004, 03:34 AM
fabz fabz is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello and thank you for this,

is there a way to get this script show post contents (like Pluhnews do for vb2) instead of only titles and posters ?
Reply With Quote
  #31  
Old 05-06-2004, 12:06 PM
Detomah's Avatar
Detomah Detomah is offline
 
Join Date: Sep 2003
Location: South Shields UK
Posts: 217
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been trying to achieve this for a while now, with certain, but limited, success. This has just made my life so much easier, saving me quite a bit of work. Thanks
Reply With Quote
  #32  
Old 05-06-2004, 05:49 PM
fabz fabz is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got Pluhnews working for my vb 3.0.1 and this works too.
Reply With Quote
  #33  
Old 05-13-2004, 09:59 AM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmmm ive got mine configured properly but the links never work, it always says that theyre wrong
Reply With Quote
  #34  
Old 05-13-2004, 03:59 PM
fabz fabz is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, you have to modify your pluhnews php files and replace all the lines containing links.

For example, a link to a thread in vb 2 was :
http://path_to_your_forum/showthread.php?s=Array[sessionhash]&threadid=xxxx

In vb 3, links to threads are now like this
http://path_to_your_forum/showthread.php?t=xxxx

So just search for lines containing "threadid=", remove "s=....." and change "threadid=" to "t="

It's simple, but if you don't succeed in it, I can send you my files.
Reply With Quote
  #35  
Old 05-13-2004, 08:27 PM
northernstar northernstar is offline
 
Join Date: May 2004
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack!
Just wondering though if there's any way to not show topic titles from forums the user is not allowed to see?
Reply With Quote
  #36  
Old 05-13-2004, 08:39 PM
boatdesign's Avatar
boatdesign boatdesign is offline
 
Join Date: Nov 2001
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod - but one big problem.

It is showing links to threads that have been soft deleted by a moderator, so when a non-admin clicks them they get "invalid thread specified" since it's been soft deleted.

Is there a way to make this mod not display the thread title if the thread has been soft deleted by a moderator?
Reply With Quote
  #37  
Old 05-13-2004, 08:44 PM
Synicide Synicide is offline
 
Join Date: Dec 2002
Location: Providence, RI
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a question that's probably off topic a little bit, how would one go about and show the contents of the first post? Like say if I had event threads and the first post of those threads were summaries, could I have those summaries on that page?
Reply With Quote
  #38  
Old 05-26-2004, 06:22 AM
freakify freakify is offline
 
Join Date: Feb 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I keep getting this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "path" on line 57

Almost forgot, my line 57 is:
while($thread_get=mysql_fetch_array($thread_sql))

any suggestions?

thanks
Reply With Quote
  #39  
Old 06-05-2004, 11:01 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me clicks install!

Works like a charm!

One thing I would like to see, is if the title gets cut off due to the character limit, it should add "..." at the end of the title like VB does on the forumhome.
Reply With Quote
  #40  
Old 06-07-2004, 01:49 PM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by freakify
I keep getting this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "path" on line 57

Almost forgot, my line 57 is:
while($thread_get=mysql_fetch_array($thread_sql))

any suggestions?

thanks
im getting a similar message as well...

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xboxworld/public_html/lastposts3.php on line 48

does anyone know what causes this?
Reply With Quote
Reply

Thread Tools

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 02:06 AM.


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.08953 seconds
  • Memory Usage 2,601KB
  • Queries Executed 53 (?)
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
  • (9)bbcode_code
  • (1)bbcode_php
  • (6)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
  • (40)post_thanks_box
  • (40)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (40)post_thanks_postbit_info
  • (39)postbit
  • (40)postbit_onlinestatus
  • (40)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