[MODDB] Inactive and Banned Users` Custom Titles & Avatars

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

[MODDB] Inactive and Banned Users` Custom Titles & Avatars

Post by mtrs » Tue Aug 05, 2008 5:50 pm

Modification Name: Inactive and Banned Users` Custom Titles & Avatars
Author: mtrs

Modification Description: This MOD assigns one of "the Inactive for X months" (3 months default), "Deactivated", "Banned" and "Suspended until X time" custom titles and/or avatars, also provides two default avatars and remove rank images of inactive users.

Modification Version:: 1.0.0

Modification Download: inactive_users.zip

Features:
  • To change the 3 months default inactive period setting.
    - Go to ACP / Board Settings / Inactive and Banned Users` Custom Titles & Avatars
  • Some users can be excluded by entering their user_ids at ACP.
  • Enabling banned, inactive users custom titles and avatars can be set at ACP for viewtopic and member profile pages separately.
  • If included user_ids field is filled at ACP, only those users can enable this mod. Any irrelevant value entered there will totally disable this mod, except default avatars.
  • Default avatars can be enabled and disabled independently. Users who has fewer than 25 posts take a new user default avatar, others take another one.
  • If enabled at ACP, this is the intended order to show inactive custom titles and avatars.
    - Banned/suspended, Inactive/deactivated (deactivated is seen only at viewtopic), normal users, 2 default avatar (25 post number selector)
  • Changing ACP settings always needs purging cache to be in effect once.
  • Ability to disable custom inactive and banned avatars view in viewtopic, but still seeing custom inactive or banned titles.
0.1.0
- Subsilver2 support added
- Some of the deactive, inactive, banned and suspended users bugs fixed
- Founders wont take banned/suspended title

0.2.0
- ACP controlled disable options
- memberprofile_view support for banned, suspended and inactive users
- "Ban reason shown to users" added to be seen by mods at viewtopic and profiles for only temporary bans
- User_id inclusion feature added to make custom titles and avatars only seen by certain users
- Custom and default avatars features added

0.2.1
- Fixed a long inactive title issue
- Added guest poster_id check for banned and suspended users
- Fix known issue of distinguishing two ban
- Demo board link added

0.2.2
- Fix bug

0.2.3
- Fix bug

0.2.4
- Fix to cancel viewing ranks twice in member profile
- A few syntax changes for coding guidelines
- Fix to ignore inactive title for those who never logged in
- Fix bug if quest poster open a new topic to be approved
- Mod package separated for subsilver2 and language files to comply modx-1.2.0

0.3.0 [Beta]
- Viewtopic custom avatar disable option added
- Code syntax corrected

0.3.1 [Beta]
- Bug fix in memberlist_view
- Language file entry
- Template paths variable and avatar names changed

0.4.0 [Beta] - 14.04.2008
- Code rewritten - function file added
- Template edits removed, mod simplified
- A user permission to view custom avatar and titles added
- UMIL suppport added

Version 0.4.0 does not contain any template edits.
There is only three file edits
- viewtopic.php
- memberlist.php
- acp_board.php

To update next version (0.4.0), you need to uninstall and install new Beta. Other than viewtopic custom title disable option, this version has same the features like the previous version.
Last edited by mtrs on Mon Jul 13, 2009 8:11 am, edited 22 times in total.
I abandoned all of my mods.

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by Elias » Tue Aug 05, 2008 5:52 pm

Very nice MOD!
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany
Contact:

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by darkonia » Tue Aug 05, 2008 6:11 pm

nice mod :D
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

User avatar
Stitch625
Registered User
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan
Contact:

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by Stitch625 » Tue Aug 05, 2008 6:36 pm

I will definetly have to check this one out. thanks ;)

User avatar
^[GS]^
Registered User
Posts: 274
Joined: Sun Aug 06, 2006 10:59 pm
Location: Argentina
Contact:

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by ^[GS]^ » Tue Aug 05, 2008 9:41 pm

:o ! very useful ^^ thanx

I add this for memberlist view profile ^^

Open memberlist.php
Find

