本文整理汇总了PHP中e107::getRate方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getRate方法的具体用法?PHP e107::getRate怎么用?PHP e107::getRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getRate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pageRating
function pageRating($page_rating_flag)
{
if ($page_rating_flag) {
return "<br /><div style='text-align:right'>" . e107::getRate()->render("page", $this->pageID, array('label' => LAN_PAGE_4)) . "</div>";
}
// return $rate_text;
}
示例2: like
function like($table, $id, $options = null)
{
$table = preg_replace('/\\W/', '', $table);
$id = intval($id);
return e107::getRate()->renderLike($table, $id, $options);
}
示例3: sc_comment_rate
function sc_comment_rate($parm = '')
{
if ($this->var['comment_blocked'] > 0 || $this->var['rating_enabled'] == false) {
return;
}
$curVal = array('up' => $this->var['rate_up'], 'down' => $this->var['rate_down'], 'total' => $this->var['rate_votes']);
return e107::getRate()->renderLike("comments", $this->var['comment_id'], $curVal);
}
示例4: sc_user_rating
function sc_user_rating($parm = '')
{
$pref = e107::getPref();
$frm = e107::getForm();
if (!vartrue($pref['profile_rate'])) {
return;
}
if (!USER) {
return "Login to rate this user";
} else {
switch ($parm) {
case 'like':
return $frm->like('user', $this->var['user_id']);
break;
case 'legacy':
$rater = e107::getRate();
$ret = "<span>";
if ($rating = $rater->getrating('user', $this->var['user_id'])) {
$num = $rating[1];
for ($i = 1; $i <= $num; $i++) {
$ret .= "<img src='" . e_IMAGE_ABS . "rate/star.png' alt='' />";
}
}
if (!$rater->checkrated('user', $this->var['user_id'])) {
$ret .= " " . $rater->rateselect('', 'user', $this->var['user_id']);
}
$ret .= "</span>";
return $ret;
break;
default:
return $frm->rate('user', $this->var['user_id']);
break;
}
return "";
}
}
示例5: intval
if (vartrue($_GET['type']) != 'up' && vartrue($_GET['type']) != 'down') {
exit;
}
$table = $tp->toDB($_GET['table']);
$itemid = intval($_GET['id']);
$type = $_GET['type'];
if ($result = e107::getRate()->submitLike($table, $itemid, $type)) {
echo $result;
} else {
exit;
}
} elseif ($_POST['table']) {
$table = $tp->toDB($_POST['table']);
$itemid = intval($_POST['id']);
$rate = intval($_POST['score']) * 2;
echo e107::getRate()->submitVote($table, $itemid, $rate);
}
exit;
}
/*
if ($sql -> db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$itemid}'"))
{
$row = $sql -> db_Fetch();
if(strpos($row['rate_voters'], ".".USERID.".") === FALSE)
{
$rate_voters = $row['rate_voters'].".".USERID.".";
$new_rating = $row['rate_rating']+$rate;
$sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating='{$new_rating}', rate_voters='{$rate_voters}' WHERE rate_id='{$row['rate_id']}' ");
if(!$returnurl)
{
$voteStatus = e107::getRate()->renderVotes($rate_voters,($row['rate_votes'] +1));
示例6: pageRating
function pageRating($page_rating_flag)
{
if ($page_rating_flag) {
return "<br /><div style='text-align:right'>" . e107::getRate()->render("page", $this->pageID, array('label' => LAN_PAGE_4)) . "</div>";
/*
$rate_text = ''; // Notice removal
require_once(e_HANDLER."rate_class.php");
$rater = new rater;
$rate_text = "<br /><table style='width:100%'><tr><td style='width:50%'>";
if ($ratearray = $rater->getrating("page", $this->pageID))
{
if ($ratearray[2] == "")
{
$ratearray[2] = 0;
}
$rate_text .= "<img src='".e_IMAGE_ABS."rate/box/box".$ratearray[1].".png' alt='' style='vertical-align:middle;' />\n";
$rate_text .= " ".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]." ";
$rate_text .= ($ratearray[0] == 1 ? "vote" : "votes");
}
else
{
$rating .= LAN_PAGE_dl_13;
}
$rate_text .= "</td><td style='width:50%; text-align:right'>";
if (!$rater->checkrated("page", $this->pageID) && USER)
{
$rate_text .= $rater->rateselect(" <b>".LAN_PAGE_4."</b>", "page", $this->pageID);
}
else if(!USER)
{
$rate_text .= " ";
}
else
{
$rate_text .= LAN_PAGE_5;
}
$rate_text .= "</td></tr></table>";
*/
}
// return $rate_text;
}