Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Prev Previous Post   Next Post Next
  #5  
Old 01-31-2011, 01:41 PM
fviper fviper is offline
 
Join Date: Jan 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good thinking there - I appreciate the input. I did have 'THIS_SCRIPT' defined in there at one point, but I thought that the primary purpose of that was for VB to be able to see which template you were calling? Here's one of my other templates that I used to track donations on the site:

Code:
<?php 

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

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', 'donations'); // change this depending on your filename 

// ################### 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( 
    'DONATIONS', 
); 

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

); 

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

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'Driven Guild Donations'; 

$navbits = construct_navbits($navbits); 
eval('$navbar = "' . fetch_template('navbar') . '";'); 
eval('print_output("' . fetch_template('donate') . '");'); 

?>
This code does fine (Gary's template guide) - as it's a VB-only driven page. If I could get the MySQL / PHP / Ajax to play nicely with VB templates, I would most certainly go that route as it would be better integrated with VB. Without calling a template, the code seemed useless to me - but hey... I admit VB's templating methods make my eyes glaze over at times lol. I'll try defining that again in my code. Keep your fingers crossed It would be cool if it was something that simple!

--------------- Added [DATE]1296502750[/DATE] at [TIME]1296502750[/TIME] ---------------

Hey kh99,

I combined a few of your suggestions, and it looks like that has done the trick. It didn't dawn on me either that some of the javascript calls or header info could be skewed by a basic table at the top of a page, but hey... I rearranged the head and meta declarations to being after <?php, and everything appears to be fat, dumb and happy lol.

Code:
<?php
define('NO_REGISTER_GLOBALS', 1); 
define('THIS_SCRIPT', 'cataloot');
require_once("../global.php");
include('auth.php');
@$user = $_GET['userid'];
@$instance = $_GET['instanceid'];
@$encounter = $_GET['encountername'];
@$lootname = $_GET['lootname'];
$showlistbits = '';
$altclass = 'alt1';
$link = mysql_connect("localhost",$username,$pass);
$result = mysql_select_db("adamsre_lootad");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<link rel="stylesheet" href="loot.css" type="text/css" />
<link rel="stylesheet" href="themes/default/nlscalendar.css" type="text/css" />
<script src="http://www.wowhead.com/widgets/power.js"></script>
<script src="lib/lang/nlscalendar_i18n_en.js"></script>
<script src="lib/nlscalendar.js"></script>
<script src="lib/nlscalendar_picker.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript">
   var cal=new AOCalendar("cal1");
   cal.opt.dtFormat = "$YY-$dm-$dd"; 
   cal.opt.themeDir="themes/default/";
   cal.render();
</script>
<title>Loot and Attendance History</title>
</head>
<body onLoad="MM_preloadImages('../images/styles/darkreign/misc/home_on.gif','../images/styles/darkreign/misc/usercp_on.gif','../images/styles/darkreign/misc/members_on.gif','../images/styles/darkreign/misc/register_on.gif','../images/styles/darkreign/misc/calendar_on.gif','../images/styles/darkreign/misc/faq_on.gif')"><table style="background: url(../images/styles/darkreign/misc/header_level1_bg.gif);" border="0" width="90%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="103"><a href="../index.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('Home','','../images/styles/darkreign/misc/home_on.gif',1)"><img src="../images/styles/darkreign/misc/home_off.gif" alt="Home" name="Home" border="0"/></a></td>
<td width="103"><a href="../usercp.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('UserCP','','../images/styles/darkreign/misc/usercp_on.gif',1)"><img src="../images/styles/darkreign/misc/usercp__off.gif" alt="UserCP" name="UserCP" border="0"/></a></td>
<td width="101"><a href="../memberlist.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('Members','','../images/styles/darkreign/misc/members_on.gif',1)"><img src="../images/styles/darkreign/misc/members__off.gif" alt="Memberlist" name="Members" border="0"/></a></td>
<td width="103"><a href="../register.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('Register','','../images/styles/darkreign/misc/register_on.gif',1)"><img src="../images/styles/darkreign/misc/register__off.gif" alt="Register" name="Register" border="0"/></a></td>
<td width="102"><a href="../calendar.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('Calendar','','../images/styles/darkreign/misc/calendar_on.gif',1)"><img src="../images/styles/darkreign/misc/calendar__off.gif" alt="Calendar" name="Calendar" border="0"/></a></td>
<td><a href="faq.php" onmouseOut="MM_swapImgRestore()" onmouseOver="MM_swapImage('FAQ','','../images/styles/darkreign/misc/faq_on.gif',1)"><img name="FAQ" border="0" src="../images/styles/darkreign/misc/faq__off.gif" alt="FAQ"/></a></td>
</tr>
</table>
<table style="background: url(../images/styles/darkreign/misc/header_level2_bg.gif);" height="80" border="0" width="90%" align="center" cellpadding="0" cellspacing="0">
	<tr><td align="left" valign="middle">
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="750" height="100" id="driven_header" >
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="../images/styles/darkreign/misc/driven_header.swf" />
	<param name="loop" value="false" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#ffffff" />
	<embed src="../images/styles/darkreign/misc/driven_header.swf" loop="false" quality="high" bgcolor="#ffffff" width="750" height="100" name="driven_header" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
	</object>
</td></tr>
</table>
<?php
is what I have now - I did define 'THIS_SCRIPT', though, in all honesty, I think was simply rearranging things that ultimately did the trick. Thanks a TON for all of your help!
Reply With Quote
 

Thread Tools
Display Modes

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 07:52 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.03791 seconds
  • Memory Usage 2,444KB
  • 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
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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