vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Forum News (News in a Forum) (https://vborg.vbsupport.ru/showthread.php?t=41052)

JJR512 07-13-2002 10:00 PM

Forum News (News in a Forum)
 
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.

http://www.jjr512.com/images/forumne...news_forum.gif

http://www.jjr512.com/images/forumne...umsettings.gif

https://vborg.vbsupport.ru/

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.

Neo 07-14-2002 06:01 AM

Gasp!!!!!!!!!!!! The hack master is back.

This is really nice and I would like to say thank you :)

JJR512 07-14-2002 06:09 AM

Wow, that's a very quick reply! :)

I've been suffering a horrible affliction over the past few months. It's made it very difficult for me to come to these forums. My problem: Hack idea blockage! No new ideas. Well, I finally had one, and I hope many people will enjoy it.

***

Also forgot to mention, for the record: This hack was developed on a clean install of vB 2.2.6. After the hack was completed, the test board was wiped clean, and the hack was tested using the instructions; it installed and worked perfectly. :)

Neo 07-14-2002 06:13 AM

I know how you feel if you ever need a idea I got one for you. I posted it a vbulltin.com though for a future addon for VB3.

I myself havent been able to stop hacking Oo It gets painful after awhile, and I can already see myself having to wear glasses.

Vivi Ornitier 07-14-2002 06:48 AM

hella nice hack, sweet idea.

JJR512 07-14-2002 07:00 AM

I just realized I didn't really mention why I made this hack, or what I think it would be useful for. I guess it's probably obvious, but just in case... I have forums on my board related to various computer topics, as well as sports, entertainment, cars, and other stuff. I wanted to have a newsfeed in each forum that was related to what the forum was about. So, in my Software forum, I have Software News, and in my Entertainment forum, I have Entertainment News. There are 334 different news feeds you can choose from; hopefully, you'll be able to find something for at least some of your forums. Remember, each forum is configured independently, to have its own feed, or no feed at all, if you can't find an appropriate one.

AndyTSJ 07-14-2002 08:01 AM

I got a hack idea for ya JJR512.... actually I got a few. Let me know if you wanna hear them...

JJR512 07-14-2002 08:16 AM

Sure, but you'd probably have better results by posting in the requests forum. If I can do it, I will; I've made requested hacks before. But if you just tell me, it might be something I don't know how to do, or don't have time to do. I just didn't look in there for a while, either, because I was just a bit worn out, I guess.

Vivi Ornitier 07-14-2002 04:46 PM

hmmm . . . where do we add the news? I can't find any link in the admin panel???

Brad 07-14-2002 08:02 PM

http://www.jjr512.com/images/forumne...ersettings.gif


in vbulletin options where that ^ is supose to be i get nothing but the forum news in the purple table and no options at all.

JJR512 07-15-2002 12:13 AM

Anime-loo, did you run all the queries at the bottom of the instructions? There were two that started with, "INSERT INTO setting", which make those two settings appear.

Vivi Ornitier, to add news to a forum, edit that forum (admin cp-> forums & moderators: modify->click the edit link by the forum you want to add news to->select a newsfeed from the drop-down box that appears in the second section of options (see the second picture above).

Brad 07-15-2002 01:09 AM

Quote:

Originally posted by JJR512
Anime-loo, did you run all the queries at the bottom of the instructions? There were two that started with, "INSERT INTO setting", which make those two settings appear.
yes i did

JJR512 07-15-2002 01:27 AM

Have you added any other sets of custom settings to the vBulletin Options? At the top, in the links to all the groups, is Who's Online the last one before News Options, or is there anything else in between them?

Note to anyone that DOES have other custom groups of settings: You will need to modify the three queries that start with "INSERT INTO". On the vBulletin Options page of the admin cp, at the top, where you have the links to all the settings groups on the page, if you point to each link, in the status bar of your browser you should see a URL that ends with something like settinggroup31. Point to the last of the links and note the number; is should be higher than 31 (31 is for Who's Online, the last of the groups that are stock). Now, in those three queries that start with "INSERT INTO", you will need to change all occurrances of the number 32 to whatever number you found plus 1; i.e., if your highest settinggroup number is 34, you need to change all 32s in the queries to 35.

Brad 07-15-2002 01:28 AM

ahh i see whats wrong :) your using the same displayorder # (32) as the default pm hack. got it working

alanvo 07-15-2002 01:38 AM

i did everything right, but for some reason, the news doesnt show up.

Brad 07-15-2002 01:38 AM

once i set a news item for a forum i cant select none anymore :(

JJR512 07-15-2002 03:16 AM

Anime-loo, I believe I have fixed that problem. I apologize for letting that one slip by; I thought I had tested for that, but I aparently forgot. Anyway, I've tested this on my own test board, and it works fine for me, as far as I can tell. I've updated the instructions. You will need to add some new code to admin/adminfunctions.php (previously not modified at all for this hack), and some of the new code for admin/forum.php has been changed. The forumdisplay.php and admin/functions.php files, all templates, and the database are not changed between 1.0 and 1.1.

alanvo, please try going to the vBulletin Options page of the admin cp, and submitting it. You don't have to change anything; just press the submit button at the bottom. Then go back to the forum, and refresh the page.

JJR512 07-15-2002 03:21 AM

For the record, the value -- None -- will now always appear as the first option in the newsfeed selection drop-down box.

The attachment in the original post in this thread has been updated.

Brad 07-15-2002 03:55 AM

Parse error: parse error in /home/kousetsu/public_html/newforum/admin/forum.php on line 235

re hacked 5 times.

JJR512 07-15-2002 04:17 AM

You must have made a mistake in editing that file. Make sure lines 187-196 look exactly like this:

PHP Code:

  if ($forumid!=-1) {
    
makeforumchooser("parentid",$forum[parentid]);
  } else {
    
makehiddencode("parentid","0");
  }

  
maketableheader("Forum News Options");
  
makeforumnewschoosercode($forum[forumnewsid]);

  
maketableheader("Moderation Options"); 


Smoothie 07-15-2002 04:43 AM

question....in my vb options, the settinggroup, whosonline is 31, and then there are 2 new ones. Quiz is 32, and signature settings is 302. What number should I use when i change the "insert into" queries?

JJR512 07-15-2002 04:56 AM

You can really use any number that's not already in use. You could make it be 33 to appear in between quiz and signature settings, or you could make it be 303 to appear last.

Smoothie 07-15-2002 05:02 AM

Two more quick questions before i install. have you had a any problems with moreover.com slowing your forums down, and are there additional queries that are added by using this hack?

Thanks.

JJR512 07-15-2002 05:51 AM

I believe it adds one query to every forumdisplay page to check if that forum has a newsfeed, and if there is, there is another query to get the details.

I haven't had any problems from moreover.com. They seem like a pretty good, reliable source. Although I suppose I should probably add some error handling in case it can't connect to their server.

JJR512 07-15-2002 06:03 AM

(Post edited because of changes to the code.)

This hack uses only one new query when showing a forum, and that query is ONLY used if that forum is getting a newsfeed. Thanks to FireFly for showing me how to do that. :)

Smoothie 07-15-2002 06:42 AM

JJR512-

Thanks for the info. BTW, in the instructions .txt file, you say:
Quote:

Note regarding the next three queries:
but you have only 2 listed below that. I'm thinking it was the one above, and the 2 below? One that started with:
Quote:

INSERT INTO settinggroup
and the other 2 that started with:
Quote:

INSERT INTO setting
All 3 should use the same number?

JJR512 07-15-2002 06:48 AM

Yes, sorry about that, I put that note in the wrong spot.

xug 07-15-2002 07:05 AM

JJT512, you have showed us again what a great 'hacker' you are.

Thanks for this great hack, one word : SUPER.

In note to a posting about slowing down, I have the feeling that it slows my forum down for about one or two seconds, which is in my eyes not a problem at all.

xug 07-15-2002 07:55 PM

I found a small bug and can't solve the problem myself.

When you look at the news that is presented like :

HiTech gets Aces High again! From: ConsoleDomain Jul 13 2002 3:24AM

and want to select the news link source, so in this sample above here it would be 'ConsoleDomain' main website you get an error because the link that will be projected is like :

http://www.gamesdomain.com%20target=/

So the taget function is not properly coded and can't figure it out myself, to me the coding looks good, but hey, I'm a dunno ;)

Please help.

JJR512 07-15-2002 08:22 PM

Sorry about that; I left a closing quote out of an <a href...> tag in the forumnewsbit template.

In that template, find this:
Code:

<a href="$forumnews[sourceurl] target="_blank">
Change it to this:
Code:

<a href="$forumnews[sourceurl]" target="_blank">
I will update the attachment shortly, but if you already have v1.1a, you do not need to download it again, as this is the only fix.

xug 07-15-2002 09:08 PM

Thanks for the fast reply.

JJR512 07-16-2002 08:23 AM

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".

xug 07-16-2002 01:37 PM

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 :cool: Is this FireFly's work? Must Be :classic:

JJR512 07-18-2002 01:24 AM

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!

JJR512 07-18-2002 02:12 AM

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.

Chris M 07-18-2002 10:18 AM

Simply Superb:)

Satan

interrealm 07-20-2002 09:57 PM

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.

JJR512 07-21-2002 01:58 AM

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.

interrealm 07-21-2002 08:13 PM

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.

mem 07-29-2002 10:24 AM

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?


All times are GMT. The time now is 06:28 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.02326 seconds
  • Memory Usage 1,842KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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