vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   welcome/login panel on non-vB page (https://vborg.vbsupport.ru/showthread.php?t=37134)

Tony DiMera 09-12-2002 09:32 PM

Hello I really want this hack but this is what I get?

PHP Code:

Fatal errorCannot redeclare stripslashesarray() in forums/global.php on line 31 


Tigga 09-14-2002 10:17 AM

I've had vBhome installed on my site for the last few months. I then modified the script a little (mostly just took out the news part) and used that to make a column on the left side of every page that shows a users info (or login box), online users, buddy list, latest topics, and etc. The majority of my pages are coded in HTML, so I just used ssi to include the PHP file and it worked great. Now I'm starting to code more and more of my site in PHP, but I'm starting to run into problems. I can't seem to use SSI anywhere in a PHP file, so I tried using the PHP include function to include that file. That worked for the most part, but the only problem is a user can not log in from that page, and if someone is already logged in it won't show their info.
I decided to try and use this hack to see if I could get it to work with my PHP scripts, but I'm still not having any luck. I put this code

Quote:

<?php
chdir("/home/virtual/site72/fst/var/www/html/forum/");
require('./global.php');
?>
at the top of the PHP page and then this code where I wanted the box to appear.

Quote:

<?php include ("/webwelcome.php"); ?>
Then when I try to go to the page it says
Quote:

Fatal error: Failed opening required 'errors/configure_instructions.php' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site72/fst/var/www/html/gallery/errors/unconfigured.php on line 10
I thought maybe it was a problem since this script changed directories to the forum, so I used chdir right under the place I included the webwelcome that to switch the directory back to the folder the script was in, but I got the exact same error again.


I've got this hack to work fine on a test page done in PHP, but I can't get it to work on a PHP script page. Does anyone have any idea how I can make this work or perhaps another way I can display a users login information on another PHP script?

Darren Lewis 09-14-2002 11:58 AM

Hi, I've updated the zip file to V1.30.

This new release contains options to show PM info and who's online (with or without usernames). There is no more copy&paste creation so things should be a bit simpler.

There are a couple of more templates to create if you want to use the pm and who's online bits.

I also fixed a very minor bug. If you chose not to show avatars the welcome text would not be centred in the box as there would still be a blank avatar column. A simple change to the webwelcome template and the php file has sorted that.


OK, this include global.php does cause a few problems. This is mainly when you have other scripts running on the same page. If these scripts require other directories they may not work. I've got Tubedog's latest threads hack on my homepage, but it's creating problems when I try to pull info from my reviews engine (Censura).

This is what I have at the very top of my index.php homepage.

<?php
chdir("forums/");
require('./global.php');
?>
<html>

I then have this where I want to show my welcome panel
<?php include("webwelcome.php"); ?>

and it works OK. Different servers behave differently. I'm running Apache on Linux.

Tony, I have no idea why you're getting that message :( Any other hacks/scripts on your page that may be creating trouble?

Darren.

PS I'll probably not be adding any new features to this hack from now. It does everything I personally need it to do on my site, and I don't have the time to do any custom work. Hopefully it will work with VB3, but if not I'll sort something out as I'll be going to VB3.

Tigga 09-14-2002 02:07 PM

No matter what I try I can't seem to get this to work with another PHP script. I tried what you suggested above and put this right above <HTML> in the PHP file...
<?php
chdir("forums/");
require('./global.php');
?>

And it came back with this error...

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site72/fst/var/www/html/gallery/albums.php:32) in /home/virtual/site72/fst/var/www/html/forum/admin/functions.php on line 1603

Anyone have any suggestions on how to make this work or know if it's even possible to make it work with another PHP script?

Darren Lewis 09-14-2002 02:43 PM

Looks like your "gallery" script is conflicting and sending header info. Is there any other PHP code above the call to vbulletin's global.php file as this may be interfering.

Tigga 09-14-2002 03:54 PM

Yes, there is quite a bit of code above where I was calling the global.php file from. Here's what's above it...

Quote:

<?
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violation\n";
exit;
}
?>
<? require($GALLERY_BASEDIR . "init.php"); ?>

<?
/* Read the album list */
$albumDB = new AlbumDB();
$gallery->session->albumName = "";
$page = 1;


/* If there are albums in our list, display them in the table */
$numAlbums = $albumDB->numAlbums($gallery->user);
$numPhotos = $albumDB->numPhotos($gallery->user);

if (!$gallery->session->albumListPage) {
$gallery->session->albumListPage = 1;
}
$perPage = $gallery->app->default["albumsPerPage"];
$maxPages = max(ceil($numAlbums / $perPage), 1);

if ($gallery->session->albumListPage > $maxPages) {
$gallery->session->albumListPage = $maxPages;
}

$pixelImage = "<img src=\"$imageDir/pixel_trans.gif\" width=\"1\" height=\"1\">";
$borderColor = $gallery->app->default["bordercolor"];

$navigator["page"] = $gallery->session->albumListPage;
$navigator["pageVar"] = "set_albumListPage";
$navigator["url"] = makeGalleryUrl("albums.php");
$navigator["maxPages"] = $maxPages;
$navigator["spread"] = 6;
$navigator["fullWidth"] = 100;
$navigator["widthUnits"] = "%";
$navigator["bordercolor"] = $borderColor;

?>

<? if (!$GALLERY_EMBEDDED_INSIDE) { ?>
<html>
<head>
<title><?= $gallery->app->galleryTitle ?></title>
<?= getStyleSheetLink() ?>
</head>
<body TEXT="#D1D1D1" BGPROPERTIES="fixed">
<? } ?>
<?php include ("http://plurplanet.com/webwelcome.php"); ?>
I've tried adding the chdir and global.php calls at the very top of the file, right above <html>, and right above where it calls the webwelcome file, but none of those have worked...

Darren Lewis 09-14-2002 04:24 PM

Try putting it above your PHP code, so it's the very first bit of code on that page. Then chdir back to your current directory

ie.
<?php
chdir("forums/");
require('global.php');
chdir("../");

// Hack Prevention
then your gallery php stuff

Darren.

Tigga 09-14-2002 06:20 PM

Well I tried your suggestion and put -

<?php
chdir("/home/virtual/site72/fst/var/www/html/forum");
require('./global.php');
chdir("/home/virtual/site72/fst/var/www/html/gallery");
?>

At the very top of the file and got this error...

Warning: Cannot send session cache limiter - headers already sent (output started at /home/virtual/site72/fst/var/www/html/gallery/albums.php:7) in /home/virtual/site72/fst/var/www/html/gallery/session.php on line 51

Fatal error: Call to a member function on a non-object in /home/virtual/site72/fst/var/www/html/webwelcome.php on line 22


I've been playing around with it for quite a while, but still no luck. If you happen to think of anything else that might work please let me know and thank you very much for your help thus far. :)

Higgins 09-18-2002 09:57 AM

I can't get it to work. Only getting this error
Quote:

Fatal error: Call to a member function on a non-object in /home/virtual/site2/fst/var/www/html/webwelcome.php on line 21
On the very Top of the webwelcome.php i have added

Quote:

<?php
chdir("/home/virtual/site2/fst/var/www/html/board/");
require('./global.php');
?>
but it didn't work for me.



*EDIT*

Ok got it running now but it Displays the whole index.php Page with broken Buttons.

Colon33 09-19-2002 06:28 AM

Hey Higgins, you need to allow GUESTS to view your board without registering. I had the same problem.


All times are GMT. The time now is 01:03 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.01226 seconds
  • Memory Usage 1,757KB
  • 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_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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