we all have our thoughts on templates. Mine are that folks will have to modify the templates to fit their sites regardless of what state they are in when purchased or the use of css. good html code and css make that process a little more tolerable. It is still a painful process, nonetheless.
I've probably done about 10 link sites in the past 3 years ( I once had life. Now all I have is a computer, a keyboard, a mouse and a modem!
). Maybe one of these days I'll do one that makes money! Anyway, when I saw the INDEXU code and templates I felt I had died and gone to heaven. No, they were not perfect but I knew that I would not have to spend much time on them either. and in the larger scheme of things, I only had to do it once. So percent of time I have spend on templates vs all of INDEXU continues to drop and will soon be negligible. So I am happy.
I ran across another links program the other day and I have shared the code for the review page below. In my humble opinion, it is a good argument for separating code and content. Also, I would sure hate to try and make this code compliant with the latest HTML stds. Or to incorporate css into it.
So there are worse and there are probably better and INDEXU could be better. But all-in-all, "it ain't all that bad." I think it is pretty good.
apenas mis dos centavos, amigos
Code:
<?
// ******************************** ***********************************
// include/review.php
// ******************************** ***********************************
$html = $table2 . "<tr><td class=\"whatText\">" . $review_1;
$html .= "</td></tr></table>";
echo whattable("100%","center","",$html);
unset($html);
$get_site = sql_query("select * from $tb_links where ID = '$SiteID'");
$site_rows = sql_fetch_array($get_site);
$average = sql_query("select avg(Rating) as average from $tb_reviews
where SiteID = '$SiteID' and Status = 'Show'");
$av_rows = sql_fetch_array($average);
$html = $table2 . "<tr><td class=\"regularText\"><font class=\"regularText\">";
$html .= $review_2 . "</font> <a class=\"regularBoldText\" href=\"out";
if($user_outer_frame == "Y"){$html .= "_frame";}
$html .= ".php?";
$html .= session_name() . "=" . session_id() . "&ID=";
$html .= $site_rows["ID"] . "\" target=\"_";
if($user_outer_frame == "Y"){$html .= "top";}else{$html .= "blank";}
$html .= "\">" . $site_rows["SiteName"] . "</a>";
if(isset($av_rows["average"])){
$html .= " - " . $review_3 . "<font class=\"regularBoldText\">";
$html .= $av_rows["average"] . "</font>";
}
$html .= "</td></tr>";
$get_reviews = sql_query("select * from $tb_reviews where SiteID='$SiteID'
and Status='Show' order by Added desc limit 0,10");
if(sql_num_rows($get_reviews)>0){
$html .= "<tr><td class=\"regularText\"><br /><ul>";
while($rows = sql_fetch_array($get_reviews)){
$html .= "<li><font class=\"regularBoldText\">" . $rows[ReviewTitle];
$html .= "</font> - " . $rows[Review] . "<br />" . $review_4;
$html .= $rows[Reviewer] . " - <";
$secure_email = str_replace("@", $review_5, $rows[ReviewerEmail]);
$secure_email = str_replace(".", $review_6, $secure_email);
$secure_email = str_replace("-", $review_7, $secure_email);
$secure_email = str_replace("_", $review_8, $secure_email);
$html .= $secure_email . ">";
if(strlen($rows[ReviewerURL])>0){
$html .= " of <a class=\"regularText\" href=\"" . $rows[ReviewerURL];
$html .= "\" target=\"_blank\">" . $rows[ReviewerURL] . "</a>";
}
$html .= "</li>";
}
$html .= "</ul></td></tr></table>";
} else {
$html = $table2 . "<tr><td class=\"regularText\">" . $review_9;
$html .= "<br /><br /></td></tr></table>";
}
echo table("98%","center","",$html);
unset($html);
$html = $table2 . "<tr><td class=\"regularText\"><a class=\"regularText\" ";
$html .= "href=\"index.php?" . session_name() . "=" . session_id();
$html .= "&show=review_add&SiteID=" . $SiteID . "\">" . $review_10;
$html .= "</a></td></tr></table>";
echo table("98%","center","",$html);
unset($html);
?>