The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[SOLVED]Garbage text getting printed on top of every custom page
--------------------------------------------------------------------------------------------------------------------
PLEASE SCROLL DOWN AND SEE LAST REPLY Update : Here is solution! -------------------------------------------------------------------------------------------------------------------- Hello Please check screen shot below : I'm designing 1 mod for vb 3.7.3 and there is garbage text getting printed on top of every custom page i've designed for mod. However i've gone through every bit of code i've written, for like zillion times. But i'm not able to figure out what possibly could be causing above garbage. The thing is, i just wanna know what kinda possible conditions could cause above garbage?? like custom redirection? <if> <else> condition? etc. etc. I've followed all vbulletin API rules while coding and also double checked. So if someone evah faced above thing in life before then kindly let me know what was causing it. P.S. I know its because of my mod so please tell me something beside disabling hooks & mods (already done that).. b'cuz i'm tryin to get rid of that garbage. |
#2
|
||||
|
||||
Very hard to tell, bad code it the issue though... without knowing what you changed its hard to tell though.
|
#3
|
||||
|
||||
Quote:
here is more detailed explanation on what exactly i've coded : Lets say my file 1 contains : Quote:
Now my test.php located at test/test.php does following : Quote:
Quote:
I fixed the problem somehow but still need lil clarification! I reffered this tutorial to create my custom pages. When i removed require_once('./global.php'); from my main file, it fixed the problem. The mod seems to work fine without that file though. Can somebody tell me, will it cause any future problems? And why exactly global.php was required there? If it was for checking whether user is logged in or not then after removing global.php, my mod is still keeping non logged in users out. then why global.php was there? My file contains following code now : Code:
error_reporting(E_ALL & ~E_NOTICE); define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'test'); $globaltemplates = array('test',); //require('./global.php'); include('test/test.php'); $navbits = array(); $navbits[$parent] = 'TEST'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); if (!$vbulletin->userinfo['userid']) { print_no_permission(); } else { eval('print_output("' . fetch_template('test') . '");'); } |
#4
|
||||
|
||||
In test.php you are including inc.php. What is in there? I would guess one of the other files getting included somewhere in your page is including global.php already.
|
#5
|
||||
|
||||
I think Lynne may be correct, IIRC this happened to be a couple months ago when i accidentally included global.php twice
|
#6
|
||||
|
||||
thats gr8 help guyes!!! now i understood where i'm missing it..
I did included global.php many times!! Thanks a million again for gr8 help!!! i will fix it tomorrow morning and will let you know guyes.. thanks! |
#7
|
||||
|
||||
Still not solved yet...
I tried everything... And now i think its not due to global.php getting called multiple times. I turned on debug mode to see what files are getting called... Here is debug information of page with garbage : Here is debug information of page without garbage : Why does it saying uncached template: orkut on garbage page and there is only php_sapi_name(): cgi-fcgi on page without garbage????? Is that the cause of problem? My template orkut contains following code : Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>Orkut Contacts Inviter</title> $headinclude </head> <body> <if condition="$adicondition"> <script language='Javascript'> window.location='next.php' </script> <else /> </if> $header $navbar <if condition="$adiinitcond"> $inviterplugs <else/> $contents </if> <br /> $footer </body> </html> My orkut.php custom page contains following code : Code:
require_once('global.php'); include('adiinviter/orkut.php'); error_reporting(E_ALL & ~E_NOTICE); define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'orkut'); // change this depending on your filename $globaltemplates = array('orkut'); $navbits = array(); $navbits[$parent] = 'Orkut Contacts Importer'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); if (!$vbulletin->userinfo['userid']) { print_no_permission(); } else { eval('print_output("' . fetch_template('orkut') . '");'); } ?> somebody please help me with this issue... |
#8
|
||||
|
||||
Try following this article in creating your custom page - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.. You have things in a different order - global called before some variables are defined. I had noticed before on my own pages that I had problems when I didn't include all the different pre-cached template groups and data arrays, even though they were empty.
|
#9
|
||||
|
||||
Quote:
how do i change order in which templates are getting called?? I mean can you tell me where do i need to change exactly??? like in template? or in custom page code i've posted above? because code order in both pages i've posted above is same... I need to call my main template in vbulletin i.e. orkut rite before : # navbar # navbar_link # navbar_notifications_menubit and just after # footer thnaks a lot for noticing.... i followed API docs thread only while designing custom pages |
#10
|
||||
|
||||
I'm not talking about the order of the templates, I'm talking about how you call global.php before you define some variables that are needed in global.php (like THIS_SCRIPT and error_reporting, etc.).
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|