Add this into a custom page and set access to suit.
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: unanswered_threads.php
| Author: Nick Jones (Digitanium)
| Adapted by Philip
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEME."theme.php";
if (!iADMIN) { redirect(BASEDIR."index.php"
; }
global $lastvisited;
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
if (isset($_GET['rowstart']) && isnum($_GET['rowstart'])) {
$rowstart = $_GET['rowstart'];
} else {
$rowstart = 0;
}
$result = dbquery(
"SELECT tt.thread_id, tt.thread_subject, tt.thread_views, tt.thread_lastuser, tt.thread_lastpost,
tt.thread_poll, tf.forum_id, tf.forum_name, tf.forum_access, tt.thread_lastpostid, tt.thread_postcount, tu.user_id, tu.user_name
FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
INNER JOIN ".DB_USERS." tu ON tt.thread_lastuser=tu.user_id
WHERE tf.forum_id !='50' AND tf.forum_id !='77' AND tf.forum_id !='78' AND tf.forum_id !='79' AND tf.forum_id !='80' AND tf.forum_id !='83'
AND ".groupaccess('tf.forum_access'
." AND tt.thread_postcount = 1
ORDER BY tt.thread_lastpost DESC LIMIT $rowstart,50
"
;
if (dbrows($result)) {
$thread_count = (dbcount("(thread_id)", DB_THREADS, "thread_postcount = 1"
);
$week_time = (time() + ($settings['timeoffset'] * 3600));
$week_utotal = (dbcount("(thread_id)", DB_THREADS, "thread_lastpost + 604800 > $week_time AND thread_postcount = 1"
);
$week_total = (dbcount("(thread_id)", DB_THREADS, "thread_lastpost + 604800 > $week_time"
);
$all_utotal = (dbcount("(thread_id)", DB_THREADS, "thread_postcount = 1"
);
$all_total = (dbcount("(thread_id)", DB_THREADS));
$i = 0;
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td class='tbl2'> </td>\n";
echo "<td class='tbl2'><strong>Total Threads: ".$all_total."<br />
Total Unanswered: ".$thread_count."<br />
Overall percentage: ".round($all_utotal*100/$all_total)."%
</strong></td>\n";
echo "<td class='tbl2' align='left' colspan='3'><strong>Total this week: ".$week_total."<br />
Unanswered: ".$week_utotal."<br />
Weeks percentage: ".round($week_utotal*100/$week_total)."%
</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl2'> </td>\n";
echo "<td width='100%' class='tbl2'><strong>".$locale['global_044']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['global_045']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['global_046']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['global_047']."</strong></td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
$row_color = ($i % 2 == 0 ? "tbl1" : "tbl2"
;
echo "<tr>\n<td class='".$row_color."'>";
if ($data['thread_lastpost'] > $lastvisited) {
$thread_match = $data['thread_id']."\|".$data['thread_lastpost']."\|".$data['forum_id'];
if (iMEMBER && preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads'])) {
echo "<img src='".get_image("folder"
."' alt='' />";
} else {
echo "<img src='".get_image("foldernew"
."' alt='' />";
}
} else {
echo "<img src='".get_image("folder"
."' alt='' />";
}
if ($data['thread_poll']) {
$thread_poll = "<span class='small' style='font-weight:bold'>[".$locale['global_051']."]</span> ";
} else {
$thread_poll = "";
}
echo "</td>\n";
echo "<td width='100%' class='".$row_color."'>".$thread_poll."<a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."&pid=".$data['thread_lastpostid']."#post_".$data['thread_lastpostid']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 30)."</a><br />\n".$data['forum_name']."</td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['thread_views']."</td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".($data['thread_postcount']-1)."</td>\n";
echo "<td width='1%' class='".$row_color."' style='text-align:center;white-space:nowrap'><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a><br />\n".showdate("forumdate", $data['thread_lastpost'])."</td>\n";
echo "</tr>\n";
$i++;
}
echo "</table>\n";
}
if ($thread_count > 50) echo "<div align='center' style=';margin-top:5px;'>\n".makepagenav($rowstart,50,$thread_count,3,FUSION_SELF."?page_id=".$_GET['page_id']."&"
."\n</div>\n";
?>[/syntaxhighlighter]