Code: Select all

		$template->assign_vars(array(
			'POSTS_DAY'			=> sprintf($user->lang['POST_DAY'], $posts_per_day),
Add before...

Code: Select all

		//Inactive Users Custom Titles
		$sql = 'SELECT ban_userid, ban_exclude, ban_end
		            FROM ' . BANLIST_TABLE . '
		            WHERE ' . $db->sql_in_set('ban_userid', $user_id);
				
		$result = $db->sql_query($sql);		
		
		$banned_id_list = array(0);
		$ban_end_time_list = array(0);
		$ban_exc_list = array();
		$ban_id_time_list = array();
		while ($row = $db->sql_fetchrow($result))
			{
				$banned_id_list[] = $row['ban_userid'];
				$ban_end_time_list[] = $row['ban_end'];		
		
				if ($row['ban_exclude'] == 1)
					$ban_exc_list[] = $row['ban_userid'];
			}	
		
		$ban_id_time_list = array_combine($banned_id_list, $ban_end_time_list);
		$db->sql_freeresult($result);
		$excluded_user_ids = array();
		$excluded_user_ids = ($config['inactive_users_exc_ids']) ? explode(",", $config['inactive_users_exc_ids']) : array();
	
		$bantest = 0;
		if(in_array((integer)$user_id, $banned_id_list) && !in_array((integer)$user_id, $excluded_user_ids) && !in_array((integer)$user_id, $ban_exc_list) && ($user_cache[$user_id]['type'] != 3)) 
			{	
				if($ban_id_time_list[(integer)$user_id] == 0)
					$bantest = 1; 
				else
					$bantest = $ban_id_time_list[(integer)$user_id];
			}
		//Inactive Users Custom Titles
Find..

Code: Select all

			'OCCUPATION'	=> (!empty($member['user_occ'])) ? censor_text($member['user_occ']) : '',
Add after...

Code: Select all

	//Inactive User Custom Titles
			'LASTVISIT_DIFF_KEY'	 => ((time() - $user_cache[$poster_id]['lastvisit'] > ($config['inactive_users_period'] * 2592000) || $user_cache[$poster_id]['type'] == 1) && (!in_array((integer)$poster_id, $excluded_user_ids) && $user_cache[$poster_id]['posts'] > 0)) ? true : false,
			'LASTVISIT_LANG' => ($user_cache[$poster_id]['type'] == 1 ) ? $user->lang['USER_DEACTIVE'] : sprintf($user->lang['USER_INACTIVE'], intval((time() - $user_cache[$poster_id]['lastvisit'])/2592000)),
			'NOT_BANNED_KEY' => ($bantest == 0) ? false : true,
			'BANNED_SUSPENDED_LANG' => ($bantest == 1 && $bantest != 0 ) ? $user->lang['USER_BANNED'] : sprintf($user->lang['USER_SUSPENDED'], $user->format_date($bantest)), 
	//Inactive Users Custom Titles
Now, open styles/prosilver/template/memberlist_view.html
Find..

Code: Select all

<dt>{L_VISITED}:</dt> <dd><strong>{VISITED}</strong></dd>
Add after..

Code: Select all

		<!-- IF NOT_BANNED_KEY --><dt></dt><dd>{BANNED_SUSPENDED_LANG}</dd><!-- ELSEIF LASTVISIT_DIFF_KEY --><dt></dt><dd>{LASTVISIT_LANG}</dd><!-- ENDIF -->
Enjoy ^^ nice mod :)

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

Re: [ALPHA2] Inactive and Banned Users` Custom Titles & Avatars

Post by mtrs » Sun Aug 10, 2008 12:39 pm

EY wrote:Very nice MOD!
Thank you EY, for your comment, I made something more make it nicer.. ;)
darkonia wrote:nice mod :D
Glad, you like it. :)
^[GS]^ wrote: :o ! very useful ^^ thanx

I add this for memberlist view profile ^^

Open memberlist.php
Find
Thanks ^[GS]^ for your help and starting the memberlist view edits. This mod has now have more features including custom avatars. Your encouragement made me start again and improve it. :)
Stitch625 wrote:I will definetly have to check this one out. thanks ;)
Thank you Stitch625, it is your Custom Rank Titles Mod I got familiar with template edits, then I wrote this mod, well but this took a lote of time, testing :( testing.. :)
Actually, while installing your mod thinking it with user_ids exclusions feature, I learnt a little bit more.. I can say that, the excluded user_id feature, would also be nice for your Custom Rank Titles mod.


******************************
Since I updated the mod, which now has new features of custom avatars and more ACP control options, if anyone installed Alpha1 before, they should first uninstall older version 0.1.0, then install this version 0.2.0.
I abandoned all of my mods.

User avatar
Lisbon
Registered User
Posts: 825
Joined: Wed Jan 30, 2008 12:28 pm
Location: Zermatt

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by Lisbon » Sun Aug 10, 2008 5:55 pm

^[GS]^ wrote::o ! very useful ^^ thanx

I add this for memberlist view profile ^^

...

Now, open styles/prosilver/template/memberlist_view.html
Can you adapte also for a subsilver2 :?:

Tks

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

Re: [ALPHA] Inactive Users Custom Titles 0.1.0

Post by mtrs » Sun Aug 10, 2008 6:33 pm

Lisbon wrote:Can you adapte also for a subsilver2 :?:

Tks
Please see the updated first post in this topic. There are prosilver and subsilver2 secreenshots. Download file also includes subsilver2 edits.
I abandoned all of my mods.

User avatar
Lisbon
Registered User
Posts: 825
Joined: Wed Jan 30, 2008 12:28 pm
Location: Zermatt

Re: [ALPHA2] Inactive and Banned Users` Custom Titles & Avatars

Post by Lisbon » Sun Aug 10, 2008 7:34 pm

Ok.

Im Sorry :oops:

Tks for help ;)

