Witam. Ze skryptem stronicowania "użeram się" już długo. Próbowałem w js - nie wyszło, w ajax'ie - to samo.
Moja wiedza na temat php dopiero raczkuje.

Dlatego chciałbym, aby ktoś pomógł mi przerobić skrypt download'u, aby co określoną liczbę plików rozpoczynała się nowa strona.
Oto mój plik download.php
$download_start = get_template('download_start.tpl');
if($_GET['cat'] >= 1)
{
//---
{
$download_info_cat = get_template('download_info_cat.tpl');
$download_info_cat = str_replace("{cat}", $row_cat['name'], $download_info_cat); $download_info_cat = str_replace("{l_cat}", $lang['cat'], $download_info_cat);
$Query_pcat="SELECT * FROM kategorie WHERE pod='".$row_cat['id']."' ORDER BY name ASC";
{
$res = mysql_query("SELECT * FROM file WHERE cat='".$row_pcat["id"]."' and active='1'");
echo' <a href="podkategoria,'.$row_pcat['id'].','.namen
($row_pcat['name']).'.html"></a>';
}
if($ile2 >= 1)
{
}
{
$download_info_file = get_template('download_info_file.tpl');
$download_info_file = str_replace("{id}", $row_file['id'], $download_info_file); $download_info_file = str_replace("{name}", $row_file['name'], $download_info_file); $download_info_file = str_replace("{name_n}", namen
($row_file['name']), $download_info_file); $download_info_file = str_replace("{data}", $row_file['data'], $download_info_file); $download_info_file = str_replace("{pobran}", $row_file['pobran'], $download_info_file); $download_info_file = str_replace("{licencja}", $row_file['licencja'], $download_info_file); $download_info_file = str_replace("{opis}", $row_file['opis'], $download_info_file); $download_info_file = str_replace("{l_data}", $lang['dodano'], $download_info_file); $download_info_file = str_replace("{l_pobran}", $lang['pobran'], $download_info_file); $download_info_file = str_replace("{l_licencja}", $lang['licencja'], $download_info_file);
if($row_file["img"] == "")
{
$download_info_file = str_replace("{img}", "", $download_info_file); }
else
{
$download_info_file = str_replace("{img}", $row_file['img'], $download_info_file); }
echo $download_info_file;
}
}
//---
}
else if($_GET['pcat'] >= 1)
{
//---
{
$download_info_cat = get_template('download_info_cat.tpl');
$download_info_cat = str_replace("{cat}", $row_catt['name'], $download_info_cat); $download_info_cat = str_replace("{l_cat}", $lang['cat'], $download_info_cat);
}
{
$download_info_file = get_template('download_info_file.tpl');
$download_info_file = str_replace("{id}", $row_file['id'], $download_info_file); $download_info_file = str_replace("{name}", $row_file['name'], $download_info_file); $download_info_file = str_replace("{name_n}", namen
($row_file['name']), $download_info_file); $download_info_file = str_replace("{data}", $row_file['data'], $download_info_file); $download_info_file = str_replace("{pobran}", $row_file['pobran'], $download_info_file); $download_info_file = str_replace("{licencja}", $row_file['licencja'], $download_info_file); $download_info_file = str_replace("{opis}", substr($row_file['opis'], 0
, 200
), $download_info_file); $download_info_file = str_replace("{l_data}", $lang['dodano'], $download_info_file); $download_info_file = str_replace("{l_pobran}", $lang['pobran'], $download_info_file); $download_info_file = str_replace("{l_licencja}", $lang['licencja'], $download_info_file);
if($row_file["img"] == "")
{
$download_info_file = str_replace("{img}", "", $download_info_file); }
else
{
$download_info_file = str_replace("{img}", $row_file['img'], $download_info_file); }
echo $download_info_file;
}
//---
}
else
{
//---
$Query_cat="SELECT * FROM kategorie WHERE pod='0' ORDER BY name ASC";
{
echo'<b><a href="kategoria,'.$row_cat['id'].','.namen
($row_cat['name']).'">'.$row_cat['name'].'</a></b><br>';
$Query_pcat="SELECT * FROM kategorie WHERE pod='".$row_cat['id']."' ORDER BY name ASC";
{
$res = mysql_query("SELECT * FROM file WHERE cat='".$row_pcat["id"]."' and active='1'");
echo' <a href="podkategoria,'.$row_pcat['id'].','.namen
($row_pcat['name']).'.html">'.$row_pcat['name'].' ['.$ile2.']</a><br>';
}
}
//---
}
$download_end = get_template('download_end.tpl');
Proszę o pomoc.