Чтение 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 !

<?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&#257; 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&#275;l&#275;t&#257;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&#363;&#382;&#299;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.'; }
	}
 ?>


Версия системы: 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

Контакты

  • D-49179, Deutschland
    Ostercappeln, Im Siek 6
  • +49 176 61966679

  • https://slaed.net
Идеи и предложения
Обратная связь