comoblog-commit Mailing List for CoMoblog Mobile Blog Application (Page 8)
Status: Inactive
Brought to you by:
markwallis
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(49) |
Oct
(127) |
Nov
(211) |
Dec
(56) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(51) |
Feb
(128) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(2) |
Aug
(24) |
Sep
|
Oct
(151) |
Nov
(9) |
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
(17) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:05
|
Update of /cvsroot/comoblog/comoblog/include/pear/Text/Password/tests In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/include/pear/Text/Password/tests Log Message: Directory /cvsroot/comoblog/comoblog/include/pear/Text/Password/tests added to the repository |
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:05
|
Update of /cvsroot/comoblog/comoblog/include/pear/Text/CAPTCHA/Driver In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/include/pear/Text/CAPTCHA/Driver Log Message: Directory /cvsroot/comoblog/comoblog/include/pear/Text/CAPTCHA/Driver added to the repository |
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:05
|
Update of /cvsroot/comoblog/comoblog/include/pear/Text/Password In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/include/pear/Text/Password Log Message: Directory /cvsroot/comoblog/comoblog/include/pear/Text/Password added to the repository |
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:05
|
Update of /cvsroot/comoblog/comoblog/include/pear/Text In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/include/pear/Text Log Message: Directory /cvsroot/comoblog/comoblog/include/pear/Text added to the repository |
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:04
|
Update of /cvsroot/comoblog/comoblog/include/pear/Image In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/include/pear/Image Log Message: Directory /cvsroot/comoblog/comoblog/include/pear/Image added to the repository |
|
From: iamdecal <iam...@us...> - 2006-10-22 01:25:04
|
Update of /cvsroot/comoblog/comoblog/modules/mod_blogrolling2/include In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2100/modules/mod_blogrolling2/include Log Message: Directory /cvsroot/comoblog/comoblog/modules/mod_blogrolling2/include added to the repository |
|
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'); |
|
From: iamdecal <iam...@us...> - 2006-08-16 16:46:40
|
Update of /cvsroot/comoblog/comoblog/include In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11809/include Modified Files: libraries.inc.php Log Message: Added some comments on locations that might be good places to check the cache Index: libraries.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/include/libraries.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- libraries.inc.php 16 Aug 2006 16:39:01 -0000 1.12 +++ libraries.inc.php 16 Aug 2006 16:46:36 -0000 1.13 @@ -91,6 +91,10 @@ $query = "delete from ".CFG_MYSQL_TABPREFIX."comments where post_id = '".$post_id."'"; $res = mysql_query($query); + + //TODO - clear cache? + + } |
|
From: iamdecal <iam...@us...> - 2006-08-16 16:39:05
|
Update of /cvsroot/comoblog/comoblog/include In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8874/include Modified Files: config.inc.php libraries.inc.php Log Message: Initial cache code added, just libraries and base schema, not linked in functionally Index: libraries.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/include/libraries.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- libraries.inc.php 16 Aug 2006 01:12:41 -0000 1.11 +++ libraries.inc.php 16 Aug 2006 16:39:01 -0000 1.12 @@ -828,4 +828,78 @@ return strtr ($string, $trans_tbl); } + +//ADDED in 1.3 +function get_cache_config($keyphrase){ + $query = " + select * + from ".CFG_MYSQL_TABPREFIX."cache c + where c.cache_keyphrase= '".addslashes($keyphrase)."'"; + $res = mysql_query($query); + + if (!$res || !mysql_num_rows($res)){ + return ("not-cached"); + } + + return $res; + +} + +function get_cache_content($keyphrase,$post_id){ + $query = " + select cache_content + from ".CFG_MYSQL_TABPREFIX."cache c + where c.cache_keyphrase= '".addslashes($keyphrase)."' and and cache_clear > now()+0 and cache_post_id='".addslashes($post_id)."'"; + ; + $res = mysql_query($query); + + if (!$res || !mysql_num_rows($res)){ + return false; + } + + return mysql_query($res,0,0); + +} +// ADDED IN 1.3 +function set_cache_content($keyphrase,$post_id,$cache_content,$cache_age){ + + // empty place holder + $query =""; + // find out if we have this cached already + if (get_cache_content($keyphrase,$post_id) !=false){ + // if we do - update the record. + $query ="update ".CFG_MYSQL_TABPREFIX."cache " . + "set cache_content=''".addslashes($cache_content)."',cache_added=now()+0,cache_clear=now()+".$cache_age." where cache_keyphrase= '".addslashes($keyphrase)."' and cache_post_id='".addslashes($post_id)."'"; + } + + else { + // if not - add a record + $query = " + insert into ".CFG_MYSQL_TABPREFIX."commenters + (cache_keyphrase,cache_post_id,cache_content,cache_added,cache_clear) + values ( + '".addslashes($keyphrase)."', + '".addslashes($post_id)."', + '".addslashes($cache_content)."', + now()+0, + now()+"/$cache_age." + ) + "; + } + + + // run the query + $res = mysql_query($query); + + if (!$res) + return (false); + + $insert_id = mysql_insert_id(); + + return ($insert_id); + +} + + + ?> Index: config.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/include/config.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- config.inc.php 16 Aug 2006 01:12:41 -0000 1.4 +++ config.inc.php 16 Aug 2006 16:39:01 -0000 1.5 @@ -53,6 +53,7 @@ // modules and filters $TOP_MODULES = array(); $SIDEBAR_MODULES = array(); +$BOTTOM_MODULES = array(); $POST_PRE_FILTERS = array(); $POST_POST_FILTERS = array(); @@ -80,7 +81,11 @@ elseif ($row['mod_pos'] == 'top') { $TOP_MODULES[] = $row['mod_name']; } - + //ADDED in 1.3 + // well, why not have them as well + elseif ($row['mod_pos'] == 'bottom') { + $BOTTOM_MODULES[] = $row['mod_name']; + } if ($row['mod_filter_posts'] == 'Y'){ $POST_PRE_FILTERS[] = $row['mod_name']; } |
|
From: iamdecal <iam...@us...> - 2006-08-16 16:39:05
|
Update of /cvsroot/comoblog/comoblog/_install In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8874/_install Modified Files: comoblog_db.xml Log Message: Initial cache code added, just libraries and base schema, not linked in functionally Index: comoblog_db.xml =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/comoblog_db.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- comoblog_db.xml 15 Aug 2006 16:56:30 -0000 1.8 +++ comoblog_db.xml 16 Aug 2006 16:39:00 -0000 1.9 @@ -9,22 +9,22 @@ <field name="comment_author_email" specs="varchar(128) default NULL" /> <field name="comment_author_url" specs="varchar(128) default NULL" /> <field name="comment_added" specs="int(10) unsigned default NULL" /> - <field name="post_id" specs="int(10) unsigned NOT NULL default '0'" /> + <field name="post_id" specs="int(10) unsigned NOT NULL default '0'" /> <field name="comment_live" specs="varchar(1) default 'N'" /> <pk name="comment_id" /> </table> - - - - <table name="comoblog_commenters"> - <field name="commenter_id" specs="int(10) unsigned NOT NULL auto_increment" /> - <field name="commenter_author_email" specs="varchar(128) default NULL" /> - <field name="commenter_default" specs="varchar(1) default 'N'" /> - - - <pk name="commenter_id" /> - </table> + + + + <table name="comoblog_commenters"> + <field name="commenter_id" specs="int(10) unsigned NOT NULL auto_increment" /> + <field name="commenter_author_email" specs="varchar(128) default NULL" /> + <field name="commenter_default" specs="varchar(1) default 'N'" /> + + + <pk name="commenter_id" /> + </table> <table name="comoblog_images"> <field name="img_id" specs="int(10) unsigned NOT NULL auto_increment" /> @@ -289,4 +289,52 @@ <pk name="trackback_id" /> </table> + + <!-- //ADDED 1.3 + holds the cached pages + + there is no point haveing caches that all expire at the same time - you want to be able to clear them when + specific things happen as well, so as well as datas, there are some extra control fields + + cache_keyphrase = the identifier used to find and save this row i.e. postpage,indexpage or mod_rss + cache_post_id = the post id - most of the caching will relate to post pages. this should speed it up. + cache_clearcodes - a comma seperated string eg (newpost,byage,oncomment,onedit) + cache_added - the date this cached page was added / updated + cache_clear - the date this cached page should be cleared (see byage) + cache_text - the content of the text + + a row might look like this... + + 1,"postpage","123","oncomment,onedit","2006-01-01 12:00:00","2009-01-01 12:00:00","foo bah humbug", + + which would represent the post page for post 123, + as a rule we wont want to change this cache very often, but we will if the post is editied or a comment is added + + the post edit page will be adapted to clear caches with a cache_clearcode like "onedit" OR a keyphrase ='postpage-123' + + or + + 2,"mod_rss,0,"byage","2006-01-01 12:00:00","2006-01-02 12:00:00","foo bah humbug", + + which will only expire by age (every 1 days) + + remeber we may also need to clear the index page etc as they may have the cached details if its a post. + + + --> + + <table name="comoblog_cache"> + <field name="cache_id" specs="int(10) unsigned NOT NULL auto_increment" /> + <field name="cache_keyphrase" specs="varchar(64) default NULL" /> + <field name="cache_post_id" specs="int(10) unsigned NOT NULL " /> + <field name="cache_clearcodes" specs="varchar(255) default NULL" /> + <field name="cache_added" specs="int(14) unsigned not NULL" /> + <field name="cache_clear" specs="int(14) unsigned not NULL" /> + <field name="cache_text" specs="text" /> + <pk name="cache_id" /> + <uk name="cache_keyphrase" /> + </table> + + + </comoblog_db> |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:56:46
|
Update of /cvsroot/comoblog/comoblog/rss/comments In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1304/rss/comments Modified Files: index.htm Log Message: Didnt mean to use MY feed address's obviously ;-) Index: index.htm =================================================================== RCS file: /cvsroot/comoblog/comoblog/rss/comments/index.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.htm 16 Aug 2006 14:51:53 -0000 1.1 +++ index.htm 16 Aug 2006 14:56:40 -0000 1.2 @@ -1 +1 @@ -<!--#include virtual="/cgi-bin/iamdecal-rss.cgi?feed=comments" --> +<!--#include virtual="modules/mod_rss/rss.php/c2.0" --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:56:44
|
Update of /cvsroot/comoblog/comoblog/rss/posts In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1304/rss/posts Modified Files: index.htm Log Message: Didnt mean to use MY feed address's obviously ;-) Index: index.htm =================================================================== RCS file: /cvsroot/comoblog/comoblog/rss/posts/index.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.htm 16 Aug 2006 14:51:53 -0000 1.1 +++ index.htm 16 Aug 2006 14:56:41 -0000 1.2 @@ -1 +1 @@ -<!--#include virtual="/cgi-bin/iamdecal-rss.cgi?feed=comments" --> +<!--#include virtual="modules/mod_rss/rss.php/2.0" --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:51:57
|
Update of /cvsroot/comoblog/comoblog/rss/comments In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31978/rss/comments Added Files: index.htm Log Message: New tree for rss feeds to try to add some permenance (i have updates to follow) --- NEW FILE: index.htm --- <!--#include virtual="/cgi-bin/iamdecal-rss.cgi?feed=comments" --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:51:57
|
Update of /cvsroot/comoblog/comoblog/rss/posts In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31978/rss/posts Added Files: index.htm Log Message: New tree for rss feeds to try to add some permenance (i have updates to follow) --- NEW FILE: index.htm --- <!--#include virtual="/cgi-bin/iamdecal-rss.cgi?feed=comments" --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:51:56
|
Update of /cvsroot/comoblog/comoblog/rss In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31978/rss Added Files: index.htm readme.htm Log Message: New tree for rss feeds to try to add some permenance (i have updates to follow) --- NEW FILE: index.htm --- --- NEW FILE: readme.htm --- These folders are used for two reasons. a; You dont have to have people looking inside of the modules tree, no point in advertising where stuff is happening. b; If you upgrade the mod_rss, you can point these feed locations to the new files, and no one will have to update their feed settings. You may need to change the file extension to .html or .shtml etc depending on which files on your sever will parse virtual includes |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:45:49
|
Update of /cvsroot/comoblog/comoblog/rss/posts In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29802/rss/posts Log Message: Directory /cvsroot/comoblog/comoblog/rss/posts added to the repository |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:45:49
|
Update of /cvsroot/comoblog/comoblog/rss In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29802/rss Log Message: Directory /cvsroot/comoblog/comoblog/rss added to the repository |
|
From: iamdecal <iam...@us...> - 2006-08-16 14:45:49
|
Update of /cvsroot/comoblog/comoblog/rss/comments In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29802/rss/comments Log Message: Directory /cvsroot/comoblog/comoblog/rss/comments added to the repository |
|
From: iamdecal <iam...@us...> - 2006-08-16 11:06:19
|
Update of /cvsroot/comoblog/comoblog/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16414/templates Added Files: pictureboard.tpl.htm Log Message: Initial commit of picture board code --- NEW FILE: pictureboard.tpl.htm --- <!-- BEGIN: main -->{FILE "templates/header.tpl.htm"} <div id="imageBox" class="imageBox"> <!-- BEGIN: images_content --> <a href="/{THUMB.post_id}/{THUMB.post_mail_subject}"> <img src="/img/posts/{THUMB.img_id}{THUMB.hasthumb}.{THUMB.img_extension}" width="100" height="100" alt="{THUMB.post_mail_subject}"/> </a> <!-- END: images_content --> </div> </body> </html> {FILE "templates/footer.tpl.htm"} <!-- END: main --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 11:06:19
|
Update of /cvsroot/comoblog/comoblog/_install In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16414/_install Modified Files: comoblog_preferences.xml Log Message: Initial commit of picture board code Index: comoblog_preferences.xml =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/comoblog_preferences.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- comoblog_preferences.xml 16 Aug 2006 01:12:41 -0000 1.18 +++ comoblog_preferences.xml 16 Aug 2006 11:06:15 -0000 1.19 @@ -353,7 +353,7 @@ display_order="0" /> - <param + <param name="CFG_INTERACTION_TRACKBACK" value="yes" description="Enable trackback" @@ -365,6 +365,52 @@ editable="Y" display_order="0" /> + + <!-- //ADDED IN 1.3 + //TODO - add to updgrade 1.2 -1.3 XML --> + <param + name="CFG_PICTURE_BOARD_ORDER" + value="yes" + description="How do you want to order your images" + topic_id="5" + encrypt="N" + type="select" + restrict_values="chronological|random" + accept_null="N" + editable="Y" + display_order="0" + /> + + <!-- //ADDED IN 1.3 + //TODO - add to updgrade 1.2 -1.3 XML --> + <param + name="CFG_PICTURE_BOARD_LIMIT" + value="9999" + description="How Many Images do you want to show" + topic_id="5" + encrypt="N" + type="text" + restrict_values="" + accept_null="N" + editable="Y" + display_order="" + /> + <!-- //ADDED IN 1.3 + //TODO - add to updgrade 1.2 -1.3 XML --> + <param + name="CFG_PICTURE_BOARD_NO_SHOW" + value="0" + description="Any Posts you dont want to include? - enter as a comma seperated string. i.e., 1,2,3,4" + topic_id="5" + encrypt="N" + type="text" + restrict_values="" + accept_null="N" + editable="Y" + display_order="" + /> + + <param name="CFG_INTERACTION_AUTHOR" |
|
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; } ?> |
|
From: iamdecal <iam...@us...> - 2006-08-16 01:27:33
|
Update of /cvsroot/comoblog/comoblog/admin/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8431/admin/templates Modified Files: index.tpl.htm Added Files: comment_edit.tpl.htm manage_comments.tpl.htm Log Message: place holder admin php and templates for editing comments and commenters --- NEW FILE: manage_comments.tpl.htm --- <!-- BEGIN: main --> {FILE "templates/header.tpl.htm"} <table width="760" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="middle"><p><img src="img/posts.gif" border="0" align="absmiddle"> <b>MANAGE POSTS</b></p></td> </tr> </table> <br /> <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid black;"> <tr> <td valign="middle" height="40"><p><a href="post_add.php" onclick="void open_popup(this.href,600,600); return false;" title="Add new post"><img src="img/add.gif" border="0" align="absmiddle"></a> <b><a href="post_add.php" onclick="void open_popup(this.href,600,500); return false;" title="Add new post">ADD NEW POST</a></b></p></td> </tr> </table> <br /> <br /> <table border="0" width="760" align="center" cellspacing="0" cellpadding="4" style="border:1px solid black;"> <!-- BEGIN: deleted --> <tr> <td colspan="5" align="center" height="40" valign="middle" class="bigger"> <img src="img/ok.gif" width="40" height="40" alt="" border="0" align="absmiddle"> Post deleted succesfully! </td> </tr> <!-- END: deleted --> <!-- BEGIN: no_posts --> <tr> <td class="bigger"><br /><b>No posts in your blog</b><br /> </td> </tr> <tr> <td>If you want to add a new post to your CoMoblog site, just write an email message to the account you specified during Installation process.<br />Contents of the email message will be published.<br /> </td> </tr> </table> <!-- END: no_posts --> <!-- BEGIN: posts --> <tr> <td colspan="5" class="bigger" style="border-bottom: 1px solid black" valign="middle">Posts: {FIRST} - {LAST} ({TOTAL} total)</td> </tr> <!-- BEGIN: post --> <tr bgcolor="{BGCOLOR}"> <td valign="top"><b>{POST.post_mail_subject}</b></td> <td valign="top">{POST.post_mail_from}</td> <td valign="top">{POST.post_mail_date}</td> <td align="right"><a href="post_edit.php?i={POST.post_id}&o={OFFSET}" onclick="void open_popup(this.href,600,500); return false;" title="edit post"><img src="img/edit.gif" border="0" alt="edit post"></a> <a href="post_del.php?i={POST.post_id}&o={OFFSET}" onclick="if (confirm('Are you sure you want to delete this item? ({POST.post_mail_subject})')) document.location.href=this.href; else return false;" title="delete post"><img src="img/delete.gif" border="0" alt="delete post"></a></td> </tr> <!-- END: post --> </table> <table border="0" width="760" align="center" cellspacing="0" cellpadding="4"> <tr> <td width="50%" align="left"><!-- BEGIN: prev --><a href="manage_posts.php?o={PREV_OFFSET}" title="previous posts"><img src="img/left.gif" width="24" height="24" alt="previous posts" border="0"></a><!-- END: prev --></td> <td width="50%" align="right"><!-- BEGIN: next --><a href="manage_posts.php?o={NEXT_OFFSET}" title="next posts"><img src="img/right.gif" width="24" height="24" alt="next posts" border="0"></a><!-- END: next --></td> </tr> </table> <!-- END: posts --> {FILE "templates/footer.tpl.htm"} <!-- END: main --> Index: index.tpl.htm =================================================================== RCS file: /cvsroot/comoblog/comoblog/admin/templates/index.tpl.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.tpl.htm 2 Sep 2005 01:06:15 -0000 1.2 +++ index.tpl.htm 16 Aug 2006 01:27:28 -0000 1.3 @@ -52,6 +52,27 @@ </p> </td> </tr> +<!-- //TODO - somewhere on the old easy moblog site, it says where the icons are from +need to find two suitable ones +--> +<tr> + <td width="20"> </td> + <td><img src="img/comments.gif" border="0"></td> + <td> + <p><a href="manage_comments.php"><b>Manage Comments</b></a><br> + Edit or Delete Comments. + </p> + </td> + <td><img src="img/comments_users.gif" border="0"></td> + <td> + <p><a href="manage_comment_users.php"><b>Manage Comment Approval</b></a><br> + Manage which users are pre approved and which are blacklisted for adding comments + </p> + </td> +</tr> + + + <tr> <td colspan="5"> </td> </tr> --- NEW FILE: comment_edit.tpl.htm --- <!-- BEGIN: main --> {FILE "templates/mod_popup_header.tpl.htm"} <form action="{ACTION}" method="POST" enctype="multipart/form-data"> <input type="hidden" name="post_id" value="{POST.post_id}"> <input type="hidden" name="post_ctype" value="{POST.post_ctype}"> <input type="hidden" name="post_images" value="{POST.post_images}"> <table border="0" width="550" cellspacing="0" cellpadding="10" align="center"> <tr> <td class="bigger" colspan="3"> <p><b>EDIT POST</b></p> </td> </tr> <!-- BEGIN: topics --> <tr> <td colspan="3"> <p>Topic:<br /> <select name="topic_id"> <option value="">- none -</option> <!-- BEGIN: topic --> <option value="{TOPIC.topic_id}"<!-- BEGIN: selected --> selected<!-- END: selected -->>{TOPIC.topic_name}</option> <!-- END: topic --> </select> </p> </td> </tr> <!-- END: topics --> <tr> <td colspan="3"> <p>Type:<br /> <select name="post_ctype"> <option value="{POST.post_ctype}" selected >No change ({POST.post_ctype})</option> <option value="text/plain">text/plain</option> <option value="text/html">text/html</option> </select> </p> </td> </tr> <tr> <td colspan="3"> <p>Subject:<br /> <input type="text" name="post_mail_subject" value="{POST.post_mail_subject}" maxlength="255" size="40" style="width:550px;"> </p> </td> </tr> <tr> <td colspan="3"> <p>Body:<br /> <textarea name="post_mail_body" style="width:550px;" cols="50" rows="7" wrap="virtual">{POST.post_mail_body}</textarea><br>(HTML allowed) </p> </td> </tr> <tr> <td colspan="3"> <p>Posted by:<br /> <input type="text" name="post_mail_from" value="{POST.post_mail_from}" maxlength="255" size="40" style="width:550px;"> </p> </td> </tr> <tr> <td colspan="3"> <p>Date Posted:<br /> <input type="radio" name="post_date_option" value="keep" checked>Don't change</input> <input type="hidden" name="post_mail_date_orig" value="{POST.post_mail_date}"> <br /> <input type="radio" name="post_date_option" value="now">Now</input><br /> <input type="radio" name="post_date_option" value="change">Change to:</input> <input type="text" name="post_mail_date" value="{POST.post_mail_date}" size="40"><br /> </p> </td> </tr> <!-- BEGIN: images --> <tr> <td colspan="3"><b>IMAGES:</b></td> </tr> <!-- BEGIN: image --> <tr> <td valign="middle"> Image {COUNTER_TXT} <a target="_blank" href="../img/posts/{IMAGE.img_id}.{IMAGE.img_extension}">[view]</a> <input type="hidden" name="image_id_{COUNTER}" value="{IMAGE.img_id}"> <input type="hidden" name="image_ext_{COUNTER}" value="{IMAGE.img_extension}"> </td> <td valign="middle"> substitute: <input type="file" name="image_file_{COUNTER}" /> </td> <td align="right" valign="middle"> delete: <input type="checkbox" name="image_delete_{COUNTER}" value="{IMAGE.img_id}"> </td> </tr> <!-- END: image --> <!-- END: images --> <!-- BEGIN: comments --> <tr> <td colspan="3"><b>COMMENTS:</b></td> </tr> <!-- BEGIN: comment --> <tr> <td valign="middle"> Author: <input type="text" size="20" name="comment_author_{COUNTER}" value="{COMMENT.comment_author}"> <input type="hidden" name="comment_id_{COUNTER}" value="{COMMENT.comment_id}"> </td> <td valign="top"> <table><tr><td valign="top">Comment: </td> <td><textarea name="comment_text_{COUNTER}">{COMMENT.comment_text} </textarea></td></tr></table> </td> <td align="right" valign="middle"> delete: <input type="checkbox" name="comment_delete_{COUNTER}" value="{COMMENT.comment_id}"> </tr> <!-- END: comment --> <!-- END: comments --> <tr> <td align="right" colspan="3"><input type="image" src="img/save_big.gif" border="0" onClick="this.src='img/save_wait.gif';"> </td> </tr> </table> <br /> <p align="center"></p> <br /> <!-- BEGIN: errors --> <script> var errmsg = "WARNING\n"; <!-- BEGIN: error --> errmsg += "\n{ERROR}"; <!-- BEGIN: error --> alert (errmsg); </script> <!-- END: errors --> </form> {FILE "templates/footer.tpl.htm"} <!-- END: main --> |
|
From: iamdecal <iam...@us...> - 2006-08-16 01:27:33
|
Update of /cvsroot/comoblog/comoblog/admin In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8431/admin Added Files: comment_del.php comment_edit.php manage_comment_users.php manage_comments.php Log Message: place holder admin php and templates for editing comments and commenters --- NEW FILE: manage_comment_users.php --- <?php require ('include/admin.inc.php'); $tpl = new XTemplate ('templates/manage_posts.tpl.htm'); $offset = 0; if (isset($_GET['o'])) $offset = $_GET['o'] + 0; $delete = 'n'; if (isset($_GET['d']) && $_GET['d'] == 'y') $delete = 'y'; if ($delete == 'y') $tpl->parse('main.deleted'); $display = 10; $posts = posts_list ($offset, $display); if ($posts) { for ($cnt = 0; $cnt < count($posts); $cnt++) { if ($cnt % 2) $tpl->assign('BGCOLOR', '#ffffff'); else $tpl->assign('BGCOLOR', '#efefef'); $posts[$cnt]['post_mail_from'] = htmlentities(antispam($posts[$cnt]['post_mail_from'])); $posts[$cnt]['post_mail_date'] = strftime('%D %T',$posts[$cnt]['post_mail_date']); if ( $posts[$cnt]['post_mail_subject'] == ""){ // need to to strip html incase we break across a tag $title = filter_html($posts[$cnt]['post_mail_body']); $posts[$cnt]['post_mail_subject'] = substr($title,0,150) ."..." ; } $tpl->assign('POST', $posts[$cnt]); $tpl->parse('main.posts.post'); } $howmany = posts_howmany(); $tpl->assign("OFFSET", $offset); $tpl->assign("FIRST", $offset + 1); $tpl->assign("LAST", $offset + $cnt); $tpl->assign("TOTAL", $howmany); if ($howmany > ($offset + $display)) { $next_offset = $offset + $display; $tpl->assign("NEXT_OFFSET", $next_offset); $tpl->parse("main.posts.next"); } if (($offset - $display) >= 0) { $prev_offset = $offset - $display; $tpl->assign("PREV_OFFSET", $prev_offset); $tpl->parse("main.posts.prev"); } $tpl->parse('main.posts'); } else { $tpl->parse('main.no_posts'); } $tpl->parse('main.home'); $tpl->parse('main'); $tpl->out('main'); // close db connection mysql_close (); ?> --- NEW FILE: comment_del.php --- <?php require_once ('include/admin.inc.php'); $offset = 0; if (isset($_GET['o'])) $offset = $_GET['o'] + 0; $post_id = ''; if (isset($_GET['i'])) $post_id = $_GET['i']; post_del ($post_id); mysql_close(); Header ('Location: manage_posts.php?d=y&o='.$offset); exit(); ?> --- NEW FILE: comment_edit.php --- <?php require ('include/admin.inc.php'); // date localization setlocale (LC_TIME, $SET_LOCALE); if (strtoupper($_SERVER['REQUEST_METHOD'] == 'POST')) { $errors = array(); foreach ($_POST as $k => $v) $post[$k] = trim($v); foreach($_POST as $k => $v) { if (substr($k, 0, 11) == 'comment_id_') { $comment_cnt = substr($k, 11); $comment = array(); $comment['comment_id'] = $post['comment_id_'.$comment_cnt]; $comment['comment_text'] = $post['comment_text_'.$comment_cnt]; $comment['comment_author'] = $post['comment_author_'.$comment_cnt]; $comment['comment_delete'] = $post['comment_delete_'.$comment_cnt]; if ($comment['comment_delete'] == $comment['comment_id']) { $query = "delete from ".CFG_MYSQL_TABPREFIX."comments where comment_id=".$comment['comment_id']; $res = mysql_query($query); } else { $query = "update ".CFG_MYSQL_TABPREFIX."comments set comment_text='".$comment['comment_text']."', comment_author='".$comment['comment_author']."' where comment_id=".$comment['comment_id']; echo $query; $res = mysql_query($query); } } if (substr($k, 0, 9) == 'image_id_') { $image_cnt = substr($k, 9); $img = array(); $img['img_id'] = $post['image_id_'.$image_cnt]; $img['file'] = $_FILES['image_file_'.$image_cnt]; $img['delete'] = $post['image_delete_'.$image_cnt]; $img['ext'] = $post['image_ext_'.$image_cnt]; // if substitute image if ($img['file']['error'] == 0) { $imgsize = @getimagesize($img['file']['tmp_name']); if ($imgsize) { if ($imgsize[2] == 1) { $ctype = 'image/gif'; $ext = 'gif'; } elseif($imgsize[2] == 2) { $ctype = 'image/jpg'; $ext = 'jpg'; } elseif($imgsize[2] == 3) { $ctype = 'image/png'; $ext = 'png'; } else { $errors[] = 'Image '.($image_cnt+1).': not supported format (use gif, jpg or png)'; } } else { $errors[] = 'Image '.($image_cnt+1).': not supported format (use gif, jpg or png)'; } // delete old image @unlink (CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'.'.$img['ext']); if (file_exists(CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'_thumb.'.$img['ext'])) @unlink (CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'_thumb.'.$img['ext']); // copy new image move_uploaded_file ($img['file']['tmp_name'], CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'.'.$ext); // create thumbnail $thumb = create_thumbnail ($img['img_id'], $ext, CFG_IMG_MAX_W, CFG_IMG_MAX_H, CFG_GD_VERSION); // update table if ($thumb) $query = "update ".CFG_MYSQL_TABPREFIX."images set img_mime = '".$ctype."', img_extension = '".$ext."', img_thumb = 'Y', img_height = '".$imgsize[1]."', img_width = '".$imgsize[0]."' where img_id = '".$img['img_id']."'"; else $query = "update ".CFG_MYSQL_TABPREFIX."images set img_mime = '".$ctype."', img_extension = '".$ext."', img_thumb = 'N', img_height = '', img_width = '' where img_id = '".$img['img_id']."'"; $res = mysql_query($query); } // if delete image if (count($errors) == 0) { if ($img['delete'] == $img['img_id']) { @unlink (CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'.'.$img['ext']); if (file_exists(CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'_thumb.'.$img['ext'])) @unlink (CFG_BASE_PATH.'/img/posts/'.$img['img_id'].'_thumb.'.$img['ext']); $query = "delete from ".CFG_MYSQL_TABPREFIX."images where img_id = '".$img['img_id']."'"; $res = mysql_query($query); $post['post_images'] -= 1; } } } } if (count($errors) == 0) { foreach($post as $k => $v) { if (get_magic_quotes_gpc() == 1) $post[$k] = stripslashes($v); } if ($post['post_mail_subject'] == "") { $title = filter_html($post['post_mail_body']); $post['post_mail_subject'] = substr($title,0,150) ."..."; } // apply post filters if (count($POST_PRE_FILTERS) > 0) { for ($filter_cnt = 0; $filter_cnt < count($POST_PRE_FILTERS); $filter_cnt++) { include_once (CFG_BASE_PATH.'/modules/'.$POST_PRE_FILTERS[$filter_cnt].'/'.$POST_PRE_FILTERS[$filter_cnt].'_post_filter.php'); } } foreach($post as $k => $v) { $post[$k] = addslashes($v); } if ($post['post_date_option'] == "now") { $post['post_mail_date'] = time(); } else if ($post['post_date_option'] == "change") { $post['post_mail_date'] = strtotime($post['post_mail_date']); } else { $post['post_mail_date'] = strtotime($post['post_mail_date_orig']); } $query = " update ".CFG_MYSQL_TABPREFIX."posts set post_mail_from = '".$post['post_mail_from'] ."', post_mail_subject = '".$post['post_mail_subject'] ."', post_mail_body = '".$post['post_mail_body'] ."', post_images = '".$post['post_images'] ."', post_mail_date = '".$post['post_mail_date'] ."', post_ctype = '".$post['post_ctype'] ."', post_added = '".$post['post_mail_date'] ."', topic_id = '".$post['topic_id'] ."' where post_id = '".$post['post_id'] ."' "; $res = mysql_query($query); // apply post filters if (count($POST_POST_FILTERS) > 0) { for ($filter_cnt = 0; $filter_cnt < count($POST_POST_FILTERS); $filter_cnt++) { include_once (CFG_BASE_PATH.'/modules/'.$POST_POST_FILTERS[$filter_cnt].'/'.$POST_POST_FILTERS[$filter_cnt].'_post_filter.php'); } } echo '<html><head></head><body><script language="javascript">opener.location.reload();this.close();</script></body></html>'; exit(); } else { foreach($errors as $k => $v) { $tpl->assign('ERROR', $v); $tpl->parse('main.errors.error'); } $tpl->parse('main.errors'); } } $tpl = new XTemplate('templates/post_edit.tpl.htm'); if (isset($_GET['i'])) $post_id = $_GET['i']; $post = post_details($post_id); if ($post) { $strdate = strftime("%D %H:%M", $post['post_mail_date']); $post['post_mail_date'] = $strdate; $post['post_mail_from'] = htmlentities(antispam($post['post_mail_from'])); $post['post_mail_body'] = htmlentities($post['post_mail_body']); $tpl->assign('POST', $post); // topics $query = "select t.*, concat(i.img_id,'.',i.img_extension) as img from ".CFG_MYSQL_TABPREFIX."topics t left join ".CFG_MYSQL_TABPREFIX."images i on t.img_id = i.img_id order by t.topic_name"; $res = mysql_query($query); if (mysql_num_rows($res) > 0) { while ($row = mysql_fetch_assoc($res)) { $tpl->assign('TOPIC', $row); if ($row['topic_id'] == $post['topic_id']) $tpl->parse('main.topics.topic.selected'); $tpl->parse('main.topics.topic'); } $tpl->parse('main.topics'); } if ($post['post_images'] > 0) { $query = " select img_id,img_extension from ".CFG_MYSQL_TABPREFIX."images where post_id = '".$post_id."' "; $res = mysql_query($query); $i = 0; while ($row = mysql_fetch_array($res)) { $tpl->assign('COUNTER', $i); $tpl->assign('COUNTER_TXT', $i + 1); $tpl->assign('IMAGE', $row); $tpl->parse('main.images.image'); $i++; } $tpl->parse('main.images'); } $comments = comment_list($post_id); if ($comments) { for ($c = 0; $c < count($comments); $c++) { $comments[$c]['comment_author_email'] = antispam ($comments[$c]['comment_a uthor_email'], true); $tpl->assign("COMMENT", $comments[$c]); $tpl->assign("COUNTER", $c); if ($comments[$c]['comment_author_email'] != '') $tpl->parse("main.comments.comment.email"); $tpl->parse("main.comments.comment"); } $tpl->parse("main.comments"); } } $tpl->assign('ACTION', basename($_SERVER['PHP_SELF'])); $tpl->parse('main'); $tpl->out('main'); ?> --- NEW FILE: manage_comments.php --- <?php require ('include/admin.inc.php'); $tpl = new XTemplate ('templates/manage_posts.tpl.htm'); $offset = 0; if (isset($_GET['o'])) $offset = $_GET['o'] + 0; $delete = 'n'; if (isset($_GET['d']) && $_GET['d'] == 'y') $delete = 'y'; if ($delete == 'y') $tpl->parse('main.deleted'); $display = 10; $posts = posts_list ($offset, $display); if ($posts) { for ($cnt = 0; $cnt < count($posts); $cnt++) { if ($cnt % 2) $tpl->assign('BGCOLOR', '#ffffff'); else $tpl->assign('BGCOLOR', '#efefef'); $posts[$cnt]['post_mail_from'] = htmlentities(antispam($posts[$cnt]['post_mail_from'])); $posts[$cnt]['post_mail_date'] = strftime('%D %T',$posts[$cnt]['post_mail_date']); if ( $posts[$cnt]['post_mail_subject'] == ""){ // need to to strip html incase we break across a tag $title = filter_html($posts[$cnt]['post_mail_body']); $posts[$cnt]['post_mail_subject'] = substr($title,0,150) ."..." ; } $tpl->assign('POST', $posts[$cnt]); $tpl->parse('main.posts.post'); } $howmany = posts_howmany(); $tpl->assign("OFFSET", $offset); $tpl->assign("FIRST", $offset + 1); $tpl->assign("LAST", $offset + $cnt); $tpl->assign("TOTAL", $howmany); if ($howmany > ($offset + $display)) { $next_offset = $offset + $display; $tpl->assign("NEXT_OFFSET", $next_offset); $tpl->parse("main.posts.next"); } if (($offset - $display) >= 0) { $prev_offset = $offset - $display; $tpl->assign("PREV_OFFSET", $prev_offset); $tpl->parse("main.posts.prev"); } $tpl->parse('main.posts'); } else { $tpl->parse('main.no_posts'); } $tpl->parse('main.home'); $tpl->parse('main'); $tpl->out('main'); // close db connection mysql_close (); ?> |
|
From: iamdecal <iam...@us...> - 2006-08-16 01:12:46
|
Update of /cvsroot/comoblog/comoblog/include In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2807/include Modified Files: config.inc.php libraries.inc.php Log Message: added update for 1,2 to 1.3 - a few comments to help with releases //ADDED in 1.3 for new code //TODO for things that still need to be looked at Index: libraries.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/include/libraries.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- libraries.inc.php 15 Aug 2006 16:56:31 -0000 1.10 +++ libraries.inc.php 16 Aug 2006 01:12:41 -0000 1.11 @@ -8,7 +8,7 @@ if ($ver == "0.5.1" || $ver == "1.0") return true; else - return false; + return false; } function in_supported_patch_list ($ver) { @@ -16,7 +16,7 @@ return true; else return false; -} +} function check_version_match () { $db_version = floatval(CFG_VERSION); @@ -25,19 +25,19 @@ if ($db_version == floatval($file_version[0])) return true; else - return false; + return false; } function run_script ($script_name) { - $errors = array(); + $errors = array(); require (dirname(__FILE__).'/../admin/include/xml2array.inc.php'); $xmlparse = &new ParseXML; $xml = $xmlparse->GetXMLTree($script_name); - $queryerror = false; + $queryerror = false; $queries = $xml['COMOBLOG_UPGRADE'][0]['DBQUERY']; for ($c = 0; $c < count($queries); $c++) @@ -54,18 +54,18 @@ unset ($xmlparse); - return $errors; + return $errors; } function topic_details ($id) { $query = "select * from ".CFG_MYSQL_TABPREFIX."topics where topic_id = '".$id."'"; $res = mysql_query($query); - + if (!$res || !mysql_num_rows($res)) return (false); - + $topic = mysql_fetch_assoc($res); - + return ($topic); } @@ -73,7 +73,7 @@ function post_del ($post_id) { $query = "delete from ".CFG_MYSQL_TABPREFIX."posts where post_id = '".$post_id."'"; $res = mysql_query($query); - + $query = "select concat(img_id,'.',img_extension) as filename, concat(img_id,'_thumb.',img_extension) as thumbname from ".CFG_MYSQL_TABPREFIX."images where post_id = '".$post_id."'"; $res = mysql_query($query); @@ -85,7 +85,7 @@ if (file_exists(CFG_BASE_PATH.'/img/posts/'.$thumb_filename)) $unlink = @unlink (CFG_BASE_PATH.'/img/posts/'.$thumb_filename); } - + $query = "delete from ".CFG_MYSQL_TABPREFIX."images where post_id = '".$post_id."'"; $res = mysql_query($query); @@ -96,7 +96,7 @@ function posts_list ($offset, $howmany) { - + if (CFG_USE_PATH_INFO == 'no') $iisbug = '?'; else @@ -121,7 +121,7 @@ if (!$res || !mysql_num_rows($res)) return (false); - + $posts = array(); while ($row = mysql_fetch_array($res)) { $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; @@ -133,7 +133,7 @@ $row['post_trackback_list_rss'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$row['post_id'].'?__mode=rss'; $posts[] = $row; } - + return ($posts); } @@ -154,7 +154,7 @@ if (!$res || !mysql_num_rows($res)) return (false); - + $posts = array(); while ($row = mysql_fetch_array($res)) { $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; @@ -166,7 +166,7 @@ $row['post_trackback_list_rss'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$row['post_id'].'?__mode=rss'; $posts[] = $row; } - + return ($posts); } @@ -241,7 +241,7 @@ if (!$res || !mysql_num_rows($res)) return (false); - + $posts = array(); while ($row = mysql_fetch_array($res)) { $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; @@ -254,7 +254,7 @@ $row['post_mail_date_rss'] = gmstrftime("%a, %d %b %Y %T %Z",$row['post_mail_date']); $posts[] = $row; } - + return ($posts); } @@ -291,12 +291,12 @@ and p.post_mail_date < ".$end." group by p.post_id order by p.post_mail_date ".CFG_POST_SORT_ORDER." - "; + "; $res = mysql_query($query); - + if (!$res || !mysql_num_rows($res)) return (false); - + $posts = array(); while ($row = mysql_fetch_array($res)) { $row['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$row['post_id']; @@ -308,7 +308,7 @@ $row['post_trackback_list_rss'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$row['post_id'].'?__mode=rss'; $posts[] = $row; } - + return ($posts); } @@ -363,10 +363,10 @@ select p.*, FROM_UNIXTIME(p.post_mail_date) as post_mail_date_nice , - count(c.post_id) as post_comments, - count(tr.post_id) as post_trackback_pings, + count(c.post_id) as post_comments, + count(tr.post_id) as post_trackback_pings, t.topic_name, concat(t.img_id,'.',i.img_extension) as topic_img - from + from ".CFG_MYSQL_TABPREFIX."posts p left join ".CFG_MYSQL_TABPREFIX."comments c on p.post_id = c.post_id @@ -380,10 +380,10 @@ group by p.post_id "; $res = mysql_query($query); - + if (!$res || !mysql_num_rows($res)) return (false); - + $post = mysql_fetch_array($res); $post['post_permalink'] = CFG_SITE_URL.'post.php'.$iisbug.'/'.$post['post_id']; if (CFG_USE_FRIENDLY_URLS =="yes"){ @@ -392,7 +392,7 @@ $post['post_trackback_ping_url'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$post['post_id']; $post['post_trackback_list'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$post['post_id'].'?__mode=list'; $post['post_trackback_list_rss'] = CFG_SITE_URL.'trackback.php'.$iisbug.'/'.$post['post_id'].'?__mode=rss'; - + return ($post); } @@ -407,43 +407,43 @@ if (!$res || !mysql_num_rows($res)) return (false); - + return (true); } - +// ADDED IN 1.3 function get_commenter_approval_state($commenter_author_email){ - + // gets the default for people who have been recorded before, // returns "unknown_user" for people who it cant find - // and Y or N if it can. + // and Y or N if it can. $query = " select c.commenter_default from ".CFG_MYSQL_TABPREFIX."commenters c where c.commenter_author_email= '".addslashes($commenter_author_email)."'"; $res = mysql_query($query); - + if (!$res || !mysql_num_rows($res)){ return ("unknown_user"); } - + return mysql_query($res,0,0); - -} +} +// ADDED IN 1.3 function set_commenter_approval_state($commenter_author_email,$state){ - // empty place holder + // empty place holder $query =""; // find out if we know about the user already. if (get_commenter_approval_state($commenter_author_email) !="unknown_user"){ // if we do - update the record. $query ="update ".CFG_MYSQL_TABPREFIX."commenters " . "set commenter_default=''".addslashes($state)."'" . - "' where commenter_author_email= '".addslashes($commenter_author_email)."'"; + "' where commenter_author_email= '".addslashes($commenter_author_email)."'"; } - + else { - // if not - add a record + // if not - add a record $query = " insert into ".CFG_MYSQL_TABPREFIX."commenters (comment_author_email,commenter_default) @@ -453,18 +453,18 @@ ) "; } - + // run the query $res = mysql_query($query); - + if (!$res) return (false); - + $insert_id = mysql_insert_id(); - - return ($insert_id); - + + return ($insert_id); + } @@ -472,14 +472,14 @@ $comment['comment_author'] = clean_up_txt($comment['comment_author']); $comment['comment_author_email'] = clean_up_txt($comment['comment_author_email']); #$comment['comment_text'] = clean_up_txt($comment['comment_text']); - // optionally allow raw HTML to be entered into comments + // optionally allow raw HTML to be entered into comments // needs an additional filter to stip script tags etc? if ($comment['comment_convert'] != 'noconvert'){ $comment['comment_text'] = clean_up_txt($comment['comment_text']); } - + // ADDED IN 1.3 // first we get the default state for new comments if (CFG_COMMENTS_DEFAULT_STATE == 'yes'){ $comment['comment_live'] = "Y"; @@ -487,13 +487,13 @@ else { $comment['comment_live'] = "N"; } - + // then we check if we have seen them before if (get_commenter_approval_state($comment['comment_author_email']) !="unknown_user"){ $comment['comment_live'] =get_commenter_approval_state($comment['comment_author_email']); } - - + + // apply comment filters global $COMMENT_PRE_FILTERS; if (count($COMMENT_PRE_FILTERS) > 0) { @@ -508,7 +508,7 @@ values ( '".addslashes($comment['comment_author'])."', '".addslashes($comment['comment_author_email'])."', - '".addslashes($comment['comment_author_url'])."', + '".addslashes($comment['comment_author_url'])."', '".addslashes($comment['comment_text'])."', '".time()."', '".$comment['post_id']."', @@ -516,12 +516,12 @@ ) "; $res = mysql_query($query); - + if (!$res) return (false); - + $comment['comment_id'] = mysql_insert_id(); - + // apply comment filters global $COMMENT_POST_FILTERS; if (count($COMMENT_POST_FILTERS) > 0) { @@ -529,8 +529,8 @@ include_once (CFG_BASE_PATH.'/modules/'.$COMMENT_POST_FILTERS[$comment_cnt].'/'.$COMMENT_POST_FILTERS[$comment_cnt].'_comment_filter.php'); } } - - + + return ($comment); } @@ -542,20 +542,20 @@ order by c.comment_added ". CFG_COMMENT_SORT_ORDER . " "; $res = mysql_query($query); - + if (!$res || !mysql_num_rows($res)) return (false); - + $c = 0; while ($row = mysql_fetch_array($res)) { $comments[$c] = $row; $comments[$c]['comment_date'] = getdate($row['comment_added']); if ($comments[$c]['comment_date']['hours'] < 10) $comments[$c]['comment_date']['hours'] = '0'.$comments[$c]['comment_date']['hours']; - if ($comments[$c]['comment_date']['minutes'] < 10) $comments[$c]['comment_date']['minutes'] = '0'.$comments[$c]['comment_date']['minutes']; + if ($comments[$c]['comment_date']['minutes'] < 10) $comments[$c]['comment_date']['minutes'] = '0'.$comments[$c]['comment_date']['minutes']; $c++; } - + return ($comments); } @@ -565,7 +565,7 @@ $query = " insert into ".CFG_MYSQL_TABPREFIX."trackback_pings (trackback_title, trackback_excerpt, trackback_url, trackback_blog_name, trackback_added, post_id) - values + values ('".addslashes($trackback['trackback_title']) ."', '".addslashes($trackback['trackback_excerpt']) ."', '".addslashes($trackback['trackback_url']) ."', @@ -574,12 +574,12 @@ '".$trackback['post_id'] ."') "; $res = mysql_query($query); - + if (!$res) return (false); - + $trackback_id = mysql_insert_id(); - + return ($trackback_id); } @@ -611,14 +611,14 @@ order by tr.trackback_added desc "; $res = mysql_query($query); - - if (!$res || !mysql_num_rows($res)) + + if (!$res || !mysql_num_rows($res)) return (false); - + $trackback_pings = array(); while ($row = mysql_fetch_assoc($res)) $trackback_pings[] = $row; - + return ($trackback_pings); } @@ -629,16 +629,16 @@ if (empty($email)) return (false); - if (eregi('(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)',$email) || !eregi ('^.+\@(\[?)[-a-zA-Z0-9\.]+\.([a-zA-Z]{2,3}|[0,9]{1,3})(\]?)$',$email)) { - return (false); - } - else { - list($user,$domain)=explode('@',$email); - if ((!eregi('^[a-zA-Z0-9\.\-]+$',$user)) || (!eregi('^[a-zA-Z0-9\.\-]+$',$domain))) { - return (false); + if (eregi('(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)',$email) || !eregi ('^.+\@(\[?)[-a-zA-Z0-9\.]+\.([a-zA-Z]{2,3}|[0,9]{1,3})(\]?)$',$email)) { + return (false); + } + else { + list($user,$domain)=explode('@',$email); + if ((!eregi('^[a-zA-Z0-9\.\-]+$',$user)) || (!eregi('^[a-zA-Z0-9\.\-]+$',$domain))) { + return (false); } - else { - return (true); + else { + return (true); } } } @@ -659,7 +659,7 @@ else { $outstr = eregi_replace( "([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_\.a-z]{2,6})", '\\1 [at] \\2 [dot] \\3', $instr); } - + return ($outstr); } @@ -678,26 +678,26 @@ function clean_up_html ($contents, $mailto = false) { // strip tags $contents = preg_replace("'<!doctype[^>]*?>'si", "", $contents); // <!DOCTYPE - + $contents = preg_replace("'<body[^>]*?>'si", "", $contents); // <body $contents = eregi_replace ("</body>", "", $contents); - + $contents = preg_replace("'<html[^>]*?>'si", "", $contents); // <html - $contents = eregi_replace ("</html>", "", $contents); - + $contents = eregi_replace ("</html>", "", $contents); + $contents = preg_replace("'<link[^>]*?>'si", "", $contents); // <link - + // strip tags with content $contents = preg_replace("'<head[^>]*?>.*?</head>'si", "", $contents); // <head - + $contents = preg_replace("'<meta[^>]*?>.*?</meta>'si", "", $contents); // <meta - + $contents = preg_replace("'<script[^>]*?>.*?</script>'si", "", $contents); // <script - + $contents = preg_replace("'<style[^>]*?>.*?</style>'si", "", $contents); // <style - + $contents = preg_replace("'<title[^>]*?>.*?</title>'si", "", $contents); // <title - + // anti-spam $contents = antispam ($contents, $mailto); @@ -706,7 +706,7 @@ } function filter_html($body) -{ +{ $search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags "'([\r\n])[\s]+'", // Strip out white space @@ -737,7 +737,7 @@ $body = preg_replace($search, $replace, $body); return $body; -} +} function create_thumbnail ($img_id, $img_ext, $maxwidth, $maxheight, $gd_version) { Index: config.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/include/config.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config.inc.php 15 Aug 2006 16:56:31 -0000 1.3 +++ config.inc.php 16 Aug 2006 01:12:41 -0000 1.4 @@ -1,6 +1,12 @@ <?php error_reporting (E_ALL ^ E_NOTICE); -require_once (dirname(__FILE__).'/param.inc.php'); +// ADDED IN 1.3 +/* TODO: we need to make sure that the upgrade will copy the file to this location + * previous versions just used param.inc.php, but thats a real bitch when you develope locally + * and deploy to your live site, as at some point the db and file path permissions will get copied up + * + */ +require_once (dirname(__FILE__).'/param.inc.'. $_SERVER['SERVER_NAME'].'.php'); // connect to db mysql_connect (CFG_MYSQL_HOST, CFG_MYSQL_USERNAME, CFG_MYSQL_PASSWORD) or die ('Error connecting to mySQL server'); @@ -49,7 +55,13 @@ $SIDEBAR_MODULES = array(); $POST_PRE_FILTERS = array(); $POST_POST_FILTERS = array(); -$COMMENT_FILTERS = array(); + + +// ADDED IN 1.3 +/* + * Comments now have pre and post filters + */ +//TODO: Check these work correctly - old ones should default to pre as thats what they originally did $COMMENT_PRE_FILTERS = array(); $COMMENT_POST_FILTERS = array(); $query = " @@ -63,12 +75,12 @@ if ($res) { while ($row = mysql_fetch_assoc($res)) { if ($row['mod_pos'] == 'sidebar') { - $SIDEBAR_MODULES[] = $row['mod_name']; + $SIDEBAR_MODULES[] = $row['mod_name']; } elseif ($row['mod_pos'] == 'top') { $TOP_MODULES[] = $row['mod_name']; } - + if ($row['mod_filter_posts'] == 'Y'){ $POST_PRE_FILTERS[] = $row['mod_name']; } @@ -80,9 +92,9 @@ } else if ($row['mod_filter_comments'] == 'O'){ $COMMENT_POST_FILTERS[] = $row['mod_name']; - } - - + } + + } } ?> |
|
From: iamdecal <iam...@us...> - 2006-08-16 01:12:45
|
Update of /cvsroot/comoblog/comoblog/_install In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2807/_install Modified Files: comoblog_preferences.xml step_1.php Log Message: added update for 1,2 to 1.3 - a few comments to help with releases //ADDED in 1.3 for new code //TODO for things that still need to be looked at Index: comoblog_preferences.xml =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/comoblog_preferences.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- comoblog_preferences.xml 16 Aug 2006 00:29:45 -0000 1.17 +++ comoblog_preferences.xml 16 Aug 2006 01:12:41 -0000 1.18 @@ -1,9 +1,9 @@ <comoblog_preferences> - - <param + + <param name="CFG_VERSION" - value="1.2" + value="1.3" description="CoMoblog version number" topic_id="0" [...997 lines suppressed...] name="CFG_FOOTER_FONT_FAMILY" value="Verdana,Arial,Helvetica,sans-serif" @@ -1393,7 +1393,7 @@ editable="Y" display_order="" /> - + <param name="CFG_FOOTER_FONT_SIZE" value="10" @@ -1406,7 +1406,7 @@ editable="Y" display_order="" /> - + <param name="CFG_FOOTER_FONT_STYLE" value="italic" Index: step_1.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/step_1.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- step_1.php 9 Oct 2005 14:11:35 -0000 1.4 +++ step_1.php 16 Aug 2006 01:12:41 -0000 1.5 @@ -2,7 +2,7 @@ /* database configuration */ - + @ignore_user_abort(true); @set_time_limit(300); session_start(); @@ -17,47 +17,47 @@ if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') { - + // check form foreach ($_POST as $k => $v) { $_POST[$k] = trim($v); } - + $errors = array(); - + if ($_POST['mysql_host'] == '') $errors[] = 'mySQL host name required'; - + if ($_POST['mysql_username'] == '') $errors[] = 'mySQL username required'; - + if ($_POST['mysql_password'] != $_POST['mysql_password_cfr']) $errors[] = 'mySQL password mismatch'; - + if ($_POST['mysql_dbname'] == '') $errors[] = 'mySQL database name required'; - + if ($_POST['mysql_tabprefix'] == '') $errors[] = 'mySQL tab prefix required'; - - + + if (count($errors) == 0) { // test db connection - + $_POST['mysql_tabprefix'] = eregi_replace(" +", "_", $_POST['mysql_tabprefix']); $_POST['mysql_tabprefix'] = eregi_replace("\.+", "_", $_POST['mysql_tabprefix']); $_POST['mysql_tabprefix'] = eregi_replace(";+", "_", $_POST['mysql_tabprefix']); $_POST['mysql_tabprefix'] = eregi_replace(":+", "_", $_POST['mysql_tabprefix']); - + $dbconn = @mysql_connect ($_POST['mysql_host'], $_POST['mysql_username'], $_POST['mysql_password']); if (!$dbconn) { $errors[] = 'Error connecting to mySQL server'; $errors[] = 'error reported: ' . mysql_error(); } - + $selectdb = @mysql_select_db ($_POST['mysql_dbname']); if (!$selectdb) - $errors[] = 'Error selecting database (check database name)'; + $errors[] = 'Error selecting database (check database name)'; $query = "select pref_value from ".$_POST['mysql_tabprefix']."preferences where pref_name='CFG_VERSION'"; $res = mysql_query($query); @@ -74,31 +74,31 @@ $config = str_replace('{##MYSQL_DBNAME##}', $_POST['mysql_dbname'], $config); $config = str_replace('{##MYSQL_TABPREFIX##}', $_POST['mysql_tabprefix'], $config); - $fp = fopen(dirname(__FILE__).'/../include/param.inc.php', 'w'); + $fp = fopen(dirname(__FILE__).'/../include/param.inc.'. $_SERVER['SERVER_NAME'].'.php', 'w'); fwrite($fp, $config); fclose($fp); - @chmod (dirname(__FILE__).'/../include/param.inc.php', 0600); - + @chmod (dirname(__FILE__).'/../include/param.inc.'. $_SERVER['SERVER_NAME'].'.php', 0600); + header ('Location: upgrade_0.php'); - exit; - } + exit; + } } - if (count($errors) == 0) { + if (count($errors) == 0) { require (dirname(__FILE__).'/../admin/include/xml2array.inc.php'); $xmlparse = &new ParseXML; $xml = $xmlparse->GetXMLTree('comoblog_db.xml'); $queryerror = false; - + // generate queries $tables = $xml['COMOBLOG_DB'][0]['TABLE']; for ($c = 0; $c < count($tables); $c++) { $table_name = $tables[$c]['ATTRIBUTES']['NAME']; $table_name = str_replace('comoblog_', $_POST['mysql_tabprefix'], $table_name); - $query = "CREATE TABLE `".$table_name."` (\n"; + $query = "CREATE TABLE `".$table_name."` (\n"; $fields = $tables[$c]['FIELD']; for ($f = 0; $f < count($fields); $f++) { $field_name = $fields[$f]['ATTRIBUTES']['NAME']; @@ -116,10 +116,10 @@ $query .= ",\nUNIQUE KEY (`".$uk."`)"; } $query .= "\n) TYPE=MyISAM\n"; - + // execute CREATE TABLE query $result = mysql_query($query); - + if (!$result) { $queryerror = true; } @@ -147,13 +147,13 @@ // execute INSERT query $result = mysql_query($query); - + if (!$result) { $queryerror = true; } } } - + // comoblog_preferences unset ($xmlparse); $xmlparse = &new ParseXML; @@ -170,16 +170,16 @@ $pref_accept_null = addslashes($preferences[$c]['ATTRIBUTES']['ACCEPT_NULL']); $pref_editable = addslashes($preferences[$c]['ATTRIBUTES']['EDITABLE']); $pref_display_order = addslashes($preferences[$c]['ATTRIBUTES']['DISPLAY_ORDER']); - + $query = "INSERT INTO `".$_POST['mysql_tabprefix']."preferences` (pref_name,pref_value,pref_description,pref_topic_id,pref_encrypt,pref_type,pref_restrict_values,pref_accept_null,pref_editable,pref_display_order) VALUES ('".$pref_name."','".$pref_value."','".$pref_description."','".$pref_topic_id."','".$pref_encrypt."','".$pref_type."','".$pref_restrict_values."','".$pref_accept_null."','".$pref_editable."','".$pref_display_order."')"; $result = mysql_query($query); - + if (!$result) { $queryerror = true; } } - + if ($queryerror === true) {// if query failed, delete all tables (prefixed by tab_prefix) and print error $sql2 = 'show tables from '.$_POST['mysql_dbname']; $res2 = mysql_query($sql2); @@ -188,7 +188,7 @@ mysql_query('drop table '.$row[0]); } $errors[] = 'Error creating mySQL tables'; - + mysql_close(); } else { @@ -201,13 +201,13 @@ $config = str_replace('{##MYSQL_PASSWORD##}', $_POST['mysql_password'], $config); $config = str_replace('{##MYSQL_DBNAME##}', $_POST['mysql_dbname'], $config); $config = str_replace('{##MYSQL_TABPREFIX##}', $_POST['mysql_tabprefix'], $config); - + $fp = fopen(dirname(__FILE__).'/../include/param.inc.php', 'w'); fwrite($fp, $config); fclose($fp); - + @chmod (dirname(__FILE__).'/../include/param.inc.php', 0600); - + // redirect to step 2 $_SESSION['step'] = 1; Header ('Location: step_2.php'); |