WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Alternating list with TemplateTamer
Categories : PHP, Templates Update Picture
Davorin Rusevljan
Date : Feb 08th 2003
Grade : 2 of 5 (graded 5 times)
Viewed : 5121
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Davorin Rusevljan
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Here is an html template:

<html>
<body>
     <h1>Alternating list example with: <a href ="http://www.templatetamer.com/">
TemplateTamer</a></h1>
     <table width=256>
     <!--NAME:ONEITEM -->
         <!--NAME:WHITEROW -->
             <tr bgcolor="white">
             This is an white item number: {ITEMNUMBER}
             </tr>
         <!--END:WHITEROW -->
         <!--NAME:BLUEROW -->
             <tr bgcolor="cyan">
             This is an blue item number: {ITEMNUMBER}
             </tr>
         <!--END:BLUEROW -->
     <!--END:ONEITEM -->
     </table>
</body>
</html>




Here is the logic code for the page:
<?PHP
// Logic code for the TemplateTamer page: REPEATED_TEMPLATE

class alternating_list_Page extends TemplateTamer_Page {

     function
alternatingRows($n=10) {
         
//this creates an array with elements for each item to be displayed
         //but this time we once include BLUEROW template, and next time WHITEROW,
         //and the again BLUEROW, ...
         
for ($i=0;$i<$n;$i++) {
             if (
$itemKey == 'BLUEROW')
                 
$itemKey = 'WHITEROW';
             else
                 
$itemKey = 'BLUEROW';

             
$itemList[] = array( $itemKey => array( ITEMNUMBER => $i ) );
         }
         return
$itemList;
     }

     function
getData() {

         return array(
             
'ONEITEM' =>  new RepeatTemplate( $this -> alternatingRows() )
         );
     }
}
?>


http://www.templatetamer.org/



Website Engine
Categories : PHP, HTML and PHP, Templates
Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself.
Categories : PHP, PHP Classes, Templates, Complete Programs
Simple Template Class/Example
Categories : PHP, Templates, PHP Classes
Very minimal templating engine
Categories : PHP, PHP Classes, Templates
PHP template processing
Categories : PHP, Templates, HTML and PHP
Parsing Simple Template Files and Data
Categories : PHP, PHP Classes, Templates, Regexps
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Cache parsed templates of ETS - Easy Template System with Turck-MMCache
Categories : PHP, Templates
GoTemplate
Categories : PHP, Complete Programs, Templates
How to update selected fields only
Categories : PHP, Databases, Beginner Guides
Accessing GET and PUT variables with HTTP_GET_VARS on Win2K.
Categories : PHP, Windows 2000, Variables
Form input return conformance
Categories : HTML and PHP, PHP, Regexps
Beginners Array Functions
Categories : PHP, Beginner Guides, Arrays
Dynamic WHERE CLAUSE depending on number of FORM FIELDS
Categories : ODBC, General SQL, PHP, Complete Programs, Databases
Convert MYSQL timestamp (14) fields back to UNIX epoch (seconds) format for display with the date() function. "revertTimeStamp($timestamp)"
Categories : PHP, Date Time, MySQL