Back to vBulletin 3.0 Add-Ons

[Addon] cinq's vbArticles Hack v2.0 - Show number of articles per category
Mod Version: 1.01, by DRJ

This modification is in the archives.
vB Version: 3.0.6 Rating: (0 vote - 0 average) Installs: 7
Released: 07 Apr 2005 Last Update: Never Downloads: 2
Not Supported DB Changes  

A small addon to show the number of articles in each category.
This addon is for cinq's vbArticles Hack v2.0

Hack version 1.0

Files to edit: 1
articles.php

Templates to edit: 2
vbArticles_categorybit
vbArticles_childcatbit

Install instructions
===========================================

File Edits

articles.php

Find
PHP Code:
$catlistbit='';
if(!empty(
$cat_cache))
{
foreach (
$cat_cache[0] AS $parentcatrow)
{
         
$parentid $parentcatrow["articles_categoryid"];
         
$catname $parentcatrow["categoryname"];
         
$parentcat $parentcatrow["parentcategory"]; 
Replace with
PHP Code:
$catlistbit='';
if(!empty(
$cat_cache))
{
foreach (
$cat_cache[0] AS $parentcatrow)
{
         
$parentid $parentcatrow["articles_categoryid"];
         
$catname $parentcatrow["categoryname"];
         
$parentcat $parentcatrow["parentcategory"];
                
$cattotal 0;
$catcount $DB_site->query("
SELECT *
FROM " 
TABLE_PREFIX "articles_article
WHERE categoryid =
$parentid 
AND usersubmitted=0
And draft = 0
"
);
$cattotal $DB_site->num_rows($catcount); 
Find
PHP Code:
         if(!empty($cat_cache[$parentid]))
{
         foreach (
$cat_cache[$parentid] AS $subcatrow)
         {
             
$subcatid=$subcatrow["articles_categoryid"];
             
$subcatname=$subcatrow["categoryname"]; 
Replace with
PHP Code:
         if(!empty($cat_cache[$parentid]))
{
         foreach (
$cat_cache[$parentid] AS $subcatrow)
         {
             
$subcatid=$subcatrow["articles_categoryid"];
             
$subcatname=$subcatrow["categoryname"];
$cattotal 0;
$catcount $DB_site->query("
SELECT *
FROM " 
TABLE_PREFIX "articles_article
WHERE categoryid =
$subcatid
AND usersubmitted=0
And draft = 0
"
);
$cattotal $DB_site->num_rows($catcount); 
End File Edits

Template Edits

vbArticles_categorybit

Replace existing code with this
PHP Code:
<if condition="$parentcat==0"><br>
<
a href="articles.php?action=viewcat&catid=$parentid"><span class="smallfont"><b>$catname</b></a> ($cattotal)</span>
</if> 
vbArticles_childcatbit


Replace existing code with this
PHP Code:
<li><span class="smallfont"><a href="articles.php?action=viewcat&catid=$subcatid">$subcatname</a> ($cattotal)</span></li
End Template Edits

You can see a demo of this mod here: http://www.vbaexpress.com/forum/articles.php

Download

No files for download.

Screenshots

File Type: %1$s Example.jpg

Similar Mods

[ADDON] cinq's vbArticles Latest 3 Featured Articles CMPS Module vBulletin 3.0 Full Releases
[ADDON] cinq's vbArticles Latest Featured Articles on ForumHome vBulletin 3.0 Full Releases
[ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024