Parašė Maksas· 2012 Sau. 12 00:01:48
#1
Atidarome
articles.php ir surandame:
include LOCALE.LOCALESET."articles.php";
ir po įrašome šį kodą:
$isTrue = false;
$str = "";
if (isset($_GET['article_id'])&& isnum($_GET['article_id'])){
$result = dbquery(
"SELECT ta.article_cat, tac.article_cat_name, ta.article_id, ta.article_subject FROM ".DB_ARTICLES." ta
LEFT JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
WHERE article_id='{$_GET['article_id']}'"
);
if (dbrows($result)) {
$data = dbarray($result);
$str .= "<img src='".get_image("right")."' title='' style='border: 0px none; vertical-align: middle;'> <a href='articles.php'> Visi straipsniai </a>";
$str .= "<img src='".get_image("right")."' title='' style='border: 0px none; vertical-align: middle;'> <a href='articles.php?cat_id={$data['article_cat']}'>{$data['article_cat_name']} </a>";
$str .= "<img src='".get_image("right")."' title='' style='border: 0px none; vertical-align: middle;'> <a href='articles.php?article_id={$_GET['article_id']}'>{$data['article_subject']} </a>";
$isTrue = true;
}
}
else if (isset($_GET['cat_id']) && isnum($_GET['cat_id'])){
$result = dbquery(
"SELECT article_cat_name FROM ".DB_ARTICLE_CATS."
WHERE article_cat_id='{$_GET['cat_id']}'");
if (dbrows($result)) {
$data = dbarray($result);
$str .= "<img src='".get_image("right")."' title='' style='border: 0px none; vertical-align: middle;'> <a href='articles.php'> Visi straipsniai </a>";
$str .= "<img src='".get_image("right")."' title='' style='border: 0px none; vertical-align: middle;'> <a href='articles.php?cat_id={$_GET['cat_id']}'>{$data['article_cat_name']} </a>";
$isTrue = true;
}
}
if($isTrue){
opentable("Straipsnių navigacija");
echo $str;
closetable();
}
Patogu ir paprasta.Tinka visoms versijoms!
Atvaizdas
Redagavo Maksas· 2012 Sau. 12 00:01:34