The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I believe its perl.
Code:
if (file_exists($myfile)) { include $myfile; } else { echo "That profile does not exist or is currently unavailable"; } using PHP? |
#2
|
|||
|
|||
![]()
Looks good to me.
|
#3
|
|||
|
|||
![]()
Well.... are you saying will this work in my vbulletin templates?
because I added it in and it litterally printed the code on my screen, I don't know how come it does that. so I was assuming this is perl and not php, I'm trying to get the equivalent of this code in php. Okay I tried some more and discovered that... since I use a variable used through my style php include start I would have to somehow get that code to work with the $myfile variable or something can someone help me figure this out? I basically want to display a custom message if the php include file is not present in a vBulletin page. Heres my attempt in my phpinclude start: Code:
if ( file_exists("http://www.mysite.com/index.txt") ) { ob_start(); require("http://www.mysite.com/index.txt"); $info = ob_get_contents(); ob_end_clean(); } else { ob_start(); require("/home/www/public/web/errors/nofile.txt"); $info = ob_get_contents(); ob_end_clean(); } ![]() Got it! Code:
$includefile="http://www.mysite.com/index.txt"; $handle = fopen($includefile, "r", 1); if ($handle) { fclose($handle); ob_start(); require("http://www.mysite.com/index.txt"); $info = ob_get_contents(); ob_end_clean(); } else { ob_start(); require("/home/www/public/web/errors/nofile.txt"); $info = ob_get_contents(); ob_end_clean(); } Works nicely ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|