2010-04-10, 01:28 AM
(2010-04-09, 02:22 AM)labrocca Wrote: [ -> ]You have to make core file edits for that. That is what I did at HF.
Here is my short-hand instructions if you can figure it out.
###### For the canviewthreads permissions to change inc/functions_forumlist.php if($permissions['canviewthreads'] != 1) { $hideinfo = true; } to if($permissions['canviewthreads'] != 1) { $hideinfo = false; } in forumdisplay.php find $fpermissions['canviewthreads'] alter the appropriate if statements
Thanks and I got the 1st one down corrected. Though, the 2nd one I find these 3 if statements when I search for that:
if($fpermissions['canviewthreads'] != 0)
{
// How many posts are there?
if($datecut > 0)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $datecutsql");
$threadcount = $db->fetch_field($query, "threads");
}
else
{
$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'];
}
// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}
}
}
if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
{
$lang->load("ratethread");
switch($db->type)
{
case "pgsql":
$ratingadd = "CASE WHEN t.numratings=0 THEN 0 ELSE t.totalratings/t.numratings::numeric END AS averagerating, ";
break;
default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";
}
$lpbackground = "trow2";
eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";");
eval("\$ratingsort = \"".$templates->get("forumdisplay_threadlist_sortrating")."\";");
$colspan = "7";
$select_voting = "\nLEFT JOIN ".TABLE_PREFIX."threadratings r ON(r.tid=t.tid AND r.uid='{$mybb->user['uid']}')";
$select_rating_user = "r.uid AS rated, ";
}
else
{
if($sortfield == "averagerating")
{
$t = "t.";
$sortfield = "lastpost";
}
$ratingadd = '';
$lpbackground = "trow1";
$colspan = "6";
}
if($fpermissions['canviewthreads'] != 0)
{
// Start Getting Threads
$query = $db->query("
SELECT t.*, {$ratingadd}{$select_rating_user}t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid){$select_voting}
WHERE t.fid='$fid' $tvisibleonly $datecutsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
");
while($thread = $db->fetch_array($query))
{
$threadcache[$thread['tid']] = $thread;
// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread
if(substr($thread['closed'], 0, 5) == "moved")
{
$tid = substr($thread['closed'], 6);
if(!$tids[$tid])
{
$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}
}
// Otherwise - set it to the plain thread ID
else
{
$tids[$thread['tid']] = $thread['tid'];
if($moved_threads[$tid])
{
unset($moved_threads[$tid]);
}
}
}
}
else
{
$tids = $threadcache = null;
}
I'm not an advanced PHP programmer so I'm not sure how to change those