Skip to content

Commit

Permalink
added moderator role
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahY committed Jan 21, 2012
1 parent 6f585a0 commit 1289551
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
File renamed without changes
File renamed without changes
Binary file added expert.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
17 changes: 10 additions & 7 deletions qa-marker-admin.php
Expand Up @@ -11,7 +11,7 @@ function option_default($option) {
switch($option) {
case 'marker_plugin_who_text':
return '♦';
case 'marker_plugin_css':
case 'marker_plugin_css_2':
return '
.qa-q-item-avatar,.qa-q-view-avatar,.qa-a-item-avatar,.qa-c-item-avatar {
position:relative;
Expand All @@ -23,13 +23,16 @@ function option_default($option) {
vertical-align: sub;
line-height: 50%;
}
.qa-who-marker-bronze {
.qa-who-marker-expert {
color: #4D90FE;
}
.qa-who-marker-editor {
color: #CB9114;
}
.qa-who-marker-silver {
.qa-who-marker-moderator {
color: #CDCDCD;
}
.qa-who-marker-gold {
.qa-who-marker-admin {
color: #EEDD0F;
}
.qa-avatar-marker {
Expand All @@ -50,7 +53,7 @@ function admin_form(&$qa_content)

$ok = null;
if (qa_clicked('marker_save_button')) {
qa_opt('marker_plugin_css',qa_post_text('marker_plugin_css'));
qa_opt('marker_plugin_css_2',qa_post_text('marker_plugin_css_2'));
qa_opt('marker_plugin_who_text',qa_post_text('marker_plugin_who_text'));


Expand Down Expand Up @@ -94,8 +97,8 @@ function admin_form(&$qa_content)

$fields[] = array(
'label' => 'Marker custom css',
'tags' => 'NAME="marker_plugin_css"',
'value' => qa_opt('marker_plugin_css'),
'tags' => 'NAME="marker_plugin_css_2"',
'value' => qa_opt('marker_plugin_css_2'),
'type' => 'textarea',
'rows' => 20
);
Expand Down
12 changes: 8 additions & 4 deletions qa-marker-layer.php
Expand Up @@ -7,7 +7,7 @@ function head_custom()

$this->output('
<style>
'.qa_opt('marker_plugin_css').'
'.qa_opt('marker_plugin_css_2').'
</style>');
}

Expand Down Expand Up @@ -56,15 +56,19 @@ function get_role_marker($uid,$switch) {
$user = get_userdata( $uid );
if (isset($user->wp_capabilities['administrator']) || isset($user->caps['administrator']) || isset($user->allcaps['administrator'])) {
$level=qa_lang('users/level_admin');
$img = 'gold';
$img = 'admin';
}
elseif (isset($user->wp_capabilities['moderator']) || isset($user->caps['moderator'])) {
$level=qa_lang('users/level_moderator');
$img = 'moderator';
}
elseif (isset($user->wp_capabilities['editor']) || isset($user->caps['editor'])) {
$level=qa_lang('users/level_editor');
$img = 'silver';
$img = 'editor';
}
elseif (isset($user->wp_capabilities['contributor']) || isset($user->caps['contributor'])) {
$level=qa_lang('users/level_expert');
$img = 'bronze';
$img = 'expert';
}
else
return;
Expand Down

0 comments on commit 1289551

Please sign in to comment.