LifesGreatestGift
02-04-2013, 11:33 PM
I am working on building a classifieds section on my forum and the current code is counting the first post of a thread as a reply. is there a way around this? Here is my current code
$cats = array(18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 ,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,4 9,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65, 66,67,68);
foreach ($cats AS $cat => $forumid) {
$t_count[$forumid] = array(
"forumid" => $forumid,
"forum_name" => $vbulletin->forumcache[$forumid]['title'],
"threadcount" => vb_number_format($vbulletin->forumcache[$forumid]['threadcount']),
"replycount" => vb_number_format($vbulletin->forumcache[$forumid]['replycount'])
);
}
foreach ($cats AS $cat) {
$total_count_thread += vb_number_format($vbulletin->forumcache[$cat]['threadcount']);
$total_count_reply += vb_number_format($vbulletin->forumcache[$cat]['replycount']);
}
$classifieds = array_merge($t_count);
if (is_member_of($vbulletin->userinfo, 6)) {
/* print_r($total_count_reply);
echo "<br />";
print_r($total_count_thread); */
}
vB_Template::preRegister('FORUMHOME',array('classi fieds' => $classifieds));
vB_Template::preRegister('FORUMHOME',array('total_ count_thread' => $total_count_thread));
vB_Template::preRegister('FORUMHOME',array('total_ count_reply' => $total_count_reply));
Here is where its rendered
https://www.thesecond.org/forum/#classifieds
if i make a "classified" aka thread, my "Listings" and "Replies" count is 1 when I'd like it to be Listings: 1 Replies: 0
Hope that makes sense.
Thanks in advance!
$cats = array(18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 ,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,4 9,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65, 66,67,68);
foreach ($cats AS $cat => $forumid) {
$t_count[$forumid] = array(
"forumid" => $forumid,
"forum_name" => $vbulletin->forumcache[$forumid]['title'],
"threadcount" => vb_number_format($vbulletin->forumcache[$forumid]['threadcount']),
"replycount" => vb_number_format($vbulletin->forumcache[$forumid]['replycount'])
);
}
foreach ($cats AS $cat) {
$total_count_thread += vb_number_format($vbulletin->forumcache[$cat]['threadcount']);
$total_count_reply += vb_number_format($vbulletin->forumcache[$cat]['replycount']);
}
$classifieds = array_merge($t_count);
if (is_member_of($vbulletin->userinfo, 6)) {
/* print_r($total_count_reply);
echo "<br />";
print_r($total_count_thread); */
}
vB_Template::preRegister('FORUMHOME',array('classi fieds' => $classifieds));
vB_Template::preRegister('FORUMHOME',array('total_ count_thread' => $total_count_thread));
vB_Template::preRegister('FORUMHOME',array('total_ count_reply' => $total_count_reply));
Here is where its rendered
https://www.thesecond.org/forum/#classifieds
if i make a "classified" aka thread, my "Listings" and "Replies" count is 1 when I'd like it to be Listings: 1 Replies: 0
Hope that makes sense.
Thanks in advance!