Jake is it possible to show all threads from the specify nod category.
I can only use this once, I needed for more than one category
I can only use this once, I needed for more than one category
Jake, I have another question, how can i add a custom tab ,that link to a external site? example : "Store Tab" -> www.mystore.com
But there's no dropdown.
<?php
class SummaryRatings_Model_SummaryRatings
{
public static function getRatings()
{
$mysqli = new mysqli("***", "***", "***", "***");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT title, player_name, rating FROM ratings";
$result = $mysqli->query($query);
/* associative and numeric array */
$row = $result->fetch_array(MYSQLI_BOTH);
echo "<table CELLPADDING=30 border =5 >";
echo "<tr>";
echo "<td>".$row['title']."</td>";
echo "<td>".$row['player_name']."</td>";
echo "<td>".$row['rating']."</td>";
echo "</tr>";
echo "</table>";
/* free result set */
$result->free();
/* close connection */
$mysqli->close();
}
}
?>
public static function getRatings(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
$response->params['row'] = $row;
<table CELLPADDING=30 border =5 >
<tr>
<td>{$row.title}</td>
<td>{$row.player_name}</td>
<td>{$row.rating}</td>
</tr>
</table>
Your function signature should be:
Code:public static function getRatings(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
That way you have access to the controller response. Then you can set view params in the response (instead of echoing):
Code:$response->params['row'] = $row;
That will allow you to reference {$row} in your page template. Example:
Code:<table CELLPADDING=30 border =5 > <tr> <td>{$row.title}</td> <td>{$row.player_name}</td> <td>{$row.rating}</td> </tr> </table>
echo '<img src="data:image/jpeg;base64,' . base64_encode( $row['player_image'] ) . '" />';
$row['player_image'] = base64_encode( $row['player_image'] );
$response->params['row'] = $row;
<img src="data:image/jpeg;base64,{$row.player_image}" />
<xen:sidebar>
</xen:sidebar>
<style>
#wrapper {
width: auto !important;
width: 100%;
}
#div1 {
float:left;
color:blue;
width:48%;
}
#div2 {
float:left;
width:48%;
margin-left:3%;
}
</style>
<div id = "div1">
<h2 class="subHeading">Team Rating : Average scores over all games</h2>
</div>
<div id="div2">
<h2 class="subHeading">Manager Rating : Average scores over all games</h2>
</div>
</br>
</br>
</br>
<div style="width:99%">
<h2 class="subHeading">Player Ratings : Average scores over all games</h2>
<table border="1" bordercolor="#a5cae4"width="100%" >
<xen:foreach loop="$row" key="$key" value="$value" i="$i">
<tr>
<td ALIGN="center" BGCOLOR="#d7edfc">{$i} </td>
<td ALIGN="center" style="width:15%;"><img src="data:image/jpeg;base64,{$row.player_image}"/></td>
<td style = "padding-left:30px; font-size: 12pt;">{$row.player_name}</td>
<td style = "padding-left:30px; font-size: 16pt; width:15%;"> {$row.rating}</td>
</tr>
</xen:foreach>
</table>
</div>
<?php
class SummaryRatings_Model_SummaryRatings
{
public static function getRatings(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$mysqli = new mysqli("x", "x", "x", "x");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT title, player_name, player_image, rating FROM ratings";
$result = $mysqli->query($query);
/* associative and numeric array */
$row = $result->fetch_array(MYSQLI_BOTH);
$row['player_image'] = base64_encode( $row['player_image'] );
$response->params['row'] = $row;
/* free result set */
$result->free();
/* close connection */
$mysqli->close();
}
}
?>
We use essential cookies to make this site work, and optional cookies to enhance your experience.