[Comoblog-commit] comoblog pictureboard.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-08-16 11:06:19
|
Update of /cvsroot/comoblog/comoblog In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16414 Added Files: pictureboard.php Log Message: Initial commit of picture board code --- NEW FILE: pictureboard.php --- <?php /* ADDED in 1.3 * Picture board shows a page full of images in a random or chronological order * */ /* TODO add these constants to xml and upgrade * $limit = CFG_PICTURE_BOARD_LIMIT; * $order =""; * if (CFG_PICTURE_BOARD_ORDER =="chronological"){ $order= "post_date asc"; }else{ $order="rand()"; } $dont_show_these =0; * $dont_show_these= CFG_PICTURE_BOARD_NO_SHOW; */ if (!file_exists('include/param.inc.php')) { Header ('Location: _install/install.php'); exit; } require_once ("include/config.inc.php"); // CHECK VERSION UPGRADE ///////////////////////////////////////////////////// if (!check_version_match()) { Header ('Location: _install/patch_0.php'); exit; } $xtpl = new XTemplate ("templates/pictureboard.tpl.html"); //TODO - move to paramater $tpl->assign ('PAGE_TITLE', "Picture Board"); $images = get_images($limit); while ($row = mysql_fetch_assoc($images)) { $row['hasthumb'] =""; if ($row['img_thumb'] =="Y"){$row['hasthumb'] ="_thumb";} $xtpl->assign('THUMB', $row); $xtpl->parse('main.images_content'); } $xtpl->parse('main'); $xtpl->out('main'); // close db connection mysql_close (); function get_images($flimit){ $query =" select " . "i.* ,p.post_mail_subject " . "from " . "easymoblog_images i, easymoblog_posts p " . "where " . "i.post_id > 0 and " . "i.post_id not in ($dont_show_these) and " . "i.post_id =p.post_id " . "order by $order " . "limit $flimit;"; $res = mysql_query($query); return $res; } ?> |