home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / AmigaOS / Aplus_Dev / AP-Website / links / themes / original / tables.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  8.3 KB  |  229 lines

  1. <?
  2. // *******************************************************************
  3. //  themes/original/tables.php
  4. // *******************************************************************
  5.  
  6. // These are some generic <table> tags     
  7.  
  8. // small 
  9. $table0 = "\r\n\t\t<!-- Start Inner Table 0 -->"; 
  10. $table0 .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n"; 
  11.  
  12. // centered small 
  13. $table = "\r\n\t\t<!-- Start Inner Table -->"; 
  14. $table .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" "; 
  15. $table .= "align=\"center\">\r\n"; 
  16.  
  17. // centered full size 
  18. $table2 = "\r\n\t\t<!-- Start Inner Table 2 -->"; 
  19. $table2 .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" "; 
  20. $table2 .= "align=\"center\" width=\"100%\">\r\n"; 
  21.  
  22. // full size 
  23. $table3 = "\r\n\t\t<!-- Start Inner Table 3 -->"; 
  24. $table3 .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" "; 
  25. $table3 .= "width=\"100%\">\r\n";
  26.  
  27. // centered full size 
  28. $table4 = "\r\n\t\t<!-- Start Inner Table 4 -->"; 
  29. $table4 .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" "; 
  30. $table4 .= "align=\"center\" width=\"100%\">\r\n"; 
  31.  
  32. // main table 
  33. $main_table = "\r\n\t\t<!-- Start Main Categories Table -->"; 
  34. $main_table .= "\r\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" "; 
  35. $main_table .= "width=\"100%\">\r\n\t\t"; 
  36.  
  37. // main category wrap table 
  38. $main_cw_table = "\r\n\t\t\t<!-- Start Main Category Wrap Table -->";
  39. $main_cw_table .= "\r\n\t\t\t<table border=\"0\" cellspacing=\"3\" cellpadding=\"0\" ";
  40. $main_cw_table .= "width=\"100%\">\r\n\t\t";
  41.  
  42. // form table
  43. $form_table = "\r\n\t\t<!-- Start Form Table -->"; 
  44. $form_table .= "\r\n\t\t<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\" "; 
  45. $form_table .= "align=\"center\">\r\n"; 
  46.  
  47.  
  48. function table($width, $align, $title, $body){
  49.     
  50.     global $theme;
  51.  
  52.     if((strlen($title) > 0) || (strlen($body) > 0)){
  53.  
  54.         $html = "\r\n<!-- Start New Table -->\r\n";
  55.         $html .= "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\" ";
  56.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  57.  
  58.         if(strlen($title) > 0){
  59.             
  60.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\" bgcolor=\"#F4F4F4\">";
  61.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ";
  62.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td align=\"left\" width=\"100%\" ";
  63.             $html .= "background=\"themes/" . $theme . "/back.gif\" class=\"tabletitle\">" . $title;
  64.             $html .= "\t\t</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>";
  65.         }
  66.  
  67.         if(strlen($body) > 0){
  68.             
  69.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\" bgcolor=\"#F4F4F4\">";
  70.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ";
  71.             $html .= "width=\"100%\" bgcolor=\"#F4F4F4\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  72.             $html .= "bgcolor=\"white\" class=\"tablebody\">" . $body;
  73.             $html .= "\t\t</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  74.         }
  75.  
  76.         $html .= "</table>\r\n<!-- End New Table -->\r\n";
  77.     }
  78.  
  79.     return $html;
  80. }
  81.  
  82. function linecattable($width, $align, $title, $body){
  83.  
  84.     if((strlen($title) > 0) || (strlen($body) > 0)){
  85.     
  86.         $html = "\r\n<!-- Start LineCat Table -->\r\n";
  87.         $html .= "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" ";
  88.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  89.  
  90.         if(strlen($title) > 0){
  91.             
  92.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  93.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  94.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  95.             $html .= "background=\"themes/" . $theme . "/back.gif\" class=\"linecattitle\">" . $title;
  96.             $html .= "</td>\r\n\t</tr>\r\n</table></td>\r\n</tr>";
  97.         }
  98.  
  99.         if(strlen($body) > 0){
  100.             
  101.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  102.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  103.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  104.             $html .= "class=\"LineCatOut\">" . $body;
  105.             $html .= "</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  106.         }
  107.  
  108.         $html .= "</table>\r\n<!-- End New Table -->\r\n";
  109.     }
  110.  
  111.     return $html;
  112. }
  113.  
  114. // this function is for the What's ... table 
  115. function whattable($width, $align, $title, $body){
  116.  
  117.     if((strlen($title) > 0) || (strlen($body) > 0)){
  118.  
  119.         $html = "\r\n<!-- Start What Table -->\r\n";
  120.         
  121.         // cellspacing sets distance between prev/next table and left/right margins
  122.         $html .= "<table  border=\"0\" cellspacing=\"2\" cellpadding=\"2\" ";
  123.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  124.  
  125.         if(strlen($title) > 0){
  126.             
  127.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  128.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  129.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  130.             $html .= "background=\"themes/" . $theme . "/back.gif\" class=\"whattabletitle\">" . $title;
  131.             $html .= "</td>\r\n\t</tr>\r\n</table></td>\r\n</tr>";
  132.         }
  133.  
  134.         if(strlen($body) > 0){
  135.             
  136.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  137.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  138.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  139.             $html .= "class=\"WhatTabOut\">" . $body;
  140.             $html .= "</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  141.         }
  142.  
  143.         $html .= "</table>\r\n<!-- End New Table -->\r\n";
  144.     }
  145.  
  146.     return $html;
  147. }
  148.  
  149. // This table function is for the nav bar ( Page [1] [2] [3]...)
  150. function navtable($width, $align, $title, $body){
  151.  
  152.     if((strlen($title) > 0) || (strlen($body) > 0)){
  153.  
  154.         $html = "\r\n<!-- Start Nav Table -->\r\n";
  155.  
  156.         // celspacing sets distance between prev/next table and left/right margins
  157.         $html .= "<table  border=\"0\" cellspacing=\"2\" cellpadding=\"2\" ";
  158.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  159.  
  160.         if(strlen($title) > 0){
  161.             
  162.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  163.             // cellpadding
  164.             $html .= "\r\n\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  165.             $html .= "width=\"100%\">\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  166.             $html .= "background=\"themes/" . $theme . "/back.gif\" class=\"navtabletitle\">" . $title;
  167.             $html .= "</td>\r\n\t</tr>\r\n</table></td>\r\n</tr>";
  168.         }
  169.  
  170.         if(strlen($body) > 0){
  171.             
  172.             $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  173.  
  174.             // cellpadding sets thickness of border try 10 for example
  175.             // note we do not use border = x but the background of another table 
  176.             // to set the 'bordercolor' in the stylesheet by changin NavTabOut there
  177.             // cellspacing sets the space duh ! around the table try 10 
  178.             $html .= "\r\n\t<table  border=\"0\" cellpadding=\"1\" cellspacing=\"0\" ";
  179.             $html .= "width=\"100%\" >\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  180.             $html .= "class=\"NavTabOut\">" . $body;
  181.             $html .= "</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  182.         }
  183.  
  184.         $html .= "</table>\r\n<!-- End Nav Table -->\r\n";
  185.     }
  186.  
  187.     return $html;
  188. }
  189.  
  190. // This table function is for the navbar.bottom.php
  191. function navtablebottom($width, $align, $body){
  192.  
  193.     if(strlen($body) > 0){
  194.             
  195.         $html = "\r\n<!-- Start Nav Bottom Table -->\r\n";
  196.         $html .= "<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ";
  197.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  198.         $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  199.         $html .= "\r\n\t<table  border=\"0\" cellpadding=\"1\" cellspacing=\"4\" ";
  200.         $html .= "width=\"100%\" >\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  201.         $html .= "class=\"NavTabOut\">" . $body;
  202.         $html .= "</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  203.         $html .= "</table>\r\n<!-- End Nav Bottom Table -->\r\n";
  204.     }
  205.     
  206.     return $html;
  207. }
  208.  
  209. // This table function is for the footer.php
  210. function footertable($width, $align, $body){
  211.  
  212.     if(strlen($body) > 0){
  213.         
  214.         $html = "\r\n<!-- Start Footer Table -->\r\n";
  215.         $html .= "<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ";
  216.         $html .= "width=\"" . $width . "\" align=\"" . $align . "\">";
  217.         $html .= "\r\n<tr>\r\n\t<td width=\"100%\">";
  218.         $html .= "\r\n\t<table  border=\"0\" cellpadding=\"1\" cellspacing=\"4\" ";
  219.         $html .= "width=\"100%\" >\r\n\t<tr>\r\n\t\t<td width=\"100%\" ";
  220.         $html .= "class=\"footerBot\">" . $body;
  221.         $html .= "</td>\r\n\t</tr>\r\n\t</table>\r\n\t</td>\r\n</tr>\r\n";
  222.         $html .= "</table>\r\n<!-- End Footer Table -->\r\n";
  223.     }
  224.     
  225.     return $html;
  226. }
  227.  
  228. ?>
  229.