本文整理汇总了PHP中e107::getRank方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getRank方法的具体用法?PHP e107::getRank怎么用?PHP e107::getRank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getRank方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: require_once
}
$text .= "</table>\n</div>";
$ftotal = $sql->db_Count('forum_thread', '(*)', 'WHERE `thread_parent` = 0');
$parms = "{$ftotal},{$view},{$from}," . e_SELF . '?[FROM].active.forum.' . $view;
$text .= "<div class='nextprev'>" . $tp->parseTemplate("{NEXTPREV={$parms}}") . '</div>';
$ns->tablerender(LAN_7, $text, 'nfp');
/*
require_once (e_HANDLER.'np_class.php');
$ftotal = $sql->db_Count('forum_thread', '(*)', 'WHERE 1');
$ix = new nextprev('top.php', $from, $view, $ftotal, '', 'active.forum.'.$view);
*/
}
}
if ($action == 'top') {
//require_once (e_HANDLER.'level_handler.php');
$rank = e107::getRank();
define('IMAGE_rank_main_admin_image', $pref['rank_main_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_main_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_main_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/main_admin.png' alt='' />");
define('IMAGE_rank_admin_image', $pref['rank_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/admin.png' alt='' />");
define('IMAGE_rank_moderator_image', $pref['rank_moderator_image'] && file_exists(THEME . "forum/" . $pref['rank_moderator_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_moderator_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/moderator.png' alt='' />");
if ($subaction == 'forum' || $subaction == 'all') {
require_once e_PLUGIN . 'forum/forum_class.php';
$forum = new e107forum();
$qry = "\r\n\t\tSELECT ue.*, u.* FROM `#user_extended` AS ue\r\n\t\tLEFT JOIN `#user` AS u ON u.user_id = ue.user_extended_id\r\n\t\tWHERE ue.user_plugin_forum_posts > 0\r\n\t\tORDER BY ue.user_plugin_forum_posts DESC LIMIT {$from}, {$view}\r\n\t\t";
// $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
$text = "\r\n\t\t\t<div>\r\n\t\t\t<table style='width:95%' class='table table-striped fborder'>\r\n\t\t\t<tr>\r\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'> </th>\r\n\t\t\t<th style='width:50%' class='forumheader3'>" . TOP_LAN_1 . "</th>\r\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'>" . TOP_LAN_2 . "</th>\r\n\t\t\t<th style='width:30%; text-align:center' class='forumheader3'>" . TOP_LAN_6 . "</th>\r\n\t\t\t</tr>\n";
$counter = 1 + $from;
$sql2 = e107::getDb('sql2');
if ($sql2->gen($qry)) {
while ($row = $sql2->db_Fetch(MYSQL_ASSOC)) {
//$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
$ldata = $rank->getRanks($row, USER && $forum->isModerator(USERID));
示例2: topPosters
function topPosters()
{
$pref = e107::pref('core');
$rank = e107::getRank();
$sql = e107::getDb();
$sql2 = e107::getDb('sql2');
$ns = e107::getRender();
$tp = e107::getParser();
define('IMAGE_rank_main_admin_image', $pref['rank_main_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_main_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_main_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/main_admin.png' alt='' />");
define('IMAGE_rank_admin_image', $pref['rank_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/admin.png' alt='' />");
define('IMAGE_rank_moderator_image', $pref['rank_moderator_image'] && file_exists(THEME . "forum/" . $pref['rank_moderator_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_moderator_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/" . IMODE . "/moderator.png' alt='' />");
if ($this->subaction == 'forum' || $this->subaction == 'all') {
require_once e_PLUGIN . 'forum/forum_class.php';
$forum = new e107forum();
$qry = "\n\t\t\tSELECT ue.*, u.* FROM `#user_extended` AS ue\n\t\t\tLEFT JOIN `#user` AS u ON u.user_id = ue.user_extended_id\n\t\t\tWHERE ue.user_plugin_forum_posts > 0\n\t\t\tORDER BY ue.user_plugin_forum_posts DESC LIMIT {$this->from}, {$this->view}\n\t\t\t";
// $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
$text = "\n\t\t\t<div>\n\t\t\t<table style='width:95%' class='table table-striped fborder'>\n\t\t\t<tr>\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'> </th>\n\t\t\t<th style='width:50%' class='forumheader3'>" . TOP_LAN_1 . "</th>\n\t\t\t<th style='width:10%; text-align:center' class='forumheader3'>" . TOP_LAN_2 . "</th>\n\t\t\t<th style='width:30%; text-align:center' class='forumheader3'>" . TOP_LAN_6 . "</th>\n\t\t\t</tr>\n";
$counter = 1 + $this->from;
if ($sql2->gen($qry)) {
while ($row = $sql2->fetch()) {
//$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
$ldata = $rank->getRanks($row, USER && $forum->isModerator(USERID));
if (vartrue($ldata['special'])) {
$r = $ldata['special'];
} else {
$r = $ldata['pic'] ? $ldata['pic'] : defset($ldata['name'], $ldata['name']);
}
if (!$r) {
$r = 'n/a';
}
$text .= "<tr>\n\t\t\t\t\t<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>\n\t\t\t\t\t<td style='width:50%' class='forumheader3'><a href='" . e107::getUrl()->create('user/profile/view', 'id=' . $row['user_id'] . '&name=' . $row['user_name']) . "'>{$row['user_name']}</a></td>\n\t\t\t\t\t<td style='width:10%; text-align:center' class='forumheader3'>{$row['user_plugin_forum_posts']}</td>\n\t\t\t\t\t<td style='width:30%; text-align:center' class='forumheader3'>{$r}</td>\n\t\t\t\t\t</tr>";
$counter++;
}
}
$text .= "</table>\n</div>";
if ($this->subaction == 'forum') {
$ftotal = $sql->count('user', '(*)', 'WHERE `user_forums` > 0');
$parms = "{$ftotal},{$this->view},{$this->from}," . e_SELF . '?[FROM].top.forum.' . $this->view;
$text .= "<div class='nextprev'>" . $tp->parseTemplate("{NEXTPREV={$parms}}") . '</div>';
}
$ns->tablerender(TOP_LAN_0, $text);
}
}
示例3: sc_level
function sc_level($parm)
{
if (!$this->postInfo['post_user']) {
return '';
}
$rankInfo = e107::getRank()->getRanks($this->postInfo['post_user']);
// FIXME - level handler!!!
if (!$parm) {
$parm = 'name';
}
switch ($parm) {
case 'userid':
return $this->sc_memberid();
break;
case 'special':
if (isset($rankInfo['special'])) {
return $rankInfo['special'];
}
if ($this->forum->isModerator($this->postInfo['post_user'])) {
return "<div class='spacer'>" . IMAGE_rank_moderator_image . '</div>';
}
return '';
break;
default:
return varset($rankInfo[$parm], '');
break;
}
}
示例4: RanksPage
function RanksPage()
{
$frm = e107::getForm();
$e107 = e107::getInstance();
$pref = e107::getPref();
$mes = e107::getMessage();
$ui = $this->getUI();
$tp = e107::getParser();
$ranks = e107::getRank()->getRankData();
$tmp = e107::getFile()->get_files(e_IMAGE . 'ranks', '.*?\\.(png|gif|jpg)');
// $this->addTitle(LAN_USER_RANKS);
foreach ($tmp as $k => $v) {
$imageList[] = $v['fname'];
}
unset($tmp);
natsort($imageList);
$text = $frm->open('core-user-ranks-form');
$fields = array('type' => array('title' => USRLAN_207, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'), 'rankName' => array('title' => USRLAN_208, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'), 'lowThresh' => array('title' => USRLAN_209, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'), 'langPrefix' => array('title' => USRLAN_210, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'), 'rankImage' => array('title' => USRLAN_210, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'));
$text .= "\r\n\t\t<table class='table adminlist'>" . $frm->colGroup($fields, array_keys($fields)) . $frm->thead($fields, array_keys($fields));
$info = $ranks['special'][1];
$val = $tp->toForm($info['name']);
$text .= "\r\n\t\t<tr>\r\n\t\t\t<td>" . LAN_MAINADMIN . "</td>\r\n\t\t\t<td>\r\n\t\t\t\t" . $frm->text('calc_name[main_admin]', $val) . "\r\n\t\t\t</td>\r\n\t\t\t<td>N/A</td>\r\n\t\t\t<td>" . $frm->checkbox('calc_pfx[main_admin]', 1, $info['lan_pfx'] ? true : false) . "</td>\r\n\t\t\t<td>" . $ui->RankImageDropdown($imageList, 'calc_img[main_admin]', $info['image']) . "</td>\r\n\t\t</tr>\r\n\t\t";
$info = $ranks['special'][2];
$val = $tp->toForm($info['name']);
$text .= "\r\n\t\t<tr>\r\n\t\t\t<td>" . LAN_ADMIN . "</td>\r\n\t\t\t<td>\r\n\t\t\t\t" . $frm->text('calc_name[admin]', $val) . "\r\n\t\t\t</td>\r\n\t\t\t<td>N/A</td>\r\n\t\t\t<td>" . $frm->checkbox('calc_pfx[admin]', 1, $info['lan_pfx'] ? true : false) . "</td>\r\n\t\t\t<td>" . $ui->RankImageDropdown($imageList, 'calc_img[admin]', $info['image']) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan='5'> </td>\r\n\t\t</tr>\r\n\t\t";
foreach ($ranks['data'] as $k => $r) {
$pfx_checked = $r['lan_pfx'] ? "checked='checked'" : '';
$text .= "\r\n\t\t\t<tr>\r\n\t\t\t\t<td>" . USRLAN_212 . "</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<input type='hidden' name='field_id[{$k}]' value='1' />\r\n\t\t\t\t\t<input class='tbox' type='text' name='calc_name[{$k}]' value='{$r['name']}' />\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>" . $frm->number("calc_lower[{$k}]", $r['thresh']) . "</td>\r\n\t\t\t\t<td>" . $frm->checkbox("calc_pfx[{$k}]", 1, $r['lan_pfx'] ? true : false) . "</td>\r\n\t\t\t\t<td>" . $ui->RankImageDropdown($imageList, "calc_img[{$k}]", $r['image']) . " " . $frm->submit_image("etrigger_delete[{$r['id']}]", LAN_DELETE, 'delete', LAN_CONFIRMDEL . ": [{$r['name']}]?") . "\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t";
}
$text .= "\r\n\t\r\n\t\t<tr>\r\n\t\t\t<td colspan='5'> </td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>" . USRLAN_214 . "</td>\r\n\t\t\t<td>" . $frm->text('new_calc_name', '') . "</td>\r\n\t\t\t<td>" . $frm->number('new_calc_lower', '') . "</td>\r\n\t\t\t<td>" . $frm->checkbox('new_calc_pfx', 1, false) . "</td>\r\n\t\t\t<td>" . $ui->RankImageDropdown($imageList, 'new_calc_img') . "</td>\r\n\t\t</tr>";
$text .= '</table>
<div class="buttons-bar center">
' . $frm->admin_trigger('update', 'no-value', 'update', LAN_UPDATE) . '
</div>
</form>';
return $text;
}
示例5: showRanks
function showRanks()
{
global $pref, $emessage;
$frm = e107::getForm();
$ns = e107::getRender();
$e107 = e107::getInstance();
require_once e_HANDLER . 'message_handler.php';
/*
$daysregged = max(1, round((time() - $user_join) / 86400))."days";
$level = ceil((($user_forums * 5) + ($user_comments * 5) + ($user_chats * 2) + $user_visits)/4);
*/
$ranks = e107::getRank()->getRankData();
$tmp = e107::getFile()->get_files(e_IMAGE . 'ranks', '.*?\\.(png|gif|jpg)');
foreach ($tmp as $k => $v) {
$imageList[] = $v['fname'];
}
unset($tmp);
natsort($imageList);
$text = "\r\n\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "'>\r\n\t";
/*
$config = array();
if ($e107->sql->db_Select('generic','gen_chardata', "gen_type='user_rank_config'", 'default'))
{
$row = $e107->sql->db_Fetch(MYSQL_ASSOC);
$config = unserialize($row['gen_chardata']);
}
$fieldList = array('core' => array(),'extended' => array());
$fieldList['core'] = array('comments' => USRLAN_201,'visits' => USRLAN_202,'daysregged' => USRLAN_203);
foreach ($e107->extended_struct as $field)
{
if (strpos($field['Type'],'int') !== false && $field['Field'] != 'user_extended_id')
{
$fieldList['extended'][] = substr($field['Field'],5);
}
}
$fields = array(
'source' => array('title' => USRLAN_197, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'),
'fieldName' => array('title' => USRLAN_198, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'),
'operation' => array('title' => USRLAN_199, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'),
'value' => array('title' => USRLAN_200, 'type' => 'int', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left'),
);
$opArray = array('*','+','-');
$text .= "
<form method='post' action='".e_SELF."?".e_QUERY."'>
<fieldset id='core-userranks-list'>
<table class='table adminlist'>".
$frm->colGroup($fields, array_keys($fields)).
$frm->thead($fields, array_keys($fields));
foreach ($fieldList['core'] as $k => $f)
{
$text .= "
<tr>
<td class='label'>".USRLAN_204."</td>
<td class='label'>{$f}</td>
<td>
<select name='op[{$k}]' class='tbox'>
";
foreach ($opArray as $op)
{
$sel = (varset($config[$k]['op']) == $op ? "selected='selected'" : '');
$text .= "<option value='{$op}' {$sel}>{$op}</option>";
}
$text .= "
</select>
</td>
<td><input type='text' class='tbox' name='val[{$k}]' value='".varset($config[$k]['val'])."' size='3' maxlength='3' /></td>
</tr>
";
}
if (count($fieldList['extended']))
{
foreach ($fieldList['extended'] as $f)
{
$text .= "
<tr>
<td colspan='4'> </td>
</tr>
<tr>
<td class='label'>".USRLAN_205."</td>
<td class='label'>{$f}</td>
<td>
<select name='op[{$f}]' class='tbox'>
";
foreach ($opArray as $op)
{
$sel = (varset($config[$f]['op']) == $op ? "selected='selected'" : '');
$text .= "<option value='{$op}' {$sel}>{$op}</option>";
}
$text .= "
</select>
</td>
<td>
<input type='text' class='tbox' name='val[{$f}]' value='".varset($config[$f]['val'])."' size='3' maxlength='3' value='' />
</td>
</tr>
";
}
}
//.........这里部分代码省略.........
示例6: sc_level
function sc_level($parm)
{
if (!$this->postInfo['post_user']) {
return '';
}
$rankInfo = e107::getRank()->getRanks($this->postInfo['post_user']);
// FIXME - level handler!!!
// print_a($rankInfo);
if ($parm == 'badge') {
return "<span class='label label-info'>" . $rankInfo['name'] . "</span>";
}
if (!$parm) {
$parm = 'name';
}
switch ($parm) {
case 'userid':
return $this->sc_memberid();
break;
case 'special':
if (isset($rankInfo['special'])) {
return $rankInfo['special'];
}
if ($this->forum->isModerator($this->postInfo['post_user'])) {
return "<div class='spacer'>" . IMAGE_rank_moderator_image . '</div>';
}
return '';
break;
case 'glyph':
$text = "";
$tp = e107::getParser();
for ($i = 0; $i < $rankInfo['value']; $i++) {
$text .= $tp->toGlyph('fa-star');
}
return $text;
break;
default:
return varset($rankInfo[$parm], '');
break;
}
}