Kyojii
07-08-2012, 12:24 PM
I have a file I would like to include on the editprofile page. Rather than edit all of the templates and include it in every one I thought it would be easier to make a hook that appends it to all of them. However when I tried this for some reason the $headinclude variable gets replaces with only "0".
if ($_REQUEST['do'] == 'editprofile'){
$headinclude += '<script type="text/javascript" src="/includes/bubbles.js"></script>';
}
echo htmlspecialchars($headinclude);
echo '<br><br><br>';
$headinclude += '<script type="text/javascript" src="/includes/bubbles.js"></script>';
echo htmlspecialchars($headinclude);
Output of above code:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <base href="" /><!--[if IE]></base><![endif]--> <meta name="generator" content="vBulletin 4.1.7" /> <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta property="fb:app_id" content="343071649037238" /> <meta property="og:site_name" content="" /> <meta property="og:description" content="" /> <meta property="og:url" content="" /> <meta property="og:type" content="website" /> <script type="text/javascript" src="clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js?v=417"></script> <script type="text/javascript" src="clientscript/yui/connection/connection-min.js?v=417"></script> <script type="text/javascript"> <!-- var SESSIONURL = ""; var SECURITYTOKEN = "1341753294-5bf2ad92bde7df16216e232b4783009f4c143736"; var IMGDIR_MISC = "images/misc"; var IMGDIR_BUTTON = "images/buttons"; var vb_disable_ajax = parseInt("0", 10); var SIMPLEVERSION = "417"; var BBURL = ""; var LOGGEDIN = 504 > 0 ? true : false; var THIS_SCRIPT = "profile"; var RELPATH = "profile.php?do=editprofile"; var PATHS = {forum : ""} // --> </script> <script type="text/javascript" src=""></script> <link rel="alternate" type="application/rss+xml" title="" href="" /> <link rel="stylesheet" type="text/css" href="css.php?styleid=13&langid=1&d=1339672467&td=ltr&sh eet=bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css," /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="css.php?styleid=13&langid=1&d=1339672467&td=ltr&sh eet=popupmenu-ie.css,vbulletin-ie.css,vbulletin-chrome-ie.css,vbulletin-formcontrols-ie.css,editor-ie.css" /> <![endif]-->
0
if ($_REQUEST['do'] == 'editprofile'){
$headinclude += '<script type="text/javascript" src="/includes/bubbles.js"></script>';
}
echo htmlspecialchars($headinclude);
echo '<br><br><br>';
$headinclude += '<script type="text/javascript" src="/includes/bubbles.js"></script>';
echo htmlspecialchars($headinclude);
Output of above code:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <base href="" /><!--[if IE]></base><![endif]--> <meta name="generator" content="vBulletin 4.1.7" /> <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta property="fb:app_id" content="343071649037238" /> <meta property="og:site_name" content="" /> <meta property="og:description" content="" /> <meta property="og:url" content="" /> <meta property="og:type" content="website" /> <script type="text/javascript" src="clientscript/yui/yuiloader-dom-event/yuiloader-dom-event.js?v=417"></script> <script type="text/javascript" src="clientscript/yui/connection/connection-min.js?v=417"></script> <script type="text/javascript"> <!-- var SESSIONURL = ""; var SECURITYTOKEN = "1341753294-5bf2ad92bde7df16216e232b4783009f4c143736"; var IMGDIR_MISC = "images/misc"; var IMGDIR_BUTTON = "images/buttons"; var vb_disable_ajax = parseInt("0", 10); var SIMPLEVERSION = "417"; var BBURL = ""; var LOGGEDIN = 504 > 0 ? true : false; var THIS_SCRIPT = "profile"; var RELPATH = "profile.php?do=editprofile"; var PATHS = {forum : ""} // --> </script> <script type="text/javascript" src=""></script> <link rel="alternate" type="application/rss+xml" title="" href="" /> <link rel="stylesheet" type="text/css" href="css.php?styleid=13&langid=1&d=1339672467&td=ltr&sh eet=bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css," /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="css.php?styleid=13&langid=1&d=1339672467&td=ltr&sh eet=popupmenu-ie.css,vbulletin-ie.css,vbulletin-chrome-ie.css,vbulletin-formcontrols-ie.css,editor-ie.css" /> <![endif]-->
0