samedi 11 janvier 2014

Category menu with new counts

Category menu with new counts
Category menu with new counts


The module is pretty simple but yet powerful for those website that want to add categories automatically with the news and articles counted without modify any Datalife Engine files only require a few lines of CSS styles and include file into the theme.


Features:
- Automatically generate the category list from the category cache files and database
- Use cache to reduce the server loading and resources
- Automatically count all news in both main categories and sub-categories and make the total count in main categories
- Supports category icons (useful for those who use category icons like file hosts and different category icons)
- Very simple to install without modify any DLE files
- Easy to customize in CSS
- Can set cache to how often to update the article count and category list

This module only tested on 9.6 - 10.1

Modules Installation Guide

- Using your FTP client to upload folders /engine/ to root of your server

- Using your FTP client to upload folders {THEME}/images/cat.png to your theme images folder

Open main.tpl or side.tpl or whatever file you want category menu to display Add this code in any place you want category menu to display


{include file="/engine/modules/cat_starter.php?new_days=1"}

OR

{include file="/engine/modules/cat_starter.php?new_days=1&cache_time=43200"}

Attribute Information


  •  new_days=1 is for the number of day to starter the grab the category list the default is "1" which is the "day the category was created"
  • cache_time=43200 is for how often the cache to update the category list and counter this use second I set "43200" is to "update every 12 hours", you can set the number you want


Add this css style to one of your css files in your theme (possibly /css/ or /styles/ folder) CSS Code:

.catmenus {margin:-4px 0 0 0;padding:0; width:100%;display:block;position:relative}
.catmenus a {font-size:14px !important;font-family: 'Ubuntu Condensed', Helvetica, Arial, sans-serif !important;font-weight:normal;font-style:normal !important;
background-image: -webkit-gradient(linear, top left, bottom left, from(rgba(255,255,255,1) 20%), to(rgba(255,255,255,0)));
background-image: -webkit-linear-gradient(top, rgba(255,255,255,1) 20%, rgba(255,255,255,0));
background-image: -moz-linear-gradient(top, rgba(255,255,255,1) 20%, rgba(255,255,255,0));
background-image: -ms-linear-gradient(top, rgba(255,255,255,1) 20%, rgba(255,255,255,0));
background-image: -o-linear-gradient(top, rgba(255,255,255,1) 20%, rgba(255,255,255,0));
background-image: linear-gradient(top, rgba(255,255,255,1) 20%, rgba(255,255,255,0));
-webkit-box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85), 0 0 0 1px rgba(0, 0, 0, .1),0 2px 0 0 rgba(0, 0, 0, .06);
-moz-box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85), 0 0 0 1px rgba(0, 0, 0, .1),0 2px 0 0 rgba(0, 0, 0, .06);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85), 0 0 0 1px rgba(0, 0, 0, .1),0 2px 0 0 rgba(0, 0, 0, .06);
background-color: #E3E6E8;
color:#3c83b0;
text-shadow: 1px 1px 0px #ffffff;
margin:3px 0;
text-decoration:none;
display:block;
cursor:pointer;
position:relative
}
.catmenus a:hover{background:#fff;color:#f30871;text-shadow:0 1px 0 #ffffff,0 -1px 3px #bebebe;}
.catmenus a span.ficon{background:url(../images/cat.png) 5px 6px no-repeat;padding:4px 5px 4px 25px;display:block}
.catmenus a span.total {
color: #fff;
display: block;
position: absolute;
top: 5px;
right:5px;
text-align:center;
padding:0 8px;
font:normal 13px Helvetica, Arial, sans-serif !important;
font-style:normal !important;
background: #3c83b0;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0, .2), 1px 1px 1px rgba(255,255,255, .1);
-moz-box-shadow: inset 1px 1px 1px rgba(0,0,0, .2), 1px 1px 1px rgba(255,255,255, .1);
box-shadow: inset 1px 1px 1px rgba(0,0,0, .2), 1px 1px 1px rgba(255,255,255, .1);
text-shadow:none !important;
}
.catmenus a:hover span.total {background: #f30871;}


You can customize the color and background color of your choices,

Download CategoryMenu-new-count.rar 
Pass Unrar : dle-guides.blogspot.com

Aucun commentaire:

Enregistrer un commentaire