Members: 16,996
Threads: 38,846
Posts: 159,391
Online: 21

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Archive > Mambo 4.5 > Mambo 4.5 'How Do I' Questions

 
 
LinkBack Thread Tools Display Modes
Old 07.04.2004, 15:05   #1 (permalink)
Junior Mamber
 
Join Date: Apr 2004
Posts: 31
kixvn is on a distinguished road
Default how do I show the number of item in each entry in main menu ?

I asked around and come out with this solution to automatically expand all the submenu in mainmenu,

"In modules/mod_mainmenu.class.php Comment out line 195 and line 197 so that it looks like this:
195: // if (in_array( $row->id, $open )) { 197: // }"

now I wonder how can I do to show the number of items in each sub-menu (if they point to a category)

thanks
kixvn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Old 07.04.2004, 21:06   #2 (permalink)
Professional Mamber
 
stingrey's Avatar
 
Join Date: Apr 2004
Location: Marikina, Manila, Philippines
Posts: 776
stingrey is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

You'd need to edit the same file.


I've included this functionality in my soon to be released Display Sections & Display Categories modules (look out for an announcement in the Development Announcements forum in the next week).


If you want I can post the code I used.
Though I'm not sure if it will work exactly off the bat for you (but it may give you a start point)
__________________
Joomla! Core Team Member
Software Coding & Design - Stability Team Leader
www.joomla.org
Former Mambo Core Team Member
stingrey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08.04.2004, 09:32   #3 (permalink)
Junior Mamber
 
Join Date: Apr 2004
Posts: 31
kixvn is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

hi there, can you post your code, it may not work but still I want to try
thanks
kixvn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12.04.2004, 14:24   #4 (permalink)
Junior Mamber
 
Join Date: Apr 2004
Posts: 31
kixvn is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

hi.
can you post your code ? I can't wait until it's announced

thanks
kixvn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12.04.2004, 20:29   #5 (permalink)
Professional Mamber
 
stingrey's Avatar
 
Join Date: Apr 2004
Location: Marikina, Manila, Philippines
Posts: 776
stingrey is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

Opps sorry, forgot about this...I read way too many posts

Warning this is part of more extensive code, i'm not sure if it will make sense on its own:

Will probably require some massaging.


Generates info:
Code:
 /**---------------------------------------------------------------------**/
  	// Count # of Categories for the Section 
  	if (($show_categories == "y") || ($show_categories_count == "y")) {
  		$query = "SELECT a.title, a.name, a.id, a.section"
  		. "\n  FROM #__categories AS a"
  		. "\n  LEFT JOIN #__sections AS b ON a.section = b.id"
  		. "\n  WHERE a.section = $row->id"
  		. "\n $access";
  		$database->setQuery($query);
  		$cats = $database->loadObjectList();
  		$cats_count = count($cats);
  	}	//---------------------------------------------------------------
THen place this where you want the number to appear:
Code:
echo "<span class='ds-categories_count'>(".$cats_count.")</span>";
__________________
Joomla! Core Team Member
Software Coding & Design - Stability Team Leader
www.joomla.org
Former Mambo Core Team Member
stingrey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12.04.2004, 20:55   #6 (permalink)
Junior Mamber
 
Join Date: Apr 2004
Posts: 31
kixvn is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

uh oh ..
Quote:
// Count # of Categories for the Section
does that mean that piece would show the number of categories in a section ?

in my case, I want to show the number of items in each categories in one section

so may be I should $cats to something else in this line, rite ?

$cats_count = count($cats);

waiting for ur answer, also, trying .. ^-^
kixvn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 12.04.2004, 21:21   #7 (permalink)
Professional Mamber
 
stingrey's Avatar
 
Join Date: Apr 2004
Location: Marikina, Manila, Philippines
Posts: 776
stingrey is on a distinguished road
Default Re: how do I show the number of item in each entry in main menu ?

Having looked at my code again, I'm thinking it may be difficult for you to use in your particular case.

Anyway heres the code:
Code:
 /**---------------------------------------------------------------------**/
 // Count # of Items for a Category
 if ($show_items_count == "y") {
 	$query = "SELECT a.catid"
 	. "\n  FROM #__content AS a"
 	. "\n  LEFT JOIN #__categories AS b ON a.catid = b.id"
 	. "\n  WHERE a.catid = $row->id";
 	$database->setQuery($query);
 	$items = $database->loadObjectList();
 	$items_count = count($items);
 }	//---------------------------------------------------------------------
The thing is the $row->id needs to be the id of the category you wish to have the items counted for. Problem is I have no idea how your capturing this in your case and to be honest I'm doing too many things already that I don't have the time to try help out further with your code


Anyway good luck with it
__________________
Joomla! Core Team Member
Software Coding & Design - Stability Team Leader
www.joomla.org
Former Mambo Core Team Member
stingrey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 05:29.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.