Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Radau savo kompe užsilikusį modą, kurį kažkada buvau susikūręs savo tikslams. Tai šiek tiek pakeistas news.php failas, įsikėlę jį ir dar šiek tiek paredagavę themes.php failą gausite naujienų reitingavo sistemą, panašią į tą, kuri buvo naudojama senesnėse DataLife Engine versijose. Prisegu news.php failą ir duodu pavyzdį kaip redaguoti theme.php (žiūrėti žemiau), kad gautumėte rezultatą. Žaliems to daryti nerekomenduojama, nes nenoriu būti apipiltas kvailais klausimais.
Taigi, themes.php faile susirandate šią vietą, kuri pavaizduota kode. Raudonai pažymėta ką turite pridėti ten (čia paimta Similitude06 thema ir viskas neatrodys tvarkingai, bet svarbiausia, kad pagautumėte esmę ką reikia keisti).
function render_news($subject, $news, $info, $rating) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo openform("N",$info['news_id']).newsposter($info," ·").newsopts($info,"·").closeform("N",$info['news_id']);
echo "</td>
</tr>
<tr>
<td align='left' class='news-footer'>$rating</td>
</tr>
</table>\n";
}
Na, o čia pateiksiu reitingų paveikslėlius, kuriuos turite įkelti į savo ftp images folderį . Aišku galite ir savo paveikslėlius naudoti.
Beje, šie paveikslėliai turi vadintis atitinkamai rating0.gif, rating1.gif, rating2.gif, rating3.gif, rating4.gif, rating5.gif.
Gali būti klaidų, nes dariau seniai ir dabar netikrinau. Jei rasite, praneškite.
:s
|
Qrmiz
Narys
Generolas
Pranešimai: 997
Įstojęs: 2005 Rugs. 4 16:09:21
|
labai gera idėja, tik va kažkodėl neprisegei news.php, spėju neleidžia php segti, parašyk kodą tiesiog
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Prisegiau dabar.
|
Qrmiz
Narys
Generolas
Pranešimai: 997
Įstojęs: 2005 Rugs. 4 16:09:21
|
ko tais man rašo, kad failas sugadintas
|
Žilvis
VIP narys
Terminatorius
Pranešimai: 1314
Įstojęs: 2006 Spa. 7 20:10:45
|
Normaliai man neraso
|
MaFetas
Administratorius
Ekspertas
Pranešimai: 3453
Įstojęs: 2005 Lie. 16 13:07:41
|
team parašė:
Normaliai man neraso
Rašo ir man Geriau uploadink kur kitur
Adminas - ban'o laisvė
www.KIETEKAS.com |
sniuff
Narys
Antras po Dievo
Pranešimai: 4491
Įstojęs: 2007 Geg. 14 16:05:52
|
Jei kas galėtų įmesti .php kodą, arba kai prisega sekit .zip formatu, kad archyvas nesusigadintų.
|
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Paįvairins Šiaip aš šitą dalyką kitur prisitaikysiu
|
Sineik
Narys
Generolas
Pranešimai: 1083
Įstojęs: 2006 Rugs. 28 10:09:10
|
Visai nieko, manau daug kam pravers. Gal ir pats kada nors panaudosiu.
|
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Man nesiunčia news.php failo
|
Enzo
Narys
Tankas
Pranešimai: 2397
Įstojęs: 2007 Lie. 30 22:07:24
|
MAnjack parašė:
Man nesiunčia news.php failo
Siunčia šitaip https://webdnd.com/forum/attachm...news_1.rar
FCBarcelona
mes que un club |
ADXS
Narys
Tankas
Pranešimai: 1710
Įstojęs: 2006 Kov. 5 14:03:31
|
Tai kas nors įsimeskit tą modą ir tegu būna kaip pvz gyvas
Pigi SMS Reklama
+++ |
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
|
Dėkui, dabar viskas gerai
|
Enzo
Narys
Tankas
Pranešimai: 2397
Įstojęs: 2007 Lie. 30 22:07:24
|
MAnjack parašė:
Dėkui, dabar viskas gerai
Pastebėjau, kad ko ankščiau nesiuntė paprastai paspaudus, tai siunčia kai eini per webdnd.com/forum/attachments/
FCBarcelona
mes que un club |
Rytis
Narys
Tankas
Pranešimai: 2258
Įstojęs: 2006 Sau. 13 17:01:49
|
Įkraukite į paste.lt ar pastebin.com tuos kodus, patogiau ir greičiau
|
mckenzie
Narys
Terminatorius
Pranešimai: 1582
Įstojęs: 2006 Spa. 5 22:10:16
|
Neblogai, man patinka
|
Qrmiz
Narys
Generolas
Pranešimai: 997
Įstojęs: 2005 Rugs. 4 16:09:21
|
o kur nors gyvai galima pažiūrėti? nes man rodos, kad šitas atvaizdavimas nėra įprastam ratings_include.php?
$pct_rating = ceil(round($tot_votes / $num_votes)); - šitas kelia įtarimą
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Qrmiz parašė:
o kur nors gyvai galima pažiūrėti? nes man rodos, kad šitas atvaizdavimas nėra įprastam ratings_include.php?
$pct_rating = ceil(round($tot_votes / $num_votes)); - šitas kelia įtarimą
Kas čia per įtarimai? Ši vieta skaičiuoja balsų vidurkį ir suapvalina iki sveikų skaičių.
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
News.php kodas.
<?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";
require_once "subheader.php";
require_once "side_left.php";
if (isset($readmore) && !isNum($readmore)) fallback(FUSION_SELF);
// Predefined variables, do not edit these values
if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }
// This number should be an odd number to keep layout tidy
$items_per_page = 11;
if (!isset($readmore)) {
$rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT $rowstart,$items_per_page"
);
$numrows = dbrows($result);
if ($settings['news_style'] == "1") $nrows = round((dbrows($result) - 1) / 2);
while ($data = dbarray($result)) {
$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";
$news_rating = "$voto";
$news_cat_image = "";
$news_subject = "<a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".stripslashes($data['news_subject'])."</a>";
if ($data['news_cat_image']) {
$news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
} else {
$news_cat_image = "";
}
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
if ($settings['news_style'] == "1") {
if ($rows <= 2 || $ncount == 1) {
$news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (iSUPERADMIN && checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date'])." ·\n";
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[0] .= $news_info['news_reads'].$locale['044']." ·\n";
}
$news_[0] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
if (iSUPERADMIN && checkrights("N")) { $news_[0] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[0] .= "</span>\n"; }
$news_[0] .= "</td>\n</tr>\n</table>\n";
if ($ncount != $rows) $news_[0] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
} else {
if ($i == $nrows && $ncolumn != 2) { $ncolumn = 2; $i = 0; }
$row_color = ($rc % 2 == 0 ? "tbl2" : "tbl1");
$news_[$ncolumn] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (iSUPERADMIN && checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date']);
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[$ncolumn] .= "<br>\n";
$news_[$ncolumn] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_reads'].$locale['044']." ·\n";
} else {
$news_[$ncolumn] .= " ·\n";
}
$news_[$ncolumn] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
if (iSUPERADMIN && checkrights("N")) { $news_[$ncolumn] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[$ncolumn] .= "</span>\n"; }
$news_[$ncolumn] .= "</td>\n</tr>\n</table>\n";
if ($ncolumn == 1 && $i < ($nrows - 1)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
$i++; $rc++;
}
$ncount++;
} else {
render_news($news_subject, $news_news, $news_info, $news_rating);
if ($i != $numrows) { tablebreak(); } $i++;
}
}
if ($settings['news_style'] == "1") {
opentable($locale['046']);
echo "<table cellpadding='0' cellspacing='0' style='width:100%'>\n<tr>\n<td colspan='3' style='width:100%'>\n";
echo $news_[0];
echo "</td>\n</tr>\n<tr>\n<td style='width:50%;vertical-align:top;'>\n";
echo $news_[1];
echo "</td>\n<td style='width:10px'><img src='".THEME."images/blank.gif' alt='' width='10' height='1'></td>\n<td style='width:50%;vertical-align:top;'>\n";
echo $news_[2];
echo "</td>\n</tr>\n</table>\n";
closetable();
}
if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$items_per_page,$rows,3)."\n</div>\n";
} else {
opentable($locale['046']);
echo "<center><br>\n".$locale['047']."<br><br>\n</center>\n";
closetable();
}
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = 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='$readmore'"
);
$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='$readmore' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='$readmore' AND rating_type='N'"),0);
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";
if (dbrows($result)!=0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$news_rating = "$voto";
$news_cat_image = "";
if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
$result2 = dbquery("UPDATE ".$db_prefix."news SET news_reads=news_reads+1 WHERE news_id='$readmore'");
$data['news_reads']++;
}
$news_subject = $data['news_subject'];
if ($data['news_cat'] != 0) {
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats WHERE news_cat_id='".$data['news_cat']."'");
if (dbrows($result2)) {
$data2 = dbarray($result2);
$news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'><img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
}
}
$news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
render_news($news_subject, $news_news, $news_info, $news_rating);
if ($data['news_allow_comments']) showcomments("N","news","news_id",$readmore,FUSION_SELF."?readmore=$readmore");
if ($data['news_allow_ratings']) showratings("N",$readmore,FUSION_SELF."?readmore=$readmore");
} else {
redirect(FUSION_SELF);
}
} else {
redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
|
ramon
Narys
Ekspertas
Pranešimai: 2977
Įstojęs: 2006 Gru. 18 11:12:50
|
Gal kas mateka nepasitiki?
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Įtarūs tie nariai ir papraščiausi veiksmai jiems sukelia įtarimą. Nejaugi aš toks nepatikimas?
|
ramon
Narys
Ekspertas
Pranešimai: 2977
Įstojęs: 2006 Gru. 18 11:12:50
|
Ok,reike pagirti zmogu,mldc Beto paziurejau koda tai neblogai sumastei nes kaip as isivaizdavau toki kurt tai vienoi vietoi tik mintis pagauta buvo, na bet vistek gera darba nuveikiai. Taip ir toliau.
|
Soo-2
Narys
Generolas
Pranešimai: 932
Įstojęs: 2007 Kov. 17 15:03:05
|
man meta erorr i news.php
|
Donatis07
VIP narys
Terminatorius
Pranešimai: 1243
Įstojęs: 2005 Gru. 10 16:12:04
|
meta klaida: Warning: Division by zero in /public_html/news.php on line 44
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Tuoj istaisysiu.
|
mXt
Narys
Viršesnis už Dievą
Pranešimai: 5775
Įstojęs: 2006 Bir. 9 16:06:09
|
Reiks paziureti laiko turint. Galbut prisitaikyti kai kur kitur
EDIT: News.php tik sitas kodas iterptas, ar dar daugiau yra? Greitai perzvelgiau, tai daugiau lyg neradau..
$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";
ex best admin!
Redagavo mXt 2008 Bal. 16 22:04:21 |
Woo-2
Narys
Buldozeris
Pranešimai: 186
Įstojęs: 2007 Geg. 10 17:05:40
|
Labai šaunu pats dariau tokia bet kai padariau pasirodė reitingų paveikslėliai per dideli, todėl ištraukiau ir pamiršau
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Ištaisytas news.php kodas
<?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";
require_once "subheader.php";
require_once "side_left.php";
if (isset($readmore) && !isNum($readmore)) fallback(FUSION_SELF);
// Predefined variables, do not edit these values
if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }
// This number should be an odd number to keep layout tidy
$items_per_page = 11;
if (!isset($readmore)) {
$rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT $rowstart,$items_per_page"
);
$numrows = dbrows($result);
if ($settings['news_style'] == "1") $nrows = round((dbrows($result) - 1) / 2);
while ($data = dbarray($result)) {
$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
if (( $num_votes > 0 ) && ($tot_votes > 0)) {
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";
} else { $voto = "<img src='".IMAGES."rating0.gif' border='0'>"; }
$news_rating = "$voto";
$news_cat_image = "";
$news_subject = "<a href='".BASEDIR."news.php?readmore=".$data['news_id']."'>".stripslashes($data['news_subject'])."</a>";
if ($data['news_cat_image']) {
$news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
} else {
$news_cat_image = "";
}
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
if ($settings['news_style'] == "1") {
if ($rows <= 2 || $ncount == 1) {
$news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (iSUPERADMIN && checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date'])." ·\n";
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[0] .= $news_info['news_reads'].$locale['044']." ·\n";
}
$news_[0] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
if (iSUPERADMIN && checkrights("N")) { $news_[0] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[0] .= "</span>\n"; }
$news_[0] .= "</td>\n</tr>\n</table>\n";
if ($ncount != $rows) $news_[0] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
} else {
if ($i == $nrows && $ncolumn != 2) { $ncolumn = 2; $i = 0; }
$row_color = ($rc % 2 == 0 ? "tbl2" : "tbl1");
$news_[$ncolumn] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (iSUPERADMIN && checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date']);
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[$ncolumn] .= "<br>\n";
$news_[$ncolumn] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_reads'].$locale['044']." ·\n";
} else {
$news_[$ncolumn] .= " ·\n";
}
$news_[$ncolumn] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
if (iSUPERADMIN && checkrights("N")) { $news_[$ncolumn] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[$ncolumn] .= "</span>\n"; }
$news_[$ncolumn] .= "</td>\n</tr>\n</table>\n";
if ($ncolumn == 1 && $i < ($nrows - 1)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
$i++; $rc++;
}
$ncount++;
} else {
render_news($news_subject, $news_news, $news_info, $news_rating);
if ($i != $numrows) { tablebreak(); } $i++;
}
}
if ($settings['news_style'] == "1") {
opentable($locale['046']);
echo "<table cellpadding='0' cellspacing='0' style='width:100%'>\n<tr>\n<td colspan='3' style='width:100%'>\n";
echo $news_[0];
echo "</td>\n</tr>\n<tr>\n<td style='width:50%;vertical-align:top;'>\n";
echo $news_[1];
echo "</td>\n<td style='width:10px'><img src='".THEME."images/blank.gif' alt='' width='10' height='1'></td>\n<td style='width:50%;vertical-align:top;'>\n";
echo $news_[2];
echo "</td>\n</tr>\n</table>\n";
closetable();
}
if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$items_per_page,$rows,3)."\n</div>\n";
} else {
opentable($locale['046']);
echo "<center><br>\n".$locale['047']."<br><br>\n</center>\n";
closetable();
}
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = 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='$readmore'"
);
$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='$readmore' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='$readmore' AND rating_type='N'"),0);
if (( $num_votes > 0 ) && ($tot_votes > 0)) {
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";
} else { $voto = "<img src='".IMAGES."rating0.gif' border='0'>"; }
if (dbrows($result)!=0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$news_rating = "$voto";
$news_cat_image = "";
if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
$result2 = dbquery("UPDATE ".$db_prefix."news SET news_reads=news_reads+1 WHERE news_id='$readmore'");
$data['news_reads']++;
}
$news_subject = $data['news_subject'];
if ($data['news_cat'] != 0) {
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats WHERE news_cat_id='".$data['news_cat']."'");
if (dbrows($result2)) {
$data2 = dbarray($result2);
$news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'><img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
}
}
$news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
render_news($news_subject, $news_news, $news_info, $news_rating);
if ($data['news_allow_comments']) showcomments("N","news","news_id",$readmore,FUSION_SELF."?readmore=$readmore");
if ($data['news_allow_ratings']) showratings("N",$readmore,FUSION_SELF."?readmore=$readmore");
} else {
redirect(FUSION_SELF);
}
} else {
redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
mXt - šiek tiek daugiau įterpta.
|
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Atsakiau, be to dar raudonai dabar pažymėjau kas pakeista, jei tik nieko nepraleidau.
|
mXt
Narys
Viršesnis už Dievą
Pranešimai: 5775
Įstojęs: 2006 Bir. 9 16:06:09
|
Aha, dėkui. Nemačiau tavo posto, kaip rašiau saavo
ex best admin! |
ADXS
Narys
Tankas
Pranešimai: 1710
Įstojęs: 2006 Kov. 5 14:03:31
|
blemba visai nice modas.
Pigi SMS Reklama
+++ |
suomis
Narys
Generolas
Pranešimai: 1167
Įstojęs: 2005 Gru. 22 00:12:19
|
dariau kaip parasyta bet neveikia
PJAUNAT GRYBĄ BARAVYKĄ - MAFIJOZAI!!! |
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Turi veikti, vakar tikrinau.
|
suomis
Narys
Generolas
Pranešimai: 1167
Įstojęs: 2005 Gru. 22 00:12:19
|
nu viska padariau kaip parasyta, toj vietoj kur tas reitingas turi but neatsiranda niekas
PJAUNAT GRYBĄ BARAVYKĄ - MAFIJOZAI!!! |
suomis
Narys
Generolas
Pranešimai: 1167
Įstojęs: 2005 Gru. 22 00:12:19
|
o meginaj ant v6.01.13 versijos?
PJAUNAT GRYBĄ BARAVYKĄ - MAFIJOZAI!!! |
Gedi Minas
Narys
Terminatorius
Pranešimai: 1229
Įstojęs: 2005 Gru. 21 18:12:30
|
Mėginau būtent ant šios versijos, themes.php failą redagavai?
|
suomis
Narys
Generolas
Pranešimai: 1167
Įstojęs: 2005 Gru. 22 00:12:19
|
zinoma redagavau gy nesu koks zaliukas jaj ka
PJAUNAT GRYBĄ BARAVYKĄ - MAFIJOZAI!!! |
Dandžu
Narys
Ekspertas
Pranešimai: 3265
Įstojęs: 2007 Lie. 23 13:07:47
|
O jokio error nemeta?
|
suomis
Narys
Generolas
Pranešimai: 1167
Įstojęs: 2005 Gru. 22 00:12:19
|
nieko is vis tik del sito kodo <tr>
<td align='left' class='news-footer'>$rating</td>
</tr>
tokia kaip tuscia vieta ir fsio
PJAUNAT GRYBĄ BARAVYKĄ - MAFIJOZAI!!! |