BloodKiller
Narys
Kapitonas

Pranešimai: 847
Įstojęs: 2006 Bir. 22 19:06:25
|
Ech, vel digis prisidare kruva spragu. :D Sikart per jo spragas, pasinaudojus print.php failu gali kas nori skaityti naujienas (ne, visai nesvarbu ar nustatytas priejimas tik tam tikrai grupei). :D Taigi, kaip mes galime istaisyti sia digio ziopla spraga? Ogi labai paprastai. :D
Kiauras print.php failo turinys.
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright Ā© 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
include LOCALE.LOCALESET."print.php";
if (!isset($item_id) || !isNum($item_id)) fallback("index.php");
echo "<html>
<head>
<title>".$settings['sitename']."</title>
<style type=\"text/css\">
body { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:14px; }
hr { height:1px;color:#ccc; }
.small { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px; }
.small2 { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px;color:#666; }
</style>
</head>
<body>\n";
if ($type == "A") {
$res = dbquery(
"SELECT ta.*, user_id, user_name FROM ".$db_prefix."articles ta
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
WHERE article_id='$item_id'"
);
if (dbrows($res) != 0) {
$data = dbarray($res);
$article = str_replace("<--PAGEBREAK-->", "", stripslashes($data['article_article']));
if ($data['article_breaks'] == "y") $article = nl2br($article);
echo "<b>".$data['article_subject']."</b><br>
<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['article_datestamp']))."</span>
<hr>
$article\n";
}
} elseif ($type == "N") {
$res = dbquery(
"SELECT tn.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
WHERE news_id='$item_id'"
);
if (dbrows($res) != 0) {
$data = dbarray($res);
$news = stripslashes($data['news_news']);
if ($data['news_breaks'] == "y") $news = nl2br($news);
if ($data['news_extended']) {
$news_extended = stripslashes($data['news_extended']);
if ($data['news_breaks'] == "y") $news_extended = nl2br($news_extended);
} else {
$news_extended = "";
}
echo "<b>".$data['news_subject']."</b><br>
<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['news_datestamp']))."</span>
<hr>
$news\n";
if (isset($news_extended)) echo "<hr>\n<b>".$locale['402']."</b>\n<hr>\n$news_extended\n";
}
}
echo "</body>
</html>\n";
?>
Puikiai uzlopytas print.php failo turinys mano deka. :D
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright Ā© 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
include LOCALE.LOCALESET."print.php";
if (!isset($item_id) || !isNum($item_id)) fallback("index.php");
echo "<html>
<head>
<title>".$settings['sitename']."</title>
<style type=\"text/css\">
body { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:14px; }
hr { height:1px;color:#ccc; }
.small { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px; }
.small2 { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px;color:#666; }
</style>
</head>
<body>\n";
if ($type == "A") {
$res = dbquery(
"SELECT ta.*, user_id, user_name, article_cat_access FROM ".$db_prefix."articles ta
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
LEFT JOIN ".$db_prefix."article_cats ON ta.article_cat = article_cat_id
WHERE article_id='$item_id'"
);
if (dbrows($res) != 0) {
$data = dbarray($res);
if (checkgroup($data['article_cat_access'])) {
$article = str_replace("<--PAGEBREAK-->", "", stripslashes($data['article_article']));
if ($data['article_breaks'] == "y") $article = nl2br($article);
echo "<b>".$data['article_subject']."</b><br>
<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['article_datestamp']))."</span>
<hr>
$article\n";
}
}
} elseif ($type == "N") {
$res = dbquery(
"SELECT tn.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
WHERE news_id='$item_id'"
);
if (dbrows($res) != 0) {
$data = dbarray($res);
if (checkgroup($data['news_visibility'])) {
$news = stripslashes($data['news_news']);
if ($data['news_breaks'] == "y") $news = nl2br($news);
if ($data['news_extended']) {
$news_extended = stripslashes($data['news_extended']);
if ($data['news_breaks'] == "y") $news_extended = nl2br($news_extended);
} else {
$news_extended = "";
}
echo "<b>".$data['news_subject']."</b><br>
<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['news_datestamp']))."</span>
<hr>
$news\n";
if (isset($news_extended)) echo "<hr>\n<b>".$locale['402']."</b>\n<hr>\n$news_extended\n";
}
}
}
echo "</body>
</html>\n";
?>
P.S. Lietuva vel vienu laipteliu auksciau saugumo atzvilgiu nei uzsienio salys. :D :D Taip pat prisegu print.php faila (pataisyta). Jei neveiks nuoroda, siuskites is CIA.
EDIT: Regis digis vel paliko ziopla klaida, kuria katik istaisiau. :D
Redagavo BloodKiller 2007 Rugp. 3 12:08:01 |
Fanio
Garbės narys
Viršesnis už Dievą

Pranešimai: 5675
Įstojęs: 2006 Sau. 27 23:01:47
|
šauniai pasidarbavai
|
Ewro
Narys
Fruktas

Pranešimai: 27
Įstojęs: 2007 Lie. 6 14:07:24
|
Dabar visi dėkokite Blood, ir neklausinėkite kaip padaryt... 
Kai ateina vakaras... |
MAnjack
Garbės narys
Legenda

Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Klausinėt ir nereikia, viskas padoryta 
|
Toonis
VIP narys
Viršesnis už Dievą
Pranešimai: 5741
Įstojęs: 2006 Spa. 17 14:10:03
|
Gal aš geriau pats pasitaisysiu, bet tavo kodo nesisiųsiu 
[galingų saliutų foto] |
WantedBoy
Narys
Ekspertas

Pranešimai: 2443
Įstojęs: 2007 Bir. 6 19:06:30
|
Nu tu ka nori ta daryk.Labai cia visiems idomu ka tu darysi? 
greitieji kreditai |
Toonis
VIP narys
Viršesnis už Dievą
Pranešimai: 5741
Įstojęs: 2006 Spa. 17 14:10:03
|
O tu galvoji man labai įdomi tavo nuomonė? Ar aš tavęs jos klausiau?
[galingų saliutų foto] |
DarK-SouL
Narys
Pulkininkas

Pranešimai: 444
Įstojęs: 2006 Gru. 23 20:12:23
|
Man gal idomu bl ka toonis darys? Wantedboy, ziuriu tu durnius...
|
Ewro
Narys
Fruktas

Pranešimai: 27
Įstojęs: 2007 Lie. 6 14:07:24
|
MAnjack parašė:
Klausinėt ir nereikia, viskas padoryta 
aš turėjau meny kitas temas (kad nekurtų tokių "kaip istrint print )
Kai ateina vakaras... |
LeBro
Narys
Terminatorius

Pranešimai: 1461
Įstojęs: 2007 Rugp. 10 10:08:52
|
man bent jau neisarchyvuoja to failiuko... :/
|
diadingo
Narys
Margas
Pranešimai: 85
Įstojęs: 2008 Vas. 17 15:02:46
|
o jei paprasciausiai istrynus print.php neatsirastu kokiu klaidu ar erroru?(aisku to print nenaudojant)
|