MyBB Community Forums

Full Version: Coding Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering if I can add a template and put PHP code in it and save it and make like a variable/shortcut so it would only be like {$menu} rather than putting the extended code in the header template. I want to make it a little bit cleaner this way. And if I can, can you please tell me how?

Here's the code
<?xml version="1.0" encoding="utf-8"?>
<!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" xml:lang="en-us">
<head>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/jGlideMenu.css" />
	<!-- Current Release of jQuery - at time of build -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
	<!-- Remove the following line to disabled dragging-dropping / Also Edit CSS to Remove cursor:move from .jGM_header -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
	<script type="text/javascript" src="js/jQuery.jGlideMenu.067.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			// Initialize Menu
			$('#jGlide_001').jGlideMenu({
				tileSource	: '.jGlide_001_tiles' , 
				demoMode	: true 
			}).show();

			// Connect "Toggle" Link	
			$('#switch').click(function(){$(this).jGlideMenuToggle();});
		});
	</script>
</head>
<body>
<p><a href="index.html" title="Back to Overview">&laquo;&nbsp;Back to Project Overview</a></p>
<a href="#" id="switch">Toggle Menu Visibility</a>

<!-- Menu Holder -->
<div class="jGM_box" id="jGlide_001">

		This is Example One

		<!-- Tiles for Menu -->
		<ul id="tile_001" class="jGlide_001_tiles" title="Tile One" alt="Description for tile number one">
			<li rel="tile_002">Link One</li>
			<li rel="tile_003">Link Two</li>
			<li rel="tile_004">Link Three</li>
			<li><a href="http://www.google.com">Link to Google 1</a></li>
			<li><a href="http://www.google.com">Link to Google 2</a></li>
			<li><a href="http://www.google.com">Link to Google 3</a></li>
			<li><a href="http://www.google.com">Link to Google 4</a></li>
			<li><a href="http://www.google.com">Link to Google 5</a></li>
			<li><a href="http://www.google.com">Link to Google 6</a></li>
			<li><a href="http://www.google.com">Link to Google 7</a></li>
			<li><a href="http://www.google.com">Link to Google 8</a></li>
		</ul>
		<ul id="tile_002" class="jGlide_001_tiles" title="Tile Two" alt="Another Tile in This Example">
			<li rel="tile_005">Click Here</li>
			<li><a href="http://www.google.com">Link to Google</a></li>
		</ul>
		<ul id="tile_003" class="jGlide_001_tiles" title="Tile Three" alt="Third Tile is loaded up">
			<li><a href="http://www.google.com">Link to Google</a></li>
		</ul>
		<ul id="tile_004" class="jGlide_001_tiles" title="Search Engines" alt="Find your favorite search engine">
                        <li><a href="http://www.google.com">Link to Google</a></li>
			<li><a href="http://www.yahoo.com">Link to Yahoo!</a></li>
			<li><a href="http://www.ask.com">Link to Ask.com</a></li>
                </ul>
		<ul id="tile_005" class="jGlide_001_tiles" title="Tile Five" alt="Active Spot Light Link">
                        <li><a href="http://www.active8media.com">Link to ASL</a></li>
                </ul>
		<!-- Tiles for Menu -->
</div>
<!-- Menu Holder -->
</body>
<script type="text/javascript" src="/resources/js/plugins/google/analytics/gatag.js"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7365212-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</html>

Please feel free to contact me via AIM or MSN if you are willing to do it for me Smile

AIM: ATLSYST3M4T1C
MSN: [email protected]
You would have to create a plugin that makes the variable available before the template is run.
I have that plugin installed already

i still dont know what to do

here's the code

<?xml version="1.0" encoding="utf-8"?>
<!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" xml:lang="en-us">
<head>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/jGlideMenu.css" />
	<!-- Current Release of jQuery - at time of build -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
	<!-- Remove the following line to disabled dragging-dropping / Also Edit CSS to Remove cursor:move from .jGM_header -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
	<script type="text/javascript" src="js/jQuery.jGlideMenu.067.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			// Initialize Menu
			$('#jGlide_001').jGlideMenu({
				tileSource	: '.jGlide_001_tiles' , 
				demoMode	: true 
			}).show();

			// Connect "Toggle" Link	
			$('#switch').click(function(){$(this).jGlideMenuToggle();});
		});
	</script>
</head>
<body>
<p><a href="index.html" title="Back to Overview">&laquo;&nbsp;Back to Project Overview</a></p>
<a href="#" id="switch">Toggle Menu Visibility</a>

<!-- Menu Holder -->
<div class="jGM_box" id="jGlide_001">

		This is Example One

		<!-- Tiles for Menu -->
		<ul id="tile_001" class="jGlide_001_tiles" title="Tile One" alt="Description for tile number one">
			<li rel="tile_002">Link One</li>
			<li rel="tile_003">Link Two</li>
			<li rel="tile_004">Link Three</li>
			<li><a href="http://www.google.com">Link to Google 1</a></li>
			<li><a href="http://www.google.com">Link to Google 2</a></li>
			<li><a href="http://www.google.com">Link to Google 3</a></li>
			<li><a href="http://www.google.com">Link to Google 4</a></li>
			<li><a href="http://www.google.com">Link to Google 5</a></li>
			<li><a href="http://www.google.com">Link to Google 6</a></li>
			<li><a href="http://www.google.com">Link to Google 7</a></li>
			<li><a href="http://www.google.com">Link to Google 8</a></li>
		</ul>
		<ul id="tile_002" class="jGlide_001_tiles" title="Tile Two" alt="Another Tile in This Example">
			<li rel="tile_005">Click Here</li>
			<li><a href="http://www.google.com">Link to Google</a></li>
		</ul>
		<ul id="tile_003" class="jGlide_001_tiles" title="Tile Three" alt="Third Tile is loaded up">
			<li><a href="http://www.google.com">Link to Google</a></li>
		</ul>
		<ul id="tile_004" class="jGlide_001_tiles" title="Search Engines" alt="Find your favorite search engine">
                        <li><a href="http://www.google.com">Link to Google</a></li>
			<li><a href="http://www.yahoo.com">Link to Yahoo!</a></li>
			<li><a href="http://www.ask.com">Link to Ask.com</a></li>
                </ul>
		<ul id="tile_005" class="jGlide_001_tiles" title="Tile Five" alt="Active Spot Light Link">
                        <li><a href="http://www.active8media.com">Link to ASL</a></li>
                </ul>
		<!-- Tiles for Menu -->
</div>
<!-- Menu Holder -->
</body>
<script type="text/javascript" src="/resources/js/plugins/google/analytics/gatag.js"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7365212-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</html>

anyone want to help? please
can anyone help/assist me in this situation...please and thanks
Maybe if a staff member moves this to "development / modifications", then someone qualified will see it.
"General Support" isn't really the right category.

##
I'm not sure exactly how to do this, and am also interested in the answer.
Moderators/Admins if you think it's better to move my thread into the development/modifications section that seeker is suggesting, then please do so. I just want to figure out how to resolve my situation as soon as possible Big Grin Thanks
sorry for bumping this but I really need this