July 05, 2008 | 03:22 PM  
Welcome

Don't have an account yet? You can create one, it is free, just click here

as a registered user you have some advantages like free downloads, comments and posting on our forums, depending upon this site's configuration and options.

 • •  Control Panel - Register - Login  • • 
Current Stable MDPro Lite 1.0821 Download
   30-Nov-1999  Print current page  Show map

m. Including other AT commands

m. Including other AT commands

Let's insert the logo of the site, the rotating banners set up in the Banner Module, date and time of the site.

Open the Main theme template theme.html :

  • Logo: find the logo placeholder <­TD WIDTH="279"> Logo here<­/TD>

    and replace with


    <­TD ALIGN="CENTER" WIDTH="279"><­a href="index.phtml"><­img border="0" src="{image-path}logo.gif" alt="<­?php echo _GOTOINDEX ?>"><­/a><­/TD>


Just add a <­A HREF> tag to make a linkable image to the Home Page defined in the Admin Pannel >> Settings >> Preferences >> Start page. The image logo.gif is linked by the AT command {image-path} that replaces the themes/YourTheme/image subfolder, where you have to copy the image. The alt parameter is to show a little box with the alternative text that will be compiled by the Php: echo (=display) the _GOTOINDEX constant. This constant has to be added in the /themes/YourTheme/lang/eng/global.php file: open it with Windows Block Note editor or other editors, and insert that line before the closing ?> command:

define('_GOTOINDEX', 'Back to the Home page');

or the text you want to display. Save.

Remember: if you set up different languages for your site, you have to create a /themes/YourTheme/lang/newlanguage subfolder with a global.php for the defines: this location is automatically searched by AutoTheme for the theme constants. If you have different languages, AT will look for the default language set up for the site.

  • Banner: replace the banner placeholder in the theme.html file

<­TD ALIGN="CENTER"> Banner here<­/TD>

with the following AT command:

<­TD ALIGN="CENTER"><­!-- [banners] --><­/TD>

Create a banner with width=300 and height=60, or copy the banner from http://www.openitalia.net to the /images/banners/ folder and rename it banner.gif

The banner has to be set up from the Admin Pannel: open it, click on Contents >> Banners: here add a banner client: insert your data, then submit. Now add a banner: select the client you just create, Show in all modules, all languages, Impressions=0 (unlimited), width=300, height=60, image URL: images/banners/banner.gif.

If you will encounter problems, copy banner.gif into the /themes/images/ path and use these tags:

<­TD ALIGN="CENTER"><­a href="index.phtml"><­img border="0" src="{image-path}banner.gif" alt="<­?php echo _GOTOINDEX ?>"><­/a><­/TD>


That's what the index will show:






  • date/hour: change the place holder for the blue stripe


    <­TD HEIGHT="24" BGCOLOR="#2D6EC5" WIDTH=100%><­IMG SRC="images/spacer.gif" WIDTH="1" HEIGHT="23">The blue stripe<­/TD>

with


<­TD HEIGHT="24" ALIGN="RIGHT" BGCOLOR="#2D6EC5"><­FONT CLASS="login"><­!-- [date] --> <­!-- [time] --><­/FONT><­/TD>


  • Top Navigation Links: Now include a simple top navigation bar within the yellow stripe:

    <­TD BGCOLOR="#FFC22C" HEIGHT=23>The yellow stripe<­/TD>

With


<­TD ALIGN="MIDDLE" WIDTH="100%" BGCOLOR="#ffa500" HEIGHT="23">

<­CENTER>

<­FONT CLASS="title"><­STRONG>

<­a href="<­?php echo _URL1; ?>"><­?php echo _LINK1; ?><­/a> 

<­a href="<­?php echo _URL2; ?>"><­?php echo _LINK2; ?><­/a> 

<­a href="<­?php echo _URL3; ?>"><­?php echo _LINK3; ?><­/a> 

<­a href="<­?php echo _URL4; ?>"><­?php echo _LINK4; ?><­/a> 

<­/STRONG><­/FONT>

<­/CENTER>

<­/TD>


Let's explain the code: in a professional theme design, text should not be hard-coded: so, instead of writing:

<­a href=”index.php”> HOME <­/a>

you should write:

<­a href="<­?php echo _URL1; ?>"><­?php echo _LINK1; ?><­/a>

and add these constants (_CONSTANT) to your /lang/eng/global.php as define() for each language used on your site:

Global.php should look like this:


<­?php

define('_ANONYMOUS','Guest');

define('_MYACCOUNT','My Account');

define('_NEWACCOUNT','Register');

define('_REMEMBERME','Remember me');

define('_WELCOME','Welcome');

define('_URL1','index.php');

define('_URL2','modules.php?op=modload&name=subjects&file=index');

define('_URL3','modules.php?op=modload&name=Topics&file=index');

define('_URL4','modules.php?op=modload&name=Web_Links&file=index');

define('_LINK1','HOME ::');

define('_LINK2','DOCUMENTS ::');

define('_LINK3','TOPICS ::');

define('_LINK4','WEB LINKS ');

?>


This method of using lang contants allows you to easily change link and url definitions by editing them simply in the language global.php file. This should be done for any text appearing in the theme template...


  • Site name/slogan: inserting site name and slogan at top of the page on the upper orange stripe:

    <­TD HEIGHT="16" WIDTH="100%" BGCOLOR="#FFA500">The orange stripe<­/TD>

Replace with

    <­TD ALIGN="CENTER" HEIGHT="16" WIDTH="100%" BGCOLOR="#FFA500">

    <­FONT CLASS="title"><­STRONG><­!-- [site-name] --> :: <­!-- [site-slogan] --><­/STRONG><­/FONT> <­/TD>


That's how it looks in the preview:






You can change position of AT commands in the <­TD ALIGN=”LEFT, CENTER, RIGHT”> tag, and the style in the <­FONT CLASS””> tag.

  • Marquee text: put it in the upper orange stripe, where you put site name and slogan:

    <­TD ALIGN="CENTER" HEIGHT="16" WIDTH="100%" BGCOLOR="#FFA500">

    <­FONT CLASS="title"><­STRONG><­MARQUEE><­!-- [site-name] --> :: <­!-- [site-slogan] --><­/MARQUEE><­/STRONG><­/FONT> <­/TD>

Remember to activate the <­MARQUEE> tag in the Admin Panel >> Settings >> Preferences >> HTML Options.