[Comoblog-commit] modules/mod_randomthumb index.php,NONE,1.1 mod_randomthumb.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2005-11-27 19:31:34
|
Update of /cvsroot/comoblog/modules/mod_randomthumb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5426/mod_randomthumb Added Files: index.php mod_randomthumb.php Log Message: initial add, just to make sure ive got the hang of it. mod_randomthumb displays a random thumbmail image and links it to the relevant post. had loads of trouble getting this to commit, so i still need to double check its all here --- NEW FILE: mod_randomthumb.php --- <?php if (in_array('mod_randomthumb', $SIDEBAR_MODULES)) $mod_pos = 'sidebar'; else $mod_pos = 'top'; require_once (CFG_BASE_PATH.'/modules/mod_randomthumb/include/mod_randomthumb.inc.php'); $randomthumb_items = mod_randomthumb(); if ($randomthumb_items) { $mod_randomthumb_tpl = new XTemplate (CFG_BASE_PATH.'/modules/mod_randomthumb/templates/'.$mod_pos.'/mod_randomthumb.tpl.htm'); for ($c = 0; $c < count($randomthumb_items); $c++) { if ($c % 2) $tpl->assign('BGCOLOR', '#ffffff'); else $tpl->assign('BGCOLOR', '#efefef'); $mod_randomthumb_tpl->assign('ITEM', $randomthumb_items[$c]); $mod_randomthumb_tpl->parse('main.item'); } $mod_randomthumb_tpl->parse('main'); $mod_contents = $mod_randomthumb_tpl->text("main"); } else $mod_contents = ''; ?> --- NEW FILE: index.php --- |