Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
News Out - posts from forum(s) on any page Details »»
News Out - posts from forum(s) on any page
Version: 1.00, by Rafe Rafe is offline
Developer Last Online: Mar 2011 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 05-13-2004 Last Update: Never Installs: 30
Is in Beta Stage  
No support by the author.

This script will let you pull the first posts from threads in a forum and display them on a non-vb page anywhere on your site.

For example you can use this to pull posts from a forum and display them as news. (Each post in the forum is a news item).

Currently it will pull them on the basis of thread start date.

This is very rough and ready. But maybe someone will find it useful.

If you read the code and comments you can do things like strip out tags, snip the post off after the first para etc etc.

You can choose to write out to a file or to write to screen. You can pull stuff from one or many forums.

I'll try and answer any questions that come up, but this is a beta so....

Rafe

Show Your Support

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

Comments
  #32  
Old 09-04-2004, 06:36 PM
AlexSFBay AlexSFBay is offline
 
Join Date: Jan 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, you've read my mind. I've been piecing together a bunch of hacks to come up with something like this. I've downloaded it and I'll give you my thoughts on how the process went for me. In any case, excellent work, and it's very much appreciated!
Reply With Quote
  #33  
Old 09-04-2004, 09:01 PM
AlexSFBay AlexSFBay is offline
 
Join Date: Jan 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The script works, but I'm getting errors at the end

Code:
Warning: mysql_query(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 212

Warning: mysql_error(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 358
Any thoughts on how I can resolve this?
Reply With Quote
  #34  
Old 09-05-2004, 09:58 PM
-=Sniper=- -=Sniper=- is offline
 
Join Date: May 2002
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get the same error! if someone can do me a similar hack! which allows me to use smilies, etc etc

then please contact me!
Reply With Quote
  #35  
Old 09-13-2004, 06:58 PM
Viruseater Viruseater is offline
 
Join Date: Mar 2002
Location: Newport Beach, CA
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't it be easier if you used

require_once("./includes/config.php");

that way you wouldn't need to use all the hard codes.
Reply With Quote
  #36  
Old 09-15-2004, 05:47 AM
AlexSFBay AlexSFBay is offline
 
Join Date: Jan 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I randomly get "Unable to add cookies, header already sent." Any ideas how can fix that?
Reply With Quote
  #37  
Old 09-15-2004, 06:46 AM
AlexSFBay AlexSFBay is offline
 
Join Date: Jan 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out! After a couple hours of tweaking my script, I finally figured out that

chdir('forums/');
require_once('./global.php');


needs to be located right at the very top (before any other additional PHP code -- ie header.php) in order to avoid the cookie error message.
Reply With Quote
  #38  
Old 09-16-2004, 01:18 AM
eLiTeGuRu eLiTeGuRu is offline
 
Join Date: Apr 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After messing around with this code, I realized that if you have a table prefix, it will not work. Therefore do this:

Find around line 45

PHP Code:
$sql "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid IN ($cats) AND sticky = '0' ORDER BY threadid DESC LIMIT $newsitems"
Change to:

PHP Code:
$sql "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM YOURTABLEPREFIX_thread WHERE forumid IN ($cats) AND sticky = '0' ORDER BY threadid DESC LIMIT $newsitems"
Find Line 67
PHP Code:
$sql2 "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1"
Change to:

PHP Code:
$sql2 "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM YOURTABLEPREFIX_post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1"
and

Find around line 104

PHP Code:
$sql3 "SELECT title FROM forum WHERE forumid = \"$forumid\" LIMIT 1"
Change to

PHP Code:
$sql3 "SELECT title FROM YOURTABLEPREFIX_forum WHERE forumid = \"$forumid\" LIMIT 1"
Reply With Quote
  #39  
Old 09-21-2004, 03:09 PM
-=Sniper=- -=Sniper=- is offline
 
Join Date: May 2002
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AlexSFBay
The script works, but I'm getting errors at the end

Code:
Warning: mysql_query(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 212

Warning: mysql_error(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 5 is not a valid MySQL-Link resource in /home/ehomeu2/public_html/forums/includes/db_mysql.php on line 358
Any thoughts on how I can resolve this?

ok, I moved to a new server and its working fine! maybe its something to do with the server settings?
Reply With Quote
  #40  
Old 09-21-2004, 07:25 PM
Dan's Avatar
Dan Dan is offline
 
Join Date: Dec 2002
Location: Titusville, Florida
Posts: 1,787
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm.... interesting mod. I could use this to work on a new custom portal. thanks for sharing it!
Reply With Quote
  #41  
Old 09-25-2004, 03:01 PM
lcryan's Avatar
lcryan lcryan is offline
 
Join Date: Aug 2004
Location: Boston
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.liquid-core.net/forums/news.php" target="_blank">http://www.liquid-core.net/forums/news.php</a>

I'm getting 'Could not execute query.'
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 08:58 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.05212 seconds
  • Memory Usage 2,317KB
  • 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
  • (2)bbcode_code
  • (6)bbcode_php
  • (1)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
  • (4)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