Skip to main content

PHP vCategory Script

PHPvCategory script is complex script for generating any level of n-tier parent child directories, navigations or category listings in your php application easily just by configuring few options

It allows you to perform complex operations just by simply write few lines of code.


Features

List of core features of php vcategory script.

  • Bootstrap 3.0 compatible
  • Support generating any level parent child ul / li listings.
  • Support single or advance multi column directory listings.
  • Fatest way to fetch records and generate simple to more complex directory listings.
  • Direct approach for fetching data instead of using slow recursive approach.
  • Support almost any type of dynamic menus, dropdowns, directory listings, navigations
  • Fully customizable through css styles
  • and more

Example Code

Example 1: Sample code for listing top 10 parent categories.

include_once("categories.php");
$cat = new vskCategory();
$cat->outputType = 0; // complete panel
$cat->panelCss = "panel panel-info"; // main panel
$cat->css = "panel-body"; // panel body
$cat->panelHeadingCss = "panel-heading"; // panel heading
$cat->headingTitle = "<h3 class=\"panel-title\">Categories</h3>";
$cat->parentCss = "ver_lst"; // parent ul class
$cat->type = 5; // load photo categories
$cat->parentid = 0; // load parents
$cat->isAll = false; // load few
$cat->isParents = true; // load only parents
$cat->totalLinks = 10; // load 10 categories
$cat->url = "[CID]/[CT].html"; // pass url
// more link
$cat->moreLinkUrl = "categories.html";
$cat->moreLinkText = "more";
$cat->moreLinkTooltip = "browse all photo categories";
$cat->moreLinkCss = "bold underline";
echo $cat->Process();

Here is output

php vcategory script example screen 01

Example 2: Sample code for generating ul / li multi heirarchy (parent / child) category listings.

$cat = new vskCategory();
$cat->outputType = 0; // complete panel
$cat->panelCss = "panel panel-info"; // main panel
$cat->css = "panel-body"; // panel body
$cat->panelHeadingCss = "panel-heading"; // panel heading
$cat->headingTitle = "<h3 class=\"panel-title\">Categories</h3>";
$cat->parentLinkCss = "parentcss"; // parent ul class
$cat->linkCss = "childcss"; // parent ul class
$cat->type = 5; // load photo categories
$cat->parentid = -1; // load parents
$cat->isAll = true; // load few
$cat->isParents = false; // load only parents
$cat->url = "[CID]/[CT].html"; // pass url
echo $cat->Process();

Here is output

php vcategory script example screen 02

Example 3: ul / li simple css navigation listing.

$cat = new vskCategory();
$cat->outputType = 2; // ul / li listing
$cat->maxlevels = 1;
//$cat->parentLinkCss = "parentcss"; // parent ul class
//$cat->linkCss = "childcss"; // parent ul class
$cat->type = 5; // load photo categories
$cat->parentid = -1; // load parents
$cat->isAll = true; // load few
$cat->isParents = false; // load only parents
$cat->url = "[CID]/[CT].html"; // pass url
echo $cat->Process();

Here is output

php vcategory script example screen 03

Example 4: ul / li simple css navigation listing / restrict parents and childs.

$cat->totalParents = 5; // total parent categories
$cat->totalChilds = 5; // total childs within each parent

Here is output

php vcategory script example screen 04

Example 5: Jquery menu example.

$cat = new vskCategory();
$cat->outputType = 2; // ul / li listing
$cat->parentCss = "topnav";
$cat->childCss = "subnav";
$cat->maxlevels = 1; // max parent / child heirarchy
$cat->totalParents = 5; // total parent categories
$cat->totalChilds = 5; // total childs within each parent
$cat->type = 5; // load photo categories
$cat->parentid = -1; // load parents
$cat->isAll = true; // load few
$cat->isParents = false; // load only parents
$cat->url = "[CID]/[CT].html"; // pass url
echo $cat->Process();

Here is output

php vcategory script example screen 05

Example 6: Multi Column directory listing.

$cat = new vskCategory();
$cat->totalColumns = 3;
$cat->repeatDirection = 1; // 0: vertical, 1: horizontal

Here is output

php vcategory script example screen 06

Example 7: Advance Directory Listing.

$cat = new vskCategory();
$cat->outputType = 2; // ul / li listing
$cat->css = "ver_lst";
//$cat->childCss = "hor_lst";
$cat->parentLinkCss = "large-text bold red underline";
$cat->linkCss = "normal-text light bold";
$cat->maxlevels = 1; // max parent / child heirarchy
$cat->type = 5; // load photo categories
$cat->parentid = -1; // load all
$cat->isAll = true; // load few
$cat->isParents = false; // load only parents
$cat->totalColumns = 3;
$cat->repeatDirection = 1; // 0: vertical, 1: horizontal
$cat->url = "[CID]/[CT].html"; // pass url
$cat->totalChilds = 5;
echo $cat->Process();

Here is output

php vcategory script example screen 08

Example 8: Advance Directory Listing Example 2.

$cat = new vskCategory();
$cat->outputType = 2; // ul / li listing
$cat->css = "ver_lst";
$cat->childCss = "hor_lst";
$cat->parentLinkCss = "large-text bold red underline";
$cat->linkCss = "normal-text light normal underline";
$cat->maxlevels = 1; // max parent / child heirarchy
$cat->type = 5; // load photo categories
$cat->parentid = -1; // load all
$cat->isAll = true; // load few
$cat->isParents = false; // load only parents
$cat->totalColumns = 3;
$cat->repeatDirection = 1; // 0: vertical, 1: horizontal
$cat->url = "[CID]/[CT].html"; // pass url
$cat->totalChilds = 10;
echo $cat->Process();

Here is output

php vcategory script example screen 09

Example 8: Twitter bootstrap main navigation.

$cat = new vskCategory();
$cat->outputType = 2; // complete panel
$cat->ulCss = "nav navbar-nav";
$cat->childCss = "dropdown-menu";
$cat->parentliCss = "dropdown";
$cat->parentLinkCss = "dropdown-toggle";
$cat->parentlinkAttr = "data-toggle=\"dropdown\"";
$cat->parentCustomValue = "[CN] <b class=\"caret\"></b>\n";
$cat->maxlevels = 1;
$cat->type = 5;
$cat->parentid = -1;
$cat->isAll = true;
$cat->totalLinks = 10;
$cat->isParents = false;
$cat->showCounter = false;
$cat->url = "[CID]/[CT].html";
//$cat->ulCss = "nav navbar-nav";
//$cat->childCss = "nav";
echo $cat->Process();