22 include __DIR__ .
'/header.php';
30 $op =
$system->cleanVars($_REQUEST,
'op',
'default',
'string');
32 $xoops->header(
'admin:comments/comments.tpl');
41 COMMENTS_PENDING =>
'<span style="text-decoration: none; font-weight: bold; color: #008000;">' .
_MD_COMMENTS_PENDING .
'</span>',
42 COMMENTS_ACTIVE =>
'<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' .
_MD_COMMENTS_ACTIVE .
'</span>',
43 COMMENTS_HIDDEN =>
'<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' .
_MD_COMMENTS_HIDDEN .
'</span>'
49 $status = (!isset($_REQUEST[
'status']) || !in_array(intval($_REQUEST[
'status']), array_keys(
$status_array))) ? 0
50 : intval($_REQUEST[
'status']);
52 $module = !isset($_REQUEST[
'module']) ? 0 : intval($_REQUEST[
'module']);
69 $id =
$system->cleanVars($_GET,
'item_id', 0,
'int');
72 if (is_object($comment)) {
76 header(
'Location: ' . \
XoopsBaseConfig::get(
'url') .
'/modules/' .
$module->getVar(
'dirname') .
'/' . $plugin->pageName() .
'?' . $plugin->itemName() .
'=' . $comment->getVar(
'itemid') .
'&id=' . $comment->getVar(
'id') .
'&rootid=' . $comment->getVar(
'rootid') .
'&mode=thread&' . str_replace(
'&',
'&', $comment->getVar(
'exparams')) .
'#comment' . $comment->getVar(
'id'));
83 case 'comments_form_purge':
95 $groupe_select->setExtra(
"style=\"width:170px;\" ");
96 $form_purge->addElement($groupe_select);
102 $form_purge->addElement(
$status,
true);
108 $form_purge->addElement(
$modules,
true);
109 $form_purge->addElement(
new Xoops\Form\Hidden(
"op",
"comments_purge"));
111 $xoops->tpl()->assign(
'form', $form_purge->render());
114 case 'comments_purge':
117 if (isset($_POST[
'comments_after']) && isset($_POST[
'comments_before'])) {
118 if ($_POST[
'comments_after'] != $_POST[
'comments_before']) {
119 $after =
$system->cleanVars($_POST,
'comments_after', time(),
'date');
120 $before =
$system->cleanVars($_POST,
'comments_before', time(),
'date');
130 $modid =
$system->cleanVars($_POST,
'comments_modules', 0,
'int');
135 $comments_status =
$system->cleanVars($_POST,
'comments_status', 0,
'int');
136 if ($comments_status > 0) {
140 $comments_userid =
$system->cleanVars($_POST,
'comments_userid',
'',
'string');
141 if ($comments_userid !=
'') {
142 foreach ($_REQUEST[
'comments_userid'] as $del) {
147 $comments_groupe =
$system->cleanVars($_POST,
'comments_groupe',
'',
'string');
148 if ($comments_groupe !=
'') {
149 foreach ($_POST[
'comments_groupe'] as $del => $u_name) {
152 $mcount = count($members);
153 if ($mcount > 4000) {
156 for (
$i = 0;
$i < $mcount; ++
$i) {
162 if (isset($_POST[
'commentslist_id'])) {
163 $commentslist_count = (!empty($_POST[
'commentslist_id']) && is_array($_POST[
'commentslist_id']))
164 ? count($_POST[
'commentslist_id']) : 0;
165 if ($commentslist_count > 0) {
166 for (
$i = 0;
$i < $commentslist_count; ++
$i) {
172 if ($verif ==
true) {
186 $comments_Handler =
$helper->getHandlerComment();
187 $comments_module =
'';
188 $comments_status =
'';
191 $comments_module =
$system->cleanVars($_REQUEST,
'comments_module', 0,
'int');
192 if ($comments_module > 0) {
194 $comments_module = $_REQUEST[
'comments_module'];
196 $comments_status =
$system->cleanVars($_REQUEST,
'comments_status', 0,
'int');
197 if ($comments_status > 0) {
199 $comments_status = $_REQUEST[
'comments_status'];
205 $comments_count = $comments_Handler->getCount(
$criteria);
207 $xoops->tpl()->assign(
'comments_count', $comments_count);
209 $comments_arr = array();
212 if ($comments_count > 0) {
213 $comments_start =
$system->cleanVars($_REQUEST,
'comments_start', 0,
'int');
214 $comments_limit =
$system->cleanVars($_REQUEST,
'comments_limit', 0,
'int');
216 $comments_limit =
$helper->getConfig(
'com_pager');
221 $comments_arr = $comments_Handler->getObjects(
$criteria,
true);
225 $form =
'<form class="form-inline" action="' .
$url .
'" method="post">
226 <select class="span2" name="comments_module">';
231 $sel =
' selected="selected"';
233 $form .=
'<option value="' . $k .
'"' .
$sel .
'>' . $v .
'</option>';
235 $form .=
'</select> <select class="span2" name="comments_status">';
240 $sel =
' selected="selected"';
242 $form .=
'<option value="' . $k .
'"' .
$sel .
'>' . $v .
'</option>';
246 $form .=
'</select> <select class="span2" name="comments_limit">';
250 $sel =
' selected="selected"';
252 $form .=
'<option value="' . $k .
'"' .
$sel .
'>' . $k .
'</option>';
254 $form .=
'</select> <input class ="btn" type="submit" value="' .
XoopsLocale::A_GO .
'" name="selsubmit" /></form>';
257 $xoops->tpl()->assign(
'php_selft',
$_SERVER[
'PHP_SELF'] .
'?op=comments_purge');
259 if ($comments_count > 0) {
260 foreach (array_keys($comments_arr) as
$i) {
261 $id = $comments_arr[
$i]->getVar(
'id');
262 $comments_poster_uname =
$xoops->getConfig(
'anonymous');
263 if ($comments_arr[$i]->getVar(
'uid') > 0) {
265 if (is_object($poster)) {
266 $comments_poster_uname =
'<a href="' .
\XoopsBaseConfig::get(
'url') .
'/userinfo.php?uid=' . $comments_arr[
$i]->getVar(
'uid') .
'">' . $poster->getVar(
'uname') .
'</a>';
270 $comments_icon = ($comments_arr[
$i]->getVar(
'icon') ==
'') ?
'/images/icons/no_posticon.gif'
271 :
'/images/subject/' . htmlspecialchars($comments_arr[$i]->getVar(
'icon'), ENT_QUOTES);
275 $comments[
'comments_poster'] = $comments_poster_uname;
276 $comments[
'comments_icon'] = $comments_icon;
277 $comments[
'comments_title'] =
'<a href="main.php?op=comments_jump&item_id=' . $comments_arr[
$i]->getVar(
"id") .
'">' . $comments_arr[
$i]->getVar(
"title") .
'</a>';
278 $comments[
'comments_ip'] = $comments_arr[
$i]->getVar(
'ip');
279 $comments[
'comments_date'] = XoopsLocale::formatTimeStamp($comments_arr[$i]->getVar(
'created'));
280 $comments[
'comments_text'] =
$myts->undoHtmlSpecialChars($comments_arr[$i]->getVar(
'text'));
291 if ($comments_count > $comments_limit) {
292 $nav =
new XoopsPageNav($comments_count, $comments_limit, $comments_start,
'comments_start',
'comments_module=' . $comments_module .
'&comments_status=' . $comments_status);
293 $xoops->tpl()->assign(
'nav', $nav->renderNav());
if(!empty($available_plugins)) $module_array[0]
static formatTimestamp($time, $format= 'l', $timeoffset=null)
if(in_array($op, array('install', 'update', 'uninstall'))) $myts
const _MD_COMMENTS_ACTIVE
static getPlugin($dirname, $pluginName= 'system', $force=false)
const _MD_COMMENTS_PENDING
const _MD_COMMENTS_HIDDEN