News:

Wondering if this will always be free?  See why free is better.

Main Menu

Remove Admin Title

Started by big red, December 12, 2010, 12:56:59 PM

Previous topic - Next topic

big red

   SMF 2.0RC4

  In the user area of the posts, i would like to remove the "admin title". I've already selected "hide post group titles" which removed "newbie" from the admin user area. Then, in edit membership groups/admin, if i remove the administrator title and just leave it blank, "newbie" shows up again  :(

  So i tried editing the Display Template but got a syntax error. Could someone show me what has to be changed in the code to remove the administrator title "only"?

// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group']))
echo '
<li class="membergroup">', $message['member']['group'], '</li>';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
<li class="postgroup">', $message['member']['post_group'], '</li>';
echo '
<li class="stars">', $message['member']['group_stars'], '</li>';



In the second code, i have an issue i haven't been able to solve. The useron/off image sits on the "same line" as the "username" and causes the username to be "out of center". As you can see by "align center", i have the user area info all centered and i need to have the useron/off image on it's own line so everything is centered  ;)

     Thank You

// Show information about the poster of this message.
echo '
<div class="poster" style="text-align: center;">
<h4>';

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '" />', $context['can_send_pm'] ? '</a>' : '';


sAce

So basically you dont want any titles at all, right ?

and for the Online status image, you just need to add "<br />" to the end of the code.

big red

Quote from: S-Ace on December 12, 2010, 01:06:33 PM
So basically you dont want any titles at all, right ?

   What i've done is replace the admin "stars" image url with an "admin image"  :) But now i have text "administrator" and below that "admin" as an image. I just want to remove the administrator"text" and only for the administrator group.

    If i leave the admin title blank in the edit membership groups area, it shows "newbie" again  ???

sAce

Remove this

// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">', $message['member']['group'], '</li>';

big red

Quote from: S-Ace on December 12, 2010, 01:06:33 PMand for the Online status image, you just need to add "<br />" to the end of the code.

   After a few tries, i added it here and it worked. Is this correct because even though the the useron/off image is on it's own line and has moved towards the center, it and the username still appear to be somewhat out of center (slightly towards the right compared with the rest of the user info).

  BTW, Thanks for your help so far!

echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '" />', $context['can_send_pm'] ? '</a><br />' : '';



sAce

Could you please provide the link to your website ?

big red

Quote from: S-Ace on December 12, 2010, 02:05:57 PM
Could you please provide the link to your website ?

  My site is still closed to the public so i'm sending you details via p.m.

big red

Correction:

  I added it here:

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '" />', $context['can_send_pm'] ? '</a><br />' : '';


sAce

Edit your Themes/theme_name/css/index.css file and look for .poster h4,

In there delete the margin element , or make it 0

big red

Quote from: S-Ace on December 12, 2010, 02:35:59 PM
Edit your Themes/theme_name/css/index.css file and look for .poster h4,

In there delete the margin element , or make it 0

  Yes, that did it and both issues fixed  ;)

   Thank You so much S-Ace  ;D

big red

Quote from: S-Ace on December 12, 2010, 01:47:37 PM
Remove this

// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">', $message['member']['group'], '</li>';


  This did work for me however, i've been trying to add color or an image to the poster info area in posts and as you can see in my included attachment, it's cut off where the administrator title was removed. The rest are fine - just like this for admin.

   As my forum isn't completed yet, i've blurred out the username and useron/off image. It's the line that runs straight through.

   Any ideas??

       Thanks!

sAce

Probably some padding is there, can you please provide the website url where this is viewable ?

Baby Daisy

Put back in this:
// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">', $message['member']['group'], '</li>';


And then change it to this:
// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">&nbsp;</li>';


The reason that padding problem exists is because the way the CSS is compiled and built recognizes another list element, you cannot simply remove it from the index and expect it to work.
あなたは私のお尻にキスするとき、私はそれを愛する

big red

Quote from: Moonview on December 28, 2010, 05:14:55 PM
Put back in this:
// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">', $message['member']['group'], '</li>';


And then change it to this:
// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">&nbsp;</li>';


The reason that padding problem exists is because the way the CSS is compiled and built recognizes another list element, you cannot simply remove it from the index and expect it to work.

    Hi There - just getting to the thread now and tried this and it worked!  ;D

       Thank You

   I have another question please: This code is just below

// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
<li class="postgroup">', $message['member']['post_group'], '</li>';
echo '
<li class="stars">', $message['member']['group_stars'], '</li>';


   ....and the problem i have is if i add a member to a "special new non-post group", the post group title disappears  :(

    I would like both the post group and non post group title to show. Can something be changed in the above code to do that??

     Thanks Again for the help!

ACAMS

#14
Quote from: S-Ace on December 12, 2010, 01:47:37 PM
Remove this

// Show the member's primary group (like 'Administrator') if they have one.
      if (!empty($message['member']['group']))
         echo '
                        <li class="membergroup">', $message['member']['group'], '</li>';



I saw this and have been wanting to do it for a long time, but I want to do it for post count groups too.......is that possible?

Thanks for the help!

I would still like to have post count groups, but show stars instead of the text.

I deleted this and all stars went away.


// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
                                    if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
                                                echo '
                                                                                                <li class="postgroup">', $message['member']['post_group'], '</li>';
                                    echo '
                                                                                                <li class="stars">', $message['member']['group_stars'], '</li>';


Deaks

big red do you still require assistance?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: