vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   news2vb - Moreover news headlines to vBulletin discussion thread (https://vborg.vbsupport.ru/showthread.php?t=72636)

Cloud-Warrior 12-07-2004 10:00 PM

news2vb - Moreover news headlines to vBulletin discussion thread
 
Updated from previous vBulletin 2 version of news2vb.

Hope the instructions at the top of the file are clear, if not please post here.

To install this utility, copy the single PHP file to your vB dir. Edit it and change the password to whatever you wish. Change the yourvbdir variable to the URL pointing to your vB directory.

As demo - here are some sample output threads:

http://www.boards.jp/forums/showthread.php?t=16277
http://www.boards.jp/forums/showthread.php?t=16276

Also, have a look at the menu here:

http://www.boards.jp/forums/news2vb....ion=picksource

This script will generate messages of the following form in whatever forum you wish, using any of the Moreover newsfeeds.

Changelog

2.0 - 8 December 2004 - Updated for vBulletin 3.0.x; fixed errors in post creation; added TABLE_PREFIX
1.1 - 19 March 2002 - "Post News" output now shows BB code parsed message, URL to thread; fixed missing references to $yourvburl
1.0 - 15 March 2002 - First version of script

Cloud-Warrior 12-08-2004 09:53 AM

So what does the hack do - basically if you call the PHP script with the jaction=picksource command you can see a list of Moreover feeds (www.moreover.com) and a list of your forums, and you can post the headlines into the forum of your choice (as long as you supply the correct password as hardcoded into the script).

Alternatively, you can ignore the categories and perform a custom list of headlines (by searching in the headline keywords or a query through the article text - keyword and query boxes respectively), or you can enter a feed number in the feed box (some unedited Moreover feeds don't have category names - you can see the feed ID number in examples at their site).

You should also be able to generate forum posts from a script, e.g. using wget you would do something like:

Quote:

set url = http://www.wherever.com/vbulletin/news2vb.php
wget -O /dev/null "$url?jaction=postnews&jpassword=cloudbot&jcategor y=Arts%2520and%2520culture%2520news&jforum=21"
wget -O /dev/null "$url?jaction=postnews&jpassword=cloudbot&jfeed=15 771&jtitle=Buffy+news&jforum=93"
wget -O /dev/null "$url?jaction=postnews&jpassword=cloudbot&jkeyword s=lord+of+the+rings&jforum=103"
wget -O /dev/null "$url?jaction=postnews&jpassword=cloudbot&jquery=% 22babylon+5%22&jforum=93"
Sample screen from the menu is attached.

Any questions, please ask.

Cloud-Warrior 12-08-2004 09:55 AM

Since passing of the title to a new reply no longer works in vB3, if you want the news headline title to propagate to a reply, you will have to add:

PHP Code:

if ($title == '') { $title $_REQUEST['title']; } 

to newreply.php after the line:

PHP Code:

$title $newpost['title']; 


Erwin 12-08-2004 10:02 AM

I like this. :) I'll check it out...

Cloud-Warrior 12-08-2004 10:03 AM

Hi Erwin - yes I remember you tried the old version too (link). Hope it works okay... Moreover went through some changes since I did the previous hack; for a while you couldn't get headlines at all without some paid registration but now they support the headlines by making the first one an advert.

Erwin 12-08-2004 10:15 AM

You can easily modify this so that the poster has a userid instead of an unregistered user by the way. That's what I've done. ;)

Erwin 12-08-2004 10:19 AM

To make the poster a registered user, do this:

Add a new variable:

Find:

PHP Code:

// Unregistered username to post as
$jfromwho "CloudBot"

Add under:

PHP Code:

// Userid - keep 0 for unregistered
$juserid "0"

Then find:

PHP Code:

  '".addslashes($jfromwho)."',
  
'0'

Replace with:

PHP Code:

  '".addslashes($jfromwho)."',
  
'$juserid'

Done! :)

Cloud-Warrior 12-08-2004 10:19 AM

Yup - I wasn't sure whether people would prefer that or not... Thanks for the updates Erwin!

Cloud-Warrior 12-08-2004 12:14 PM

Replaced some mysql_query's and mysql_fetch_array's with $DB_site->query and $DB_site->fetch_array, and added Erwin's suggestion above.

Lethal 12-08-2004 01:42 PM

nice ill try it out.

joeychgo 12-08-2004 07:58 PM

your sample threads dont work


No Thread specified. If you followed a valid link, please notify the webmaster

Polo 12-09-2004 12:50 AM

I was about to say the same thing.. they dont work...

Erwin 12-09-2004 08:43 AM

A minor bug fix:

In the file, FIND:

PHP Code:

$jgenerateurl "wget -O /dev/null \"$yourvburl/news2vb.php?jaction=postnews&jpassword=$checkpassword&jforum=$jforum"

$checkpassword should be $jcheckpassword, otherwise the direct URL does not have the password.

Replace with:

PHP Code:

$jgenerateurl "wget -O /dev/null \"$yourvburl/news2vb.php?jaction=postnews&jpassword=$jcheckpassword&jforum=$jforum"

That's it. :)

Cloud-Warrior 12-09-2004 09:51 AM

Thanks Erwin, will update the file now...

Also, thread links updated in original thread.

dwh 12-10-2004 12:19 AM

Are people happy with this?

Cloud-Warrior 12-10-2004 06:53 AM

How do you mean?

dwh 12-10-2004 07:55 AM

Meaning, for people who have installed it, do they like this hack's implementation? Is it working well? I'm debating installing it but I'd like to see more feedback from people.

joeychgo 12-10-2004 12:37 PM

anyone have this implemented? id like to see it run

Cloud-Warrior 12-10-2004 05:43 PM

Well I have it installed, the three links in the original post show two sample outputs and the last one shows the interface. But I'm not sure what you want to see...

fly 12-31-2004 03:09 AM

How often are these threads created? I guess I should download it and maybe it will tell me.

edit: I see it runs manually. Can I set it up on a cron job somehow?

Cloud-Warrior 01-05-2005 12:00 PM

Yep you can use crontab -e and wget on unix to set up a job, e.g.

0 8 * * * wget -O /dev/null "http://www.wherever.com/vbulletin/news2vb.php?jaction=postnews&jpassword=blah&jcateg ory=Sports%253A%2520soccer%252 0news&jforum=1"

Erwin 01-05-2005 08:20 PM

I've got this running in vB cron. :)

Cloud-Warrior 01-06-2005 06:42 PM

Even better :) Did you have to do anything special Erwin?

Erwin 01-06-2005 09:02 PM

Quote:

Originally Posted by Cloud-Warrior
Even better :) Did you have to do anything special Erwin?

I just set the variables in the PHP file itself, since vB Cron does not allow variables in the URL. So you need separate PHP files for each forum/news.

gkar 02-13-2005 12:47 PM

Nice one, thanks a lot . Only one question, can I add more sites to read notices or only moreover ones are supported? If so, how can I add more notices?

Gutspiller 08-06-2005 12:11 AM

Is it possible to get this hack to work with any RSS feed?

Cloud-Warrior 08-22-2005 08:46 AM

No this only works with Moreover CSV feeds.

To make it work with RSS would be slightly more complex; first you'd need to integrate it with MagpieRSS and then use that to produce the items in the list.

Is there a demand for this?


All times are GMT. The time now is 04:47 PM.

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.02374 seconds
  • Memory Usage 1,782KB
  • 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
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete