Count Number of Subfolder in a Folder | Wapkiz Tutorial

Today I’m gonna show you how you can display the number of subfolder or subfolders are there in a folder. Easily you can show it to your site by just adding a simple wapkiz tag. This wapkiz tag was hidden before.

Below is the filemanager folder code which added to show folders list from filemanager, as you know that.

[fm_folder]set||content[/fm_folder]

Where Set can be filled with

  • d , where d is directory id.

and Content can be filled with

  • %id% folder id
  • %name% folder name
  • %count% count no of file inside the folder
  • %thumb% folder thumbnail show with 50px width
  • %urlthumb% for get only url thumbnail

And there are no other tag mentioned in wapkiz.

You can count no of files are inside a folder with %count% tag, but by which tag you will display the no of subfolders are inside a folder?

You can do it by %fcount% tag..

Then how to set the tag to work?

Lets show you with an example…

From the above screenshot you can see, In Unplugged Song there are total 16 files and in English Mp3 Song there are 2 subfolders.

Example Code: (customize the code with your css)

[fm_folder]d=0||
<b>%name%</b><br/>
No of File: %count%<br/>
No of Subfolder: %fcount%
<hr/>
[/fm_folder]

The above code will display as shown in below image..

Note: Blank file number or blank subfolder number means there are no files or subfolders inside the folder.

Example 2:

[fm_folder]d=0||
<b>%name%</b><br/>
No of File: (if %count%=)0(/if)%count%<br/>
No of Subfolder: (if %fcount%=)0(/if)%fcount%
<hr/>
[/fm_folder]

Comment below if you need any help.

5 Comments

Leave a Reply