• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Php latestnews including top 5 players gesior

vingo

Active Member
Joined
Oct 27, 2012
Messages
464
Reaction score
43
As the title says


I need like a latestnews script that works with tfs 1.0 if that has anything to do with anything that is.


It should have all the normal stuff on rl layout + on the right side a box where the top 5 players are included



http://paste.ots.me/560633/text
 
The boxes to the right have nothing to do with latestnews.php, it's all in layout.php :p

Btw, here's a top 5 players script,
Code:
                                        <?php
                                            $test = $SQL->query("SELECT `name`,`level` FROM players ORDER BY `level` DESC LIMIT 5");
                                            $count = 1;
                                         
                                            foreach ($test as $display) {
                                                if (strlen($display['name']) > 10) { $valuex = substr($display['name'],0,10).'...'; } else { $valuex = $display['name']; }
                                                echo '<tr><td width="10%">' . $count++ . '.</td><td width="60%"><a href="?subtopic=characters&name=' . $display['name'] . '">' . $valuex . '</a></td> <td width="20%" align="right">' . $display['level'] . '</td></tr>';
                                                }
                                       
                    ?>
 
I haven't came further than this.



PHP:
  <div id="Themeboxes">
  <div id="NewcomerBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/parceiro/border_supported.gif);">


<br>
<br>

                                        <?php
                                            $test = $SQL->query("SELECT `name`,`level` FROM players ORDER BY `level` DESC LIMIT 1");
                                            $count = 1;
                                            foreach ($test as $display) {
                                                if (strlen($display['name']) > 10) { $valuex = substr($display['name'],0,10).'...'; } else { $valuex = $display['name']; }
                                                echo '<tr><td width="10%">' . $count++ . '.</td><td width="60%"><a href="?subtopic=characters&name=' . $display['name'] . '">' . $valuex . '</a></td> <td width="20%" align="right">' . $display['level'] . '</td></tr>';}?>

</div>
    </div>
  </div>

                                    </div>
                                </form>
                            </div>


                              <div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.gif);"></div>
                        </div>



Example http://sinaot.sytes.net/OT/?subtopic=latestnews
 
Insert this gif in 'layouts\tibiacom\images\themeboxes' with the name 'highscores.gif' ... or change and use yourself gif

https://i.imgur.com/svSqkD5.gif

PHP:
          <div id="Themeboxes">
      
  <div id="NewcomerBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/highscores.gif);height:200px;">
<div id="TextTheme" class="TextTheme" style="position:absolute;top:40px;left:15px;text-align:left;font-size:15px;" >

                        <?PHP
                            $position = 1;
                            foreach($SQL->query('SELECT `name`,`level`, `online` FROM players ORDER BY `level` DESC LIMIT 7') as $i => $data)
                            {
                                echo  $position . '  <a style="font-weight:bold;text-decoration:none;" href="?subtopic=characters&name='.urlencode($data['name']).'">'.($data['online']>0 ? "<font color=\"green\">".htmlspecialchars($data['name'])."</font>" : "<font color=\"red\">".htmlspecialchars($data['name'])."</font>").'</a> ( ' . $data[level] . ' )<br>';
                            $position = $position+1;
                            }
                        ?>
</div>
  <div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.gif);"></div>
  </div>

        </div>
example
yPYYWHI.jpg
 
Back
Top