本文整理汇总了PHP中getRating函数的典型用法代码示例。如果您正苦于以下问题:PHP getRating函数的具体用法?PHP getRating怎么用?PHP getRating使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRating函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMediaItem
function getMediaItem($item)
{
$content = '<li class="list-group-item">';
$content .= getRating($item['rating']);
$content .= $item['title'] . '<br>';
$content .= '<small>' . $item['description'] . '</small><br>';
$content .= getTags($item['tags']);
// Buttonrow
$content .= '<div class="text-right">';
// Edit Button
$content .= '<a href="index.php?media_item_id=' . $item['id'] . '">';
$content .= '<button type="button" class="btn btn-xs" aria-label="Editieren">';
$content .= '<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>';
$content .= '</button>';
$content .= '</a>';
// Delete Button
$content .= '<a href="submit.php?delete_id=' . $item['id'] . '">';
$content .= '<button type="button" class="btn btn-xs" aria-label="Editieren">';
$content .= '<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>';
$content .= '</button>';
$content .= '</a>';
$content .= '</div>';
// END buttonrow
$content .= '</li>';
return $content;
}
示例2: getRating
if ($obj->getCommentsAllowed() && $obj->getCommentCount() > 0) {
?>
<div class="image-cr"><i class="fa fa-comments"></i><span> <?php
echo $obj->getCommentCount();
?>
</span></div>
<?php
}
}
?>
<?php
if (function_exists('getRating')) {
if (getRating($obj)) {
?>
<div class="image-cr"><i class="fa fa-star"></i><span> <?php
echo getRating($obj);
?>
</span></div>
<?php
}
}
?>
</div>
<i class="fa fa-angle-up mobile-click-details"></i>
</div>
<?php
$count++;
}
?>
</div>
</div>
示例3: number_format
echo "<font size=\"3\" face=\"arial\" color=\"blue\">";
echo " <i>VIEWS:</i>";
echo " " . number_format($views);
echo "</font>";
echo "<br/>";
$t = mysql_query("SELECT count(mid) FROM `Downloads` WHERE mid='{$mid}'") or die(mysql_error());
$row6 = mysql_fetch_assoc($t);
$downss = $row6['count(mid)'];
echo "<font size=\"3\" face=\"arial\" color=\"blue\">";
echo "DOWNLOADS: ";
echo number_format($downss);
echo "</font>";
echo "<br/>";
echo "<font size=\"2\" face=\"arial\" color=\"green\">";
echo "Rating: ";
$rate = getRating($mid);
if ($rate != NULL) {
echo round($rate, 2);
} else {
echo "No one rated this media yet. Be first";
}
echo "</font>";
echo "<br/>";
$t = mysql_query("SELECT SUM(likes),SUM(dislikes) FROM `Likes_Dislikes` WHERE mid='{$mid}'") or die(mysql_error());
$row4 = mysql_fetch_assoc($t);
echo "<font size=\"1\" face=\"arial\" color=\"red\">";
echo "LIKES:";
$lks = $row4['SUM(likes)'];
if ($lks == NULL) {
echo "0";
} else {
示例4: mysql_query
?>
</th>
</tr>
<?
$tmpPlayers = mysql_query($tmpQuery);
if (mysql_num_rows($tmpPlayers)==0)
echo "<tr><td colspan='8'>".$MSG_LANG["noopponent"]."</td></tr>";
while($tmpPlayer = mysql_fetch_array($tmpPlayers, MYSQL_ASSOC))
{
if ($tmpPlayer['lastUpdate'] >= (time()-300))
$img="online";
else
$img="offline";
if (getRating($tmpPlayer['playerID']) == 0)
echo "<tr>
<td width=5%><img src='images/$img.gif' alt='$img'></td>
<td width=5%>
<form action='newuserchallenge.php' method='post'><input type='hidden' name='player_id' value=$tmpPlayer[playerID]>
<input type='button' style='font-size:11' value='$MSG_LANG[invite]' onClick=\"submit()\"> </form> </td>
<td width=5%>
<form action='sendmessage.php' method='post'><input type='hidden' name='player_id' value=$tmpPlayer[playerID]>
<input type='button' style='font-size:11' value='$MSG_LANG[sendmessage]' onClick=\"submit()\"> </form> </td>
<td width=50% style='text-align:left'>".$tmpPlayer['firstName']."</td>
<td width=15%>".$tmpPlayer['pais']."</td>
<td width=10%><strong><font color=red>$MSG_LANG[newuser]</strong></font></td>
<td width=10%>".getPlayerLevel($tmpPlayer['playerID'])."</td>";
else
echo "<tr>
示例5: round
</tr>
';
$k++;
}
if ($totalunits >= 1) {
$ave = round($totalscore / $totalunits, 4);
} else {
$ave = 0;
}
echo '
<tr>
<td><b>TOTAL</b></td>
<td align="center"><b>' . $totalunits . '</b></td>
<td colspan = 3></td>
<td align="right"><b>' . $ave . '</b></td>
<td align="center"><b>' . getRating($ave) . '</b></td>
</tr>
';
$j++;
}
echo "</table>";
} else {
if (!isset($search)) {
echo "There is no instructor whose all classes are already closed for evaluation.";
} else {
echo "No instructor found.";
}
}
if (isset($search)) {
echo "<br/><br/><a href='" . base_url('index.php/clerk/reportmanagement/facultysummarizedreport') . "'>Back to all instructors </a>";
}
示例6: url
$image->readImage($setting['image_output'] . $row2['ID'] . "." . $row2['FILE']);
$image->setFormat("jpg");
$image->setImageCompression(Imagick::COMPRESSION_JPEG);
$image->setImageCompressionQuality($setting['thumbnail_quality']);
$image->thumbnailImage($setting['thumbnail_size'], 0);
$image->writeImage($thumb_fn);
$image->clear();
}
//$output = $image->getImageBlob();
echo '<a href="image.php?id=' . $row2['ID'] . '"><div class="image" style="background-image: url(' . $setting['image_output_htmlsafe'] . 'thumbnails/' . $row2['ID'] . '.jpg);">';
if (time() - 24 * 60 * 60 <= $row2['DATEADD']) {
echo '<div class="new_banner">NEW</div>';
}
echo '<div class="info">
<div class="i_l">
<span style="color: ' . getRatingColor($row2['RATING']) . '; padding-left: 10px;">' . getRating($row2['RATING']) . '</span>
</div>
<div class="i_r">
<span style="color: #add1ff; padding-right: 10px;">◉ ' . $row2['VIEWS'] . '</span>
<span style="color: #ffa5be; padding-right: 10px;">❤ ' . $favorites . '</span>
<span style="color: #ffeaa5; padding-right: 10px;">◆ -</span>
</div>
</div>
</div></a>';
}
} else {
echo 'This user does not exist.';
}
?>
</div>
</div>
示例7: round
<strong>File type</strong><br/>
<?php
echo $ext;
?>
<br/><br/>
<strong>File size</strong><br/>
<?php
echo round($size / 1024) . "KB";
?>
<br/><br/>
<strong>Rating</strong><br/>
<span style="color: <?php
echo getRatingColor($rating);
?>
;"><?php
echo getRating($rating);
?>
</span>
<br/><br/>
<a href="<?php
echo $source;
?>
" style="font-size: 11pt;"><strong>Source</strong></a><br/>
</div>
</div>
<?php
$query = "SELECT * FROM image_db WHERE ID=" . $_GET['id'];
$result = mysqli_query($mysqli, $query);
$row = mysqli_fetch_array($result);
?>
<div class="column2">
示例8: getTitle
?>
<div class="wrap">
<div class="row">
<div class="col-md-8">
<img class="img-responsive img-rounded pull-right" src="../images/info_banner_1.jpg" alt="<?php
getTitle();
?>
">
</div>
<div class="col-md-4">
<h3><?php
getTitle();
?>
</h3>
<p>Rating: <?php
getRating();
?>
/ 10 <?php
getParentalGuide();
?>
<?php
if (isset($_SESSION['loggedin'])) {
?>
<input type="submit" id="favorite" name="favorite" value= <?php
echo isset($isFavorite) ? "Unfavorite" : "Favorite";
?>
>
<?php
} else {
?>
示例9: getRating
return $sql->fetchColumn();
}
function getRating($id)
{
$GLOBALS['star']->id = "app-{$id}";
return $GLOBALS['star']->getRating("", "rate_value");
}
$i = 0;
foreach ($results as $r) {
$response['apps'][$i] = $r;
$response['apps'][$i]['author'] = getAuthorName($r['author']);
$response['apps'][$i]['author_page'] = \Lobby::u("/u/{$r['author']}");
$response['apps'][$i]['description'] = $Parsedown->text(htmlspecialchars($r['description']));
$response['apps'][$i]['image'] = L_URL . "/api/app/{$r['id']}/logo";
$response['apps'][$i]['permalink'] = L_URL . "/apps/{$r['id']}";
$response['apps'][$i]['rating'] = getRating($r['id']) . "/5";
$response['apps'][$i]['requires'] = json_decode($r['requires'], true);
/**
* If `lobby` param is not present then,
* client is using Lobby < 0.6
*/
if (!isset($_POST["lobby"])) {
$response['apps'][$i]['requires']["lobby"] = array(">=", "0.6");
}
/**
* Recommended : Singular word
* For versions >=0.7
*/
$response['apps'][$i]['require'] = $response['apps'][$i]['requires'];
$response['apps'][$i]['updated'] = strtotime($r['updated']);
$i++;
示例10: mysqli_query
</div>
</div>
</div>
</div>
</div>';
}
?>
<div class="col nine">
<h2>Previous Sessions</h2>
</div>
<?php
require 'connect_database.php';
for ($i = $current - 1; $i >= 0; $i--) {
$result = mysqli_query($link, "SELECT * FROM sessions WHERE id='{$id[$i]}'");
$arr = mysqli_fetch_array($result, MYSQLI_ASSOC);
$rating = getRating(intval($arr['id']));
$followers = getFollowers(intval($arr['id']));
echo '
<div class="col nine">
<div class="session clearfix">
<div class="col two"><img src="' . $arr["poster"] . '" alt="Session Poster"></div>
<div class="col ten">
<h2 class="title">' . $arr["Title"] . '</h2>
<p class="speaker">
<i class="fa fa-user"></i>
<span>Speaker:</span>
' . $arr["speaker"] . '
</p>
<p class="where">
<i class="fa fa-location-arrow"></i>
<span>Where:</span>
示例11: __construct
function __construct()
{
$pid = $_GET['place_id'];
$pResult = getPlace($pid);
if ($pResult != null && mysqli_num_rows($pResult) > 0) {
$row = mysqli_fetch_assoc($pResult);
$this->id = $row["Place_ID"];
$this->title = $row["Title"];
$this->description = $row["Description"];
$this->address = $row["Address"];
$this->picture = "subpages/pictures/places/" . $row["picture"];
$this->category = $row["Cat_Type"];
}
$pResult = getRating($pid);
if ($pResult != null && mysqli_num_rows($pResult) > 0) {
$row = mysqli_fetch_assoc($pResult);
$this->rating = number_format($row["rating"], 1);
}
}
示例12: getRanking
?>
<?php
echo $MSG_LANG['turns'];
?>
</td></tr>
-->
<tr>
<td width="40%" rowspan="2"><div align="center">
<?php
echo $_SESSION['playerName'];
?>
,
<?
$ranking = getRanking($_SESSION['playerID']);
$rating = getRating($_SESSION['playerID']);
if ($CFG_ENABLE_TRIAL_RATING && $rating == 0){
$p = mysql_query("select count(*) from games where (whitePlayer='$_SESSION[playerID]' OR blackPlayer='$_SESSION[playerID]') AND (gameMessage='playerResigned' OR gameMessage='checkMate' OR gameMessage='draw')");
$r = mysql_fetch_array($p);
$n = 5-$r[0];
echo "<table style='width: 100%' border='1' style='background:red'><tr><td style='background:red'>";
echo "<font color=white><B>".$MSG_LANG['trialprocess']."</B><BR>";
echo str_replace("%n",$n,$MSG_LANG['trialmessage']);
echo "</font>";
echo "</td></tr></table>";
}
else
echo $MSG_LANG["yourrating"].": <B>$rating</b> ".$MSG_LANG["yourranking"].": <B>$ranking</B><BR>";
echo "</P>";
示例13: pullRating
function pullRating($media, $id, $show5 = false, $showPerc = false, $showVotes = false, $static = NULL)
{
$sql = "SELECT * FROM media_rating WHERE media_id = '{$id}' AND media_type = '{$media}' AND user_id = '{$user}'";
$query = @mysql_query($sql);
$count = @mysql_num_rows($query);
if ($count > 0) {
$msg = " -- You have voted all ready!";
exit;
$text = '';
if ($show5 || $showPerc || $showVotes) {
$text .= '<div class="rated_text">';
}
if ($show5) {
$text .= '<b>Rated: </b><span id="outOfFive_' . $id . '" class="out5Class">' . outOfFive($id) . '</span>/5';
}
if ($showPerc) {
$text .= '(<span id="percentage_' . $id . '" class="percentClass">' . getRating($media, $id) . '</span>)';
}
if ($showVotes) {
$text .= '(<span id="showvotes_' . $id . '" class="votesClass">' . getVotes($media, $id) . '</span>)';
}
if ($show5 || $showPerc || $showVotes) {
$text .= '';
}
return $text . '
<span class="inline-rating">
<ul class="star-rating2" id="rater_' . $id . '">
<li class="current-rating" style="width:' . getRating($media, $id) . ';" id="ul_' . $id . '"></li>
<li><a onclick="return false;" title="1 star out of 5 ' . $msg . '" class="one-star">1</a></li>
<li><a onclick="return false;" title="2 stars out of 5 ' . $msg . '" class="two-stars">2</a></li>
<li><a onclick="return false;" title="3 stars out of 5 ' . $msg . '" class="three-stars">3</a></li>
<li><a onclick="return false;" title="4 stars out of 5 ' . $msg . '" class="four-stars">4</a></li>
<li><a onclick="return false;" title="5 stars out of 5 ' . $msg . '" class="five-stars">5</a></li>
</ul>
</span>
</div>
<div id="loading_' . $id . '"></div>';
exit;
} else {
$sel = mysql_query("SELECT user_id FROM media_rating WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "' AND media_type = '{$media}' AND media_id = '{$id}'");
if (mysql_num_rows($sel) > 0 || $static == 'novote' || $_COOKIE['has_voted_' . $media . '_' . $id]) {
if ($static == 'novote') {
$msg = " Please Login to vote";
$text = '';
} else {
$msg = " -- You have voted for this item";
$text = '';
}
if ($show5 || $showPerc || $showVotes) {
$text .= '<div class="rated_text">';
}
if ($show5) {
$text .= '<b>Rated: </b> <span id="outOfFive_' . $id . '" class="out5Class">' . outOfFive($media, $id) . '</span>/5';
}
if ($showPerc) {
$text .= ' (<span id="percentage_' . $id . '" class="percentClass">' . getRating($media, $id) . '</span>)';
}
if ($showVotes) {
$text .= ' (<span id="showvotes_' . $id . '" class="votesClass">' . getVotes($media, $id) . '</span>)';
}
if ($show5 || $showPerc || $showVotes) {
$text .= '';
}
return $text . '
<span class="inline-rating">
<ul class="star-rating2" id="rater_' . $id . '">
<li class="current-rating" style="width:' . getRating($media, $id) . ';" id="ul_' . $id . '"></li>
<li><a onclick="return false;" title="1 star out of 5 ' . $msg . '" class="one-star">1</a></li>
<li><a onclick="return false;" title="2 stars out of 5 ' . $msg . '" class="two-stars">2</a></li>
<li><a onclick="return false;" title="3 stars out of 5 ' . $msg . '" class="three-stars">3</a></li>
<li><a onclick="return false;" title="4 stars out of 5 ' . $msg . '" class="four-stars">4</a></li>
<li><a onclick="return false;" title="5 stars out of 5 ' . $msg . '" class="five-stars">5</a></li>
</ul>
</span>
</div>
<div id="loading_' . $id . '"></div>';
} else {
if ($show5 || $showPerc || $showVotes) {
$text .= '<div class="rated_text">';
}
if ($show5) {
$show5bool = 'true';
$text .= '<b>Rated: </b><span id="outOfFive_' . $id . '" class="out5Class">' . outOfFive($media, $id) . '</span>/5';
} else {
$show5bool = 'false';
}
if ($showPerc) {
$showPercbool = 'true';
$text .= ' (<span id="percentage_' . $id . '" class="percentClass">' . getRating($media, $id) . '</span>)';
} else {
$showPercbool = 'false';
}
if ($showVotes) {
$showVotesbool = 'true';
$text .= ' (<span id="showvotes_' . $id . '" class="votesClass">' . getVotes($media, $id) . '</span>)';
} else {
$showVotesbool = 'false';
}
if ($show5 || $showPerc || $showVotes) {
$text .= '';
//.........这里部分代码省略.........
示例14: file_get_contents
$c_host = $databaselocation;
$c_user = $databaseuser;
$c_pass = $databasepass;
$c_db = $databasename;
$username = $_SESSION["username"];
$html = file_get_contents("index.html");
$html = str_replace("{USERNAME}", $username, $html);
$user = $_SESSION["userid"];
$premium = $_SESSION["premium"];
$locales = getLocales($user);
$html_locales = "";
$contador = 0;
$contador_locales = 0;
foreach ($locales as $local) {
$contador_locales++;
$rating = getRating($local->id);
$norating = 5 - $rating;
$stars = "";
for ($i = 0; $i < $rating; $i++) {
$stars .= "<span class='glyphicon glyphicon-star' aria-hidden='true' style='color:yellow;'></span>";
}
for ($i = 0; $i < $norating; $i++) {
$stars .= "<span class='glyphicon glyphicon-star' aria-hidden='true' style='color:gray;'></span>";
}
if ($local->activo == 1) {
$estado = "<span class='glyphicon glyphicon-ok' aria-hidden='true' style='color:green;'></span>";
} else {
$estado = "<span class='glyphicon glyphicon-remove' aria-hidden='true' style='color:red;'></span>";
}
$acciones = "<a href='update-shop.php?local=" . $local->id . "'><span class='glyphicon glyphicon-cog' aria-hidden='true'></span></a> " . "<a href='#deleteDialogBox' onclick='deleteDialogBox(" . $local->id . ", \"" . utf8_encode($local->nombre) . "\"); return false;'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a>";
$html_locales .= "<tr><td>" . ++$contador . "</td><td>" . utf8_encode($local->nombre) . "</td><td>" . $estado . "</td><td>" . $stars . "</td><td>" . $acciones . "</td></tr>";
示例15: getRating
$flagFall = $row['flagFall'];
$oficial = $row['oficial'];
$teamMatch = $row['teamMatch'];
if ($row['whitePlayer'] == $_SESSION['playerID'])
{
$MyRating = getRating($row['whitePlayer']);
$OpponentRating = getRating($row['blackPlayer']);
$MyPV = $row['PVWhite'];
$OpponentPV = $row['PVBlack'];
}
else
{
$MyRating = getRating($row['blackPlayer']);
$OpponentRating = getRating($row['whitePlayer']);
$MyPV = $row['PVBlack'];
$OpponentPV = $row['PVWhite'];
}
processMessages();
/* Verify permission */
if (!isBoardDisabled()){
if (($white != $_SESSION['playerID']) && ($black != $_SESSION['playerID']))
die($MSG_LANG["youdonthavepermission"]);
}
if (($numMoves == -1) || ($numMoves % 2 == 1)){
$mycolor2 = "white";