Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-25-2007, 03:13 PM
S2KingKtulu S2KingKtulu is offline
 
Join Date: Nov 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default fetch_template return blank

using the below script fetch_template() seems to return an empty string which evaluates to a blank response on line 52 eval('print_output("' . fetch_template('kpop_remove') . '");');

Ive debugged this script for a couple hours now. The templates preview just fine, yet I cant see where the issue lies. The most annoying thing is that I had this working fine 2 days ago.

Thanks for your thoughts.

PHP Code:
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''kpop');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('kpop_add''kpop_remove''kpop_error');

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
chdir('/****/******/****/*****/****/');
require_once(
'./global.php');

if (
$vbulletin->userinfo['userid'] == OR !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
{
    
print_no_permission();
}
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################


if(isset($_GET['tid']) AND is_numeric($_GET['tid']) )
{
$tid $_GET['tid']; }

$t_user fetch_userinfo($tid);


//add/remove switch
if($_REQUEST['do'] == 'add' )
{
    
$t_user['newfield5'] = $t_user['field5'] + 1;

    eval(
'print_output("' fetch_template('kpop_add') . '");');

} elseif(
$_REQUEST['do'] == 'remove' ) {

    
$t_user['newfield5'] = $t_user['field5'] - 1;
    
$vbulletin->userinfo['newfield11'] = $vbulletin->userinfo['field11'] - 2;

    eval(
'print_output("' fetch_template('kpop_remove') . '");');


my template:


PHP Code:
$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>

<
title>********** *********</title>

<
style type="text/css">

.
b11 font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#000000; }

.g12 font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:12pxcolor:#ffc944; }

.g14 font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:14pxcolor:#ffc944; }

.w11 font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; }
.w11:link font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; text-decoration: underline; }
.w11:visited font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; text-decoration: underline; }
.w11:active font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; text-decoration: underline; }
.w11:hover font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; text-decoration: none; }

.my11 font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFD774; }

