Version: , by Dave#
Developer Last Online: Jan 2017
Version: Unknown
Rating:
Released: 09-24-2001
Last Update: Never
Installs: 2
No support by the author.
Synopsis
This hack allows webmaster to provide syndicated VB content to other webmasters such as Latest topics, Latest Polls or calendar entries to other webmasters for inclusion on their websites. The webmasters using the feeds do NOT need PHP, PERL, MYSQL, ASP just a javascript enabled browser.
Requirements
* Crontab
* The ability to run PHP via the command line
Please note the documentation is sketchy and if your aren't savvy with hacking code yourself then maybe you should wait until the documentation is up to speed.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
//Offer somewhere on your site for users to get the following code
//<script language="JavaScript" src="http://yourdomain/forums/latest_topics.js"></script>
//Crontab? i recommend using lynx as it will always work
//10 * * * * /usr/bin/lynx -dump [url]http://urltoyourboard/newsfeed.php[/url]
//Based on hack by Dave Campbell ([url]www.cpfc.org[/url])
//Modified by Scott MacVicar (software@pp-network.com)
//
//Note you made need to create a latest_topics.js file in your forums directory and chmod to 666.
$bburl="http://url.com/to/forums";
//load config
require("./admin/config.php");
// init db **********************
// load db class
$dbclassname="./admin/db_$dbservertype.php";
require($dbclassname);
$DB_site=new DB_Sql_vb;
$DB_site->appname="vBulletin Control Panel";
$DB_site->appshortname="vBulletin (cp)";
$DB_site->database=$dbname;
$DB_site->server=$servername;
$DB_site->user=$dbusername;
$DB_site->password=$dbpassword;
$DB_site->connect();
// end init db
//below is the variable for number of topics to show
$num_active = 10;
//Get forums which normal users can view
$forums=$DB_site->query("SELECT forumid FROM forum");
while ($forum=$DB_site->fetch_array($forums)) {
$fperms=$DB_site->fetch_array($DB_site->query("SELECT canview,forumid FROM forumpermission WHERE usergroupid='1' AND forumid='$forum[forumid]'"));
if($fperms["canview"] == 1) {
//can view forum
$forumperms[]=$forum["forumid"];
}
elseif(!isset($fperms["canview"])) {
$forumperms[]=$forum["forumid"];
//forumpermission doesn't exist for this forum
}
}
$DB_site->free_result($forums);
unset($forum);
unset($fperms);
if(!empty($forumperms)) {
$forumperms='AND forumid='.implode(' OR forumid=',$forumperms);
}
//Get the latest threads which are open
$query=$DB_site->query("SELECT * FROM thread WHERE open='1' $forumperms ORDER BY lastpost DESC LIMIT $num_active");
the above code is working fine on the version of vBulletin i administor. It was taken straight from the file couple minutes ago and we're using it without problems.
I tried to use: /usr/bin/php -q /path/to/htdocs/newsfeed.cgi
It seems to execute the file now, but I get a parse error...
---------
<br>
<b>Parse error</b>: parse error in <b>/home/********/********/******/newsfeed.cgi</b> on line <b>73</b><br>
---------