vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I wrote this templete and its showing up red in debugger (https://vborg.vbsupport.ru/showthread.php?t=196107)

DieselMinded 11-12-2008 06:58 PM

I wrote this templete and its showing up red in debugger
 
PHP Code:

<style type="text/css">
#dropmenudiv{
position:absolute;
border:1px solid black;
border-bottom-width0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}

#dropmenudiv a{
width200px;
displayblock;
text-indent3px;
border-bottom1px solid black;
padding1px 0;
text-decorationnone;
font-weightbold;
}

#dropmenudiv a:hover{ /*hover background color*/
background-coloryellow;
}

</
style>
<
script language="JavaScript" type="text/JavaScript">
<!--
function 
MM_jumpMenu(targ,selObj,restore){ //v3.0
  
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (
restoreselObj.selectedIndex=0;
}
//-->
</script>
<
table border="0" width="992" height="26" cellspacing="0" cellpadding="0" background="http://www.dieselbombers.com/images/headbar.png">
    <
tr>
        <
td height="100%" width="375" align="center"><p style="margin-top: 10px; margin-bottom: 5px">
    <
font face="Verdana"><b>
    <
font size="2">&nbsp;&nbsp;&nbsp;&nbsp;
    </
font></b></font>
    <
a target="_self" href="http://www.dieselbombers.com">
    <
font size="2">
    <
img border="0" src="http://www.dieselbombers.com/images/home24.png" width="24" height="24" alt="Go To The Home Page"></font></a>
    <
a target="_self" href="http://www.dieselbombers.com/About.php">
    <
img border="0" src="http://www.dieselbombers.com/images/infoabout24.png" width="24" height="24" alt="About Us"></a>

<if 
condition="$vbulletin->userinfo['userid']"> <a target="_self" href="http://www.dieselbombers.com/search.php"><img border="0" src="http://www.dieselbombers.com/images/find24.png" width="24" height="24" alt="Search The Forums"></a>
    <
a target="_self" href="http://www.dieselbombers.com/all_albums.php">
    <
img border="0" src="http://www.dieselbombers.com/images/pictures24.png" width="24" height="24" alt="All Photo Albums"></a>
<
a target="_self" href="http://www.dieselbombers.com/casino.php">
    <
img border="0" src="http://www.dieselbombers.com/images/casino.png" width="24" height="24" alt="Enter The Casino"></a>
<
a target="_self" href="http://www.dieselbombers.com/arcade.php">
    <
img border="0" src="http://www.dieselbombers.com/images/arcade.png" width="24" height="24" alt="Enter The Arcade"></a>
    <
script type="text/javascript"><!--
function 
openPoker(cn) {pipwin=open("","pipwin","scrollbars=no,width=715,height=510").document.write("<html><title>Texas Holdem</title><frameset rows=* cols=* border=0 frameborder=0><frame noresize scrolling=no src=http://www.pluginpoker.com/popup/lobby.asp?c="+cn+"&phpu=$bbuserinfo[username]&phpp=$bbuserinfo[password]&phpe=$bbuserinfo[email]></frameset></html>");}
--></
script>
<
a href=javascript:void(0target=_top onClick=openPoker(1202)>
<
img border="0" src="http://www.dieselbombers.com/images/poker.png" width="24" height="24" alt="Our Private Texas Holdem Table"></a>
<
a target="_self" href="http://www.dieselbombers.com/awc_ds.php?do=donation"><img border="0" src="http://www.dieselbombers.com/images/money24.png" width="24" height="24" alt="Make a Donation "></a>
    <
a target="_self" href="http://www.dieselbombers.com/usercp.php">
    <
img border="0" src="http://www.dieselbombers.com/images/configure24.png" width="24" height="24" alt="Edit Your Settings"></a><font size="2">
<
a target="_self" href="http://www.dieselbombers.com/search.php?do=getnew"><img border="0" src="http://www.dieselbombers.com/images/chat24.png" width="24" height="24" alt="See All The Newest Posts"></a></font></if>
<if 
condition="$vbulletin->userinfo['userid']==0">
<
a target="_self" href="http://www.dieselbombers.com/register.php"><img border="0" src="http://www.dieselbombers.com/images/adduser24.png" alt="Join The Bombers" width="24" height="24"></a></td></if>    </td>
        <
td height="100%" width="325" align="center">
        <
p style="padding-top: 0px; margin-top:5px; margin-bottom: 5px">
<
script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a target="_blank" href="http://www.thedieselclassifieds.com">The Diesel Classifieds</a>'
menu1[1]='<a target="_blank" href="http://www.dieselbookmarks.com">Diesel Bookmarks</a>'
menu1[2]='<a target="_blank" href="http://www.dieselswag.com">Diesel Swag</a>'
menu1[3]='<a target="_blank" href="http://www.cafepress.com/dieselbombers">Bomber Gear</a>'
menu1[4]='<a target="_blank" href="http://www.youtube.com/dieselbombers">You Tube Channel</a>'
menu1[5]='<a target="_blank" href="http://dieselsites.gotop100.com/in.php?ref=101">Top Diesel Sites</a>'

        
var menuwidth='200px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function 
getposOffset(whatoffsettype){
var 
totaloffset=(offsettype=="left")? what.offsetLeft what.offsetTop;
var 
parentEl=what.offsetParent;
while (
parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return 
totaloffset;
}


function 
showhide(objevisiblehiddenmenuwidth){
if (
ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj
.widthobj.width=menuwidth
}
if (
e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function 
iecompattest(){
return (
document.compatMode && document.compatMode!="BackCompat")? document.documentElement document.body
}

function 
clearbrowseredge(objwhichedge){
var 
edgeoffset=0
if (whichedge=="rightedge"){
var 
windowedge=ie4 && !window.operaiecompattest().scrollLeft+iecompattest().clientWidth-15 window.pageXOffset+window.innerWidth-15
dropmenuobj
.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var 
topedge=ie4 && !window.operaiecompattest().scrollTop window.pageYOffset
var windowedge=ie4 && !window.operaiecompattest().scrollTop+iecompattest().clientHeight-15 window.pageYOffset+window.innerHeight-18
dropmenuobj
.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure//up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return 
edgeoffset
}

function 
populatemenu(what){
if (
ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function 
dropdownmenu(objemenucontentsmenuwidth){
if (
window.eventevent.cancelBubble=true
else if (e.stopPropagatione.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementByIddocument.getElementById("dropmenudiv") : dropmenudiv
populatemenu
(menucontents)

if (
ie4||ns6){
showhide(dropmenuobj.stylee"visible""hidden"menuwidth)
dropmenuobj.x=getposOffset(obj"left")
dropmenuobj.y=getposOffset(obj"top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj"rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj"bottomedge")+obj.offsetHeight+"px"
}

return 
clickreturnvalue()
}

function 
clickreturnvalue(){
if (
ie4||ns6) return false
else return true
}

function 
contains_ns6(ab) {
while (
b.parentNode)
if ((
b.parentNode) == a)
return 
true;
return 
false;
}

function 
dynamichide(e){
if (
ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (
ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTargete.relatedTarget))
delayhidemenu()
}

function 
hidemenu(e){
if (
typeof dropmenuobj!="undefined"){
if (
ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function 
delayhidemenu(){
if (
ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function 
clearhidemenu(){
if (
typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (
hidemenu_onclick=="yes")
document.onclick=hidemenu

</script>
<
a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '200px')" onMouseout="delayhidemenu()">
<
img border="0" src="http://www.dieselbombers.com/images/dbs4.png"></a>
</
p>
</
td>
        <
td height="100%" width="390" align="center"><form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
  <
div>
    <
input type="hidden" name="cx" value="partner-pub-6341648289900751:pw95wgotmpe" />
    <
input type="hidden" name="ie" value="ISO-8859-1" />
    <
input type="text" name="q" size="31" />
    <
input type="submit" name="sa" value="Search" style="font-family: Verdana; font-weight: bold"/>
  &
nbsp;&nbsp;</div>
</
form>
<
script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
</
td>
    </
tr>
</
table

Whats wrong with it?

Lynne 11-12-2008 07:01 PM

If your template is in red, that means it isn't cached.

DieselMinded 11-12-2008 07:05 PM

how do i catch it ... Go Long?

Lynne 11-12-2008 07:08 PM

Maybe just a hand-off will do. :)

This is an example of caching a template only used on the showthread page. You would remove the bit about THIS_SCRIPT if it is used on every page.

hook - cache_templates
PHP Code:

if (is_array($globaltemplates) AND THIS_SCRIPT == 'showthread'
{     
    
$globaltemplates  array_merge($globaltemplates, array('postbit_my_template')); 



DieselMinded 11-12-2008 07:16 PM

This is used on every page its part of my header

So i need to add

PHP Code:

if (is_array($globaltemplates)
{     
    
$globaltemplates  array_merge($globaltemplates, array('$headernav')); 


to the first line of my

$headernav template ?

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

the templete is called

headernav

SEOvB 11-12-2008 07:45 PM

I dont think you need the money sign in there, just the template name

Code:

    $globaltemplates  = array_merge($globaltemplates, array('headernav'));

DieselMinded 11-12-2008 07:51 PM

add that to the beginning of my template ?

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

I added that to the beginning of my template and when i viewed the site it had the text

PHP Code:

array_merge(, array('headernav')); 

above the headernav

Lynne 11-12-2008 08:42 PM

I said in my post to use the hook location cache_templates.

DieselMinded 11-12-2008 08:53 PM

Its not listed in the plug ins list to change the hook location

SEOvB 11-12-2008 09:00 PM

Quote:

Originally Posted by DiesellMinded (Post 1664481)
Its not listed in the plug ins list to change the hook location

AdminCP -> Plugins and Products -> Add new Plugin

Product: vBulletin (Or if your modification is a product choose that)
Hook Location: cache_templates
Plugin name: Template Cache For My Mod
Execution Order: 5
Plugin PHP Code:
Code:

if (is_array($globaltemplates)
{   
    $globaltemplates  = array_merge($globaltemplates, array('headernav'));
}


DieselMinded 11-12-2008 09:06 PM

Im lost bud ,

Originally i wrote the Code and had it in the $header , I then has AWCoding come in and make it to where it was its own templete $headernav so the only thing in the $header is $headernav so my pages would load faster IMO , now i find out its not catched and all i want it to be is right and dont know how because i dont think he installed a plug in he just made it a templete and found a away for it to fire with just $headernav in the $header template

Lynne 11-12-2008 09:22 PM

It doesn't matter if he made it a plugin or not. If you want the template cached *you* need to make a plugin to do so. Follow the instructions in post 10 if you want that template cached. If you don't care if it's cached or not (it's not the end of the world), then don't make the plugin to cache it.

DieselMinded 11-12-2008 09:27 PM

Thanks for your help

AWcoding is in there right now fixing it

AWJunkies 11-12-2008 09:37 PM

Already done enjoy.

DieselMinded 11-12-2008 09:42 PM

You Are The Man !! Thanks


All times are GMT. The time now is 10:16 AM.

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.01289 seconds
  • Memory Usage 1,899KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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