[Comoblog-commit] modules/mod_skinselect/include mod_skinselect.inc.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-02-24 00:01:36
|
Update of /cvsroot/comoblog/modules/mod_skinselect/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13177/mod_skinselect/include Added Files: mod_skinselect.inc.php Log Message: initial commit to make sure i've not missed anything transfering the code from my live site down to my cvs version basic premis is that new skins sit in css/SKINNAME/css.php of mod skin select is set to be shown then the users can change the skin via a drop down, if not then a default can be set in the admin area. these skins are imported after the rest of the css so that the content overrides and extends the existing comoblog css - i think we need to decide if skins will provide a full set of styleing or just override and extend the exising code should skin css be entered via the admin area, or uploaded (like a module) ? id prefere to upload as a module as that allows for custom images etc note need to change things like the topic icons some how --- NEW FILE: mod_skinselect.inc.php --- <?php function mod_skinselect_details ($item_id) { $query = "select * from ".CFG_MYSQL_TABPREFIX."mod_skinselect where skinselect_id = '".$item_id."'"; $res = mysql_query($query); if (!$res || !mysql_num_rows($res)) return (false); $item = mysql_fetch_assoc($res); return ($item); } function mod_skinselect_adminlist () { $query = " select b.* from ".CFG_MYSQL_TABPREFIX."mod_skinselect b order by b.skinselect_display_order "; $res = mysql_query($query); if (!$res || !mysql_num_rows($res)) return (false); $items = array(); while ($row = mysql_fetch_assoc($res)) { $items[] = $row; } return ($items); } function mod_skinselect_list () { $query = " select b.* from ".CFG_MYSQL_TABPREFIX."mod_skinselect b where skinselect_visible ='Y' order by b.skinselect_added desc"; #echo $query; $res = mysql_query($query); if (!$res || !mysql_num_rows($res)) return (false); #$items = array(); $c = 0; while ($row = mysql_fetch_assoc($res)) { $items[$c] = $row; $items[$c]['skinselect_added'] = getdate($row['skinselect_added']); $c++; } return ($items); } function mod_skinselect_add ($item) { $query = "select max(skinselect_display_order)+1 from ".CFG_MYSQL_TABPREFIX."mod_skinselect"; $res = mysql_query($query); $item['skinselect_display_order'] = mysql_result($res,0,0); $item['skinselect_added'] = time(); $query = " insert into ".CFG_MYSQL_TABPREFIX."mod_skinselect (skinselect_title,skinselect_description,skinselect_nav_text,skinselect_nav_link,skinselect_visible,skinselect_added,skinselect_display_order,skinselect_author) values ('". $item['skinselect_title'] ."', '". $item['skinselect_description'] ."', '". $item['skinselect_nav_text']."', '". $item['skinselect_nav_link']."', '". $item['skinselect_visible']."', '". $item['skinselect_added']."', '". $item['skinselect_display_order']."', '". $item['skinselect_author'] ."') "; $res = mysql_query($query); if (!$res) return (false); $item['id'] = mysql_insert_id(); return ($item); } function mod_skinselect_del ($item_id) { $query = "delete from ".CFG_MYSQL_TABPREFIX."mod_skinselect where skinselect_id = '".$item_id."'"; $res = mysql_query($query); if (!$res) return (false); return (true); } function mod_skinselect_edit ($item) { $query = "update ".CFG_MYSQL_TABPREFIX."mod_skinselect set skinselect_title='". $item['skinselect_title'] ."', skinselect_description='". $item['skinselect_description'] ."', skinselect_nav_text='". $item['skinselect_nav_text']."', skinselect_nav_link='". $item['skinselect_nav_link']."', skinselect_visible='". $item['skinselect_visible']."', skinselect_added= '". $item['skinselect_added']."', skinselect_display_order= '". $item['skinselect_display_order']."', skinselect_author= '". $item['skinselect_author']."', where skinselect_id = '". $item['skinselect_id'] ."'"; define_syslog_variables(); openlog("TextLog", LOG_PID, LOG_LOCAL0); $data = date("Y/m/d H:i:s"); syslog(LOG_DEBUG,"Messagge: $query"); closelog(); $res = mysql_query($query); if (!$res) return (false); return ($item); } function mod_skinselect_up ($item_id) { } function mod_skinselect_down ($item_id) { } ?> |