Jump to content

Recommended Posts

		{if $smarty.session.UserId == ''}
            <div id="stylememlogin"></div>
            {else}{/if}
			{include file="navi.tpl"}
			<div id="innen">
				<!-- Leftside Menu   -->
				<div id="leftcolumn">
					{include file="leftcolumn.tpl"}
				</div>
				<!-- Rightside Menu   -->
				<div id="rightcolumn">
					{include file="rightcolumn.tpl"}
				</div>
                    <!-- Rendered page -->
				<div id="content">
					{$rendered_page}
                  <br />
					{$modosdate_main}
                  <br />
				</div>
			</div>
			<!--  Footer   -->

 

 

This is the code I am using on my index.tpl so it shows up on all pages in the same format is there a way to create if statements so that  for example if profile.tpl is being shown it will not show the rightcolumn.tpl and will change the size of the $rendered_page so that it makes up for the room that rightcolumn.tpl would have had.

 

If you need more of my coding shown let me known it started with the open source code of OSdate which I customizing like crazy... my website is http://www.alovemark.com just incase you need it to see what I am talking about... thanks for your help in advance.

Link to comment
https://forums.phpfreaks.com/topic/88086-customizing-code/
Share on other sites

tpl is just the file type its grabbed by php scripts

 

 

<body dir="{lang mkey='DIRECTION'}" {if $google_map eq 'Y'}onload="load_map()"{/if}>
	<center>
<!-- Header portion  -->

	<div id="main">
		<div id="header" >
		<a href="{$DOC_ROOT}"><img id="logo" src="{$image_dir}logo.gif" alt=""></a>
			<div id="login">

				{if $smarty.session.UserId == ''}
				<form name="frmLogin" method="post" action="midlogin.php" onsubmit="javascript: return newvalidateLogin(this);">
					<br /><b>{lang mkey='members_login'}</b><br /><br />{lang mkey='signup_username'}  <input maxlength="25" name="txtusername" />   <br /><br />{lang mkey='signup_password'}  <input type="password" name="txtpassword" />  <br /><br /><input type="submit" value="{lang mkey='login_submit'}" />  <a href="signup.php">{lang mkey='register'}</a>
				</form>
				{else} <strong>{lang mkey='welcome'} {$smarty.session.UserName}!</strong> {/if}</div>

	</div>
		{if $smarty.session.UserId == ''}
            <div id="stylememlogin"></div>
            {else}{/if}
			{include file="navi.tpl"}
			<div id="innen">
				<!-- Leftside Menu   -->
				<div id="leftcolumn">
					{include file="leftcolumn.tpl"}
				</div>
				<!-- Rightside Menu   -->
				<div id="rightcolumn">
					{include file="rightcolumn.tpl"}
				</div>
                    <!-- Rendered page -->
				<div id="content">
					{$rendered_page}
                  <br />
					{$modosdate_main}
                  <br />
				</div>
			</div>
			<!--  Footer   -->
			<div id="footer">
					{if $smarty.session.UserId <= 0}
						<a href='index.php?page=login' >{lang mkey='site_links' skey='login'}</a> | 
					{/if}
					{if $config.enable_mod_rewrite == 'Y'}
						<a href='privacy.html' >{lang mkey='site_links' skey='privacy'}</a> | 
						<a href='terms_of_use.html' >{lang mkey='site_links' skey='terms_of_use'}</a> | 
						<a href='services.html' >{lang mkey='site_links' skey='services'}</a> | 
						<a href='faq.html' >{lang mkey='site_links' skey='faq'}</a> | 
						<a href='articles.html' >{lang mkey='site_links' skey='articles'}</a> | 
					{else}
						<a href='index.php?page=privacy' >{lang mkey='site_links' skey='privacy'}</a> | 
						<a href='index.php?page=terms_of_use' >{lang mkey='site_links' skey='terms_of_use'}</a> | 
						<a href='index.php?page=services' >{lang mkey='site_links' skey='services'}</a> | 
						<a href='index.php?page=faq' >{lang mkey='site_links' skey='faq'}</a> | 
						<a href='index.php?page=articles' >{lang mkey='site_links' skey='articles'}</a> | 
					{/if}
					<a href='affindex.php' >{lang mkey='site_links' skey='affliates'}</a> | 
{*						<a href='javascript:launchTellFriend();' >{lang mkey='site_links' skey='invite_a_friend'}</a> *}
					<a href='tellafriend.php' >{lang mkey='site_links' skey='invite_a_friend'}</a> 
{* Feedback link depending on the option in global site settings *}
					{if ( $config.feedback_info == 'Y' && $smarty.session.UserId != '') or $config.feedback_info == 'N'}
						 | 
						<a href='feedback.php' >{lang mkey='site_links' skey='feedback'}</a>
					{/if}
				</div>
			<div id="copy">
				Copyright <a href="http://www.alovemark.com">{$config.copyright}</a>  All Rights Reserved.</div>
		</div>
	</center>

{closedb}
</body>
</html>
{/strip}

 

I thought that was all php or am I wrong?

Link to comment
https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452040
Share on other sites

Its a template engine for PHP called Smarty. The TPL is just a generic file extension used to denote a template file.

 

You would use a conditional statement, using smarty variables you have defined in your code, to show the sidebar.

 

Something like:

{if $show_rightcolumn}
<div id="rightcolumn">
    {include file="rightcolumn.tpl"}
</div>
{/if}

Link to comment
https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452053
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.