1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

comment_menu - 0.8 aware

This commit is contained in:
secretr
2009-10-08 10:53:02 +00:00
parent 885a966161
commit f57a35bd04
4 changed files with 101 additions and 90 deletions

View File

@@ -1,47 +1,54 @@
<?php
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:52 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
* e107 website system
*
* Copyright (C) 2001-2008 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Comment menu
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu.php,v $
* $Revision: 1.2 $
* $Date: 2009-10-08 10:53:02 $
* $Author: secretr $
*/
if (!defined('e107_INIT')) { exit; }
if (!defined('e107_INIT'))
{
exit;
}
require_once(e_PLUGIN."comment_menu/comment_menu_shortcodes.php");
require_once(e_HANDLER."comment_class.php");
$cobj = new comment;
require_once (e_PLUGIN."comment_menu/comment_menu_shortcodes.php");
if (file_exists(THEME."comment_menu_template.php")){
require_once(THEME."comment_menu_template.php");
}else{
require_once(e_PLUGIN."comment_menu/comment_menu_template.php");
$cobj = e107::getObject('comment');
//require_once (e_HANDLER."comment_class.php");
//$cobj = new comment;
if (file_exists(THEME."comment_menu_template.php"))
{
require_once (THEME."comment_menu_template.php");
}
else
{
require_once (e_PLUGIN."comment_menu/comment_menu_template.php");
}
$data = $cobj->getCommentData(intval($menu_pref['comment_display']));
$text = '';
// no posts yet ..
if(empty($data) || !is_array($data)){
if (empty($data) || !is_array($data))
{
$text = CM_L1;
}
global $row;
foreach($data as $row){
foreach ($data as $row)
{
e107::setRegistry('plugin/comment_menu/current', $row);
$text .= $tp->parseTemplate($COMMENT_MENU_TEMPLATE, true, $comment_menu_shortcodes);
}
e107::setRegistry('plugin/comment_menu/current', null);
$ns->tablerender($menu_pref['comment_caption'], $text, 'comment');
e107::getRender()->tablerender($menu_pref['comment_caption'], $text, 'comment_menu');
?>

View File

@@ -1,25 +1,23 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu_shortcodes.php,v $
| $Revision: 1.4 $
| $Date: 2009-08-23 10:57:51 $
| $Author: marj_nl_fr $
+----------------------------------------------------------------------------+
* e107 website system
*
* Copyright (C) 2001-2008 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Comment menu shortcodes
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu_shortcodes.php,v $
* $Revision: 1.5 $
* $Date: 2009-10-08 10:53:02 $
* $Author: secretr $
*/
if (!defined('e107_INIT')) { exit; }
global $tp;
$comment_menu_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
e107::getRegistry('plugin/comment_menu/current');
/*
SC_BEGIN CM_ICON
//TODO review bullet
@@ -36,38 +34,39 @@ return $bullet;
SC_END
SC_BEGIN CM_DATESTAMP
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
$gen = new convert;
return $gen->convert_date($row['comment_datestamp'], "short");
SC_END
SC_BEGIN CM_HEADING
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
return $row['comment_title'];
SC_END
SC_BEGIN CM_URL_PRE
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
return ($row['comment_url'] ? "<a href='".$row['comment_url']."'>" : "");
SC_END
SC_BEGIN CM_URL_POST
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
return ($row['comment_url'] ? "</a>" : "");
SC_END
SC_BEGIN CM_TYPE
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
return $row['comment_type'];
SC_END
SC_BEGIN CM_AUTHOR
global $row;
$row = e107::getRegistry('plugin/comment_menu/current');
return $row['comment_author'];
SC_END
SC_BEGIN CM_COMMENT
global $row, $menu_pref, $pref, $tp;
global $menu_pref, $pref, $tp;
$row = e107::getRegistry('plugin/comment_menu/current');
$COMMENT = '';
if($menu_pref['comment_characters']>0)
{

View File

@@ -1,20 +1,17 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu_template.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:52 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
* e107 website system
*
* Copyright (C) 2001-2008 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Comment menu default template
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/comment_menu_template.php,v $
* $Revision: 1.2 $
* $Date: 2009-10-08 10:53:02 $
* $Author: secretr $
*/
$sc_style['CM_TYPE']['pre'] = "[";

View File

@@ -9,9 +9,9 @@
* Plugin Administration - Comment menu
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/config.php,v $
* $Revision: 1.2 $
* $Date: 2008-12-21 12:53:48 $
* $Author: e107steved $
* $Revision: 1.3 $
* $Date: 2009-10-08 10:53:02 $
* $Author: secretr $
*
*/
$eplug_admin = TRUE;
@@ -26,68 +26,75 @@ if (!getperms("1"))
}
require_once(e_ADMIN."auth.php");
$menu_config = e107::getConfig('menu');
if (isset($_POST['update_menu']))
{
$temp = array();
$temp = $old = $menu_config->getPref();
$tp = e107::getParser();
while (list($key, $value) = each($_POST))
{
if ($value != CM_L9)
{
$temp[$key] = $value;
$temp[$tp->toDB($key)] = $tp->toDB($value);
}
}
if (!$_POST['comment_title'])
{
$temp['comment_title'] = 0;
}
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_04'))
{
$tmp = addslashes(serialize($menu_pref));
$sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='menu_pref' ");
}
$ns->tablerender("", "<div style=\"text-align:center\"><b>".CM_L10."</b></div>");
}
$menu_config->setPref($temp);
if ($admin_log->logArrayDiffs($old, $menu_config->getPref(), 'MISC_04'))
{
if($menu_config->save(false))
{
e107::getMessage()->add(CM_L10, E_MESSAGE_SUCCESS);
}
}
else
{
e107::getMessage()->add(LAN_NO_CHANGE);
}
}
// TODO - 0.8 aware markup, e_form usage
$text = "<div style='text-align:center'>
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" id=\"plugin-menu-config-form\">
<table style=\"width:85%\" class=\"fborder\" >
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L3.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_pref['comment_caption']."\" maxlength=\"100\" />
<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_config->get('comment_caption')."\" maxlength=\"100\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L4.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_pref['comment_display']."\" maxlength=\"2\" />
<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_config->get('comment_display')."\" maxlength=\"2\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L5.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_pref['comment_characters']."\" maxlength=\"4\" />
<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_config->get('comment_characters')."\" maxlength=\"4\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L6.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_pref['comment_postfix']."\" maxlength=\"200\" />
<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_config->get('comment_postfix')."\" maxlength=\"200\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L7.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input type=\"checkbox\" name=\"comment_title\" value=\"1\"";
if ($menu_pref['comment_title']) {
$text .= " checked ";
}
$text .= " />
<input type=\"checkbox\" name=\"comment_title\" value=\"1\"".($menu_config->get('comment_title') ? ' checked="checked"' : '')." />
</td>
</tr>
@@ -97,6 +104,7 @@ $text .= " />
</table>
</form>
</div>";
$ns->tablerender(CM_L8, $text);
e107::getRender()->tablerender(CM_L8, e107::getMessage()->render().$text);
require_once(e_ADMIN."footer.php");
?>