Hello Guest
No Avatar
Sign In to Remove
Posts: 
17
Reputation: 
5
Posted: April 26, 2011, 9:33 AM  -- Last Edit: April 27, 2011, 3:06 AM by Blueberry
  • Group: Member
On a old theme my forum use to use, for admins it would say when a Fourm Account is Awaiting Approval, because we had spam bots. But we switch to your new and sexy theme, but it doesn't have it. I wanted to know how to implant it. Heres the code.

Code: [Select]
// Are there any members waiting for approval?
                        if (!empty($context['unapproved_members']))
                        echo '
                           <li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';

                        echo '
                           <li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
                           <li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
                  echo '
                     </ul>';
                  }

Heres the page it would take you to, to approve it.

Heres where I want the notification / button.
Posts: 
400
Reputation: 
20
Posted: April 26, 2011, 9:52 AM  -- Last Edit: April 26, 2011, 10:07 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
This should work but it is untested and if you get any errors please just come back  ;)

FIND (index.template.php)
Code: [Select]
else
{
echo '
<div class="top_bar_welcome_member">
<div class="top_bar_welcome_member_text">', $txt['vp_greeting'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=profile">',$context['user']['name'],'</a> |
<a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=login">', $txt['vp_sign_in'] ,'</a> ', $txt['vp_or'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=register">', $txt['vp_register'] ,'</a>
</div>
</div>
';
}


REPLACE:
Code: [Select]
else
{
echo '
<div class="top_bar_welcome_member">
<div class="top_bar_welcome_member_text">', $txt['vp_greeting'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=profile">',$context['user']['name'],'</a> |
<a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=login">', $txt['vp_sign_in'] ,'</a> ', $txt['vp_or'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=register">', $txt['vp_register'] ,'</a>
</div>
</div>
';
}



// Are there any members waiting for approval? blueberry code
                        echo '
                             <div class="floatleft">
                             <ul>
                        '; 
                        if (!empty($context['unapproved_members']))
                        echo '
                           <li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';

                        echo '
                           <li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
                           <li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
                  echo '
                     </ul>
                    </div>';
                  }
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
17
Reputation: 
5
Posted: April 26, 2011, 10:31 AM
  • Group: Member
Code: [Select]
The file you tried to save generated the following error:
Parse error: syntax error, unexpected '}' in index.template.php on line 344
Posts: 
400
Reputation: 
20
Posted: April 27, 2011, 2:08 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
It was your code with the extra } at the bottom if you see here is the new edits - come back as always::

FIND (index.template.php)
Code: [Select]
else
{
echo '
<div class="top_bar_welcome_member">
<div class="top_bar_welcome_member_text">', $txt['vp_greeting'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=profile">',$context['user']['name'],'</a> |
<a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=login">', $txt['vp_sign_in'] ,'</a> ', $txt['vp_or'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=register">', $txt['vp_register'] ,'</a>
</div>
</div>
';
}


REPLACE:
Code: [Select]
else
{
echo '
<div class="top_bar_welcome_member">
<div class="top_bar_welcome_member_text">', $txt['vp_greeting'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=profile">',$context['user']['name'],'</a> |
<a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=login">', $txt['vp_sign_in'] ,'</a> ', $txt['vp_or'] ,' <a class="top_bar_welcome_member_text" href="', $scripturl ,'?action=register">', $txt['vp_register'] ,'</a>
</div>
</div>
';
}



// Are there any members waiting for approval? blueberry code
                        echo '
                             <div class="floatleft">
                             <ul>
                        '; 
                        if (!empty($context['unapproved_members']))
                        echo '
                           <li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';

                        echo '
                           <li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
                           <li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
                  echo '
                     </ul>
                    </div>';
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
17
Reputation: 
5
Posted: April 27, 2011, 2:57 AM
  • Group: Member
Its working so far great, I had to edit the code some to make it work, but here's the new code, in-case someone wants to use it.

Code: [Select]
// Are there any members waiting for approval? blueberry code
                        echo '
                             <div class="floatleft">
                             <ul>
                        '; 
                        if (!empty($context['unapproved_members']))
                        echo '
                           <li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve;">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
                  echo '
                     </ul>
                    </div>';

I have one problem thought, I dont want the dot there lol, and I want it to match the other text also.
Posts: 
17
Reputation: 
5
Posted: April 28, 2011, 2:22 AM
  • Group: Member
After help with my last problem, I should be good.
Posts: 
400
Reputation: 
20
Posted: April 28, 2011, 3:54 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
After help with my last problem, I should be good.

o lol sorry - I thought I read it all but here is a solution.

Add:
Code: [Select]
style="list-style: none;"
to your ul tag
<3 Nerve, Sk8, Labradoodle, Austin
anything