Update of /cvsroot/webnotes/webnotes
In directory sc8-pr-cvs1:/tmp/cvs-serv22181
Modified Files:
admin_manage_notes.php
Log Message:
- Added the "visits" field to the pages table.
- Added support for tracking the page visits.
- Display the page visits in the manage notes page.
Index: admin_manage_notes.php
===================================================================
RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- admin_manage_notes.php 19 Aug 2003 23:19:58 -0000 1.20
+++ admin_manage_notes.php 20 Aug 2003 08:46:35 -0000 1.21
@@ -55,22 +55,19 @@
<p><strong>Following are all the pages that use phpWebNotes:</strong></p>
<p>Time now is $t_now</p>
<table class="box" summary="">
- <tr><th>Page</th><th># of Notes</th><th>Last Updated</td><th>URL</th></tr>\n
+ <tr><th>Page</th><th># of Notes</th><th># of hits</th><th>Last Updated</td><th>URL</th></tr>\n
EOT;
$count = 0;
$pages = page_get_array ( page_where_url_exists(), 'last_updated DESC' );
foreach( $pages as $page ) {
extract( $page, EXTR_PREFIX_ALL, 'v' );
- $v_id = (integer)$v_id;
- $query = "SELECT COUNT(*) FROM " . config_get( 'phpWN_note_table' ) . ' ' .
- "WHERE (page_id = $v_id )";
- $result = db_query( $query );
- $t_number = db_result( $result );
+ $t_number = page_notes_count( $v_id );
+ $t_visits = page_visits_count( $v_id );
$t_last_updated = date( config_get( 'date_format' ), $v_last_updated );
$color = util_alternate_colors( $count++ );
- echo "<tr bgcolor=\"$color\"><td><a href=\"$v_url\">$v_page</a></td><td>$t_number</td><td>$t_last_updated</td><td>$v_url</td></tr>\n";
+ echo "<tr bgcolor=\"$color\"><td><a href=\"$v_url\">$v_page</a></td><td>$t_number</td><td>$t_visits</td><td>$t_last_updated</td><td>$v_url</td></tr>\n";
}
echo <<<EOT
|