XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
rmc_comments.php
Go to the documentation of this file.
1 <div class="comments_search">
2  <form name="search_form" method="get" action="comments.php">
3  <?php _e('Search:','rmcommon'); ?>
4  <input type="text" name="w" id="wsearch" value="<?php echo isset($keyw) ? $keyw : '' ?>" size="20" />
5  <input type="button" value="<?php _e('Apply','rmcommon'); ?>" onclick="$('#wsearch').val()==''?alert('<?php _e('You need something to search!','rmcommon'); ?>'):submit();" />
6  <input type="hidden" name="action" value="" />
7  </form>
8 </div>
9 <h1 class="rmc_titles"><?php _e('Comments Manager','rmcommon'); ?></h1>
10 <form name="list_comments" method="post" action="comments.php" id="list-comments">
11 <div class="rmc_bulkactions">
12 <?php $nav->display(false, true); ?>
13 <select name="action" id="action-select" onchange="$('#action-select2').val($(this).val());">
14  <option value="" selected="selected"><?php _e('Bulk Actions...','rmcommon'); ?></option>
15  <option value="unapprove"><?php _e('Set unapproved','rmcommon'); ?></option>
16  <option value="approve"><?php _e('Set approved','rmcommon'); ?></option>
17  <option value="spam"><?php _e('Mark as SPAM','rmcommon'); ?></option>
18  <option value="delete"><?php _e('Delete comments','rmcommon'); ?></option>
19 </select>
20 <input type="submit" value="<?php _e('Apply','rmcommon'); ?>" onclick="if($('#action-select').val()=='delete') return confirm('Do you really want to delete selected comments?');" /> &nbsp;&nbsp;
21 <a href="comments.php"><?php _e('View all','rmcommon'); ?></a> |
22 <?php if($filter=='waiting'): ?>
23 <strong><?php _e('Unapproved','rmcommon'); ?></strong> |
24 <?php else: ?>
25 <a href="comments.php?filter=waiting"><?php _e('Unapproved','rmcommon'); ?></a> |
26 <?php endif; ?>
27 <?php if($filter=='approved'): ?>
28 <strong><?php _e('Approved','rmcommon'); ?></strong>
29 <?php else: ?>
30 <a href="comments.php?filter=approved"><?php _e('Approved','rmcommon'); ?></a>
31 <?php endif; ?>
32 |
33 <?php if($filter=='spam'): ?>
34 <strong><?php _e('SPAM','rmcommon'); ?></strong>
35 <?php else: ?>
36 <a href="comments.php?filter=spam"><?php _e('SPAM','rmcommon'); ?></a>
37 <?php endif; ?>
38 </div>
39 <table class="outer" cellspacing="0" width="100%">
40  <thead>
41  <tr>
42  <th width="20"><input type="checkbox" id="checkall" value="" onclick="$('#list-comments').toggleCheckboxes(':not(#checkall)');" /></th>
43  <th align="left"><?php _e('Author','rmcommon'); ?></th>
44  <th align="left"><?php _e('Comment','rmcommon'); ?></th>
45  <th><?php _e('Status','rmcommon'); ?></th>
46  <th><?php _e('Module','docs'); ?></th>
47  <th nowrap="nowrap"><?php _e('In reply to','rmcommon'); ?></th>
48  </tr>
49  </thead>
50  <tfoot>
51  <tr>
52  <th width="20"><input type="checkbox" id="checkall2" value="" onclick="$('#list-comments').toggleCheckboxes(':not(#checkall2)');" /></th>
53  <th align="left"><?php _e('Author','rmcommon'); ?></th>
54  <th align="left"><?php _e('Comment','rmcommon'); ?></th>
55  <th><?php _e('Status','rmcommon'); ?></th>
56  <th><?php _e('Module','docs'); ?></th>
57  <th nowrap="nowrap"><?php _e('In reply to','rmcommon'); ?></th>
58  </tr>
59  </tfoot>
60  <tbody>
61  <?php if(count($comments)<=0): ?>
62  <tr class="head">
63  <td colspan="5" align="center"><?php _e('There are not comments yet!','rmcommon'); ?></td>
64  </tr>
65  <?php else: ?>
66  <?php foreach ($comments as $com): ?>
67  <tr class="<?php echo tpl_cycle("even,odd"); ?>" valign="top"<?php if($com['status']=='spam'): ?> style="color: #F00;"<?php endif; ?>>
68  <td align="center"><input type="checkbox" name="coms[]" id="com-<?php echo $com['id']; ?>" value="<?php echo $com['id']; ?>" /></td>
69  <td class="poster_cell"><img class="poster_avatar" src="<?php echo $com['poster']['avatar']; ?>" />
70  <strong><?php echo $com['poster']['name']; ?></strong>
71  <span class="poster_data"><a href="mailto:<?php echo $com['poster']['email']; ?>"><?php echo $com['poster']['email']; ?></a><br />
72  <?php echo $com['ip']; ?></span></td>
73  <td><span class="comment_date"><?php echo $com['posted']; ?></span>
74  <?php echo $com['text']; ?>
75  <span class="rmc_options">
76  <a href="comments.php?id=<?php echo $com['id']; ?>&amp;action=edit&amp;page=<?php echo $page; ?>&amp;filter=<?php echo $filter; ?>&amp;w=<?php echo $keyw; ?>"><?php _e('Edit','rmcommon'); ?></a> |
77  <a href="javascript:;" onclick="confirm_delete(<?php echo $com['id']; ?>);"><?php _e('Delete','rmcommon'); ?></a> |
78  <?php if($com['status']=='approved'): ?>
79  <a href="javascript:;" onclick="approve_action(<?php echo $com['id']; ?>,'unapprove');"><?php _e('Unnaprove','rmcommon'); ?></a>
80  <?php else: ?>
81  <a href="javascript:;" onclick="approve_action(<?php echo $com['id']; ?>,'approve');"><?php _e('Approve','rmcommon'); ?></a>
82  <?php endif; ?>
83  <?php if($com['status']!='spam'): ?>
84  | <a href="javascript:;" onclick="approve_action(<?php echo $com['id']; ?>,'spam');"><?php _e('Spam','rmcommon'); ?></a>
85  <?php endif; ?>
86  </span>
87  </td>
88  <td align="center">
89  <?php
90  switch($com['status']){
91  case 'approved':
92  _e('Approved', 'rmcommon');
93  break;
94  case 'waiting':
95  _e('Unapproved','rmcommon');
96  break;
97  case 'spam':
98  echo "<span style='color: #F00;'>";
99  _e('SPAM', 'rmcommon');
100  echo "</span>";
101  break;
102  }
103  ?>
104  </td>
105  <td align="center"><?php echo $com['module']; ?></td>
106  <td align="center">
107  <?php if(isset($com['item'])): ?><a href="<?php echo $com['item_url']; ?>"><?php echo $com['item']; ?></a><?php else: echo "&nbsp;"; endif; ?>
108  </td>
109  </tr>
110  <?php endforeach; ?>
111  <?php endif; ?>
112  </tbody>
113 </table>
114 <div class="rmc_bulkactions">
115 <?php $nav->display(false, true); ?>
116 <select name="actionb" id="action-select2" onchange="$('#action-select').val($(this).val());">
117  <option value="" selected="selected"><?php _e('Bulk Actions...','rmcommon'); ?></option>
118  <option value="unapprove"><?php _e('Set unapproved','rmcommon'); ?></option>
119  <option value="approve"><?php _e('Set approved','rmcommon'); ?></option>
120  <option value="delete"><?php _e('Delete comments','rmcommon'); ?></option>
121 </select>
122 <input type="submit" value="<?php _e('Apply','rmcommon'); ?>" onclick="if($('#action-select').val()=='delete') return confirm('Do you really want to delete selected comments?');" /> &nbsp;&nbsp;
123 </div>
124 <input type="hidden" name="filter" value="<?php echo $filter; ?>" />
125 <input type="hidden" name="w" value="<?php echo $keyw; ?>" />
126 <input type="hidden" name="page" value="<?php echo $page; ?>" />
127 <?php echo $xoopsSecurity->getTokenHTML(); ?>
128 </form>