PDA

View Full Version : Included some Vbulletin features in external pages but got message error


07-24-2000, 08:23 PM
Hi,
I called from an external page (still on the same domain / same site) some vbulletin features such as member numbers, last member registered....

And on I got an error message on the very top of the brower page. It strange, because I don't have myself this error, it seems only non registered member got this message.

Here is the code I included:

1) To call the script features (just below the html body tag):

<? require("/domain/www/community/global.php");


$numbersmembers=$DB_site->query_first("SELECT COUNT(userid) AS users FROM user");
$numbermembers=$numbersmembers[users];

$getnewestusers=$DB_site->query_first("SELECT username,userid FROM user ORDER BY userid DESC LIMIT 1");
$newusername=$getnewestusers[username];
$newuserid=$getnewestusers[userid];


$countposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post");
$totalposts=$countposts[posts]; ?>



And to display all these features, somewhere else in the page:

<?PHP echo "$numbermembers"; ?> members are registered, and <?PHP echo "$totalposts"; ?> messages were posted in total. Welcome to our newest member: <?PHP echo "$newusername"; ?>.?


And here is the error message:
Warning: Oops, php3_SetCookie called after header has been sent in /xpk_hq/www/community/global.php on line 712

It works pefectly, it just display this ugly message on top.


Why is a cookie involved here ? Could this be the problem ?

Please help me,
Thanks,

Benj

07-27-2000, 02:13 AM
I tried using your same code (changing the path to the correct one on my server) and it gets errors trying to find the admin/config.php

It appears it's trying to still find it from the directory where I have the file calling the script from.

So I have this:

page that has your code: /path/through/server/test/test.html
pointing the require call to: /path/through/server/test/boards/gobal.php
but due to the global.php looking for admin/config.php I get an error of: Warning: Failed opening 'admin/config.php' for inclusion (include_path='') in boards/global.php on line 36
cause it seems that it is looking for test/admin/config.php which of course does not exist

Any thoughts on how to get around that problem? Or do I have to put my non-vb page inside the boards folder with the other vb pages to make it work?

07-27-2000, 12:54 PM
benj,

It looks like global.php sends a cookie is my best bet, but i am not sure. I havn't pay for the board yet so i don't have the code to be sure.

07-28-2000, 10:54 PM
This is getting more discussion on another thread (http://www.vbulletin.com/forum/showthread.php?threadid=2055) I started before I saw this one