dl.dbox {background:#351405 url(dbox_tl.gif) top left no-repeat; margin:7px 0; padding:0; width:240px;}
dl.dbox dt {background:transparent url(dbox_tr.giftop right no-repeatpadding:3pxpadding-left:10px;}
dl.dbox dd {background:#4e0707 url(dbox_bl.gif) bottom left no-repeat; padding:0; margin:0; color: #fff;}
dl.dbox dd p {background:#4e0707; margin:0; padding:8px; padding-bottom:1px;}
dl.dbox dd p.last {background:transparent url(dbox_br.gifbottom right no-repeat; }

.
charinset {backgroundtransparentmargin:4px 0pxmargin-bottom0;}
.
charinset h1, .charinset p {margin:0 8px;}
.
charinset h1 {font-family:Tahoma,Arial,Verdana,Helvetica,sans-seriffont-size:11pxcolor:#FFF9E9; font-weight: normal;}

.charinset .top, .charinset .bottom {display:blockbackground:transparentfont-size:1px;}
.
charinset .b1, .charinset .b2, .charinset .b3, .charinset .b4, .charinset .b1b, .charinset .b2b, .charinset .b3b, .charinset .b4b {display:blockoverflow:hidden;}
.
charinset .b1, .charinset .b2, .charinset .b3, .charinset .b1b, .charinset .b2b, .charinset .b3b {height:1px;}
.
charinset .b2 {background:#310001; border-left:1px solid #000; border-right:1px solid #1c1711;}
.charinset .b3 {background:#310001; border-left:1px solid #000; border-right:1px solid #33191a;}
.charinset .b4 {background:#310001; border-left:1px solid #000; border-right:1px solid #4e2d2e;}
.charinset .b4b {background:#310001; border-left:1px solid #1c1711; border-right:1px solid #654041;}
.charinset .b3b {background:#310001; border-left:1px solid #33191a; border-right:1px solid #654041;}
.charinset .b2b {background:#310001; border-left:1px solid #4e2d2e; border-right:1px solid #654041;}

.charinset .b1 {margin:0 5pxbackground:#000;}
.charinset .b2, .charinset .b2b {margin:0 3pxborder-width:0 2px;}
.
charinset .b3, .charinset .b3b {margin:0 2px;}
.
charinset .b4, .charinset .b4b {height:2pxmargin:0 1px;}
.
charinset .b1b {margin:0 5pxbackground:#654041;}
.charinset .boxcontent {display:blockbackground:#310001; border-left:1px solid #000; border-right:1px solid #654041;}


</style>

</
head>
<
body bgcolor=#000000>
<!-- Start Subtract -->
<
dl class="dbox">
<
dt><span class=g14><b>Subtract Kharma</b></span></dt>
<
dd>
<
p>
<
table border=0 cellpadding=0 cellspacing=0 width=224 class=w11>
    <
tr>
        <
td>You are about to subtract one kharma point from <b>$t_user[username]</b>. To remove one kharma pointyour earned kharma points will be reduced by two.</td>
    </
tr>
    <
tr>
        <
td><img src=spacer.gif width=3 height=5></td>
    </
tr>
    <
tr>
        <
td>
        <
div class="charinset">
        <
class="top"><class="b1"></b><class="b2"></b><class="b3"></b><class="b4"></b></b>
        <
div class="boxcontent">
        <
table border=0 cellpadding=1 cellspacing=1 align=center width=205 class=w11>
            <
tr>
                <
td colspan=2><span class=g12><b>$t_user[username]</b></span></td>
            </
tr>
            <
tr>
                <
td><span class=my11><b>Current Kharma Score:</b></span></td>
                <
td align=right>$t_user[field5]</td>
            </
tr>
            <
tr>
                <
td><span class=my11><b>New Kharma Score:</b></span></td>
                <
td align=right>$t_user[newfield5]</td>
            </
tr>
        </
table>
        </
div>
        <
class="bottom"><class="b4b"></b><class="b3b"></b><class="b2b"></b><class="b1b"></b></b>
        </
div>
        </
td>
    </
tr>
    <
tr>
        <
td>
        <
div class="charinset">
        <
class="top"><class="b1"></b><class="b2"></b><class="b3"></b><class="b4"></b></b>
        <
div class="boxcontent">
        <
table border=0 cellpadding=1 cellspacing=1 align=center width=205 class=w11>
            <
tr>
                <
td colspan=2><span class=g12><b>$bbuserinfo[username] </b></span></td>
            </
tr>
            <
tr>
                <
td><span class=my11><b>Current Kharma Points:</b></span></td>
                <
td align=right>$bbuserinfo[field11] </td>
            </
tr>
            <
tr>
                <
td><span class=my11><b>New Kharma Points:</b></span></td>
                <
td align=right>$bbuserinfo[newfield11] </td>
            </
tr>
        </
table>
        </
div>
        <
class="bottom"><class="b4b"></b><class="b3b"></b><class="b2b"></b><class="b1b"></b></b>
        </
div>
        </
td>
    </
tr>
    <
tr>
        <
td><img src=spacer.gif width=3 height=5></td>
    </
tr>
    <
tr>
        <
td>
        <
div class="charinset">
        <
class="top"><class="b1"></b><class="b2"></b><class="b3"></b><class="b4"></b></b>
        <
div class="boxcontent">
        <
table border=0 cellpadding=1 cellspacing=1 align=center width=205 class=w11>
            <
tr>
                <
td><span class=g12><b>Explanation:</b></span></td>
            </
tr>
            <
tr>
                <
td><textarea class=b11 style="width:200px;" rows=3></textarea></td>
            </
tr>
        </
table>
        </
div>
        <
class="bottom"><class="b4b"></b><class="b3b"></b><class="b2b"></b><class="b1b"></b></b>
        </
div>
        </
td>
    </
tr>
    <
tr>
        <
td><img src=spacer.gif width=3 height=10></td>
    </
tr>
    <
tr>
        <
td align=center>
        <
table border=0 cellpadding=1 cellspacing=1 width=200>
            <
tr><form name="" action="" method="post">
                <
td align=center><input type=image src=bt_subkarma.gif width=107 height=18 border=0></td>
                <
td align=center><input type=image src=bt_cancel.gif width=55 height=18 border=0></td>
            </
tr></form>
        </
table>
        </
td>
    </
tr>
</
table>
</
p>
<
class="last"></p>
</
dd>
</
dl>
<!-- 
End Subtract -->

</
body>
</
html
this should be vbull general discussion. Will a MOD help me out? thnx
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03577 seconds
  • Memory Usage 2,667KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete