vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Last topics in phpnuke.... (https://vborg.vbsupport.ru/showthread.php?t=30113)

dadymac 10-23-2001 06:30 PM

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

BramT 10-23-2001 06:58 PM

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...

dadymac 10-23-2001 07:19 PM

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

dadymac 10-23-2001 07:22 PM

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

BramT 10-23-2001 07:34 PM

strange....

cant find whats causing this.... let me know if u do!

kontrabass 07-09-2002 08:17 PM

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.

wooolF[RM] 07-24-2002 11:18 PM

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


All times are GMT. The time now is 12:20 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
  • Page Generation 0.01140 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete