Everything works fine, seems like would be a great hack, thats if it was syndicating with the .xml .rss feeds - I get this error from articlebot.php
Fatal error: Call to a member function on a non-object in /hsphere/local/home/williamk/cs-elite.net/forums/articlebot/articlebot.php on line 92
PHP Code:
<?php
/* +------------------------------------------------------------------+
| articlebot.php, v1.1, 07/25/04 |
+------------------------------------------------------------------+
| Support: www.vbulletin.org/forum/showthread.php?t=67078 |
+------------------------------------------------------------------+
| Author: velocd |
| www.animesystem.com |
+------------------------------------------------------------------+ */
/* +---------------------------------+
| Environment |
+---------------------------------+ */
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
$globaltemplates = array(
'articlebot_post'
);
/* +---------------------------------+
| Dependencies |
+---------------------------------+ */
// Provide absolute server path to forums.
// e.g. /home/cjohn/public_html/forums/
// chdir('/hsphere/local/home/williamk/cs-elite.net/forums/');
// require_once './global.php';
include_once '/hsphere/local/home/williamk/cs-elite.net/forums/articlebot/rss_fetch.inc';
// If you intend to call this script by placing a
// include_once './articlebot/articlebot.php'; in your
// phpinclude_end template, then comment out:
//
// chdir('/path/to/forums/');
// require_once './global.php';
//
// Note, recommended usage for this script is by
// crontab with this shell command in mind:
//
// e.g. /usr/local/bin/php /path/to/forums/articlebot/articlebot.php
// (substituting the paths with their correct location)
//
// If /usr/local/bin/php is not the correct path (generally it is),
// use PuTTY to SSH in and use the command "whereis php" to find
// the correct path.
//
// Explanation on crontabs:
// http://www.cpanel.net/docs/cp/cronJobs.htm
//
// By this method you are not calling an extra query on every page
// to check for ready-to-post article bots.
if ($vboptions['similarthreadsearch'])
{
require_once './includes/functions_search.php';
}
/* +------------------------------------------+
| Request: article bot syndication |
+------------------------------------------+ */
if (!$_REQUEST['do'])
{
/* +---------------------------------+
| Query: fetch article bots |
+---------------------------------+ */
$result_articlebots = $DB_site->query("
SELECT articlebot_rss.*, articlebot.userid,
articlebot.articlebotid,
articlebot.regex_title_search AS global_regex_title_search,
articlebot.regex_title_replace AS global_regex_title_replace,
articlebot.regex_desc_search AS global_regex_desc_search,
articlebot.regex_desc_replace AS global_regex_desc_replace,
".TABLE_PREFIX."user.username
FROM articlebot_rss
LEFT JOIN articlebot
USING (articlebotid)
LEFT JOIN ".TABLE_PREFIX."user
USING (userid)
WHERE nextpost <= ".TIMENOW."
AND articlebot_rss.enabled = 1
AND articlebot.enabled = 1
");
if ($DB_site->num_rows($result_articlebots))
{
$fetch_days = 20;
$timecut = TIMENOW - ((60*60*24) * $fetch_days);
/* +---------------------------------+
| Query: fetch threads |
+---------------------------------+ */
$result_threads = $DB_site->query("
SELECT title
FROM articlebot_rss_cache
WHERE dateline >= $timecut
");
while ($thread = $DB_site->fetch_array($result_threads))
{
$threads[] = trim($thread['title']);
}
while ($articlebot = $DB_site->fetch_array($result_articlebots))
{
$rss = fetch_rss($articlebot['rss_path']);
$articles = array_reverse($rss->items);
$count = 0;
foreach ($articles as $article)
{
$article['title'] = trim($article['title']);
if (!$article['link'] || !$article['title'])
{
continue;
}
if ($articlebot['desc_required'] && !$article['description'])
{
continue;
}
if (is_array($threads) && in_array($article['title'], $threads))
{
continue;
}
if (!$articlebot['lastpost'] && (--$articlebot['initialtrim'] > 0))
{
/* +---------------------------------------+
| Query: insert unused cache threads |
+---------------------------------------+ */
$DB_site->query("
INSERT INTO articlebot_rss_cache
(title, dateline)
VALUES
('".addslashes($article['title'])."', ".TIMENOW.")
");
continue;
}
/* +---------------------------------+
| Query: insert cache thread |
+---------------------------------+ */
$DB_site->query("
INSERT INTO articlebot_rss_cache
(title, dateline)
VALUES
('".addslashes($article['title'])."', ".TIMENOW.")
");
if ($articlebot['global_regex_title_search'] || $articlebot['regex_title_search'])
{
if ($articlebot['regex_title_search'])
{
$articlebot['global_regex_title_search'] = $articlebot['regex_title_search'];
$articlebot['global_regex_title_replace'] = $articlebot['regex_title_replace'];
}
$article['title'] = @preg_replace(
"$articlebot[global_regex_title_search]",
"$articlebot[global_regex_title_replace]",
$article['title']
);
}
if ($vboptions['similarthreadsearch'] && $articlebot['build_similar_threads'])
{
$similarthreads = fetch_similar_threads($article['title']);
}
else
{
$similarthreads = '';
}
if ($articlebot['label'])
{
$article['title'] = $articlebot['label'] . ' ' . $article['title'];
}
/* +---------------------------------+
| Query: insert thread |
+---------------------------------+ */
$DB_site->query("
INSERT INTO ".TABLE_PREFIX."thread
(title, lastpost, forumid, open,
replycount, postusername, postuserid, lastposter, dateline, iconid,
visible, attach, similar, is_rss)
VALUES
('".addslashes($article['title'])."', ".TIMENOW.", $articlebot[forumid],
1, 0, '".addslashes($articlebot['username']) . "', $articlebot[userid],
'".addslashes($articlebot['username']) . "', ".TIMENOW.", $articlebot[iconid], 1, 0,
'".addslashes($similarthreads)."', 1)
");
$thread_id = $DB_site->insert_id();
$article['description'] = strip_tags(html_entity_decode(trim($article['description'])));
if ($articlebot['global_regex_desc_search'] || $articlebot['regex_desc_search'])
{
if ($articlebot['regex_desc_search'])
{
$articlebot['global_regex_desc_search'] = $articlebot['regex_desc_search'];
$articlebot['global_regex_desc_replace'] = $articlebot['regex_desc_replace'];
}
$article['description'] = @preg_replace(
"$articlebot[global_regex_desc_search]",
"$articlebot[global_regex_desc_replace]",
$article['description']
);
}
eval('$articlebot_post = "' . fetch_template('articlebot_post', 0, 0) . '";');
/* +---------------------------------+
| Query: insert post |
+---------------------------------+ */
$DB_site->query("
INSERT INTO ".TABLE_PREFIX."post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible, attach)
VALUES
($thread_id, 0, '".addslashes($article['title'])."',
'".addslashes($articlebot['username'])."', $articlebot[userid],
".TIMENOW.", '" . addslashes($articlebot_post)."', 0, 1,
'".addslashes($_SERVER['SERVER_ADDR'])."', $articlebot[iconid], 1, 0)
");
$post_id = $DB_site->insert_id();
/* +---------------------------------+
| Query: update thread |
+---------------------------------+ */
$DB_site->query("
UPDATE ".TABLE_PREFIX."thread
SET firstpostid = $post_id
WHERE threadid = $thread_id
");
require_once './includes/functions_databuild.php';
$foruminfo['indexposts'] = 1;
build_post_index($post_id, $foruminfo, 1);
if ($forums[$articlebot['forumid']])
{
$forum_posts = ++$forums[$articlebot['forumid']]['forum_posts'];
unset($forums[$articlebot['forumid']]);
}
else
{
$forum_posts = 1;
}
$forums[$articlebot['forumid']] = array(
'lastposter' => $articlebot['username'],
'lastthread' => $article['title'],
'lastthreadid' => $thread_id,
'lasticonid' => $articlebot['iconid'],
'forum_posts' => $forum_posts
);
if ($users[$articlebot['userid']])
{
$users[$articlebot['userid']]++;
}
else
{
$users[$articlebot['userid']] = 1;
}
if (++$count >= $articlebot['fetchlimit'])
break;
}
$nextpost = TIMENOW + ($articlebot['postinterval'] * 60);
/* +-------------------------+
| Query: update rss |
+-------------------------+ */
$DB_site->query("
UPDATE articlebot_rss
SET lastpost = ".TIMENOW.",
nextpost = $nextpost
WHERE rssid = $articlebot[rssid]
");
unset($rss);
}
if (is_array($users))
{
foreach ($users as $userid => $user_posts)
{
/* +---------------------------------+
| Query: update article bot(s) |
+---------------------------------+ */
$DB_site->query("
UPDATE ".TABLE_PREFIX."user
SET posts = posts + $user_posts
WHERE userid = $userid
");
}
}
if (is_array($forums))
{
foreach ($forums as $forumid => $forum)
{
/* +---------------------------------------+
| Query: update affected forum(s) |
+---------------------------------------+ */
$DB_site->query("
UPDATE ".TABLE_PREFIX."forum
SET replycount = replycount + $forum[forum_posts],
threadcount = threadcount + $forum[forum_posts],
lastpost = ".TIMENOW.",
lastposter = '" . addslashes($forum['lastposter']) . "',
lastthread = '" . addslashes($forum['lastthread']) . "',
lastthreadid = $forum[lastthreadid],
lasticonid = $forum[lasticonid]
WHERE forumid = $forumid
");
}
}
}
}
?>
That's a copy of how articlebot.php is at the moment. Any ideas?