vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   cannot include files? (https://vborg.vbsupport.ru/showthread.php?t=65812)

will_lean 06-04-2004 04:27 AM

cannot include files?
 
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 08: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 03: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?


Code:

<?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','toolbar=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 03:27 PM

well, include that file into your phpinclude_start template:

PHP Code:

<?php
/*======================================================================*\
|| #################################################################### ||
|| # v3 SMS System 1.0. by PcFreak [[url]http://at-lantis.de][/url]                ||
|| # 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','toolbar=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.

Brad 06-04-2004 03:44 PM

Ouch thats a query every load, regged or not.

Try this block:

PHP Code:

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 07:37 PM

big thankx xenon worked great!

@brad.loo

is this correct?
Code:

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','toolbar=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 09:36 PM

you're welcome

yes, seems correct

will_lean 06-05-2004 04: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 11:22 AM

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.


All times are GMT. The time now is 11:38 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.01477 seconds
  • Memory Usage 1,748KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete