![]() |
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 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] |
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:
/************************************************************/ 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; |
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"; } ?> ========================= |
allright...
replace this Code:
."<tr>\n" Code:
."<tr><td bgcolor=\"#eeeeee\">\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.. :p) |
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... |
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.. :rolleyes: 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... :o 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] |
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 |
really cool intro, i must say....!!!:eek:
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 :rolleyes: |
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... |
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... :confused: |
i just put the last XX posts in the index file right above where the news pasts go
look here it works fina and looks good http://www.darkdimensionsonline.com/test/ but i need help on another front for php-nuke: is there any way to add more categories to php-nuke downloads and link sections? like right now it only supports 2 layers like MP3's > Techno but i want more layers like this MP3's > Heavy > Tool > CDS since i have sooo many downloads to add i need to categorize them into many different and specialized categories. |
Quote:
Michael |
you must be joking... :eek:
the solution i gave (the second post) ONLY works for the 'blocks'... left or right doesn't matter.... i haven't looked at the php code for the 'center page' at all.. :p but anyways... you've got it fixed... so... enjoy! :D |
Quote:
I found a hack that seems to integrate the registration of users with vB and phpNuke at this thread: http://www.vbulletin.com/forum/showt...threadid=27932 Have not tried it out et as their seems to be some question to it working but thought you might want to see it. Michael |
i've looked at the code, yes...
but i'm not sure if it is what i want... i'd like people to sing up @ my nuke site... not at vbb... i'm going to take a look at this soon.... but it's going to take a while (got a lot of work to do...) but when i find a solution.. it's going to be a better one... :D LOL c u next time! |
Hey, my PHP-Nuke theme is this:
PHP Code:
|
Quote:
What I did was combine the two databases (phpNuke and vB) into one database which solved the problem. It seemed that the php code in nuke was referencing the wrong database so causing the script to break. Instead of looking thru the code for the problem it was easier to combine both databases into one. Thanks, Michael |
bringing this back from the grave, i too got errors for the center page, looking closely its cuz the code we replace screws up the tables in relation to what is in sql.
moving it to the right at the bottom of the color DOES fix it, why? because there are no more tables below it to screw up. try moving it towards the top, errors galore. oh well, it works, using it for online.php for who is online. |
mkilty:
yes.. i also used a single database to for PHPnuke and VB... works great... (no overlapping tables etc..) daymac: i think you made an error with replacing the php code for the ThemeSideBox function. The solution i gave should work. It works with me... ;) Make sure you didn't make any 'typos'.... |
jasoncorn:
your solution is pretty simple: replace Code:
."<b>.: $title</b><br>\n" Code:
."<b>.: $title</b><br>\n"; sorry for the late reply btw.... i've been away for a while... post here again if anyone needs help with phpnuke (and vb integration). c-ya! |
here is the original code:
Quote:
Quote:
Quote:
Quote:
in the right, it works, but i cant have it above certain blocks. i guess its ok, i have it i the right bottom, at least it is there |
Quote:
Code:
<? include('forum/admin/online.php'); ?> |
same, still get:
Quote:
|
actually, it doesnt work on the left....but yes it works on the right.
lol, oh well, maybe all my includes will be the right side, at least it (sorta) works for me |
strange....
cant find whats causing this.... let me know if u do! |
There's a MUCH easier way of doing this. Go back to the original post's idea of making a custom block, and put this in it:
<? if (eregi("block-Sample_Block.php",$PHP_SELF)) { Header("Location: index.php"); die(); } $file = fopen ("http://www.path_to.your/last10.php", "r"); while (!feof ($file)) { $content = fread ($file, 20000); } ?> VOILLA! just save that as block-whatever.php in your blocks folder, then include it as a phpnuke block. The 20000 is a number I picked - it has to do with how far php reads the file (how many bytes). If the number is too low it'll cut off the output. |
using your replacement BramT in theme, then using your way of including a php file, then I get error:
PHP Code:
PHP Code:
PS: the php page which I include works fine when I use direct access to it... PSS: vBB 2.2.6 | phpNuke 5.5 |
All times are GMT. The time now is 12:13 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|