Elimdeki modüle sayfa ekliyorum bu sayfaları sıralama da sorun yaşıyorum. Kategoriye tıkladığımda en yeniler en başta çıkıyor. Böyle değil de eskiler en başta olsun istiyorum. index.php dosyası aşağıdaki gibi.
function menu($c_cid) {
global $prefix, $db, $module_name;
$c_cid = intval($c_cid);
OpenTable();
$sql = $db->sql_query("SELECT title, description FROM ".$prefix."_phpturk_kategoriler WHERE cid='$c_cid'");
list($c_title, $c_description) = $db->sql_fetchrow($sql);
echo "<center><font class=\"option\"><b>$c_title</b></font><br>$c_description</center>";
CloseTable();
}
function footmenu() {
global $module_name;
OpenTable();
echo "<center>[ <a href=\"j a v a s c r i p t:history.go(-1)\">"._PAGEBACK."</a> | <a href=\"modules.php?name=$module_name\">"._PAGEHOME."</a> | <a href=#>"._PAGETOP."</a> ]</center>";
CloseTable();
}
function links($sc_cid) {
global $prefix, $db, $module_name;
$sc_cid = intval($sc_cid);
$sql = "SELECT cid FROM ".$prefix."_phpturk_kategoriler WHERE parentid = '$sc_cid'";
$resnum = $db->sql_query($sql);
if ($numrows = $db->sql_numrows($resnum) > 0) {
$cat_links = "cat";
} else {
$cat_links = "showcat";
}
echo "<a href=\"modules.php?name=$module_name&op=$cat_links&cid=$sc_cid\">";
}
function main() {
global $db, $prefix, $module_name, $multilingual, $currentlang, $tablecathome, $tablenumhome, $catdescrhome, $homesubcat, $newhome, $newhomenum, $shownumeric, $datetime;
include("header.php");
title(""._PAGESNOTE."");
OpenTable();
if ($multilingual == 1) {
$querylang = "WHERE planguage='$currentlang'";
} else {
$querylang = "";
}
if ($tablecathome == 1) {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\" width=\"100%\"><tr>";
$tc = 0;
$tdwidth = intval(100/$tablenumhome);
}
$result = $db->sql_query("SELECT cid, title, description FROM ".$prefix."_phpturk_kategoriler $querylang");
while (list($cid, $title, $description) = $db->sql_fetchrow($result)) {
if ($tablecathome == 1) {
echo "<td valign=\"top\" width=\"".$tdwidth."%\">";
}
echo "<img border=\"0\" src=\"modules/$module_name/images/folder.gif\"> ";
links($cid);
echo "<b>$title</b></a>";
if ($catdescrhome == 1) {
echo "<br>$description";
}
if ($homesubcat == 1) {
echo "<br>";
$sc = 0;
$sql2 = "SELECT cid, title FROM ".$prefix."_phpturk_kategoriler WHERE parentid='$cid'";
$result2 = $db->sql_query($sql2);
while (list($sc_cid, $sc_title) = $db->sql_fetchrow($result2)) {
if ($sc > 0) { echo ", "; }
links($sc_cid);
echo "$sc_title</a>";
$sc++;
}
}
if ($tablecathome == 1) {
$tc++;
if ($tc == $tablenumhome) {
$tc = 0; echo "</td></tr><tr>";
} else {
echo "</td>";
}
} else {
echo "<br><br>";
}
}
if ($tablecathome == 1) { echo "</table>"; }
echo "<br>";
$newhomenum = intval($newhomenum);
if ($newhome == 1) {
$result3 = $db->sql_query("SELECT pid, title, hometext, date FROM ".$prefix."_phpturk WHERE cid !='0' AND active = '1' ORDER BY pid DESC LIMIT $newhomenum");
if ($numrows = $db->sql_numrows($result3) > 0) {
echo "<font class=\"option\"><b>"._NEWPAGES."</b></font><hr>";
while (list($p_pid, $p_title, $p_hometext, $date) = $db->sql_fetchrow($result3)) {
$p_hometext = stripslashes(check_html($p_hometext, nohtml));
formatTimestamp($date);
echo "<b><a href=\"modules.php?name=$module_name&op=page&pid=$p_pid\" title=\"$p_title\">$p_title</a></b><br>$p_hometext<br>"._SENDDATE.": $datetime<br><br>";
}
}
}
$result4 = $db->sql_query("SELECT pid, title, hometext, date FROM ".$prefix."_phpturk WHERE cid ='0' AND active = '1' ORDER BY pid DESC");
if ($numrows = $db->sql_numrows($result4) > 0) {
echo "<font class=\"option\"><b>"._PAGESHOMECATS."</b></font><hr>";
while (list($p_pid, $p_title, $p_hometext, $date) = $db->sql_fetchrow($result4)) {
$p_hometext = stripslashes(check_html($p_hometext, nohtml));
formatTimestamp($date);
echo "<b><a href=\"modules.php?name=$module_name&op=page&pid=$p_pid\" title=\"$p_title\">$p_title</a></b><br><i>$p_hometext</i><br>"._SENDDATE.": $datetime<br><br>";
}
}
CloseTable();
if ($shownumeric == 1) {
OpenTable();
$num_cat = $db->sql_numrows($db->sql_query("SELECT cid FROM ".$prefix."_phpturk_kategoriler"));
$num_page = $db->sql_numrows($db->sql_query("SELECT pid FROM ".$prefix."_phpturk WHERE active='1'"));
echo "<center>"._ALLP.": <b>$num_page</b> "._ALLP2." <b>$num_cat</b> "._ALLP3."</center>";
CloseTable();
}
include("footer.php");
}
function cat($cid) {
global $db, $prefix, $module_name, $tablecat, $tablenum, $catdescr, $subcat, $datetime;
$cid = intval($cid);
include("header.php");
title(""._PAGESNOTE."");
menu($cid);
OpenTable();
if ($tablecat == 1) {
echo "<table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"100%\"><tr>";
$tc = 0;
$tdwidth = intval(100/$tablenum);
}
$result = $db->sql_query("SELECT cid, title, description, parentid FROM ".$prefix."_phpturk_kategoriler WHERE parentid='$cid'");
while (list($c_cid, $title, $description, $parentid) = $db->sql_fetchrow($result)) {
if ($tablecat == 1) {
echo "<td valign=\"top\" width=\"".$tdwidth."%\">";
}
echo "<img border=\"0\" src=\"modules/$module_name/images/folder.gif\"> ";
links($c_cid);
echo "<b>$title</b></a>";
if ($catdescr == 1) {
echo "<br><i>$description</i>";
}
if ($subcat == 1) {
echo "<br>";
$sc = 0;
$result2 = $db->sql_query("SELECT cid, title FROM ".$prefix."_phpturk_kategoriler WHERE parentid='$c_cid'");
while (list($sc_cid, $sc_title) = $db->sql_fetchrow($result2)) {
if ($sc > 0) {
echo ", ";
}
links($sc_cid);
echo "$sc_title</a>";
$sc++;
}
}
if ($tablecat == 1) {
$tc++;
if ($tc == $tablenum) {
$tc = 0; echo "</td></tr><tr>";
} else {
echo "</td>";
}
} else {
echo "<br><br>";
}
}
if ($tablecat == 1) {
echo "</table>";
}
echo "<br><br>";
$result3 = $db->sql_query("SELECT pid, title, hometext, date FROM ".$prefix."_phpturk WHERE cid ='$cid' AND active = '1' ORDER BY pid DESC");
if ($numrows = $db->sql_numrows($result3) > 0) {
echo "<font class=\"option\"><b>"._PAGESHOMECAT."</b></font><hr>";
while (list($p_pid, $p_title, $p_hometext, $date) = $db->sql_fetchrow($result3)) {
$p_pid = intval($p_pid);
$p_hometext = stripslashes(check_html($p_hometext, nohtml));
formatTimestamp($date);
echo "<b><a href=\"modules.php?name=$module_name&op=page&pid=$p_pid\" title=\"$p_title\">$p_title</a></b><br>$p_hometext<br>"._SENDDATE.": $datetime<br><br>";
}
}
CloseTable();
footmenu();
include("footer.php");
}
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız