Closed

75752 Przerobienie prostego skryptu wyswietlajacego RSS

Czesc,

Chodzi mi o poprawienie troszke istniejacego skryptu ktory jest pod adresem [url removed, login to view]

Poniżej kod skryptu. Chodzi oto aby skrypt dodatkowo wyswietal date pod naglowkiem oraz obok tresci zdjecia jezeli sa one

dostepne na danym kanale RSS cena jak moge zaplacic to 25zl

<meta name=\"generator\" content=\"Namo WebEditor\">

<?

function polacz()

{

$host=\'[url removed, login to view]\';

$user=\'*******\';

$pass=\'******\';

if (mysql_connect($host, $user, $pass) && mysql_select_db($baza)) return true;

else return false;

}

function czytaj_rss($tytul,$id,$licz=\'7\',$tryb=\'0\')

{

global $numer;

$zap=mysql_query(\"SELECT * FROM `$id` ORDER BY id DESC LIMIT 0, $licz\");

if ($zap) {

$tytul=strtoupper($tytul);

$p=rand(1,50);

echo(\"<div class=\\\"rss1\\\">\\n<div class=\\\"maintitle\\\">\\n<img src=\\\"include/ico$[url removed, login to view]\\\" alt=\\\"\\\"> $tytul<br></div>\\n\");

if ($tryb==\'0\')

{

while ($wyn=mysql_fetch_array($zap))

{

echo(\"<div class=\\\"title\\\"><a href=\\\"$wyn[link]\\\" target=\\\"_blank\\\" rel=\\\"clearbox(960,,600,,click)\\\"><b>$wyn[title]</b></a><br /><br />\\\"$wyn[description]\\\"<a href=\\\"$wyn[link]\\\" target=\\\"_blank\\\" rel=\\\"clearbox(960,,600,,click)\\\"><b> Czytaj więcej...</b></a><hr size=\\\"1\\\" style=\\\"color:#DFDFDF\\\"></div>\\n\\n\");

}

}

else

{

while ($wyn=mysql_fetch_array($zap))

{

echo(\"<div class=\\\"title\\\"><a href=\\\"$wyn[link]\\\" rel=\\\"clearbox(960,,600,,click)\\\"><b>$wyn[title]</b></a> <a href=\\\"$wyn[link]\\ rel=\\\"clearbox(960,,600,,click)\\\"><i>więcej...</i> </a><br /><br /><hr size=\\\"1\\\" style=\\\"color:#DFDFDF\\\"></div>\\n\\n\");

}

}

echo(\"</div>\\n\\n\");

if ($numer % 3 == 0) echo(\"</div>\\n\\n<div class=\\\"rss2\\\">\\n\\n\");

return true;

}

else { echo \'<span id=\"potwierdz\">Error: \'.mysql_error().\'</span><br />\'; return false; }

}

//bezpieczne zapytania

function zapytanie($query,$typ=\'0\') {

if ($typ==\'1\') $query=mysql_escape_string(mysql_query($query));

else { $query=htmlspecialchars(strip_tags($query)); $query=mysql_escape_string(mysql_query($query)); }

if ($query) return true;

else return false;

}

function aktualizuj_rss($adres,$id) {

if (zapytanie(\"SELECT * FROM `$id`\")) {

// dodawanie newsa

ini_set(\"user_agent\", $_SERVER[\'SERVER_NAME\']);

$xml = @simplexml_load_file($adres);

if ($xml)

{

$ile=1;

foreach($xml->xpath(\'//item\') as $item)

{

if ($ile<8)

{

$description=strip_tags($item->description);

if (zapytanie(\"INSERT INTO `$id` (`id`, `link`, `title`, `description`) VALUES ( NULL, \'$item->link\', \'$item->title\', \'$description\' );\"))

echo \'OK<br />\';

else echo \'<span id=\"potwierdz\">Error: \'.mysql_error().\'</span><br />\';

}

$ile++;

}

return true;

}

else

{

return false;

}

}

else

//dodawanie tabeli

{

if(!(zapytanie(\"CREATE TABLE `$id` (

`id` int(11) NOT NULL auto_increment,

`link` text NOT NULL default \'\',

`title` text NOT NULL default \'\',

`description` text NOT NULL default \'\',

PRIMARY KEY (`id`));\")))

aktualizuj_rss($adres,$id);

}

}

function porzadkuj($id) {

$ile=mysql_fetch_array(mysql_query(\"SELECT id from `$id` ORDER BY id DESC LIMIT 1\"));

$ile=(intval($ile[\'id\'])-40);

if (mysql_query(\"DELETE FROM `$id` WHERE `id` < $ile\")) return true;

else return false;

}

?>

Skills: CSS, Graphic Design, HTML, PHP, Website Design

See more: graphic text design generator, global p, echo design, typ, oto, img table, pass query, global error, meta item description, mysql_connect, div png, xpath generator, query content query, baza date, png div, rss generator, table rss, img generator, img img generator, namo

About the Employer:
( 1 review ) Poland

Project ID: #5648606