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
  #22  
Old 10-23-2001, 06:30 PM
dadymac dadymac is offline
 
Join Date: Nov 2001
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here is the original code:
Quote:
."<tr valign=\"top\"><td bgcolor=\"#000000\">\n"
."$content\n"
."</td></tr></table>\n"
here is what i changed it to:

Quote:
."<tr valign=\"top\"><td bgcolor=\"#000000\">\n";
if (substr($content,0,2) != "<?")
echo $content; else { $content = str_replace ("<?", "", $content);
eval($content);}
echo "</td></tr></table>\n"
here is what I am trying to include:

Quote:
<?php

if (eregi("block-LastPosts",$PHP_SELF)) {
Header("Location: index.php");
die();
}

$content = "<? include('forum/admin/online.php'); ?>";

?>
and here is online.php:

Quote:
<?
//...........Who's Online v0.0.2...........\\
//......by Kevin (kevin@tubescan.com)......\\

// For vBulletin version 2, beta 3
// (c) 2001 Jelsoft Enterprises, Ltd.

// vbulletin.com thread: http://www.vbulletin.com/forum/showt...threadid=12010

///////////// CHANGE LOG /////////////
//
// New in version 0.0.2
// -- Option to display either usernames or just a number of registered members online
//
// New in version 0.0.1
// -- Released!
//
/////////// END CHANGE LOG ///////////

//////// CONFIG EXPLANATION //////////
//
// There are only two config options in this script.
// First is whether or not you want usernames displayed for registered members who are on the board. If you opt to not display
// usernames, it will simply display the number of members. Guests are unaffected by this. If you want usernames displayed, set
// $usernames to "on" in the CONFIG section below. If you want a simple number, set it to "off".
// The second is the path to config.php (in the /admin directory of your forums). It MUST NOT include a leading *or* trailing slash.
// So, for example: Your config.php is in
// /home/mysite/public_html/board/admin/
// and you are putting this file into
// /home/mysite/public_html/directory/
// So your path is
// /home/mysite/public_html/board/admin
// Make sure you set this correctly. You can refer to the General Options in your Admin Control Panel if you need a refresher on
// your path.
//
////// END CONFIG EXPLANATION ////////

/////////////// CONFIG ///////////////
//
$usernames = "on"; // if you would like it to display the names of registered members who are on, leave this set to "on".
// if you want just a number of members, change it to "off".
$path = "/home/dadymac/public_html/forums/forum/admin"; // set the path to your admin directory. see above for info about this.
//
///////////// END CONFIG /////////////

require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'") or die("oops1");
$cookietimeout = mysql_result($cookievalue, 0, 0);
$datecut = time()-$cookietimeout;

$invisibleregmember = "0";

if ($usernames == "on") {
$regmembers = mysql_query("SELECT DISTINCT username,invisible FROM user,session WHERE session.userid=user.userid AND session.lastactivity>$datecut AND invisible='0' ORDER BY username ASC") or die("oops2");
while($regmember = mysql_fetch_array($regmembers)):
++$regmembercomma;
if ($regmember[invisible] == 0) {
$regmemberson .= $regmember[username];
} else {
++$regmembercomma;
}
if ($regmembercomma < mysql_num_rows($regmembers)):
$regmemberson .= ", ";
endif;
endwhile;
} else {
$regmembers = mysql_query("SELECT DISTINCT COUNT(userid) AS membersonline FROM session WHERE userid>0 AND session.lastactivity>$datecut") or die("oops2");
while($members = mysql_fetch_array($regmembers)) {
$regmemberson = number_format($members[membersonline]);
}
}

$guests = mysql_query("SELECT COUNT(userid) AS guestsonline FROM session WHERE userid=0 AND session.lastactivity>$datecut") or die("oops3");
while($guest = mysql_fetch_array($guests)):
$guestson = number_format($guest[guestsonline]);
endwhile;

echo("<B>Member(s) currently in the forums:</B><br><br><font color=\"#CCCCFF\">$regmemberson</font><br><br><B>Number of Guest(s) in the forums:</B> $guestson.");
?>
is there a conflict somewhere? in the left colum, it will mess up the center.

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

Quote:
here is what I am trying to include:


quote:
--------------------------------------------------------------------------------

<?php

if (eregi("block-LastPosts",$PHP_SELF)) {
Header("Location: index.php");
die();
}

$content = "<? include('forum/admin/online.php'); ?>";

?>
don't use a seperate block.... just include
Code:
<? include('forum/admin/online.php'); ?>
as text in a textblock (when adding a new custom block). you don't have to use modules/blocks...
Reply With Quote
  #24  
Old 10-23-2001, 07:19 PM
dadymac dadymac is offline
 
Join Date: Nov 2001
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

same, still get:

Quote:
Warning: Supplied argument is not a valid MySQL result resource in /home/dadymac/public_html/forums/admin/modules/blocks.php on line 43
Reply With Quote
  #25  
Old 10-23-2001, 07:22 PM
dadymac dadymac is offline
 
Join Date: Nov 2001
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #26  
Old 10-23-2001, 07:34 PM
BramT
Guest
 
Posts: n/a
Default

strange....

cant find whats causing this.... let me know if u do!
Reply With Quote
  #27  
Old 07-09-2002, 08:17 PM
kontrabass kontrabass is offline
 
Join Date: Feb 2002
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #28  
Old 07-24-2002, 11:18 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

using your replacement BramT in theme, then using your way of including a php file, then I get error:
PHP Code:
Parse errorparse errorunexpected T_IF in /home/wooolf/WWW/phpnuke/themes/OceanBlue/theme.php(358) : eval()'d code on line 3 
where line 358 is:
PHP Code:
        eval($content);} 
Any ideas? I'm lost...

PS: the php page which I include works fine when I use direct access to it...

PSS: vBB 2.2.6 | phpNuke 5.5
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 10:41 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.04766 seconds
  • Memory Usage 2,285KB
  • Queries Executed 24 (?)
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
  • (3)bbcode_code
  • (2)bbcode_php
  • (6)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (5)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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