Zobacz temat
Archiwum newsow - poprawki
|
|
woymil |
Dodany dnia 14.03.2005 11:49:40
|
Przedszkolak Postów: 86 Data rejestracji: 08.01.2005 17:36 |
Jesli chcecie zwiekszyc ilosc newsow w archiwum wyswietlanych na jednej stronie, to nalezy zmienic nastepujace wartosci w pliku: news_archive.php <? /*--------------------------------------------+ | PHP-Fusion 5 - Content Management System | |---------------------------------------------| | author: Nick Jones (Digitanium) © 2002-2005 | | web: http://www.php-fu... | | email: | |---------------------------------------------| | Released under the terms and conditions of | | the GNU General Public License (Version 2) | +--------------------------------------------*/ @include "../../fusion_config.php"; include "../../fusion_core.php"; include FUSION_BASE."subheader.php"; include FUSION_BASE."side_left.php"; @include FUSION_INFUSIONS."news_archive/lang/".$settings['language'].".php"; @include FUSION_INFUSIONS."news_archive/lang/English.php"; opentable(NA_001); $splityears = array(); $result = dbquery("SELECT * FROM ".$fusion_prefix."news" if (dbrows($result)!=0) { while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); array_push($splityears, $allyears); } $years = array_unique($splityears); for ($i=0;$years[$i];$i++) { echo ". <a href='news_archive.php?year=$years[$i]'>$years[$i]</a><br>"; } closetable(); if (isset($year)){ tablebreak(); opentable($year); $splitmonths = array(); $result = dbquery("SELECT * FROM ".$fusion_prefix."news" while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); if ($allyears == $year){ $allmonths = date('F', $date[news_datestamp]); array_push($splitmonths, $allmonths); } } $months = array_unique($splitmonths); for ($i=0;$months[$i];$i++) { echo ". <a href='news_archive.php?year=$year&month=$months[$i]'>$months[$i]</a> (<a href='news_archive.php?listtype=bymonth&year=$year&month=$months[$i]'>".NA_004."</a><br>"; } closetable(); if ($listtype == "bymonth"{ tablebreak(); opentable($month); $newsbymonth = array(); $result = dbquery("SELECT * FROM ".$fusion_prefix."news" // Calculate Rows $rows = dbrows($result); if (!$rowstart) $rowstart = 0; tablebreak(); $i = 1; $result = dbquery("SELECT * FROM ".$fusion_prefix."news ORDER BY news_datestamp DESC LIMIT $rowstart,10" $numrows = dbrows($result); // End Calculate Rows while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); if ($allmonths == $month && $allyears == $year){ $newsid = $date[news_id]; array_push($newsbymonth, $newsid); } } for ($i=0;$newsbymonth[$i];$i++) { $result2 = dbquery("SELECT * FROM ".$fusion_prefix."news WHERE news_id=$newsbymonth[$i]" $data = dbarray($result2); echo ". <a href='".FUSION_BASE."news.php?readmore=$newsbymonth[$i]'>".$data['news_subject']."</a> (".$data['news_reads']." ".NA_002."<br>"; } // Create Page Navigation echo "<br /><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,3,"$PHP_SELF?listtype=$listtype&year=$year&month=$month&"."\n</div>\n"; // End Create Page Navigation closetable(); }elseif (isset($month)){ tablebreak(); opentable($month); $splitdays = array(); $result = dbquery("SELECT * FROM ".$fusion_prefix."news" while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); if ($allmonths == $month && $allyears == $year){ $alldays = date('d', $date[news_datestamp]); array_push($splitdays, $alldays); } } $days = array_unique($splitdays); for ($i=0;$days[$i];$i++) { echo ". <a href='news_archive.php?year=$year&month=$month&day=$days[$i]'>$days[$i]</a><br>"; } closetable(); } if (isset($day)){ tablebreak(); opentable($day); $news = array(); $result = dbquery("SELECT * FROM ".$fusion_prefix."news" while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); $alldays = date('d', $date[news_datestamp]); if ($alldays == $day && $allmonths == $month && $allyears == $year){ $newsid = $date[news_id]; array_push($news, $newsid); } } for ($i=0;$news[$i];$i++) { $result2 = dbquery("SELECT * FROM ".$fusion_prefix."news WHERE news_id=$news[$i]" $data = dbarray($result2); echo ". <a href='".FUSION_BASE."news.php?readmore=$news[$i]'>".$data['news_subject']."</a> (".$data['news_reads']." ".NA_002."<br>"; } closetable(); } } } else { echo "<center><br>".NA_003."<br><br></center>\n"; closetable(); } include FUSION_BASE."side_right.php"; include FUSION_BASE."footer.php"; ?> nalezy zmienic wartosci pokazane na czerwono. Domyslne ustawienia to 10 newsow, ale mozna np wpisac 30. Koordynator Podlaskiego Stowarzyszenia
Badaczy Zjawisk Niezwykłych "Terra Incognita" http://ti.org.pl |
|
|
Wścibski Gość |
Dodany dnia 22.12.2024 15:47:48
|
Pan Kontekstualny Postów: n^x Data rejestracji: Zawsze |
|
IP: localhost | |
SebaZ |
Dodany dnia 14.03.2005 13:48:50
|
Zaawansowany Postów: 1598 Pomógł: 2 Data rejestracji: 10.11.2004 22:39 |
ale mi nowośc. Logiczne. Niepotrzebnie dałes cały kod żeby tylko 2 takie małe rzeczy zmienić.
Zadawanie pytań na forum to nie jest prawo, to jest przywilej, którego każdy może być pozbawiony jeżeli nie będzie umiał z niego korzystać. Nie wymagaj więc natychmiastowej odpowiedzi.
|
|
Przejdź do forum: |