jp2b81 Posted January 27, 2008 Share Posted January 27, 2008 {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 More sharing options...
jp2b81 Posted January 29, 2008 Author Share Posted January 29, 2008 no one know the answer? ??? Link to comment https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452020 Share on other sites More sharing options...
maxudaskin Posted January 29, 2008 Share Posted January 29, 2008 There are not many people online at this time of night, and most people that answer, are pretty much only fluent in HTML, Javascript and PHP... not many people know tpl. Link to comment https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452022 Share on other sites More sharing options...
jp2b81 Posted January 29, 2008 Author Share Posted January 29, 2008 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 More sharing options...
rlindauer Posted January 29, 2008 Share Posted January 29, 2008 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 More sharing options...
jp2b81 Posted January 29, 2008 Author Share Posted January 29, 2008 so with that on the pages that I want the right column I just put in $show_rightcolumn ? Link to comment https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452687 Share on other sites More sharing options...
rlindauer Posted January 29, 2008 Share Posted January 29, 2008 No, you need to define the variable in your php code. Link to comment https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452840 Share on other sites More sharing options...
jp2b81 Posted January 29, 2008 Author Share Posted January 29, 2008 Ok I am still learning this stuff how do u define it in your variable to only show up in certain areas? because the way I currently have it set up it shows on all pages I don't want to show up on certain pages. Link to comment https://forums.phpfreaks.com/topic/88086-customizing-code/#findComment-452847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.