-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactoring' of https://github.com/EzioBallarin/game-on …
…into TheMacLab/master Conflicts: types/tasks/task_shortcode.php
- Loading branch information
Showing
54 changed files
with
7,060 additions
and
7,706 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,60 @@ | ||
<?php | ||
|
||
function go_display_comment_author() { | ||
function go_display_comment_author () { | ||
global $comment; | ||
$author_id = $comment->user_id; | ||
$author = $comment->comment_author; | ||
$author_obj = get_userdata($author_id); | ||
$author_obj = get_userdata( $author_id ); | ||
$author_roles = $author_obj->roles; | ||
$is_admin = false; | ||
if (is_array($author_roles)) { | ||
foreach ($author_roles as $role) { | ||
if ($role == "administrator") { | ||
if ( is_array( $author_roles ) ) { | ||
foreach ( $author_roles as $role ) { | ||
if ( $role == "administrator" ) { | ||
$is_admin = true; | ||
break; | ||
} | ||
} | ||
} else { | ||
if ($author_roles == "administrator") { | ||
if ( $author_roles == 'administrator' ) { | ||
$is_admin = true; | ||
} | ||
} | ||
if ($is_admin) { | ||
if ( $is_admin ) { | ||
return $author; | ||
} else { | ||
$points = get_user_meta($author_id, 'go_rank', true); | ||
$focus = get_user_meta($author_id, 'go_focus', true); | ||
if (!empty($focus)) { | ||
if (is_array($focus)) { | ||
for ($i = 0; $i < count($focus); $i++) { | ||
if (!empty($focus[$i])) { | ||
$careers .= $focus[$i]; | ||
if (($i + 1) < count($focus)) { | ||
$points = get_user_meta( $author_id, 'go_rank', true ); | ||
$focus = get_user_meta( $author_id, 'go_focus', true ); | ||
if ( !empty( $focus ) ) { | ||
if ( is_array( $focus ) ) { | ||
for ( $i = 0; $i < count( $focus ); $i++ ) { | ||
if ( !empty( $focus[ $i ] ) ) { | ||
$careers .= $focus[ $i ]; | ||
if ( ( $i + 1 ) < count( $focus ) ) { | ||
$careers .= '/'; | ||
} | ||
} | ||
} | ||
} else { | ||
$no_focus_str = 'No '.get_option('go_focus_name', 'Profession'); | ||
if ($focus != $no_focus_str) { | ||
$no_focus_str = 'No '.get_option( 'go_focus_name', 'Profession' ); | ||
if ( $focus != $no_focus_str ) { | ||
$careers = $focus; | ||
} | ||
} | ||
} | ||
if (!empty($careers)) { | ||
if (!empty($points)) { | ||
if ( !empty( $careers ) ) { | ||
if ( !empty( $points ) ) { | ||
return $author.'<br/>'.'('.$careers.', '.$points[0][0].')'; | ||
} else { | ||
return $author; | ||
} | ||
} else { | ||
if (!empty($points)) { | ||
if ( !empty( $points ) ) { | ||
return $author.'<br/>'.'('.$points[0][0].')'; | ||
} else { | ||
return $author; | ||
} | ||
} | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.