Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by BramT (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-11-2001 Last Update: Never Installs: 0
 
No support by the author.

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"); ?>
in a block (as text)

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'); ?>";

?>
but none of them give any output... all paths are correct (used relative and absolute variations) and the last10.php script runs correctly as wel...

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-11-2001, 03:10 PM
BramT
Guest
 
Posts: n/a
Default

I've found what's causing the problem myself...

putting
Code:
<? include("last10.php"); ?>
in a text-block is the correct solution....

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.                */
/************************************************************/
at the end of the THEME.PHP file

there should be a statement somewhere (in the middle) saying
Code:
echo $content
it might be surrounded by other code....

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);}
Now you can use the "<? include" statement to include ANY PHP file...
Reply With Quote
  #3  
Old 10-11-2001, 08:04 PM
mkilty mkilty is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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";
}

?>

=========================
Reply With Quote
  #4  
Old 10-11-2001, 08:18 PM
BramT
Guest
 
Posts: n/a
Default

allright...

replace this
Code:
."<tr>\n" 
."<td bgcolor=\"#eeeeee\">$content</td>\n" 
."</tr>\n"
EXACTLY with this:
Code:
."<tr><td bgcolor=\"#eeeeee\">\n";
if (substr($content,0,2) != "<?")  echo $content;
else {$content = str_replace ("<?", "", $content);
eval($content);}
echo "</td></tr>\n"
good luck! (reply here if it doesn't work.. i'll receive an e-mail automaticly...)

(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.. )
Reply With Quote
  #5  
Old 10-11-2001, 08:39 PM
mkilty mkilty is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 10-11-2001, 09:09 PM
BramT
Guest
 
Posts: n/a
Default

Quote:
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
this DOES seems like an error in the php file you are trying to include... it can't reach it's database or the name of the table is screwed somehow... (vbullet.nuke... access you sql server and see if this table really excists..)

(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:
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..
(don't you just love those quote tags.. )

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]
Reply With Quote
  #7  
Old 10-11-2001, 09:21 PM
mkilty mkilty is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 10-11-2001, 09:29 PM
BramT
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #9  
Old 10-11-2001, 10:16 PM
mkilty mkilty is offline
 
Join Date: Oct 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #10  
Old 10-11-2001, 10:49 PM
BramT
Guest
 
Posts: n/a
Default

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...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08565 seconds
  • Memory Usage 2,297KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (4)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete