Jump to content


- - - - -

BBCode/ HTML in member titles


  • Please log in to reply
1 reply to this topic

#1 smcentral

smcentral

    Member

  • Members
  • PipPipPip
  • 25 posts
  • Location:SMCentral HQ
  • Real Name:Shear Mohammed
  • IPB Version:v3.2.x

Posted 18 November 2011 - 12:13 PM

Past few weeks, my members are requesting that they have colour in their member titles. So I've been doing research all over to find out how I can add bbcode/ html to member titles in 3.2. Member titles are added by admins so I have no fear of any wrong-doing or such. Just need to get pointed in the right direction, maybe a tweak or tickle. :)
Hi there!

#2 smcentral

smcentral

    Member

  • Members
  • PipPipPip
  • 25 posts
  • Location:SMCentral HQ
  • Real Name:Shear Mohammed
  • IPB Version:v3.2.x

Posted 18 November 2011 - 01:36 PM

With my basic understanding of php. I managed a work around, creating this.

This is in the /admin/applications/members/member.php

//-----------------------------------------
		// Fix custom title
		// @see	http://forums.invisionpower.com/index.php?app=tracker&showissue=17383
		//-----------------------------------------
		
		$memberTitle	= $this->request['title'];
		$rankCache		= ipsRegistry::cache()->getCache( 'ranks' );
		$toReplace = array('<', '>'); // replace this
		$replaceWith = array('<', '>'); // with this
		$memberTitle = str_replace($toReplace, $replaceWith, $memberTitle); // final product
		if ( is_array( $rankCache ) && count( $rankCache ) )
		{
			foreach( $rankCache as $k => $v)
			{
				if ( $member['posts'] >= $v['POSTS'] )
				{
					/* If this is the title passed to us from the form, we didn't have a custom title */
					if ( $v['TITLE'] == $memberTitle )
					{
						$memberTitle	= '';
					}

					break;
				}
			}
		}


Is there a way to put this in a hook?

Edited by smcentral, 18 November 2011 - 01:36 PM.

Hi there!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users