diff --git a/e107_plugins/content/admin_content_config.php b/e107_plugins/content/admin_content_config.php index 3072009e7..53597a344 100644 --- a/e107_plugins/content/admin_content_config.php +++ b/e107_plugins/content/admin_content_config.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/admin_content_config.php,v $ -| $Revision: 1.6 $ -| $Date: 2007-03-13 16:51:05 $ +| $Revision: 1.7 $ +| $Date: 2008-12-29 20:53:24 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -108,8 +108,11 @@ if(isset($delete) && $delete == 'cat'){ //delete content item if(isset($delete) && $delete == 'content'){ if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ - $e107cache->clear($plugintable); $message = CONTENT_ADMIN_ITEM_LAN_3; + global $e_event; + $data = array('method'=>'delete', 'table'=>$plugintable, 'id'=>$del_id, 'plugin'=>'content', 'function'=>'delete_content'); + $message .= $e_event->triggerHook($data); + $e107cache->clear($plugintable); } } diff --git a/e107_plugins/content/content_shortcodes.php b/e107_plugins/content/content_shortcodes.php index 4ffa4cbe5..a58d1a001 100644 --- a/e107_plugins/content/content_shortcodes.php +++ b/e107_plugins/content/content_shortcodes.php @@ -4,6 +4,11 @@ include_once(e_HANDLER.'shortcode_handler.php'); $content_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__); /* +SC_BEGIN CONTENTFORM_HOOK +global $CONTENTFORM_HOOK; +return $CONTENTFORM_HOOK; +SC_END + SC_BEGIN CM_AMOUNT global $row, $tp, $content_pref; if($sc_mode){ diff --git a/e107_plugins/content/e_tagwords.php b/e107_plugins/content/e_tagwords.php new file mode 100644 index 000000000..89c3ad16a --- /dev/null +++ b/e107_plugins/content/e_tagwords.php @@ -0,0 +1,48 @@ +settings = array(); + + $this->settings['plugin'] = "content"; + $this->settings['table'] = "pcontent"; + $this->settings['db_id'] = "content_id"; + $this->settings['caption'] = "content"; + } + + function getLink($id) + { + global $tp; + if($this->row=='') + { + $this->row = $this->getRecord($id); + } + $url = e_PLUGIN."content/content.php?content.{$this->row['content_id']}"; + return "".$tp->toHTML($this->row['content_heading'], TRUE, '').""; + } + + function getRecord($id) + { + global $sql; + + $this->row = ''; + + $qry = "SELECT c.* + FROM #pcontent as c + WHERE c.content_id='{$id}' AND c.content_refer !='sa' + AND c.content_datestamp < ".time()." AND (c.content_enddate=0 || c.content_enddate>".time().") + AND c.content_class REGEXP '".e_CLASS_REGEXP."' "; + + if($sql->db_Select_gen($qry)) + { + $this->row=$sql->db_Fetch(); + } + return $this->row; + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_db_class.php b/e107_plugins/content/handlers/content_db_class.php index 166215f05..a568663ca 100644 --- a/e107_plugins/content/handlers/content_db_class.php +++ b/e107_plugins/content/handlers/content_db_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_db_class.php,v $ -| $Revision: 1.10 $ -| $Date: 2008-10-07 19:22:20 $ -| $Author: e107steved $ +| $Revision: 1.11 $ +| $Date: 2008-12-29 20:53:24 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -294,13 +294,16 @@ class contentdb{ $refer = ""; } $sql -> db_Insert($plugintable, "'0', '".$_POST['content_heading']."', '".$_POST['content_subheading']."', '".$_POST['content_summary']."', '".$_POST['content_text']."', '".$tp->toDB($author)."', '".$icon."', '".$totalattach."', '".$totalimages."', '".$_POST['parent']."', '".intval($_POST['content_comment'])."', '".intval($_POST['content_rate'])."', '".intval($_POST['content_pe'])."', '".$refer."', '".$starttime."', '".$endtime."', '".$_POST['content_class']."', '".$contentprefvalue."', '0', '".intval($_POST['content_score'])."', '".$_POST['content_meta']."', '".$_POST['content_layout']."' "); - + $id = mysql_insert_id(); $e107cache->clear("$plugintable"); //trigger event for notify $edata_cs = array("content_heading" => $_POST['content_heading'], "content_subheading" => $_POST['content_subheading'], "content_author" => $_POST['content_author_name']); $e_event->trigger("content", $edata_cs); + $data = array('method'=>'create', 'table'=>$plugintable, 'id'=>$id, 'plugin'=>'content', 'function'=>'dbContent'); + $message = $e_event->triggerHook($data); + if(!$type || $type == "admin"){ js_location(e_SELF."?".e_QUERY.".cc"); }elseif($type == "contentmanager"){ @@ -321,6 +324,10 @@ class contentdb{ $e107cache->clear("$plugintable"); $e107cache->clear("comment.$plugintable.{$_POST['content_id']}"); + + $data = array('method'=>'update', 'table'=>$plugintable, 'id'=>$_POST['content_id'], 'plugin'=>'content', 'function'=>'dbContent'); + $message = $e_event->triggerHook($data); + if(!$type || $type == "admin"){ js_location(e_SELF."?".e_QUERY.".cu"); }elseif($type == "contentmanager"){ diff --git a/e107_plugins/content/handlers/content_form_class.php b/e107_plugins/content/handlers/content_form_class.php index dd4112723..cd7cea650 100644 --- a/e107_plugins/content/handlers/content_form_class.php +++ b/e107_plugins/content/handlers/content_form_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $ -| $Revision: 1.21 $ -| $Date: 2008-11-20 20:35:10 $ -| $Author: e107steved $ +| $Revision: 1.22 $ +| $Date: 2008-12-29 20:53:24 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -213,7 +213,7 @@ class contentform{ } function show_create_content($mode, $userid="", $username=""){ - global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $content_shortcodes, $content_pref, $plugintable, $plugindir, $pref, $eArrayStorage, $message, $row, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id, $months, $ne_day, $ne_month, $ne_year, $current_year, $end_day, $end_month, $end_year, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image, $iconlist, $checkattachnumber, $filelist, $checkimagesnumber, $imagelist, $CONTENTFORM_CATEGORY, $CONTENTFORM_CUSTOM, $CONTENTFORM_CUSTOM_KEY, $CONTENTFORM_CUSTOM_VALUE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, $CONTENTFORM_PRESET, $CONTENT_ADMIN_CONTENT_CREATE, $CONTENT_ADMIN_BUTTON; + global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $content_shortcodes, $content_pref, $plugintable, $plugindir, $pref, $eArrayStorage, $message, $row, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id, $months, $ne_day, $ne_month, $ne_year, $current_year, $end_day, $end_month, $end_year, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image, $iconlist, $checkattachnumber, $filelist, $checkimagesnumber, $imagelist, $CONTENTFORM_CATEGORY, $CONTENTFORM_CUSTOM, $CONTENTFORM_CUSTOM_KEY, $CONTENTFORM_CUSTOM_VALUE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, $CONTENTFORM_PRESET, $CONTENT_ADMIN_CONTENT_CREATE, $CONTENT_ADMIN_BUTTON, $e_event; $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); @@ -786,6 +786,10 @@ class contentform{ } } + global $CONTENTFORM_HOOK; + $data = array('method'=>'form', 'table'=>$plugintable, 'id'=>$row['content_id'], 'plugin'=>'content', 'function'=>'create_item'); + $CONTENTFORM_HOOK = $e_event->triggerHook($data); + $button = ($hidden ? $hidden : ""); if($qs[1] == "edit" || $qs[1] == "sa" ){ if($qs[1] == "sa"){