The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
I've been trying to use the Last XX posts script ( http://www.vbulletin.com/forum/showt...threadid=12324 ) in PHP Nuke...
I've tried putting Code:
<? include("last10.php"); ?> and using a custom block with the following code: Code:
<?php if (eregi("block-LastPosts",$PHP_SELF)) { Header("Location: index.php"); die(); } $content = "<? include('www.vhvn.net/vhvn/forums/last10.php'); ?>"; ?> anyone knows a sollution for this? I've been searching the forums but i haven't found a decent solution yet... [edit] using phpnuke 5.2 [/edit] Show Your Support
|
Comments |
#2
|
|||
|
|||
I've found what's causing the problem myself...
putting Code:
<? include("last10.php"); ?> BUT: the problem is caused by some lazy-programming in THEME.PHP file of your phpnuke's theme: Look for Code:
/************************************************************/ /* Function themesidebox() */ /* */ /* Control look of your blocks. Just simple. */ /************************************************************/ there should be a statement somewhere (in the middle) saying Code:
echo $content You'll have to issolate the "echo $content" statement and replace it with: Code:
if (substr($content,0,2) != "<?") echo $content; else { $content = str_replace ("<?", "", $content); eval($content);} |
#3
|
|||
|
|||
Ok I am having trouble here. Where would you put the code for it to work.
Here is the snippet of code from my themebox - =================== function themesidebox($title, $content) { echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#eeeeee\" width=\"150\"><tr><td>\n" ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"150\">\n" ."<tr>\n" ."<td><img src=\"themes/Somara-Platinum/images/sideBoxTop.gif\"></td>\n" ."</tr>\n" ."</table>\n" ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\" width=\"100%\">\n" ."<tr><td bgcolor=\"#CACACA\" align=\"center\">\n" ."<font size=\"2\" color=\"#363636\"><b>$title</b></font>\n" ."</td></tr>\n" ."<tr>\n" ."<td bgcolor=\"#eeeeee\">$content</td>\n" ."</tr>\n" ."</table></td></tr></table>\n" ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"150\">\n" ."<tr>\n" ."<td><img src=\"themes/Somara-Platinum/images/sideBoxBottom.gif\"></td>\n" ."</tr>\n" ."</table>\n" ."<br>\n\n\n"; } ?> ========================= |
#4
|
|||
|
|||
allright...
replace this Code:
."<tr>\n" ."<td bgcolor=\"#eeeeee\">$content</td>\n" ."</tr>\n" Code:
."<tr><td bgcolor=\"#eeeeee\">\n"; if (substr($content,0,2) != "<?") echo $content; else {$content = str_replace ("<?", "", $content); eval($content);} echo "</td></tr>\n" (you might want to check out www.vhvn.net to see my phpNuke & vBB site to see what else i've come up with in the past 4 days.. ) |
#5
|
|||
|
|||
First I want to say "Thanks" for your help on this.
I applied the change to the code and it works. But I now get an error with the center of the home nuke page being blank. This is the error: Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/html/vbportal/html/mainfile.php on line 145 1146: Table 'vbullet.nuke_stories' doesn't exist When I put the theme.php file back to default the site works correctly again. Idea's? Also I would love to know if you were able to hack Nuke to use the vB database for users....I hate to have my members register twice etc... |
#6
|
|||
|
|||
Quote:
(are you using phpnuke or vbportal btw? coz it says .../vbportal/html/... in the errormsg..) anyways... try to run the php file your are trying to run on it's own... (by entering it's url in your browser). If it doesn't run correctly: there's your problem.. if it DOES run correctly, note this: the paths used in the php file you are trying to run should be relative to the path where the index.htm file of phpnuke resides... dunno if you get this, so here's an example: my phpnuke index.php is in : /vhvn the file i'm including is in : /vhvn/forums the file i'm including needs a file in /vhvn/forums/admin in the file i'm including there's an include statement, pointing to the file it needs... normally this should be ./admin/file.php. If i do this, i can run the file correctly from /vhvn/forums. But since i'm actually run this php file from /vhvn the path should be ./forums/admin/file.php. Now, if i do this, the php file i'm including does NOT run correctly (on it's own) from /vhvn/forums but it DOES run correctly from /vhvn. And that's what we want... uhm... now i'm not sure if this example made it any clearer to you... You can forget about this example anywayz if both files (index.php and the file you are trying to include) are in the same dir. so.. you should check out what i mentioned before: Quote:
note: don't expect to much from me either... i've been using mysql and php for only a few days.. (but i'm a quick learner though.. ) [edit] by the way.. what do you think of my site? www.vhvn.net and post your url too... i might have some suggestions.. [/edit] |
#7
|
|||
|
|||
I'll check it out with the relative paths. I currently have the "topposters" $path variables with absolute paths as well as the "include" statement.
The URL with the vbportal in its path is just a holdover from running vbportal as a test. It really is the document root for my server. Check my site out on www.clublexus.com - I have the latest posts working on the front page not thru .php but thru javascript code. I'll post back on the results..... Thanks, Michael |
#8
|
|||
|
|||
really cool intro, i must say....!!!
javascript is also an option.. ofcourse.. but i wanted my site in 100% PHP this time... so... i didn't even consider it... hehe.. my fault... good luck! if anyone still has problems with this, reply here and i'll come to the rescue.... LOL |
#9
|
|||
|
|||
Hmmm...
I am still getting that error. The code works great. I've created a page called test3.php - http://www.clublexus.com/html/test3.php Which works great on it's own. It will work on my nuke site as well but the error call is referencing to the wrong database. vbullet is my forum database but the nuke database is called chr so the "mainfile.php" seems to be getting the wrong database in it's $db variable after running the include file. I'll try out other code but this is frustrating... |
#10
|
|||
|
|||
i think something in your php file (test3.php) is making a "relative" call to your database... allowing phpnuke to add it's own tag in front of it...
i think you should try to look for the call in the test3.php file and see if there are any variables in front of it... and remove them.. making it an "absolute" call... if you know what i mean... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|