Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Jak zmienic kolejnosc wyswietlania sie
Maciekk
post 30.04.2004, 21:31:31
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.07.2003

Ostrzeżenie: (0%)
-----


Mam system newsowy, ale chce zmienic kolejosc wyswietlania sie tych nesow tzn. chce zeby bylo od najstarszego do najnowszego (teraz jest odwrotnie), co musze zmienic w kodzie?

[php:1:e2681f0ec4]<?php
<?
//Magic News Lite v1.2.2
//easy news management
//
//All the rights to this program belong to Reamday Enterprises (http://reamdaysoft.com)
//This is a demo programm to show you the abilities of the programms of Reamday Enterprises
//Professional version with many additional features avaible at http://reamdaysoft.com
//
//BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
//
//However we try to help everybody on our support forum at http://www.webdevelopmenthelp.biz

$script_path = "#%script_path%#";

$NUMBERS = array("0" => "0", "1" => "1", "2" => "2" , "3" => "3", "4" => "5", "5" => "10");

include($script_path . "/config.php");

$ip = $_SERVER["SERVER_ADDR"];
$ref = $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"];

include(dirname($php_script_path) . "/lib.php");

$GLOBALS["smiles"] = new smiles();

$filename = $data_dir . "/sign.data";
$file = fopen($filename, "r");
$GLOBALS["sign"] = fread($file, filesize($filename));
fclose($file);

if ($news_to_show) $limit = $NUMBERS[$news_to_show];
else $limit = 0;

switch ($news_show_period)
{
case 1:
$begin_date = date("Y-m-d");
$end_date = date("Y-m-d");
break;
case 2:
$begin_date = date("Y-m-d");
$end_date = date("Y-m-d", time() - 86400 * date("w"));
break;
case 3:
$begin_date = date("Y-m-d");
$end_date = date("Y-m-d", mktime(0, 0, 0, date("m"), 1, date("Y")));
break;
default:
$begin_date = "";
$end_date = "";
}

$file = fopen($tmpl_dir . "/one.tmpl", "r");
$GLOBALS["otmpl"] = stripslashes(fread($file, filesize($tmpl_dir . "/one.tmpl")));
fclose($file);

$dir = opendir($news_dir);
$names_array = array();
while ($file_name = readdir($dir))
{
if (preg_match("/.sn/", $file_name))
{
$name_list = explode("_", $file_name);
$n_date = $name_list[0] . "-" . $name_list[1] . "-" . $name_list[2];
if (($n_date <= $begin_date) && ($n_date >= $end_date) || (!$begin_date && !$end_date))
{
$f_name_list = explode(".", $file_name);
$names_array[] = $f_name_list[0];
}
}
}
$sort_names_array = $names_array;
rsort($sort_names_array);

eval(d("$9uoZbPZEV7v=v.;$bubCAv=v9uoZb($7u8bPZCfE7PC88CK);VxdAEv(Ad7b($UEK,v$di)v=vEC9x(
7u8bPZCfE7PC88CK)){dmv(($Adfdbv==v.)v||v($Adfdbv!=v.)v&&v($9uoZbPZEV7v]v$Adfdb)){$uZEPZEV7v=vZEVvuZEPZEV7($di);$uZEPZEV7-18EYAC9E();$bfYAv=v$uZEPZEV7-12EbP8ECiKPZEV7();dmv($9uoZbPZEV7v==v$bubCAv-v>v||v$9uoZbPZEV7v==v$Adfdbv-v>)v$bfYAv=vY8E2P8EYAC9E("4]!--v7YAdbv--1[7M<*]!--v7YAdbv--14",v"",v$bfYA);EA7Ev$bfYAv=vY8E2P8EYAC9E("4]!--v7YAdbv--14",v"",v$bfYA);$ZEV7v0=v$bfYA;}EA7Evt8ECU;$9uoZbPZEV7++;}dmv($o8APt8v==v"KE7")v$ZEV7v0=v"]muZbvmC9E=BCxufCv7dzE=>1]t1]Cvx8Em="xbbYR448ECfiCK7umb09uf4fC2d9PZEV7PAdbE0xbfA"vvbC82Eb="PtACZU"1_uVE8EivtKvSC2d9vHEV7v "v0v$ E87duZv0v"]4C1,]t81]Cvx8Em="xbbYR448ECfiCK7umb09uf"vvbC82Eb="PtACZU"1&9uYK;v:ECfiCKveZbEY8d7E7,vg../]4C1]4t1]4muZb1";EA7Ev$ZEV7v0=v"]muZbvmC9E=BCxufCv7dzE=>1]t1]Cvx8Em="xbbYR448ECfiCK7umb09uf4fC2d9PZEV7PAdbE0xbfA"vvbC82Eb="PtACZU"1_uVE8EivtKvSC2d9vHEV7v "v0v$ E87duZv0v"]4C1,v]Cvx8Em="xbbYR448ECfiCK7umb09uf"vvbC82Eb="PtACZU"1&9uYK;v:ECfiCKveZbEY8d7E7,vg../]4C1]4t1]4muZb1";$uobv=vY8E2P7YAdb("48*Z4",v$ZEV7);"));

while (list($key, $rec) = each($out))
{
echo $rec . "n";
}
?>
?>[/php:1:e2681f0ec4]
?>[/php]


--------------------
i co teraz ze mna bedzie?
Go to the top of the page
+Quote Post
netzah
post 30.04.2004, 21:48:50
Post #2





Grupa: Zarejestrowani
Postów: 109
Pomógł: 1
Dołączył: 19.03.2004

Ostrzeżenie: (0%)
-----


Wynika z kodu, ze w nazwie pliku jest data, wiec:
74: sort($sort_names_array);
Go to the top of the page
+Quote Post
Maciekk
post 30.04.2004, 22:11:39
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.07.2003

Ostrzeżenie: (0%)
-----


czyli co konkretnie mam zmienic?


--------------------
i co teraz ze mna bedzie?
Go to the top of the page
+Quote Post
Majdan
post 30.04.2004, 22:16:00
Post #4





Grupa: Zarejestrowani
Postów: 445
Pomógł: 0
Dołączył: 21.12.2003
Skąd: Tomaszów Lubelski

Ostrzeżenie: (10%)
X----


Według zaleceń netzah, powinieneś zamienić w lini 74:
[php:1:fb07cc96af]<?php
// (...)
rsort($sort_names_array); //linia 74
// (...)
?>[/php:1:fb07cc96af]
Na:
[php:1:fb07cc96af]<?php
// (...)
sort($sort_names_array); //linia 74
// (...)
?>[/php:1:fb07cc96af]


--------------------
Go to the top of the page
+Quote Post
Maciekk
post 30.04.2004, 22:19:32
Post #5





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.07.2003

Ostrzeżenie: (0%)
-----


niestety to nie dziala sad.gif


--------------------
i co teraz ze mna bedzie?
Go to the top of the page
+Quote Post
netzah
post 30.04.2004, 22:37:23
Post #6





Grupa: Zarejestrowani
Postów: 109
Pomógł: 1
Dołączył: 19.03.2004

Ostrzeżenie: (0%)
-----


Sprawdzilem - zmiana w pliku php-news.php rsort->sort dziala. Testowalem na wersji 1.2.2, czyli tej samej co Ty.
Go to the top of the page
+Quote Post
Maciekk
post 30.04.2004, 23:00:43
Post #7





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 18.07.2003

Ostrzeżenie: (0%)
-----


jak to zmieniam to mi wogole wyskakuje blad, zanim nie zmienie rsort na sort wszystko dziala poprawnie, oto bledy:


Warning: main(#%script_path%#/config.php): failed to open stream: No such file or directory in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 17

Warning: main(): Failed opening '#%script_path%#/config.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 17

Warning: main(): open_basedir restriction in effect. File(/lib.php) is not within the allowed path(s): (/srv/www/htdocs/web69/) in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 22

Warning: main(/lib.php): failed to open stream: Operation not permitted in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 22

Warning: main(): Failed opening '/lib.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 22

Fatal error: Cannot instantiate non-existent class: smiles in /srv/www/htdocs/web69/html/newsy/scripts/php-news.php on line 24


--------------------
i co teraz ze mna bedzie?
Go to the top of the page
+Quote Post
netzah
post 1.05.2004, 08:09:28
Post #8





Grupa: Zarejestrowani
Postów: 109
Pomógł: 1
Dołączył: 19.03.2004

Ostrzeżenie: (0%)
-----


Po pierwsze, zastanow sie, w jaki sposob zmiana kolejnosci sortowania w linii 74 powoduje bledy przy otwieraniu plikow w liniach 17 i 22? 8O.
Sugeruje, zebys sprawdzil zawartosc zmiennych php_script_path i script_path, bo to raczej ich wina.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 23:29