Username Colour Change MOD

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

Ok then, here is the list of the forums:

ID= 1 = Welcome
ID= 2 = Introduction
ID= 3 = Usefull things
ID= 4 = Usefull application
ID= 5 = Off topic

Ok then:

If user has
Total posts in forums (Forums ID= 1+2+3+4) > 150 ( total posts less the posts in ID= 5)
&&
Total posts in forum (Forum ID= 2) > 0 ( has said welcome to the board)
&&
Total Post in forum (Forum ID= 3) > 49 ( has posted at least 50 posts in Usefull things)

Then the user is able to change its username color.
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

Yes, it is possible, but you need to do that on your own by custom coding to the mod. Noone asked to base it on post counts in forums.
I give basic support in this topic.
Besides, every calculation uses an sql query, it seems not worth.
I abandoned all of my mods.
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

Mmm, ok then.
I guess i could find another solution.
Thanks.
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

We previously talk about the posts in a certain forum. What if i'd like to count the topic only?
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

For topic counts, you'll need run sql queries on TOPICS_TABLE
I abandoned all of my mods.
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

mtrs wrote:For X posts limit, it is simple,
After installing this mod

Open
includes/ucp/ucp_profile.php
Find

Code: Select all

if ($auth->acl_get('u_change_colour'))
Replace with

Code: Select all

if ($auth->acl_get('u_change_colour') && $user->data['user_posts'] > 999)
For X posts limit in some forums
Open
includes/ucp/ucp_profile.php
Find

Code: Select all

if ($auth->acl_get('u_change_colour'))
Replace with

Code: Select all

	// Count users post in $X forum ID
		$X = 555; //forum_id where posts will be counted //change to an appropriate number you need
		$sql = 'SELECT COUNT(post_id) as posts_num
			FROM ' . POSTS_TABLE . '
			WHERE poster_id = ' . $user->data['user_id'] . ';
				AND forum_id = ' . $X;
		$result = $db->sql_query($sql);
		$user_posts_num = (int) $db->sql_fetchfield('posts_num');
		$db->sql_freeresult($result);
if ($auth->acl_get('u_change_colour') && $user_posts_num > 99 && $user->data['user_posts'] > 999)
Also you can use the user permissions to only allow certain users

Note: code is not tested, you need to test. Replace 99 and 999 number with your limit.

Don't we just need to replace "user_posts" or "post_num" with "user_topic" or "topic_num"?
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

No answers?
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

No, it is not that simple. User topics count is not stored at database, you'll have to run a query to learn topics count.
I abandoned all of my mods.
BMercer
Registered User
Posts: 55
Joined: Tue Aug 04, 2009 10:58 pm

Re: Username Colour Change MOD

Post by BMercer »

Sorry, but i thought:
When you use the search.php functions and you search topic of a certain user in a certain forum isnt that the same? Anyway i dont know anything, i can just try to help you helping me.
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

search.php runs sql queries to count them. User topic number are not stored or updated at database, unless you install a mod.
$user->data['user_posts'] exists by default, but $user->data['user_topics'] is not used at an unmodded board.
I abandoned all of my mods.
User avatar
Ephemeraboy
Registered User
Posts: 333
Joined: Tue Dec 29, 2009 4:25 pm
Location: Bandung Kota Hujan
Name: Bernando Bona Tius Sianipar
Contact:

Re: Username Colour Change MOD

Post by Ephemeraboy »

it doesn't appear at UCP...??
any solution...??
My diary, my notepad, and my life on
http://www.bonatius.com
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

After installing the mod, also read DIY instructions. You should set the user permissions.
I abandoned all of my mods.
User avatar
Bobski2000
Registered User
Posts: 130
Joined: Mon Feb 16, 2009 9:40 pm
Location: UK

Re: Username Colour Change MOD

Post by Bobski2000 »

HI,

Will you be updating this mod so it works with 3.0.6?

Ta

Dave
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Username Colour Change MOD

Post by mtrs »

Mod works with 3.0.6 fine, no update needed.
I abandoned all of my mods.
User avatar
Bobski2000
Registered User
Posts: 130
Joined: Mon Feb 16, 2009 9:40 pm
Location: UK

Re: Username Colour Change MOD

Post by Bobski2000 »

Hi, im installing this mod on my new board and im up to editing the first edit includes/acp/acp_board.php.

Find:

Code: Select all

'warnings_expire_days'	=> array('lang' => 'WARNINGS_EXPIRE',		'validate' => 'int',	'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
Add After:

Code: Select all

			// Begin : Username Colour Change MOD
		//If other mods are installed you may have to change legend3 to the next available legend number
					'legend3'						=> 'USERNAME_COLOUR_CHANGE',
					'uccm_euclidean_distance'		=> array('lang' => 'SIMILAR_COLOUR_CHECK',	'validate' => 'int:0:650',	'type' => 'text:4:4', 'explain' => true),
					'uccm_disallowed_colours'		=> array('lang' => 'DISALLOWED_COLOURS',	'validate' => 'string',	'type' => 'text:25:255', 'explain' => true),
		// End : Username Colour Change MOD
But i see that i already have legend3?

Code: Select all

'legend3'					=> 'ACP_SUBMIT_CHANGES',
Any ideas please?
Will this be a problem?
Locked

Return to “[3.0.x] MOD Database Releases”