Update of /cvsroot/php-blog/serendipity/include/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1635/include/admin
Modified Files:
comments.inc.php
Log Message:
Save HTTP referrer for a user when entering a comment.
Discussed in http://thread.gmane.org/gmane.comp.serendipity.devel/3215
(I think user-agent logging is not neccessary, can be drawn out of usual access logs...)
Index: comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/comments.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- comments.inc.php 2 Dec 2004 14:11:28 -0000 1.8
+++ comments.inc.php 3 Dec 2004 10:07:40 -0000 1.9
@@ -109,7 +109,7 @@
}
/* Searchable fields */
-$filters = array('author', 'email', 'ip', 'url', 'body');
+$filters = array('author', 'email', 'ip', 'url', 'body', 'referer');
/* Compress the filters into an "AND" SQL query, and a querystring */
foreach ( $filters as $filter ) {
@@ -216,15 +216,17 @@
<td><input type="text" name="serendipity[filter][ip]" size="15" value="<?php echo $serendipity['GET']['filter']['ip'] ?>" /></td>
<td><?php echo CONTENT ?>:</td>
<td><input type="text" name="serendipity[filter][body]" size="15" value="<?php echo $serendipity['GET']['filter']['body'] ?>" /></td>
+ <td><?php echo REFERER ?>:</td>
+ <td><input type="text" name="serendipity[filter][referer]" size="15" value="<?php echo $serendipity['GET']['filter']['referer'] ?>" /></td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
<td><?php echo COMMENTS_FILTER_SHOW ?>:</td>
<td><select name="serendipity[filter][show]">
<option value="all"<?php if ( $serendipity['GET']['filter']['show'] == 'all' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_ALL ?></option>
<option value="approved"<?php if ( $serendipity['GET']['filter']['show'] == 'approved' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_APPROVED_ONLY ?></option>
<option value="pending"<?php if ( $serendipity['GET']['filter']['show'] == 'pending' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_NEED_APPROVAL ?></option>
</select></td>
- </tr>
- <tr>
- <td colspan="4"> </td>
<td><?php echo TYPE; ?></td>
<td><select name="serendipity[filter][type]">
<option value="NORMAL"<?php if ($c_type == 'NORMAL') echo ' selected="selected"' ?>><?php echo COMMENTS; ?></option>
@@ -272,6 +274,9 @@
if (empty($rs['url'])) {
$rs['url'] = 'N/A';
}
+ if (empty($rs['referer'])) {
+ $rs['referer'] = 'N/A';
+ }
$fullBody = nl2br(strip_tags($rs['body']));
$summary = serendipity_mb('substr', $fullBody, 0, $summaryLength);
@@ -297,9 +302,12 @@
</tr>
<tr>
<td><strong>IP</strong>: <?php echo htmlspecialchars($rs['ip']) ?></td>
- <td><strong>URL</strong>: <?php echo htmlspecialchars($rs['url']) ?></td>
+ <td><strong><?php echo URL; ?></strong>: <?php echo htmlspecialchars($rs['url']) ?></td>
</tr>
<tr>
+ <td colspan="2"></td>
+ <td><strong><?php echo REFERER; ?></strong>: <?php echo htmlspecialchars($rs['referer']) ?></td>
+ <tr>
<td style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC" colspan="3">
<div id="<?php echo $rs['id'] ?>_summary"><?php echo $summary ?></div>
<div id="<?php echo $rs['id'] ?>_full" style="display: none"><?php echo $fullBody ?></div>
|