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; }
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>
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 {
?> </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>
</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>"; }
$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>
<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">
?> <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 { ?>
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++;
</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>
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); } }
?> <?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>";
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 .= ''; } return $text . ' <span class="inline-rating"> <ul class="star-rating" id="rater_' . $id . '"> <li class="current-rating" style="width:' . getRating($media, $id) . ';" id="ul_' . $id . '"></li> <li><a onclick="rate(\'' . $media . '\',\'1\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?media=' . $media . '&id=' . $id . '&rating=1" title="1 star out of 5" class="one-star" >1</a></li> <li><a onclick="rate(\'' . $media . '\',\'2\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?media=' . $media . '&id=' . $id . '&rating=2" title="2 stars out of 5" class="two-stars">2</a></li> <li><a onclick="rate(\'' . $media . '\',\'3\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?media=' . $media . '&id=' . $id . '&rating=3" title="3 stars out of 5" class="three-stars">3</a></li> <li><a onclick="rate(\'' . $media . '\',\'4\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?media=' . $media . '&id=' . $id . '&rating=4" title="4 stars out of 5" class="four-stars">4</a></li> <li><a onclick="rate(\'' . $media . '\',\'5\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?media=' . $media . '&id=' . $id . '&rating=5" title="5 stars out of 5" class="five-stars">5</a></li> </ul> </span> </div> <div id="loading_' . $id . '"></div>'; } } }
$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>";
$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";
if ($_zp_current_image->getCommentsAllowed() && getCommentCount() > 0) { ?> <div class="image-cr"><i class="fa fa-comments"></i><span> <?php echo getCommentCount(); ?> </span></div> <?php } } ?> <?php if (function_exists('getRating')) { if (getRating($_zp_current_image)) { ?> <div class="image-cr"><i class="fa fa-star"></i><span> <?php echo getRating($_zp_current_image); ?> </span></div> <?php } } ?> </div> <i class="fa fa-angle-up mobile-click-details"></i> </div> <?php } ?> </div> <?php
function getBuyer($buyer_id = null) { $qry = 'SELECT * FROM mm_buyers WHERE '; if (!empty($buyer_id)) { $qry .= "user_id='" . mysql_escape_string($buyer_id) . "' AND "; } $qry .= '('; $qry .= 'flag_mercoxit OR '; $qry .= 'flag_arkonor OR '; $qry .= 'flag_bistot OR '; $qry .= 'flag_spodumain OR '; $qry .= 'flag_crokite OR '; $qry .= 'flag_darkochre OR '; $qry .= 'flag_gneiss OR '; $qry .= 'flag_hedbergite OR '; $qry .= 'flag_hemorphite OR '; $qry .= 'flag_jaspet OR '; $qry .= 'flag_kernite OR '; $qry .= 'flag_omber OR '; $qry .= 'flag_plagioclase OR '; $qry .= 'flag_pyroxeres OR '; $qry .= 'flag_scordite OR '; $qry .= 'flag_veldspar OR '; $qry .= 'flag_isogen OR '; $qry .= 'flag_megacyte OR '; $qry .= 'flag_mexallon OR '; $qry .= 'flag_morphite OR '; $qry .= 'flag_nocxium OR '; $qry .= 'flag_pyerite OR '; $qry .= 'flag_tritanium OR '; $qry .= 'flag_zydrine'; $qry .= ') AND '; $qry .= '1=1 ORDER BY region, date_created DESC'; // echo $qry; $results = mysql_query($qry); $buyers = _toarray($results); $cnt = 0; foreach ($buyers as $buyer) { $buyers[$cnt]['Rating'] = array(); $buyers[$cnt]['Rating'] = getRating($buyer['user_id']); // $buyers[$cnt]['RatingViewers'] = getRating($buyer['user_id'],$_REQUEST['viewer_id']); $cnt++; } return $buyers; }
} function getDriverThreshold($fid) { //取司機門檻 $sql = "SELECT `threshold` FROM `receiver` WHERE `aid` = '{$fid}'"; $result = mysql_query($sql); $i = mysql_fetch_array($result); return $i[0]; } //if($selection === 'passenger'){//requester $sql = "SELECT `receiver`.`aid` FROM `receiver`,`account` WHERE `account`.`rating` >= '{$threshold}' and `account`.`aid`=`receiver`.`aid` and `seat` != '0'"; //篩選乘客評價門檻 $result = mysql_query($sql); //司機評價符合乘客門檻 $driver_num = mysql_num_rows($result); $resarr = array(); $count = 0; for ($i = 0; $i < $driver_num; $i++) { $res = mysql_result($result, $i); if (getDriverThreshold($res) <= getRating($id)) { //乘客評價符合司機門檻 $resarr[$count] = $res; $count++; } } echo json_encode($resarr); //} ?>
$jt = mysql_query("SELECT * FROM team_members WHERE fk_player='$_SESSION[playerID]'"); $num_rows = mysql_fetch_array($jt); if ($num_rows =="0"){ ?> <form name="thisteam" action="teams.php" method="post"> <? if ($_POST['action']) $action = $_POST['action']; else if ($_GET['action']) $action = $_GET['action']; if ($action == 'choose'){ mysql_query("INSERT INTO team_members (fk_player,fk_team,date,init_rating,level) VALUES ('$_SESSION[playerID]','$_POST[teamid]','".time()."','".getRating($_SESSION[playerID])."','0')"); echo "<script>window.location='teams.php'</script>"; } ?> <input type='hidden' name='action' value='choose'> <input type='hidden' name='teamid' value='<?php echo $tm[teamID]; ?> '> <input style='cursor: hand' type=submit value='<?php echo $MSG_LANG['asktojoin']; ?> '> </form>
</div> </div> <img src="./img/4.jpg" alt=""> </a> </div> <div class="wrapper"> <a href="http://www.yelp.com/biz/joes-shanghai-flushing" target="_blank"><h3>Joe’s Shanghai</h3></a> <figure>136-21 37th Avenue</figure> <div class="info"> <div class="type"> <i><img src="./img/restaurant.png" alt=""></i> <span>Restaurant</span> </div> <div class="type"> <i><?php echo getRating('joes-shanghai-flushing'); ?> </i> </div> <div class="type"> <i><?php echo getRatingCount('joes-shanghai-flushing'); ?> </i> </div> </div> </div> </div> </div> <!-- /.item--> <!-- /.item-->
} $q = mysql_query("SELECT count(*) FROM games WHERE gameMessage='' AND ((whitePlayer = ".$JOGADOR." AND blackPlayer = ".$opponent.") OR (whitePlayer = ".$opponent." AND blackPlayer = ".$JOGADOR.")) "); $mult = mysql_fetch_array($q); #################################### //$opLevel = getPlayerLevel($opponent); //$myLevel = getPlayerLevel($JOGADOR); //$diff = $myLevel - $opLevel; $RatingG = getRating($opponent); $RatingP = getRating($JOGADOR); $diff = $RatingP - $RatingG; if ($mult[0]>0){ echo "$now # $JOGADOR_NAME ignoring multiple games: ". $row['gameID']."\n"; mysql_query("UPDATE games SET reason='#multiplegames',gameMessage = 'inviteDeclined', messageFrom = '".$JOGADOR_COR."' WHERE gameID = ".$row['gameID']); } else if (($diff >= 250 && $PLY == 5) || ($diff >= 200 && $PLY == 6) || ($diff >= 150 && $PLY == 7) || ($diff >= 100 && $PLY == 8) || ($diff >= 50 && $PLY >= 9)){ echo "$now # $JOGADOR_NAME ignoring weak player: ". $row['gameID']."\n"; mysql_query("UPDATE games SET reason='#weakplayer',gameMessage = 'inviteDeclined', messageFrom = '".$JOGADOR_COR."' WHERE gameID = ".$row['gameID']); } else if ($mult[0] == 0){
// Fetch Ratings and Results only if CompetitorBio !==FALSE // Ratings & Ranks if ($competitorBio !== FALSE) { $ratings = getRating($getID, "pr"); var_dump($ratings); } if ($competitorBio !== FALSE) { $ratings = getRating($getID, "tp"); var_dump($ratings); } if ($competitorBio !== FALSE) { $ratings = getRating($getID, "ar"); var_dump($ratings); } if ($competitorBio !== FALSE) { $ratings = getRating($getID, "ap"); var_dump($ratings); } // Results if ($competitorBio !== FALSE) { $resultsPR = getPR($getID); var_dump($resultsPR); } if ($competitorBio !== FALSE) { $resultsTP = getTP($getID); var_dump($resultsTP); } if ($competitorBio !== FALSE) { $resultsAR = getAR($getID); var_dump($resultsAR); }
} /* check if loading game */ if (isset($_POST['gameID'])) { $_SESSION['gameID'] = $_POST['gameID']; } /* debug flag */ define("DEBUG", 0); /* connect to database */ require_once 'connectdb.php'; /* Language selection */ require_once "languages/" . $_SESSION['pref_language'] . "/strings.inc.php"; $action = !empty($_POST['action']) ? $_POST['action'] : $_GET['action']; $pl = mysql_query("SELECT * FROM players WHERE playerID='" . $_SESSION['playerID'] . "'"); $me = mysql_fetch_array($pl); $firstName = $me['firstName']; if (getRating($_SESSION['playerID']) == 0) { displayError("You can't participate in a tournament until you have an official rating. To establish a rating you need to finish 5 games.", "mainmenu.php"); } ?> <html> <head> <title>Webmaster</title> <LINK rel="stylesheet" href="themes/<?php echo $_SESSION["pref_colortheme"]; ?> /styles.css" type="text/css"> </head>
function renderRecilence($char_data) { $rating = getRating($char_data[UNIT_FIELD_LEVEL]); $melee = $char_data[PLAYER_FIELD_CRIT_TAKEN_MELEE_RATING]; $ranged = $char_data[PLAYER_FIELD_CRIT_TAKEN_RANGED_RATING]; $spell = $char_data[PLAYER_FIELD_CRIT_TAKEN_SPELL_RATING]; $minResilience = min($melee, $ranged, $spell); createTopTable(); printf("<TR><TD class=head>Resilience %d</TD></TR>", $minResilience); printf("<TR><TD>Melee Resilience %d (%.2f%%)</TD></TR>", $melee, $melee / GetRatingCoefficient($rating, CR_CRIT_TAKEN_MELEE)); printf("<TR><TD>Ranged Resilience %d (%.2f%%)</TD></TR>", $ranged, $ranged / GetRatingCoefficient($rating, CR_CRIT_TAKEN_RANGED)); printf("<TR><TD>Spell Resilience %d (%.2f%%)</TD></TR>", $spell, $spell / GetRatingCoefficient($rating, CR_CRIT_TAKEN_SPELL)); createEndTable("normStat", $minResilience); }
init_srand(); } if ($_POST['color'] == 'random') { $tmpColor = rand(0, 1) == 1 ? "white" : "black"; } else { $tmpColor = $_POST['color']; } $tmpQuery = "INSERT INTO games (whitePlayer, blackPlayer, gameMessage, messageFrom, dateCreated, lastMove, ratingWhite, ratingBlack,ratingWhiteM, ratingBlackM,oficial,PVBlack,PVWhite) VALUES ("; if ($tmpColor == 'white') { $white = $_SESSION['playerID']; $black = $_POST['opponent']; } else { $white = $_POST['opponent']; $black = $_SESSION['playerID']; } $tmpQuery .= "{$white}, {$black}, 'playerInvited', '" . $tmpColor . "', NOW(), NOW()," . getRating($white) . "," . getRating($black) . "," . getRatingMonth($white) . "," . getRatingMonth($black) . ",'" . $_POST['oficial'] . "'," . getPV($black) . "," . getPV($white) . ")"; mysql_query($tmpQuery); /* if email notification is activated... */ if ($CFG_USEEMAILNOTIFICATION) { /* if opponent is using email notification... */ $tmpOpponentEmail = mysql_query("SELECT value FROM preferences WHERE playerID = " . $_POST['opponent'] . " AND preference = 'emailNotification'"); if (mysql_num_rows($tmpOpponentEmail) > 0) { $opponentEmail = mysql_result($tmpOpponentEmail, 0); if ($opponentEmail != '') { /* notify opponent of invitation via email */ webchessMail('invitation', $opponentEmail, '', $_SESSION['nick']); } } } } break;
include_once "function.php"; include 'connect.php'; require 'Header.php'; echo "<div class='sform' >"; $q = mysql_query("SELECT * FROM `Media_Rating` Group by mid ORDER BY avg(rating) desc LIMIT 0,5") or die(mysql_error()); while ($row = mysql_fetch_assoc($q)) { $id = $row['mid']; $r = mysql_query("SELECT * FROM `Media`m natural join`userList`u natural join Views where `mid`='{$id}'and permission='public'") or die(mysql_error()); while ($row1 = mysql_fetch_assoc($r)) { $mid = $row1['mid']; $name = $row1['Title']; $text = $row1['Description']; $uid = $row1['uid']; $uname = $row1['UserName']; $views = $row1['views']; $rating = getRating($mid); $path = $row1['MediaPath']; $type = $row1['Type']; $dPath = "http://mmlab.cs.clemson.edu/spring12/g5/metube/" . $path; if (stripos($type, "wmv") !== false) { echo "<div class='rbox'>"; echo "<img style=\"float:left;\" src=\"images/Video.jpg\" alt=\"profile\" height=\"100\" width=\"100\" />"; echo "<b><a href=\"player_wmv.php?mid={$mid}\">"; echo $name . "</a><b/><br/>"; echo "<br/><font size=\"2\" face=\"arial\" color=\"green\">"; echo "<b>VIEWS: "; echo number_format($views) . "</b>"; echo "</font><br/>"; echo "<font size=\"2\" face=\"arial\" color=\"blue\">"; echo "<b>Rating: "; echo round($rating, 2) . "</b>";
function pullRating($id, $show5 = false, $showPerc = false, $showVotes = false, $static = NULL) { // Check if they have already voted... $text = ''; $sel = mysql_query("SELECT id FROM ratings WHERE ip = '" . $_SERVER['REMOTE_ADDR'] . "' AND beer_id = '{$id}'"); if (mysql_num_rows($sel) > 0 || $static == 'novote' || isset($_COOKIE['has_voted_' . $id])) { if ($show5 || $showPerc || $showVotes) { $text .= '<div class="rated_text">'; } if ($show5) { $text .= 'Rated <span id="outOfFive_' . $id . '" class="out5Class">' . outOfFive($id) . '</span>/5'; } if ($showPerc) { $text .= ' (<span id="percentage_' . $id . '" class="percentClass">' . getRating($id) . '</span>)'; } if ($showVotes) { $text .= ' (<span id="showvotes_' . $id . '" class="votesClass">' . getVotes($id) . '</span>)'; } if ($show5 || $showPerc || $showVotes) { $text .= '</div>'; } return $text . ' <ul class="star-rating2" id="rater_' . $id . '"> <li class="current-rating" style="width:' . getRating($id) . ';" id="ul_' . $id . '"></li> <li><a onclick="return false;" href="#" title="1 star out of 5" class="one-star" >1</a></li> <li><a onclick="return false;" href="#" title="2 stars out of 5" class="two-stars">2</a></li> <li><a onclick="return false;" href="#" title="3 stars out of 5" class="three-stars">3</a></li> <li><a onclick="return false;" href="#" title="4 stars out of 5" class="four-stars">4</a></li> <li><a onclick="return false;" href="#" title="5 stars out of 5" class="five-stars">5</a></li> </ul> <div id="loading_' . $id . '"></div>'; } else { if ($show5 || $showPerc || $showVotes) { $text .= '<div class="rated_text">'; } if ($show5) { $show5bool = 'true'; $text .= 'Rated <span id="outOfFive_' . $id . '" class="out5Class">' . outOfFive($id) . '</span>/5'; } else { $show5bool = 'false'; } if ($showPerc) { $showPercbool = 'true'; $text .= ' (<span id="percentage_' . $id . '" class="percentClass">' . getRating($id) . '</span>)'; } else { $showPercbool = 'false'; } if ($showVotes) { $showVotesbool = 'true'; $text .= ' (<span id="showvotes_' . $id . '" class="votesClass">' . getVotes($id) . '</span>)'; } else { $showVotesbool = 'false'; } if ($show5 || $showPerc || $showVotes) { $text .= '</div>'; } return $text . ' <ul class="star-rating" id="rater_' . $id . '"> <li class="current-rating" style="width:' . getRating($id) . ';" id="ul_' . $id . '"></li> <li><a onclick="rate(\'1\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?id=' . $id . '&rating=1" title="1 star out of 5" class="one-star" >1</a></li> <li><a onclick="rate(\'2\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?id=' . $id . '&rating=2" title="2 stars out of 5" class="two-stars">2</a></li> <li><a onclick="rate(\'3\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?id=' . $id . '&rating=3" title="3 stars out of 5" class="three-stars">3</a></li> <li><a onclick="rate(\'4\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?id=' . $id . '&rating=4" title="4 stars out of 5" class="four-stars">4</a></li> <li><a onclick="rate(\'5\',\'' . $id . '\',' . $show5bool . ',' . $showPercbool . ',' . $showVotesbool . '); return false;" href="includes/rating_process.php?id=' . $id . '&rating=5" title="5 stars out of 5" class="five-stars">5</a></li> </ul> <div id="loading_' . $id . '"></div>'; } }
function create_games($id) { global $_SESSION; $t = mysql_query("SELECT * FROM tournaments WHERE id = '$id'"); $t = mysql_fetch_array($t); if ($t['players'] == 4) { $games = array( 1 => array('whitePlayer' => $t['player1'], 'blackPlayer' => $t['player2']), 2 => array('whitePlayer' => $t['player1'], 'blackPlayer' => $t['player3']), 3 => array('whitePlayer' => $t['player1'], 'blackPlayer' => $t['player4']), 4 => array('whitePlayer' => $t['player2'], 'blackPlayer' => $t['player1']), 5 => array('whitePlayer' => $t['player2'], 'blackPlayer' => $t['player3']), 6 => array('whitePlayer' => $t['player2'], 'blackPlayer' => $t['player4']), 7 => array('whitePlayer' => $t['player3'], 'blackPlayer' => $t['player1']), 8 => array('whitePlayer' => $t['player3'], 'blackPlayer' => $t['player2']), 9 => array('whitePlayer' => $t['player3'], 'blackPlayer' => $t['player4']), 10 => array('whitePlayer' => $t['player4'], 'blackPlayer' => $t['player1']), 11 => array('whitePlayer' => $t['player4'], 'blackPlayer' => $t['player2']), 12 => array('whitePlayer' => $t['player4'], 'blackPlayer' => $t['player3'])); while (list($key, $val) = each($games)) { $query = "INSERT INTO {$db_prefix}games (timelimit, gameMessage,messageFrom, whitePlayer, blackPlayer, dateCreated, lastMove, ratingWhite, ratingBlack,ratingWhiteM,ratingBlackM,PVBlack,PVWhite,tournament,oficial,thematic) VALUES ("; $white = $games[$key]['whitePlayer']; $black = $games[$key]['blackPlayer']; $query .= "".$t['days'].", '', '', $white, $black, NOW(), NOW(),".getRating($white).",".getRating($black).",".getRatingMonth($white).",".getRatingMonth($black).",".getPV($black).",".getPV($white).", '$id', '".$t['official']."','".$t['thematic']."')"; mysql_query($query); echo mysql_error(); } // while $query = mysql_query("SELECT game_id FROM {$db_prefix}games WHERE tournament = '$id'"); while ($g = mysql_fetch_array($query)) { if (!function_exists('createNewGame')) { include 'newgame.php'; } $_SESSION['gameID'] = $g['gameID']; createNewGame($_SESSION['gameID']); saveGame(); } // while } // 4 players }
</option> <option value="black"><?php echo $MSG_LANG["black"]; ?> </option> </select></TD></TR> <TR> <TD style="text-align:left"><?php echo $MSG_LANG["isofficial"]; ?> :</TD> <TD style="text-align:left"> <? if ($newuser ==1 || ($computer == 1 && !$CFG_RANK_COMPUTER) || getRating($_SESSION[playerID]) == 0){?> <input type='hidden' name='oficial' value='0'> <select name="oficialdisabled" disabled=true> <option value="1"><?php echo $MSG_LANG["yes"]; ?> </option> <option value="0" SELECTED><?php echo $MSG_LANG["no"]; ?> </option> </select> <?}else{?> <select name="oficial"> <option value="1" SELECTED><?php echo $MSG_LANG["yes"];
function create_match_games($match_id){ //load up all signed up players and arrange in order $tmp_teams = mysql_query("SELECT * FROM matches WHERE match_id = '$match_id'"); $teams = db_result_to_array($tmp_teams); $team1 = $teams[0][1]; $team2 = $teams[0][2]; $boards = $teams[0][6]; //load up player IDs for team 1 $tmp_players = mysql_query("SELECT playerID FROM match_players WHERE match_id = '$match_id' AND teamID = '$team1'"); $team1_players = db_result_to_array($tmp_players); for ($i=0;$i<$boards;$i++){ $tmp_player_info = mysql_query("SELECT rating FROM {$db_prefix}players WHERE playerID = ".$team1_players[$i][0]); $tmp_rating = mysql_fetch_array($tmp_player_info); $rating=$tmp_rating[0]; $team1_players[$i][1] = $rating; # echo "Player team 1, player $i: ".$team1_players[$i][0]." rating = ".$team1_players[$i][1]."<br>"; } usort ($team1_players, 'compare');//sort in rank order //load up player IDs for team 2 $tmp_players = mysql_query("SELECT playerID FROM match_players WHERE match_id = '$match_id' AND teamID = '$team2'"); $team2_players = db_result_to_array($tmp_players); for ($i=0;$i<$boards;$i++){ $tmp_player_info = mysql_query("SELECT rating FROM {$db_prefix}players WHERE playerID = ".$team2_players[$i][0]); $tmp_rating = mysql_fetch_array($tmp_player_info); $rating=$tmp_rating[0]; $team2_players[$i][1] = $rating; # echo "Player team 2, player $i: ".$team2_players[$i][0]." rating = ".$team2_players[$i][1]."<br>"; } usort ($team2_players, 'compare');//sort in rank order //debug line # echo "<br>".$team1_players[0][0]." : ".$team1_players[0][1]."<br>".$team1_players[1][0]." : ".$team1_players[1][1]."<br>".$team2_players[0][0]." : ".$team2_players[0][1]."<br>".$team2_players[1][0]." : ".$team2_players[1][1]; //for each pair, create first game $tmpColor = 'white';//set first team 1 player to white for ($i=0;$i<$boards;$i++){ $tmpQuery = "INSERT INTO {$db_prefix}games (white_player, black_player, status, message_from, dateCreated, lastMove, ratingWhite, ratingBlack, ratingWhiteM, ratingBlackM, oficial, PVBlack, PVWhite, timelimit, teamMatch, team) VALUES ("; if ($tmpColor == 'white'){ $white = $team1_players[$i][0]; $black = $team2_players[$i][0]; $tmpColor = 'black'; }else{ $white = $team2_players[$i][0]; $black = $team1_players[$i][0]; $tmpColor = 'white'; } $tmpQuery .= "$white, $black, '', '', NOW(), NOW(),".getRating($white).",".getRating($black).",".getRatingMonth($white).",".getRatingMonth($black).",'1',".getPV($black).",".getPV($white).",".getMatchTimeLimit($match_id).",'1',$match_id)"; mysql_query($tmpQuery); /* if email notification is activated... */ # if ($CFG_USEEMAILNOTIFICATION){ # /* if opponent is using email notification... */ # $tmpOpponentEmail = mysql_query("SELECT value FROM ch_preferences WHERE playerID = ".$_POST['opponent']." AND preference = 'emailNotification'"); # if (mysql_num_rows($tmpOpponentEmail) > 0){ # $opponentEmail = mysql_result($tmpOpponentEmail, 0); # if ($opponentEmail != ''){ # /* notify opponent of invitation via email */ # webchessMail('invitation', $opponentEmail, '', $_SESSION['nick']); # } # } # } // setup new board $game_id = mysql_insert_id();// get ID of new game $_SESSION['game_id'] = $game_id; createNewGame($game_id); saveGame(); } //for each pair, create second game $tmpColor = 'black';//set first team 1 player to white for ($i=0;$i<$boards;$i++){ $tmpQuery = "INSERT INTO {$db_prefix}games (white_player, black_player, status, message_from, dateCreated, lastMove, ratingWhite, ratingBlack, ratingWhiteM, ratingBlackM, oficial, PVBlack, PVWhite, timelimit, teamMatch, team) VALUES ("; if ($tmpColor == 'black'){ $black = $team1_players[$i][0]; $white = $team2_players[$i][0]; $tmpColor = 'white'; }else{ $black = $team2_players[$i][0]; $white = $team1_players[$i][0]; $tmpColor = 'black'; } $tmpQuery .= "$white, $black, '', '', NOW(), NOW(),".getRating($white).",".getRating($black).",".getRatingMonth($white).",".getRatingMonth($black).",'1',".getPV($black).",".getPV($white).",".getMatchTimeLimit($match_id).",'1',$match_id)"; mysql_query($tmpQuery); /* if email notification is activated... */ # if ($CFG_USEEMAILNOTIFICATION){ # /* if opponent is using email notification... */ # $tmpOpponentEmail = mysql_query("SELECT value FROM ch_preferences WHERE playerID = ".$_POST['opponent']." AND preference = 'emailNotification'"); # if (mysql_num_rows($tmpOpponentEmail) > 0){ # $opponentEmail = mysql_result($tmpOpponentEmail, 0); # if ($opponentEmail != ''){ # /* notify opponent of invitation via email */ # webchessMail('invitation', $opponentEmail, '', $_SESSION['nick']); # } # } # } // setup new board $game_id = mysql_insert_id();// get ID of new game $_SESSION['game_id'] = $game_id; createNewGame($game_id); saveGame(); } //update match table mysql_query("UPDATE matches SET status = '' WHERE match_id = '$match_id'"); }