[Comoblog-commit] comoblog/admin post_add.php,1.1.1.1,1.2 post_edit.php,1.1.1.1,1.2
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-10-05 00:45:48
|
Update of /cvsroot/comoblog/comoblog/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14199/admin Modified Files: post_add.php post_edit.php Log Message: Added functionality to allow pre and post database save post filtering. This is prework for the mod_search module Index: post_add.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/admin/post_add.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- post_add.php 16 Aug 2005 05:49:44 -0000 1.1.1.1 +++ post_add.php 5 Oct 2005 00:45:34 -0000 1.2 @@ -48,9 +48,9 @@ } // apply post filters - if (count($POST_FILTERS) > 0) { - for ($filter_cnt = 0; $filter_cnt < count($POST_FILTERS); $filter_cnt++) { - include_once (CFG_BASE_PATH.'/modules/'.$POST_FILTERS[$filter_cnt].'/'.$POST_FILTERS[$filter_cnt].'_post_filter.php'); + 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'); } } @@ -78,6 +78,13 @@ $post['post_id'] = mysql_insert_id(); + // 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'); + } + } + for ($i = 0; $i < count($images); $i++) { $query = "insert into ".CFG_MYSQL_TABPREFIX."images (img_mime,img_extension,post_id,img_display,img_thumb) values ('".$images[$i]['ctype']."','".$images[$i]['ext']."','".$post['post_id']."','attach','N')"; Index: post_edit.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/admin/post_edit.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- post_edit.php 16 Aug 2005 05:49:44 -0000 1.1.1.1 +++ post_edit.php 5 Oct 2005 00:45:34 -0000 1.2 @@ -79,9 +79,9 @@ } // apply post filters - if (count($POST_FILTERS) > 0) { - for ($filter_cnt = 0; $filter_cnt < count($POST_FILTERS); $filter_cnt++) { - include_once (CFG_BASE_PATH.'/modules/'.$POST_FILTERS[$filter_cnt].'/'.$POST_FILTERS[$filter_cnt].'_post_filter.php'); + 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'); } } @@ -102,6 +102,13 @@ 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(); |