News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Member Awards (2.0 Compatible!)

Started by Spuds, September 18, 2006, 03:14:03 PM

Previous topic - Next topic

JayBachatero

Run this query in phpMyAdmin.

REPLACE INTO smf_settings
(variable, value)
VALUES ('admin_areas_other', 1)
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

YelleN

done. I got:
Inserted rows: 2 (Query took 0.0003 sec)

but I still can't see the award thingy anywhere

JayBachatero

Replace the adminIndex function with this one.

// Set up the administration sections.
function adminIndex($area)
{
global $txt, $context, $scripturl, $sc, $modSettings, $user_info, $settings;

// Load the language and templates....
loadLanguage('Admin');
loadTemplate('Admin');

// Admin area 'Main'.
$context['admin_areas']['forum'] = array(
'title' => $txt[427],
'areas' => array(
'index' => '<a href="' . $scripturl . '?action=admin">' . $txt[208] . '</a>',
'credits' => '<a href="' . $scripturl . '?action=admin;credits">' . $txt['support_credits_title'] . '</a>',
)
);

if (allowedTo(array('edit_news', 'send_mail', 'admin_forum')))
$context['admin_areas']['forum']['areas']['news'] = '<a href="' . $scripturl . '?action=news">' . $txt['news_title'] . '</a>';

if (allowedTo('admin_forum'))
$context['admin_areas']['forum']['areas']['manage_packages'] =  '<a href="' . $scripturl . '?action=packages">' . $txt['package1'] . '</a>';

// Admin area 'Configuration'.
if (allowedTo('admin_forum'))
{
$context['admin_areas']['config'] = array(
'title' => $txt[428],
'areas' => array(
'edit_mods_settings' => '<a href="' . $scripturl . '?action=featuresettings">' . $txt['modSettings_title'] . '</a>',
'edit_settings' => '<a href="' . $scripturl . '?action=serversettings;sesc=' . $sc . '">' . $txt[222] . '</a>',
'edit_theme_settings' => '<a href="' . $scripturl . '?action=theme;sa=settings;th=' . $settings['theme_id'] . ';sesc=' . $sc . '">' . $txt['theme_current_settings'] . '</a>',
'manage_themes' => '<a href="' . $scripturl . '?action=theme;sa=admin;sesc=' . $sc . '">' . $txt['theme_admin'] . '</a>',
)
);
}

// Admin area 'Forum'.
if (allowedTo(array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum')))
{
$context['admin_areas']['layout'] = array(
'title' => $txt['layout_controls'],
'areas' => array()
);

if (allowedTo('manage_boards'))
$context['admin_areas']['layout']['areas']['manage_boards'] =  '<a href="' . $scripturl . '?action=manageboards">' . $txt[4] . '</a>';

if (allowedTo(array('admin_forum', 'moderate_forum')))
$context['admin_areas']['layout']['areas']['posts_and_topics'] = '<a href="' . $scripturl . '?action=postsettings">' . $txt['manageposts'] . '</a>';
if (allowedTo('admin_forum'))
{
$context['admin_areas']['layout']['areas']['manage_calendar'] = '<a href="' . $scripturl . '?action=managecalendar">' . $txt['manage_calendar'] . '</a>';
$context['admin_areas']['layout']['areas']['manage_search'] = '<a href="' . $scripturl . '?action=managesearch">' . $txt['manage_search'] . '</a>';
}
if (allowedTo('manage_smileys'))
$context['admin_areas']['layout']['areas']['manage_smileys'] = '<a href="' . $scripturl . '?action=smileys">' . $txt['smileys_manage'] . '</a>';

if (allowedTo('manage_attachments'))
$context['admin_areas']['layout']['areas']['manage_attachments'] = '<a href="' . $scripturl . '?action=manageattachments">' . $txt['smf201'] . '</a>';
}

// Admin area 'Members'.
if (allowedTo(array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum')))
{
$context['admin_areas']['members'] = array(
'title' => $txt[426],
'areas' => array()
);

if (allowedTo('moderate_forum'))
$context['admin_areas']['members']['areas']['view_members'] = '<a href="' . $scripturl . '?action=viewmembers">' . $txt[5] . '</a>';

if (allowedTo('manage_membergroups'))
$context['admin_areas']['members']['areas']['edit_groups'] = '<a href="' . $scripturl . '?action=membergroups;">' . $txt[8] . '</a>';

if (allowedTo('manage_permissions'))
$context['admin_areas']['members']['areas']['edit_permissions'] = '<a href="' . $scripturl . '?action=permissions">' . $txt['edit_permissions'] . '</a>';

if (allowedTo(array('admin_forum', 'moderate_forum')))
$context['admin_areas']['members']['areas']['registration_center'] = '<a href="' . $scripturl . '?action=regcenter">' . $txt['registration_center'] . '</a>';

if (allowedTo('manage_bans'))
$context['admin_areas']['members']['areas']['ban_members'] = '<a href="' . $scripturl . '?action=ban">' . $txt['ban_title'] . '</a>';
}

// Admin area 'Maintenance Controls'.
if (allowedTo('admin_forum'))
{
$context['admin_areas']['maintenance'] = array(
'title' => $txt[501],
'areas' => array(
'maintain_forum' => '<a href="' . $scripturl . '?action=maintain">' . $txt['maintain_title'] . '</a>',
'generate_reports' => '<a href="' . $scripturl . '?action=reports">' . $txt['generate_reports'] . '</a>',
// !!! Why?  Don't you want to take care of errors in the order they happened, like normal people and programmers?  Seeing them backwards helps no one, and only increases confusion.
// !!! You know I've argued this before.
'view_errors' => '<a href="' . $scripturl . '?action=viewErrorLog;desc">' . $txt['errlog1'] . '</a>'
)
);

if (!empty($modSettings['modlog_enabled']))
$context['admin_areas']['maintenance']['areas']['view_moderation_log'] = '<a href="' . $scripturl . '?action=modlog">' . $txt['modlog_view'] . '</a>';
}

// Other.  This is shown w/o permissions so that it works with other mods.
$context['admin_areas']['other'] = array(
'title' => $txt[5000],
'areas' => array(),
);

// Category for admin panel.  Pogo Awards
if ((isset($modSettings['admin_areas_other']) && $modSettings['admin_areas_other'] == 1) && allowedTo('manage_awards'))
{
$context['admin_areas']['other']['areas']['awards_admin'] = '<a href="' . $scripturl . '?action=awards">' . $txt['awards'] . '</a>';
}
elseif (!isset($modSettings['admin_areas_other']) || (isset($modSettings['admin_areas_other']) && $modSettings['admin_areas_other'] == 0) && allowedTo('manage_awards'))
{
$context['admin_areas']['awards_admin'] = array(
'title' =>  $txt['pa_mods'],
'areas' => array(
'awards_admin' => '<a href="' . $scripturl . '?action=awards">' . $txt['awards'] . '</a>',
),
);
}

//A new mods section for the Global Announcements.
if ((isset($modSettings['admin_areas_other']) && $modSettings['admin_areas_other'] == 1) && allowedTo('global_announcements_admin'))
{
$context['admin_areas']['other']['areas']['ga_admin'] = '<a href="' . $scripturl . '?action=globalAnnouncementsAdmin">' . $txt['global_announcements_admin'] . '</a>';
}
elseif (!isset($modSettings['admin_areas_other']) || (isset($modSettings['admin_areas_other']) && $modSettings['admin_areas_other'] == 0) && allowedTo('global_announcements_admin'))
{
$context['admin_areas']['ga_admin'] = array(
'title' =>  $txt['global_announcements_mods'],
'areas' => array(
'ga_admin' => '<a href="' . $scripturl . '?action=globalAnnouncementsAdmin">' . $txt['global_announcements_admin'] . '</a>',
),
);
}

// Make sure the administrator has a valid session...
validateSession();

// Figure out which one we're in now...
foreach ($context['admin_areas'] as $id => $section)
if (isset($section[$area]))
$context['admin_section'] = $id;
$context['admin_area'] = $area;

// obExit will know what to do!
$context['template_layers'][] = 'admin';
}
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

YelleN

hmmm I did that and now I am getting:
Parse error: parse error, unexpected T_STRING, expecting ')' in /srv/www/vhosts/www.osa-clan.com/forum/Sources/Subs.php on line 3572

I restored and now it is still there...

JayBachatero

You might have missed something when you replaces the function.  Email me the whole file.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

YelleN


JayBachatero

Ok here you go.  Your text editor messed some special chars up.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

YelleN

it worked thanks man  8)

I should have check the end of line character  :P :P :P :P :P

JayBachatero

Just keep it in mind next time.  I suggest you use an editor like ConTEXT.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

YelleN

thanks for the tip :-)

normaly I use JEdit [nofollow] but since I did a copy and paste I used Kate(KDE) and that fooked up :)

JayBachatero

Yea I had a similar problem with gEdit.  Seems like it can't handle UTF-8 chars correctly.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Assistance

would it be possible to ask for a Tiny Portal Block?

something like ( more idea's welcome if someone can do this, willingly )

Most Revent Award
( Image )
# of people
if less then 10 : list them

Most Awards
List Top 5 or 10
~playing poker~

JayBachatero

It can be done.  I just haven't really looked at how TP handles the blocks.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

TechnoDragon

actually in a variety of ways...php, script/html, ssi...the list goes on...I think at a minimum it would need a database call to calculate the most recent x number of awards added.

for the listing of who has a particular award...seems like it would be easy, because you could call up the most recently added award and then call all of the members that have that award assigned, though that list could get lengthy depending on the number of people that have it.
Don't tell me to get into shape...I have a shape...It is round!


Mamoun

#134
Hii,
I use Arabic UTF8 language pack, I have copied all the mod entries in the modification.english to modification.arabic-utf8 BUT I get when I clicked the awards admin section.


Loverboy

Quote from: Mamoun on October 24, 2006, 11:01:19 AM
Hii,
I use Arabic UTF8 language pack, I have all the mod entries in the modification.english in modification.arabic-utf8 BUT I get when I clicked the awards admin section.
You miss a language file. I can't figure out which one.

Mamoun

Really fast reply :D

Yes, I will try to figure out which one, Thanks for your reply

JayBachatero

ManageAwards.english.php
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Mamoun

#138
That was it, Thanks  :D

EDIT: Sorry to ruin the fun, But looks like your mods don't like RC3 UTF8, I get question marks too with this mod :'(

JayBachatero

For the language file?  Did you use the correct entities for it?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: