Nice work on the greenhybrid site! Would you mind sharing your PHP parse code -- I'm guessing you used preg_replace() -- to format the source link on the front page?
Apparently calling global.php, as this hack does, is erasing all other variables in the php defined before it.
I've associated pages on my site with forums and have stored a forumid for each page in my db. I wanted to pull that forumid, pass it to this script, and have it print out topics.
However upon calling global.php the variable holding my forumid is erased. I don't know why, I can't explain it, but I tested it and its happening.
So, there is no way to dynamically feed this script information, for god knows what reason...
Quote: Originally Posted by greenhybrid
Here's what I was able to achieve with some creative modification of the code: http://www.greenhybrid.com/
Nice work on the greenhybrid site! Would you mind sharing your PHP parse code -- I'm guessing you used preg_replace() -- to format the source link on the front page?
I just realized there's more to the "Source" link function. Your script needs to be able to scan the text output and capture the URL. Anyone wanna take a stab on how to do that.
I was also wondering how one can have an excerpted post for news threads that links back to your custom CMS page. See example in action here. (I figured out that this site is using the vBulletin-WordPress Bridge hack)
Fatal error: Call to a member function on a non-object in D:\server\mobilejoe\joeforums\includes\functions_bbcodeparse.php on line 398
This one looks better using old bbcode function but far away from how it should be (see screenshot below) because it still shows ****** bbcode. How can I fix this?
Problem: You cannot use old parser, connect dies within script.
I finally got this to work. A friend of mine found out, that the db connect was broken and the new parser didn't work because of that issue. Here's what I did on my page to get this working in 3.5 including new Parser and Fix within db connect (including advertising after 3 news):
See this line: $xdb = mysql_select_db("$dbname", $connection) or die ("Could not select database.");
$bbparser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$connection = mysql_connect("$servername","$dbusername","$dbpassword") or die ("Cannot connect to server.");
$xdb = mysql_select_db("$dbname", $connection) or die ("Could not select database.");
$sql = "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid IN ($cats) AND sticky = '0' ORDER BY threadid DESC LIMIT $newsitems";
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query.".mysql_error());
$sql2 = "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1";
$sql_result2 = mysql_query($sql2, $connection) or die ("Could not execute query in second sql statement.".mysql_error());
if (!$sql_result2)
echo "Could not get news.";
else
{
while ($row2 = mysql_fetch_array($sql_result2))
{
$ptext = $row2["pagetext"];
$dateposted = date("j.n.Y G:i",$dateline);
$commenttext = "Kommentar";
$sql3 = "SELECT title FROM forum WHERE forumid = \"$forumid\" LIMIT 1";
$sql_result3 = mysql_query($sql3, $connection) or die ("Could not execute query in second sql statement.");
$row3 = mysql_fetch_array($sql_result3);
$forumname = $row3["title"];