User avatar
^[GS]^
Registered User
Posts: 274
Joined: Sun Aug 06, 2006 10:59 pm
Location: Argentina
Contact:

Re: [ALPHA2] Inactive and Banned Users` Custom Titles & Avatars

Post by ^[GS]^ » Mon Aug 11, 2008 5:26 am

careful, because you have an error in viewtopic, whether the topic I think a guest, in this case must be determined whether the id of the poster is not a guest.

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

Re: [ALPHA2] Inactive and Banned Users` Custom Titles & Avatars

Post by mtrs » Mon Aug 11, 2008 10:27 am

^[GS]^ wrote:careful, because you have an error in viewtopic, whether the topic I think a guest, in this case must be determined whether the id of the poster is not a guest.
Thanks for the note.
Although, I couldn't reproduce the error, I added another check for guest poster_id in viewtopic.php .

Open
viewtopic.php

Find

Code: Select all

//We check if only a few users allowed to see custom titles and avatars 
if($included_only)
Replace with

Code: Select all

//We check if only a few users allowed and anonymous poster won't take banned custom title and avatar
if($included_only && ($poster_id != 1))
I abandoned all of my mods.

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

Re: [ALPHA] Inactive and Banned Users` Custom Titles & Avatars

Post by mtrs » Thu Aug 14, 2008 7:19 pm

- Mod version updated to 0.2.1
- Demo board link added
I abandoned all of my mods.

User avatar
Lisbon
Registered User
Posts: 825
Joined: Wed Jan 30, 2008 12:28 pm
Location: Zermatt

Re: [ALPHA] Inactive and Banned Users` Custom Titles & Avatars

Post by Lisbon » Fri Aug 15, 2008 4:08 pm

Whit this mod can i inactivate a member manually and activate when i want?

User avatar
..::House::..
Registered User
Posts: 212
Joined: Tue Jul 22, 2008 3:52 am

Re: [ALPHA] Inactive and Banned Users` Custom Titles & Avatars

Post by ..::House::.. » Fri Aug 15, 2008 4:12 pm

Very Nice MOD!
Good Job,
GoogleSupport Request GeneratorNo Support via PMFirefox Download

autinhyeu
Registered User
Posts: 685
Joined: Mon Apr 14, 2008 6:34 am
Location: Vietnamese
Contact:

Re: [ALPHA] Inactive and Banned Users` Custom Titles & Avatars

Post by autinhyeu » Fri Aug 15, 2008 4:17 pm

Cool MOD.
Thanks ;)
phpBB Community in Vietnamese: http://www.phpbbvn.com

Sorry, my English language is fine impossible

Locked

Return to “[3.0.x] MODs in Development”