How i can create custom page with my php code in it?
Версия системы: SLAED CMS 4.1 Pro
Версия PHP: PHP 5
Сервер: Сервер в интернете
<?php function splittopages($count,$perpage){ $pagescount=ceil($count/$perpage); $pages=array(); if($pagescount<2){ return $pages; } for($i=1;$i<=$pagescount;$i++){ $pages[]=$i; } return $pages; } ?> <? require("dbconfig.inc.php") ?> <h1>Banu saraksts</h1> <?php $sql = mysql_query("SELECT COUNT( * ) AS `bid` FROM `amx_bans`") or die(mysql_error()); while ($result = mysql_fetch_array($sql)){ echo "<center><b>Kopā izveidoti " .$result["bid"]. " bani.</center></b><br /> <br></br> "; } ?> <?php if(empty($_GET['id'])){ $perpage=50; // ieraksti viena lappuse $_LIMIT=(!empty($_GET['lapa']) && $_GET['lapa']>1)?($_GET['lapa']*$perpage)-$perpage:0; $_LIMIT.=", ".$perpage; $sql="SELECT SQL_CALC_FOUND_ROWS * FROM `amx_bans` ORDER BY `amx_bans`.`bid` DESC LIMIT ".$_LIMIT; $res=mysql_query($sql); $count=mysql_fetch_object(mysql_query("SELECT FOUND_ROWS() as c")); if (mysql_num_rows($res) > 0) { echo '<table width="500" border="0"> <tr> <th>Spēlētājs</th> <th>Laiks</th> <th>Izbanoja</th> <th>Iemesls</th> </tr>'; while($arr = mysql_fetch_array($res)) { $ip = $arr['player_ip']; echo '<tr><td><a href="?id='.$arr['bid'].'">'.$arr['player_nick'].'</a> </td> <td>'; if (($arr['ban_length']) == '0'){ echo "Mūžīgs"; } else { echo $arr['ban_length'].' min.'; } echo '</td> <td>'.$arr['admin_nick'].'</td> <td>'.$arr['ban_reason'].'</td> </tr>'; } } echo '</table>'; $pages=splittopages($count->c,$perpage); if($_GET['lapa']<2){ $_GET['lapa']=1; } $now=array_search($_GET['lapa'],$pages); $prev=$now-1; $next=$now+1; if(array_key_exists($prev,$pages)){ echo '<a href="?lapa='.$pages[$prev].'">Iepriekseja;</a> '; } foreach($pages as $value){ $active=$_GET['blapa']==$value?' class="active"':''; echo '<a href="?lapa='.$value.'"'.$active.'>'.$value.'</a> '; } if(array_key_exists($next,$pages)){ echo '<a href="?lapa='.$pages[$next].'">Nakama; </a> '; } } if(!empty($_GET["id"])){ $result = mysql_query("SELECT * FROM `amx_bans` WHERE `bid` = '".$_GET["id"]."'") or die(mysql_error()); if (mysql_num_rows($result) > 0) { while($arr = mysql_fetch_array($result)) { $ip = $arr['player_ip']; echo ' <table border="0" width="500"> <a href="http://igaming.ctts.lv/bani.php">Atpakal</a> <tr> <td>ID: </td> <td>'.$arr['bid'].'</td> </tr> <tr> <td>Niks: </td> <td>'.$arr['player_nick'].'</td> </tr> <tr> <td>IP: </td> <td>'.$arr['player_ip'].'</td> </tr> <tr> <td>Bans uzlikts: </td> <td>'.date('Y.m.d H:i:s', ($arr['ban_created'])).'</td> </tr> <tr> <td>Bana ilgums: </td> <td>'; if (($arr['ban_length']) == '0'){ echo "Muzigs"; } else { echo $arr['ban_length'].' min.'; } echo ' </td> </tr> <tr> <td>Iemesls: </td> <td>'.$arr['ban_reason'].'</td> </tr> <tr> <td>Banu uzlika: </td> <td>'.$arr['admin_nick'].'</td> </tr> <tr> <td>Serveris: </td> <td>'.$arr['server_name'].'</td> </tr> <tr> <td>Links</td> <td>http://igaming.ctts.lv/bans.php?id='.$arr['bid'].'</td> </tr> </table>'; } } else {echo 'Shads bans neeksiste.'; } } ?>
Форум
Контакты