Jump to content


Welcome to DevFuse Forums


Sign In  Log in with Facebook

Create Account
Welcome to DevFuse Forums, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of DevFuse Forums by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.
 
Guest Message by DevFuse

Tutorial info Visit support topic

  • Added on: Aug 15 2009 06:49 AM
  • Date Updated: Aug 30 2012 10:15 PM
  • Views: 3025
 


Number of members using each skin in dropdown (IPB 3.3.x)

Posted by Michael on Aug 15 2009 06:49 AM
This tutorial will show you how to add the number of members using each skin in the skin dropdown.

Posted Image

Open admin/sources/classes/output/formats/html/htmlOutput.php
Find: in function html_fetchSetsDropDown )
		//-----------------------------------------
		// Go get 'em
		//-----------------------------------------

Add ABOVE:

//-----------------------------------------
		// Skin Dropdown Member Count by Devfuse
		//-----------------------------------------
		
		$this->DB->build( array(
								'select' => 'sc.set_id',
								'from' => array( 'skin_collections' => 'sc' ),
								'group' => 'sc.set_id',
								'add_join' => array(
													array(
															'select' => 'count(m.skin) as total_skins',
															'from' => array( 'members' => 'm' ),
															'where' => "m.skin=sc.set_id",
															'type' => 'left',
														)
													)
					) 	);
		$this->DB->execute();

		$skin_count = array();
		while( $skin = $this->DB->fetch() )
		{
			$skin_count[ $skin['set_id'] ] = $skin['total_skins'];
		}

Find: ( in function html_fetchSetsDropDown )

/* Ok to add... */
            $output[]    = array( 'id' => $data['set_id'], 'depth' => $depthMarkers, 'title' => $data['set_name'], 'selected' => $_selected );

Replace With:
/* Ok to add... */
            $output[]    = array( 'id' => $data['set_id'], 'depth' => $depthMarkers, 'title' => $data['set_name'], 'selected' => $_selected, 'count' => $skin_count[ $data['set_id'] ] );

Save admin/sources/classes/output/formats/html/htmlOutput.php

Open ACP > Look & Feel Tab > select skin > Global Templates > globalTemplate

Find:
<a href='#' data-clicklaunch='changeSkin' data-skinid='{$skin['id']}'>{$skin['title']}</a>

Replace With:
<a href='#' data-clicklaunch='changeSkin' data-skinid='{$skin['id']}'>{$skin['title']} ({$skin['count']})</a>

Save Template.

Powered by Tutorials 1.5.1 © 2016, by Michael McCune