[Comoblog-commit] comoblog index.php,1.5,1.6 post.php,1.2,1.3
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-08-16 16:46:40
|
Update of /cvsroot/comoblog/comoblog In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11809 Modified Files: index.php post.php Log Message: Added some comments on locations that might be good places to check the cache Index: post.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/post.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- post.php 11 Dec 2005 12:14:00 -0000 1.2 +++ post.php 16 Aug 2006 16:46:36 -0000 1.3 @@ -12,13 +12,20 @@ $post = post_details ($post_id); -if (!$post) +if (!$post){ error_404(); -else +} +else{ $tpl = new XTemplate ("templates/index.tpl.htm"); +} + + // TODO get from cache + // or run query and store in cache + if ($post) { + // timestamp post day $current_timestamp = $post['post_added']; @@ -33,10 +40,10 @@ $res = mysql_query($query); while ($row = mysql_fetch_assoc($res)) { - if (eregi('\.3g2',$row['img_name'])) { - $tpl->assign('IMAGE', $row); - $tpl->parse('main.post.video_3g2'); - } + if (eregi('\.3g2',$row['img_name'])) { + $tpl->assign('IMAGE', $row); + $tpl->parse('main.post.video_3g2'); + } else if ($row['img_thumb'] == 'Y') { $tpl->assign('IMAGE', $row); $tpl->parse('main.post.thumb_img'); Index: index.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.php 19 Apr 2006 12:38:33 -0000 1.5 +++ index.php 16 Aug 2006 16:46:36 -0000 1.6 @@ -50,11 +50,15 @@ $tpl = new XTemplate ("templates/index.tpl.htm", "main"); if(isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/' && $_SERVER['PATH_INFO'] != '') { + // TODO get from cache + // or run query and store in cache $posts = posts_in_date ($current_timestamp); $date = ucfirst(strftime($POST_DATE_FORMAT, $current_timestamp)); $page_title = $TXT['posts_received'] . ' : ' . $date; } else { + // TODO get from cache + // or run query and store in cache $posts = posts_last (CFG_HOWMANY_ITEMS); $page_title = $TXT['recent_posts']; } @@ -63,7 +67,7 @@ - +/// if we get this far there is no point doing the caching - we've done the heavy lifting already if ($posts) { for ($c = 0; $c < count($posts); $c++) { @@ -130,6 +134,8 @@ // if (count($SIDEBAR_MODULES) > 0) { for ($mod_cnt = 0; $mod_cnt < count($SIDEBAR_MODULES); $mod_cnt++) { + // TODO get from cache + // or run query and store in cache include_once (CFG_BASE_PATH.'/modules/'.$SIDEBAR_MODULES[$mod_cnt].'/'.$SIDEBAR_MODULES[$mod_cnt].'.php'); $tpl->assign('SIDEBAR_MODULE',$mod_contents); $tpl->parse('main.sidebar_module'); @@ -137,6 +143,8 @@ } if (count($TOP_MODULES) > 0) { for ($mod_cnt = 0; $mod_cnt < count($TOP_MODULES); $mod_cnt++) { + // TODO get from cache + // or run query and store in cache include_once (CFG_BASE_PATH.'/modules/'.$TOP_MODULES[$mod_cnt].'/'.$TOP_MODULES[$mod_cnt].'.php'); $tpl->assign('TOP_MODULE',$mod_contents); $tpl->parse('main.top_bar.top_module'); |