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

Форум

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

Карта сайта моделя новостей для 4.3 и open

0

0
1
14.08.2009 19:11:10
За основу взят код написаный Serg_pnz.

Выводит категории и лежащие в них новости

Создать файл ваше_название.php сунуть туда код кинуть в корень сайта и дать ссылку с главной страницы на ваш файл

<?php



define("MODULE_FILE", true);
include("function/function.php");
function err_handler ($errno, $errstr, $errfile, $errline) {
global $display_errors;
if(($errno != E_NOTICE && $errno != E_WARNING) && $display_errors){
echo '';
}
}
$error_flags = E_ALL & ~E_NOTICE;
@error_reporting($error_flags);
@ini_set ('error_reporting', $error_flags);
$old_error_handler = set_error_handler("err_handler");
define("DB", true);
define("FUNC_FILE", true);
if (!ini_get("register_globals")) {import_request_variables('GPC');}
if (isset($_COOKIE["lang"])) {
include("language/lang-".$_COOKIE["lang"].".php");
} else {
include("language/lang-russian.php");
}





global $conf, $db, $prefix;


$result = $db->sql_query("SELECT sid,catid, title FROM ".$prefix."_stories WHERE time <= now() AND status !='0' ORDER BY title ASC");
while (list($sid, $catid, $title) = $db->sql_fetchrow($result))



$filesm[] = array($sid, $title, $catid);


$result = $db->sql_query("SELECT id, title, parentid FROM ".$prefix."_categories where modul='news'");
while (list($cid, $title, $parentid) = $db->sql_fetchrow($result))
$massiv[$cid] = array($title, $parentid);

foreach ($massiv as $key => $val) {
$contentium[$key] = $val[0];
$contentium3[$key] = $val[0];
$contentium4[$key] = 1;
$flag = $val[1];
while ($flag != "0") {
$contentium[$key] = $massiv[$flag][0]."/".$contentium[$key];
$contentium4[$key]++;
$flag = $massiv[$flag][1];}}


asort ($contentium);



echo"<table border=0 align=left>";

foreach ($contentium as $key => $val) {
echo"<tr><td style=\"padding-left: ".(1*$contentium4[$key])."px\">
<a style=\"font-size: 12px; font-weight: bold;\" href=\"index.php?name=news&cat=".$key."\">".$contentium3[$key]."</a></td></tr>";

foreach ($filesm as $key2 => $val2) {




if ($val2[2]==$key) echo"<tr><td style=\"padding-left: ".(10*$contentium4[$key])."px\"><a style=\"color: #FFCCE);\" href=\"index.php?name=news&op=view&id=".$val2[2]."\">".$val2[1]."</a></td></tr>";
}

}
echo"</table>";


?>



Пример http://flash.ustal.net/mapgames.php
3.76

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

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

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

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