mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 03:10:50 +02:00
e_tagwords + triggerHook added to content
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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){
|
||||
|
48
e107_plugins/content/e_tagwords.php
Normal file
48
e107_plugins/content/e_tagwords.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class e_tagwords_content
|
||||
{
|
||||
function e_tagwords_content()
|
||||
{
|
||||
$this->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 "<a href='".$url."'>".$tp->toHTML($this->row['content_heading'], TRUE, '')."</a>";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -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"){
|
||||
|
@@ -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"){
|
||||
|
Reference in New Issue
Block a user