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.


All times are GMT. The time now is 06:14 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.01087 seconds
  • Memory Usage 1,748KB
  • 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
  • (6)bbcode_php_printable
  • (1)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
  • (10)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