![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 14 Pomógł: 0 Dołączył: 29.12.2003 Ostrzeżenie: (0%) ![]() ![]() |
[php:1:7e4eca36f3]
<?php // Nie przechowuj w cache'u: @ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); @ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); @ header("Cache-Control: no-store, no-cache, must-revalidate"); @ header("Cache-Control: post-check=0, pre-check=0", false); @ header("Pragma: no-cache"); if (!$_GET) $_GET = $HTTP_GET_VARS; $number = (int)$_GET['n']; $maxlength = (int)$_GET['m']; $frame = $_GET['f']; $charset = $_GET['c']; $javascript = isset($_GET['j']) ? true : false; ////////// SETTINGS // Adres forum: $base_url = 'http://linux-hell.net/forum'; // Bezwzgle;dna s'ciez.ka doste;pu do katalogu forum: $base_path = '/var/www/forum'; // Ustawienia domys'lne: $default_number = 10; $default_maxlength = 60; $default_frame = '_blank'; $default_charset = 'iso-8859-2'; ////////// $base_url .= strrpos($base_url, '/') != strlen($base_url)-1 ? '/' : ''; $base_path .= strrpos($base_path, '/') != strlen($base_path)-1 ? '/' : ''; if (!$number) $number = $default_number; if (!$maxlength) $maxlength = $default_maxlength; if (!$frame) $frame = $default_frame; if (!$charset) $charset = $default_charset; if (defined('IN_PHPBB')) exit; define('IN_PHPBB', true); @ include($base_path . 'extension.inc'); @ include($base_path . 'config.'.$phpEx); @ include($base_path . 'includes/constants.'.$phpEx); @ include($base_path . 'includes/functions.'.$phpEx); @ include($base_path . 'includes/db.'.$phpEx); $sql = "SELECT DISTINCT t.topic_id, t.topic_title, f.forum_name FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f WHERE t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND p.topic_id = t.topic_id AND p.post_id = t.topic_last_post_id ORDER BY p.post_time DESC LIMIT " . $number; if ( !($result = @ $db->sql_query($sql)) ) { @ $db->sql_close(); exit; } if ($javascript) echo "document.write('"; $i = 0; while ($row = @ $db->sql_fetchrow($result)) { $row['topic_title'] = str_replace('&', '&', $row['topic_title']); $row['topic_title'] = str_replace('"', '"', $row['topic_title']); $row['topic_title'] = str_replace('<', '<', $row['topic_title']); $row['topic_title'] = str_replace('>', '>', $row['topic_title']); $row['topic_title'] = stripslashes($row['topic_title']); // Przycinanie: if (strlen($row['topic_title']) > $maxlength) { $row['topic_title'] = substr($row['topic_title'], 0, $maxlength); if (strstr($row['topic_title'], ' ')) $row['topic_title'] = substr($row['topic_title'], 0, strrpos($row['topic_title'], ' ')); $row['topic_title'] .= '...'; } // Cenzura: $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); if (count($orig_word)) $row['topic_title'] = preg_replace($orig_word, $replacement_word, $row['topic_title']); // Zamiana strony kodowej: if (strtolower($charset) == 'windows-1250') { $row['topic_title'] = strtr($row['topic_title'], "xA1xA6xACxB1xB6xBC", "xA5x8Cx8FxB9x9Cx9F"); $row['forum_name'] = strtr($row['forum_name'], "xA1xA6xACxB1xB6xBC", "xA5x8Cx8FxB9x9Cx9F"); } $link = '<a target="' . htmlspecialchars($frame) . '" href="' . $base_url . 'viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . urlencode($row['topic_id']) . '" title="' . htmlspecialchars(strip_tags($row['forum_name'])) . '">' . htmlspecialchars($row['topic_title']) . '</a>'; echo ($i++ > 0 ? '<br />' : '') . (!$javascript ? "n" . $link : addslashes($link)); } if ($javascript) echo "');"; @ $db->sql_freeresult($result); @ $db->sql_close(); ?>[/code] skrypt ten "zaincludowany" w odpowiednim miejsu powinien wyswietlać ostatnie wiadomości, z forum w phpBB. I tak było... wyświetlał. Potem usunęliśmy go ze względu na zmianę laya. Teraz chciałem go spowrotem zainstalować zrobiłem to... i dupa :? nic nie wyświetla. Nie wiem co mu jest bo właściwie powinno wszystko działać. Kto niewierzy to zapraszam: www.linux-hell.net/last.php Czemu tak jest ? Znacie może jakies inne skrypty do tego (szukałem, ale nie znalazłem ;-) ). a jeżeli jakaś odpowiedz to prosze "po ludzku" bo na php to... eh ![]() ![]() pozdro [/php:1:7e4eca36f3] |
|
|
![]()
Post
#2
|
|
![]() Grupa: Przyjaciele php.pl Postów: 2 712 Pomógł: 23 Dołączył: 27.10.2003 Skąd: z kontowni Ostrzeżenie: (0%) ![]() ![]() |
Hmmm, w sumie, to jest gdzieś błąd, tylko nie wiadomo gdzie, bo wszędzie @ blokują wyświetlanie błędów. Spróbuj je pousuwać i zobacz co ci wyjdzie.
-------------------- "Coś się kończy, coś się zaczyna." Andrzej Sapkowski
|
|
|
![]()
Post
#3
|
|
![]() Grupa: Przyjaciele php.pl Postów: 660 Pomógł: 0 Dołączył: 28.08.2002 Skąd: Starachowice Ostrzeżenie: (0%) ![]() ![]() |
@zielony: proszę wyedytować swój post i umieścić kod php w znacznikach [php] - poprawi to jego czytelność.
|
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 24.07.2025 - 13:21 |