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

Reply
 
Thread Tools
Forum News (News in a Forum) Details »»
Forum News (News in a Forum)
Version: 1.00, by JJR512 JJR512 is offline
Developer Last Online: Jun 2006 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-13-2002 Last Update: Never Installs: 85
 
No support by the author.

This hack adds news headlines to the top of a forum. The headlines come from an XML source. The headlines are links to the articles. Through the admin cp, add or modify forums system, you can select from a list of sources (or select no news for that forum). There is also a master on/off switch for the entire feature, and you can also select how many headlines will appear.

Support for this hack will be provided only within the vbulletin.org forums.

This hack involves database modifications. Please make a backup copy of your database prior to installing this hack. The author of this hack assumes no responsibility for anything.

The XML feeds come from Moreover.com. This service is provided free-of-charge only to non-commercial, non-profit, educational, or personal/hobby sites, and may not be used on any for-profit site. If you operate a for-profit site, you must contact Moreover.com to discuss purchasing the rights to the service.







Changelog
v1.0: Original release
v1.1: Fixes problem of not being able to change a forum's newsfeed back to NONE after previously selecting one.
v1.1a: Error in instructions file corrected. If you have 1.1, you do not need to download this; absolutely no code has changed.
v1.1b: See Post #30 below. If you have v1.1a, you do not need to download again; just make the fix as instructed in Post #30.
v1.2: Changes the code added to forumdisplay.php so that only one query is used. If you have v1.1b, you only need to replace the code added to forumdisplay.php with the newer bit of code from the instructions.
v1.2a: Fixes a minor bug affecting only the appearance of the output. If you already have installed v1.2, you do not need to re-download and re-install; please see Post #34 below for the simple fix.
v1.2b: Current release. Corrects the URL shown in the registration required notice. The only change over v1.2a is the "forumnewsbit_accessreg" template.

OPTIONAL Add-in feature: Make this feature user-selectable
I have created some instructions you can use if you'd like to give your users the ability to not see the news in a forum. Read Post #44 below for more info.

Show Your Support

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

Comments
  #32  
Old 07-15-2002, 09:08 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the fast reply.
Reply With Quote
  #33  
Old 07-16-2002, 08:23 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have updated this hack to v1.2, after FireFly has shown me how to reduce the queries when showing a forum from one all the time, plus another if there's a newsfeed for that forum, to just one, only if there's a newfeed for that forum.

I have sent an update using the send update feature to all users who've clicked the Install button.

For the record, if you have v1.1b, you only need to change the code added to forumdisplay.php, the part from "// Begin Forum News" to "// End Forum News".
Reply With Quote
  #34  
Old 07-16-2002, 01:37 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JJR512
I have updated this hack to v1.2, after FireFly has shown me how to reduce the queries when showing a forum from one all the time, plus another if there's a newsfeed for that forum, to just one, only if there's a newfeed for that forum.

I have sent an update using the send update feature to all users who've clicked the Install button.

For the record, if you have v1.1b, you only need to change the code added to forumdisplay.php, the part from "// Begin Forum News" to "// End Forum News".
Thanks JJR512 and FireFly! :classic:

Cool Update Feature Is this FireFly's work? Must Be :classic:
Reply With Quote
  #35  
Old 07-18-2002, 01:24 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have identified a minor bug in this hack.

Some of the sources that Moreover.com uses require free registration at their site before you can view the entire article linked to in the headlines. Headlines that come from sources that require registration are marked in the XML source with a special flag, and I have written a feature into the XML decoder that if that flag is present, a notice will appear by the headline that says, "(NOTE: Registration or subscription may be required to access this article.)". There was a minor code error in this part of the hack whereby if there was more than one headline showing up with this notice, there would be one notice for the first, two for the second, three for the third, etc.

I will be updating the attachment in the original post above shortly. That will become v1.2a. If you have already installed v1.2, all you need to do to fix this is:

In forumdisplay.php, find:
PHP Code:
eval("\$forumnewsaccessregbit .= \"".gettemplate("forumnewsbit_accessreg")."\";"); 
Change it to this:
PHP Code:
eval("\$forumnewsaccessregbit = \"".gettemplate("forumnewsbit_accessreg")."\";"); 
That's it!
Reply With Quote
  #36  
Old 07-18-2002, 02:12 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One other minor little bug corrected, which was that in the "(NOTE: Registration or subscription may be required to access this article.)" message, as described in the previous post, the URL which formed the text "Registration or subscription" was not defined properly, causing it to point back to your own forum's home page. This is corrected in v1.2b.
Reply With Quote
  #37  
Old 07-18-2002, 10:18 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simply Superb

Satan
Reply With Quote
  #38  
Old 07-20-2002, 09:57 PM
interrealm interrealm is offline
 
Join Date: Nov 2001
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I have an idea for an enhancement for this script... what is the possibility to take it to the next step and allow the headlines to be put into a specific forum(s) and then have an "initial" post made for each news article with a preset template with the article name, source and a "cookie cutter" sentense asking for people to read the article and discuss it there. If you need more clarification let me know. Its just an idea.
Reply With Quote
  #39  
Old 07-21-2002, 01:58 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Something like that is probably beyond my capabilities at this point, and it may even be beyond vBulletin's capabilities. Moreover updates their headlines about every 15 minutes. Now a particular newsfeed may not get a new headline every update, of course. But, if every headline was to get automatically posted as a thread, you would need to run some kind of cron job in your website that would check the newsfeed to see if there were any new headlines on it. That's why I say it might be beyond the capabilities of vB, because cron jobs are separate. The only way I can think of to do it in vBulletin is for the script to check for new headlines whenever the forum itself is loaded (whenever someone goes to that forum), and unless that forum is constantly busy, there might be some headlines that get missed.
Reply With Quote
  #40  
Old 07-21-2002, 08:13 PM
interrealm interrealm is offline
 
Join Date: Nov 2001
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I utilize moreover's feed via cold fusion and have it set to check on a preset time (2 hours). It pulls the list... then queries the list against the table i made.. if it finds it already in the able (article name and date/time match) then it ignores it.. if it does not find it.. it proceeds to create a new record with this information.

I'm considering trying to write an outside hack (using cold fusion) to populate the vB this way... but this would require a better understanding of the table relationships and field creation rules that vB has then what i am capable of myself...

Just an idea... sounds like something that might bring vB to yet another level that no other board has right now (not that vB isn't already above the rest).

I'll be happy to give more ideas on concept for this on how I see it working.. just let me know.
Reply With Quote
  #41  
Old 07-29-2002, 10:24 AM
mem mem is offline
 
Join Date: Oct 2001
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Warning: php_hostconnect: connect failed in /home/fashe/maze0001/forum/admin/functions.php on line 2339

Warning: file("http://p.moreover.com/cgi-local/page?c=Windows%202000%20news&o=xml") - Bad file descriptor in /home/fashe/maze0001/forum/admin/functions.php on line 2339

Warning: Bad arguments to implode() in /home/fashe/maze0001/forum/admin/functions.php on line 2339

Why?
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 01:45 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.04349 seconds
  • Memory Usage 2,316KB
  • 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_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