View Full Version : cannot include files?
will_lean
06-04-2004, 05:27 AM
hi
im tryin to sort a problem im having with a hack,
but maybe its my board setup?
im not that familiar with vb's function but whenever i try to include a file in the
phpinclude_end template
it gives me a white page and nobody can access my forum anymore?
usually when a white page is displayed its because a template is broken or missing?
can anyone shed a lil light on my problem? :disappointed:
Xenon
06-04-2004, 09:30 AM
does your included file have some direct output devices (like echo 'xjfur'; or plain html not in <?php tags)?
If yes, you should get rid of those, as they broke vb's outputsystem (i have had to find out myself, often in the past..^^)
will_lean
06-04-2004, 04:02 PM
thanks for the help
the includes file is as below and all is enclosed in php tags.
however adding this to phpinclude_end template breaks the output as you said.
same thing happens if i include the data below directly into a file?
would the
print "<head>";
print "<script>";
portion of the file be creating my problem?if so how can i fix it?
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # v3 SMS System 1.0. by PcFreak [http://at-lantis.de] ||
|| # SMS empfangen auf jeder Seite. ||
|| # Please click install if you used this hack ||
|| ################################################## ################## ||
\*================================================ ======================*/
// ##### SMS SYSTEM #####
$smsvorhanden = $DB_site->query_first("
SELECT id_vom_empfaenger
FROM " . TABLE_PREFIX . "sms
WHERE id_vom_empfaenger = $bbuserinfo[userid]
");
if ($smsvorhanden[id_vom_empfaenger] == '')
{}
else
{
print "<head>";
print "<script>";
print "function popsms(){";
print "win = window.open('sms.php?do=sms_lesen','_blank','toolb ar=no,location=no,menubar=no,scrollbars=yes,width= 550,height=500,resizeable=no,status=no');";
print "}";
print "</script>";
print "</head>";
print "<body onLoad='popsms()'>";
print "</body>";
}
// ##### SMS SYSTEM #####
?>
thanks :nervous: again
Xenon
06-04-2004, 04:27 PM
well, include that file into your phpinclude_start template:
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # v3 SMS System 1.0. by PcFreak [http://at-lantis.de] ||
|| # SMS empfangen auf jeder Seite. ||
|| # Please click install if you used this hack ||
|| ################################################## ################## ||
\*================================================ ======================*/
// ##### SMS SYSTEM #####
$smsvorhanden = $DB_site->query_first("
SELECT id_vom_empfaenger
FROM " . TABLE_PREFIX . "sms
WHERE id_vom_empfaenger = $bbuserinfo[userid]
");
if ($smsvorhanden[id_vom_empfaenger] == '')
{ $smshtml = '';}
else
{
$smshtml = "
<script>
function popsms(){
win = window.open('sms.php?do=sms_lesen','_blank','toolb ar=no,location=no,menubar=no,scrollbars=yes,width= 5 50,height=500,resizeable=no,status=no');
}
</script>
<body onLoad='popsms()'></body>";
}
// ##### SMS SYSTEM #####
?>
and then put $smshtml into your header template, i assume that should work.
Ouch thats a query every load, regged or not.
Try this block:
if ($bbuserinfo['userid'])
{
$smsvorhanden = $DB_site->query_first("
SELECT id_vom_empfaenger
FROM " . TABLE_PREFIX . "sms
WHERE id_vom_empfaenger = $bbuserinfo[userid]
");
}
else
{
$smsvorhanden = array();
}
will_lean
06-04-2004, 08:37 PM
big thankx xenon worked great!
@brad.loo
is this correct?if ($bbuserinfo['userid'])
{
$smsvorhanden = $DB_site->query_first("
SELECT id_vom_empfaenger
FROM " . TABLE_PREFIX . "sms
WHERE id_vom_empfaenger = $bbuserinfo[userid]
");
}
else
{
$smsvorhanden = array();
}
if ($smsvorhanden[id_vom_empfaenger] == '')
{ $smshtml = '';}
else
{
$smshtml = "
<script>
function popsms(){
win = window.open('sms.php?do=sms_lesen','_blank','toolb ar=no,location=no,menubar=no,scrollbars=yes,width= 550,height=500,resizeable=no,status=no');
}
</script>
<body onLoad='popsms()'></body>";
}
// ##### SMS SYSTEM #####
?>
Xenon
06-04-2004, 10:36 PM
you're welcome
yes, seems correct
will_lean
06-05-2004, 05:16 PM
hi xenon
im wondering if you can maybe help me further with this?
the sms system seems to work but the original includes file makes it so a message is received by popup when sent,
i.e i send a sms msg to myself and the popup should display right away,
the way i have it working now will only load the replying msg when i refresh the page?
is it possible to make the javascript portion timed instead of onload?
sorry for all the trouble :squareeyed:
Xenon
06-06-2004, 12:22 PM
hmm, sorry, i don't know that much about JS, but i don't believe the original did it that way.
that will just appear, when you send an SMS to yourself, as it was in the phpinclude_end.
but when others sent you an SMS the old and the new one would have required to refresh the page, at least from what i see.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.