Чтение RSS каналов

Форум

Открыть Ответить

Custom

0

0
1
07.03.2010 11:57:08
How i can create custom page with my php code in it?


Версия системы: SLAED CMS 4.1 Pro
Версия PHP: PHP 5
Сервер: Сервер в интернете
3.91

3.91
3
07.03.2010 16:39:5107.03.2010 16:51:30
Okey still problem , i want to fill the custom page with this code
but all what i get is errors !

001<?php
002function splittopages($count,$perpage){
003    $pagescount=ceil($count/$perpage);
004    $pages=array();
005    if($pagescount<2){ return $pages; }
006    for($i=1;$i<=$pagescount;$i++){
007    $pages[]=$i;
008    }
009    return $pages;
010  }
011?>
012 
013<? require("dbconfig.inc.php") ?>
014 
015<h1>Banu saraksts</h1>
016 
017<?php
018$sql = mysql_query("SELECT COUNT( * ) AS `bid` FROM `amx_bans`") or die(mysql_error());
019while ($result = mysql_fetch_array($sql)){
020echo "<center><b>Kop&#257; izveidoti " .$result["bid"]. " bani.</center></b><br />
021<br></br>
022"; 
023}
024?>
025<?php
026if(empty($_GET['id'])){
027    $perpage=50; // ieraksti viena lappuse
028    $_LIMIT=(!empty($_GET['lapa']) && $_GET['lapa']>1)?($_GET['lapa']*$perpage)-$perpage:0;
029    $_LIMIT.=", ".$perpage;
030    $sql="SELECT SQL_CALC_FOUND_ROWS * FROM `amx_bans` ORDER BY `amx_bans`.`bid` DESC LIMIT ".$_LIMIT;
031    $res=mysql_query($sql);
032    $count=mysql_fetch_object(mysql_query("SELECT FOUND_ROWS() as c"));
033    if (mysql_num_rows($res) > 0) {
034 
035    echo '<table width="500" border="0">
036    <tr>
037    <th>Sp&#275;l&#275;t&#257;js</th>
038    <th>Laiks</th>
039    <th>Izbanoja</th>
040    <th>Iemesls</th>
041    </tr>';
042    while($arr = mysql_fetch_array($res)) {
043    $ip = $arr['player_ip'];
044 
045    echo '<tr><td><a href="?id='.$arr['bid'].'">'.$arr['player_nick'].'</a>
046    </td>
047    <td>';
048    if (($arr['ban_length']) == '0'){
049    echo "M&#363;&#382;&#299;gs"; }
050    else {
051    echo $arr['ban_length'].' min.'; }
052    echo '</td>
053    <td>'.$arr['admin_nick'].'</td>
054    <td>'.$arr['ban_reason'].'</td>
055    </tr>';
056    }
057    }
058    echo '</table>';
059     
060    $pages=splittopages($count->c,$perpage);
061     
062    if($_GET['lapa']<2){ $_GET['lapa']=1; }
063    $now=array_search($_GET['lapa'],$pages);
064    $prev=$now-1;
065    $next=$now+1;
066    if(array_key_exists($prev,$pages)){ 
067    echo '<a href="?lapa='.$pages[$prev].'">Iepriekseja;</a> ';
068    }
069    foreach($pages as $value){
070    $active=$_GET['blapa']==$value?' class="active"':'';
071    echo '<a href="?lapa='.$value.'"'.$active.'>'.$value.'</a> ';
072    }
073    if(array_key_exists($next,$pages)){
074    echo '<a href="?lapa='.$pages[$next].'">Nakama;
075    </a> ';
076    }
077}
078 
079if(!empty($_GET["id"])){
080    $result = mysql_query("SELECT * FROM `amx_bans` WHERE `bid` = '".$_GET["id"]."'") or die(mysql_error());
081    if (mysql_num_rows($result) > 0) {
082    while($arr = mysql_fetch_array($result)) {
083     
084    $ip = $arr['player_ip'];
085     
086echo '
087<table border="0" width="500">
088<a href="http://igaming.ctts.lv/bani.php">Atpakal</a>
089  <tr>
090    <td>ID: </td>
091    <td>'.$arr['bid'].'</td>
092  </tr>
093    <tr>
094    <td>Niks: </td>
095    <td>'.$arr['player_nick'].'</td>
096  </tr>
097   <tr>
098    <td>IP: </td>
099    <td>'.$arr['player_ip'].'</td>
100  </tr>
101 
102    <tr>
103    <td>Bans uzlikts: </td>
104    <td>'.date('Y.m.d H:i:s', ($arr['ban_created'])).'</td>
105  </tr>
106   <tr>
107    <td>Bana ilgums: </td>
108    <td>';
109    if (($arr['ban_length']) == '0'){
110    echo "Muzigs"; }
111    else {
112    echo $arr['ban_length'].' min.'; }
113    echo '
114    </td>
115  </tr>
116   <tr>
117    <td>Iemesls: </td>
118    <td>'.$arr['ban_reason'].'</td>
119  </tr>
120   <tr>
121    <td>Banu uzlika: </td>
122    <td>'.$arr['admin_nick'].'</td>
123  </tr>
124   <tr>
125    <td>Serveris: </td>
126    <td>'.$arr['server_name'].'</td>
127  </tr>
128   <tr>
129    <td>Links</td>
130    <td>http://igaming.ctts.lv/bans.php?id='.$arr['bid'].'</td>
131  </tr>
132   
133</table>';
134    }
135    }
136    else {echo 'Shads bans neeksiste.'; }
137    }
138 ?>


Версия системы: SLAED CMS 4.1 Pro
Версия PHP: PHP 5
Сервер: Сервер в интернете
4
07.03.2010 17:50:10
налицо явное непонимание того, что человек делает.
3.61

3.61
Открыть Ответить
Хотите опробовать SLAED CMS в действии?

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

Идеи и предложения
Обратная связь