Bywalec
Postów: 915 Pomógł: 41
Data rejestracji: 12.03.2006 07:28
|
witam a oto pelny mod (przeznaczony do wersji 6.???)
najpierw dodac baze danych najlatwiej poprzez MyphpAdmin
1) szukamy db_prefix_news (zobacz screen )
2) i tam dodajemy (zobacz screen )
dobra git maby baze ruszmy dalej :]
teraz edytujemy plik news.php, ktory znajduje sie w katalogu Administration zmiany w kodzie oznaczone beda tak"////od tad zmiana kodu" i "////koniec zmiany"
<?php
require_once "../maincore.php";
require_once "subheader.php";
require_once ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/news-articles.php";
if (!checkrights("N")) fallback("../index.php");
if (isset($news_id) && !isNum($news_id)) fallback(FUSION_SELF);
if ($settings['tinymce_enabled'] == 1) echo "<script type='text/javascript'>advanced();</script>\n";
if (isset($status)) {
if ($status == "su") {
$title = $locale['400'];
$message = "<b>".$locale['401']."</b>";
} elseif ($status == "sn") {
$title = $locale['404'];
$message = "<b>".$locale['405']."</b>";
} elseif ($status == "del") {
$title = $locale['406'];
$message = "<b>".$locale['407']."</b>";
}
opentable($title);
echo "<div align='center'>".$message."</div>\n";
closetable();
tablebreak();
}
if (isset($_POST['save'])) {
$news_subject = stripinput($_POST['news_subject']);
$news_cat = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$body = addslash($_POST['body']);
if ($_POST['body2']) $body2 = addslash(preg_replace("(^<p>\s</p>$)", "", $_POST['body2']));
$news_start_date = 0; $news_end_date = 0;
if ($_POST['news_start']['mday']!="--" && $_POST['news_start']['mon']!="--" && $_POST['news_start']['year']!="----") {
$news_start_date = mktime($_POST['news_start']['hours'],$_POST['news_start']['minutes'],0,$_POST['news_start']['mon'],$_POST['news_start']['mday'],$_POST['news_start']['year']);
}
if ($_POST['news_end']['mday']!="--" && $_POST['news_end']['mon']!="--" && $_POST['news_end']['year']!="----") {
$news_end_date = mktime($_POST['news_end']['hours'],$_POST['news_end']['minutes'],0,$_POST['news_end']['mon'],$_POST['news_end']['mday'],$_POST['news_end']['year']);
}
$news_visibility = isNum($_POST['news_visibility']) ? $_POST['news_visibility'] : "0";
if ($settings['tinymce_enabled'] != 1) { $news_breaks = isset($_POST['line_breaks']) ? "y" : "n"; } else { $news_breaks = "n"; }
$news_comments = isset($_POST['news_comments']) ? "1" : "0";
////od tad kod jest zmieniony
$news_link = stripinput($_POST['news_link']);
$news_ratings = isset($_POST['news_ratings']) ? "1" : "0";
if (isset($news_id)) {
$result = dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_allow_comments='$news_comments', news_link='$news_link', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");
redirect(FUSION_SELF."?status=su");
} else {
$result = dbquery("INSERT INTO ".$db_prefix."news VALUES('', '$news_subject', '$news_cat', '$body', '$body2', '$news_breaks', '".$userdata['user_id']."', '".($news_start_date != 0 ? $news_start_date : time())."', '$news_start_date', '$news_end_date', '$news_visibility', '0', '$news_comments', '$news_link', '$news_ratings')");
redirect(FUSION_SELF."?status=sn");
}
////koniec zmiany
} else if (isset($_POST['delete'])) {
$result = dbquery("DELETE FROM ".$db_prefix."news WHERE news_id='$news_id'");
$result = dbquery("DELETE FROM ".$db_prefix."comments WHERE comment_item_id='$news_id' and comment_type='N'");
$result = dbquery("DELETE FROM ".$db_prefix."ratings WHERE rating_item_id='$news_id' and rating_type='N'");
redirect(FUSION_SELF."?status=del");
} else {
if (isset($_POST['preview'])) {
$news_subject = stripinput($_POST['news_subject']);
$body = phpentities(stripslash($_POST['body']));
$bodypreview = str_replace("src='".str_replace("../", "", IMAGES_N), "src='".IMAGES_N, stripslash($_POST['body']));
if ($_POST['body2']) {
$body2 = phpentities(stripslash($_POST['body2']));
$body2preview = str_replace("src='".str_replace("../", "", IMAGES_N), "src='".IMAGES_N, stripslash($_POST['body2']));
}
if (isset($_POST['line_breaks'])) {
$news_breaks = " checked";
$bodypreview = nl2br($bodypreview);
if ($body2) $body2preview = nl2br($body2preview);
} else {
$news_breaks = "";
}
$news_comments = isset($_POST['news_comments']) ? " checked" : "";
//// od tad kod jest zmieniony
$news_link = stripinput($_POST['news_link']);
////koniec zmiany
$news_ratings = isset($_POST['news_ratings']) ? " checked" : "";
opentable($news_subject);
echo "$bodypreview\n";
closetable();
if (isset($body2preview)) {
tablebreak();
opentable($news_subject);
echo "$body2preview\n";
closetable();
}
tablebreak();
}
$editlist = ""; $sel = "";
$result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC");
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if (isset($news_id)) $sel = ($news_id == $data['news_id'] ? " selected" : "");
$editlist .= "<option value='".$data['news_id']."'$sel>".$data['news_subject']."</option>\n";
}
}
opentable($locale['408']);
echo "<form name='selectform' method='post' action='".FUSION_SELF."'>
<center>
<select name='news_id' class='textbox' style='width:250px'>
$editlist</select>
<input type='submit' name='edit' value='".$locale['409']."' class='button'>
<input type='submit' name='delete' value='".$locale['410']."' onclick='return DeleteNews();' class='button'>
</center>
</form>\n";
closetable();
tablebreak();
if (isset($_POST['edit'])) {
$result = dbquery("SELECT * FROM ".$db_prefix."news WHERE news_id='$news_id'");
if (dbrows($result) != 0) {
$data = dbarray($result);
$news_subject = $data['news_subject'];
$news_cat = $data['news_cat'];
$body = phpentities(stripslashes($data['news_news']));
$body2 = phpentities(stripslashes($data['news_extended']));
if ($data['news_start']>0) $news_start = getdate($data['news_start']);
if ($data['news_end']>0) $news_end = getdate($data['news_end']);
$news_breaks = ($data['news_breaks'] == "y" ? " checked" : "");
$news_comments = ($data['news_allow_comments'] == "1" ? " checked" : "");
//// od tad kod jest zmieniony
$news_link = $data['news_link'];
//// koniec zmiany
$news_ratings = ($data['news_allow_ratings'] == "1" ? " checked" : "");
$news_visibility = $data['news_visibility'];
}
}
if (isset($news_id)) {
$action = FUSION_SELF."?news_id=$news_id";
opentable($locale['400']);
} else {
if (!isset($_POST['preview'])) {
$news_subject = "";
$body = "";
$body2 = "";
$news_breaks = " checked";
$news_comments = " checked";
//// od tad zmiana kodu
$news_link = "";
//// koniec zmiany
$news_ratings = " checked";
$news_visibility = 0;
}
$action = FUSION_SELF;
opentable($locale['404']);
}
$image_files = makefilelist(IMAGES_N, ".|..|index.php", true);
$image_list = makefileopts($image_files);
$result = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_name");
$news_cat_opts = ""; $sel = "";
if (dbrows($result)) {
while ($data = dbarray($result)) {
if (isset($news_cat)) $sel = ($news_cat == $data['news_cat_id'] ? " selected" : "");
$news_cat_opts .= "<option value='".$data['news_cat_id']."'$sel>".$data['news_cat_name']."</option>\n";
}
}
$visibility_opts = ""; $sel = "";
$user_groups = getusergroups();
while(list($key, $user_group) = each($user_groups)){
$sel = ($news_visibility == $user_group['0'] ? " selected" : "");
$visibility_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
echo "<form name='inputform' method='post' action='$action' onSubmit='return ValidateForm(this);'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td width='100' class='tbl'>".$locale['411']."</td>
<td width='80%' class='tbl'><input type='text' name='news_subject' value='$news_subject' class='textbox' style='width: 250px'></td>
</tr>
<tr>
<td width='100' class='tbl'>".$locale['511']."</td>
<td width='80%' class='tbl'><select name='news_cat' class='textbox'>
<option value='0'>".$locale['425']."</option>
$news_cat_opts</select>
</td>
</tr>
<tr>
<td valign='top' width='100' class='tbl'>".$locale['412']."</td>
<td width='80%' class='tbl'><textarea name='body' cols='95' rows='10' class='textbox'>$body</textarea></td>
//// od tad zmiana kodu
</tr><tr>
<td width='100' class='tbl'>adres strony (textu pobranego do newsa)</td>
<td width='80%' class='tbl'><input type='text' name='news_link' value='$news_link' class='textbox' style='width: 250px'></td>
</tr>\n";
//// koniec zmiany
}
echo "<tr>\n<td valign='top' width='100' class='tbl'>".$locale['413']."</td>
<td class='tbl'><textarea name='body2' cols='95' rows='10' class='textbox'>$body2</textarea></td>
</tr>\n";
if ($settings['tinymce_enabled'] != 1) {
echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px' onClick=\"addText('body2', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('body2', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('body2', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('body2', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"insertText('body2', '<img src=\'".str_replace("../","",IMAGES_N)."', '\' style=\'margin:5px\' align=\'left\'>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('body2', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('body2', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('body2', '<span class=\'small2\'>', '</span>');\">
<input type='button' value='alt' class='button' style='width:25px' onClick=\"addText('body2', '<span class=\'alt\'>', '</span>');\"><br>
<select name='setcolor' class='textbox' style='margin-top:5px' onChange=\"addText('body2', '<span style=\'color:' + this.options[this.selectedIndex].value + '\'>', '</span>');this.selectedIndex=0;\">
<option value=''>".$locale['420']."</option>
<option value='maroon' style='color:maroon'>Maroon</option>
<option value='red' style='color:red'>Red</option>
<option value='orange' style='color:orange'>Orange</option>
<option value='brown' style='color:brown'>Brown</option>
<option value='yellow' style='color:yellow'>Yellow</option>
<option value='green' style='color:green'>Green</option>
<option value='lime' style='color:lime'>Lime</option>
<option value='olive' style='color:olive'>Olive</option>
<option value='cyan' style='color:cyan'>Cyan</option>
<option value='blue' style='color:blue'>Blue</option>
<option value='navy' style='color:navy'>Navy Blue</option>
<option value='purple' style='color:purple'>Purple</option>
<option value='violet' style='color:violet'>Violet</option>
<option value='black' style='color:black'>Black</option>
<option value='gray' style='color:gray'>Gray</option>
<option value='silver' style='color:silver'>Silver</option>
<option value='white' style='color:white'>White</option>
</select>
<select name='insertimage' class='textbox' style='margin-top:5px' onChange=\"insertText('body2', '<img src=\'".str_replace("../","",IMAGES_N)."' + this.options[this.selectedIndex].value + '\' style=\'margin:5px\' align=\'left\'>');this.selectedIndex=0;\">
<option value=''>".$locale['421']."</option>
$image_list</select>
</td>
</tr>\n";
}
echo "<tr>
<td class='tbl'>".$locale['414']."</td>
<td class='tbl'><select name='news_start[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".($news_start['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='news_start[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".($news_start['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='news_start[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".($news_start['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='news_start[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".($news_start['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='news_start[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".($news_start['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>
<tr>
<td class='tbl'>".$locale['415']."</td>
<td class='tbl'><select name='news_end[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".($news_end['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='news_end[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".($news_end['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='news_end[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".($news_end['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='news_end[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".($news_end['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='news_end[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".($news_end['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>
<tr>
<td class='tbl'>".$locale['422']."</td>
<td class='tbl'><select name='news_visibility' class='textbox'>
$visibility_opts</select></td>
</tr>
<tr>
<td class='tbl'></td><td class='tbl'>";
if ($settings['tinymce_enabled'] != 1) echo "<input type='checkbox' name='line_breaks' value='yes'$news_breaks> ".$locale['417']."<br>\n";
echo "<input type='checkbox' name='news_comments' value='yes' onClick='SetRatings();'$news_comments> ".$locale['423']."<br>
<input type='checkbox' name='news_ratings' value='yes'$news_ratings> ".$locale['424']."</td>
</tr>
<tr>
<td align='center' colspan='2' class='tbl'><br>
<input type='submit' name='preview' value='".$locale['418']."' class='button'>
<input type='submit' name='save' value='".$locale['419']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
echo "<script type='text/javascript'>
function DeleteNews() {
return confirm('".$locale['551']."');
}
function ValidateForm(frm) {
if(frm.news_subject.value=='') {
alert('".$locale['550']."');
return false;
}
}
function SetRatings() {
if (inputform.news_comments.checked == false) {
inputform.news_ratings.checked = false;
inputform.news_ratings.disabled = true;
} else {
inputform.news_ratings.disabled = false;
}
}
</script>\n";
}
echo "</td>\n";
require_once BASEDIR."footer.php";
?>
teraz edycja pliku news.php w glownym katalogu
<?php
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
$i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = "";
// This number should be an odd number to keep layout tidy
$news_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.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_datestamp DESC LIMIT $rowstart,$news_per_page"
);
$nrows = round((dbrows($result) - 1) / 2);
while ($data=dbarray($result)) {
$news_cat_image = "";
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);
if (file_exists(IMAGES_NC.$data2['news_cat_image'])) $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-right:5px'></a>";
}
}
$news_news = stripslashes($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_comments = dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'");
if ($rows <= 2 || $ncount == 1) {
$news_[0] .= "<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>
<tr>
<td class='tbl1'><b><a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".$data['news_subject']."</b></td>
</tr>
<tr>
<td class='tbl1' style='text-align:justify'>$news_news</td>
</tr>
////od tad zmiana kodu
<tr>
<td align='right' class='tbl1'>\n";
if (checkrights("N")) $news_[0] .= "<form name='editnews".$data['news_id']."' method='post' action='".ADMIN."news.php?news_id=".$data['news_id']."'>\n";
$news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> ".$locale['041'].showdate("longdate", $data['news_datestamp'])."<br><a href='".$data['news_link']."'><b>zródło</b></a><br>";
if ($data['news_extended'] || $data['news_allow_comments']) {
$news_[0] .= ($data['news_extended'] ? "<a href='".FUSION_SELF."?readmore=".$data['news_id']."'>".$locale['042']."</a> ·\n" : "");
$news_[0] .= ($data['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$data['news_id']."'>".$news_comments.$locale['043']."</a> ·\n" : "");
$news_[0] .= $data['news_reads'].$locale['044']." ·\n";
}
$news_[0] .= "<a href='print.php?type=N&item_id=".$data['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
if (checkrights("N")) { $news_[0] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$data['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='5'></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='1' class='tbl-border'>
<tr>
//// koniec zmiany
<td class='$row_color'><b><a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".$data['news_subject']."</b></td>
</tr>
<tr>
<td class='$row_color' style='text-align:justify'>$news_news</td>
</tr>
//// od tad zmiana kodu
<tr>
<td align='right' class='$row_color'>\n";
if (checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$data['news_id']."' method='post' action='".ADMIN."news.php?news_id=".$data['news_id']."'>\n";
$news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> ".$locale['041'].showdate("longdate", $data['news_datestamp'])." <br><a href='".$data['news_link']."'><b>zródło</b></a><br>";
if ($data['news_extended'] || $data['news_allow_comments']) {
$news_[$ncolumn] .= "\n";
$news_[$ncolumn] .= ($data['news_extended'] ? "<a href='".FUSION_SELF."?readmore=".$data['news_id']."'>".$locale['042']."</a> ·\n" : "");
$news_[$ncolumn] .= ($data['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$data['news_id']."'>".$news_comments.$locale['043']."</a> ·\n" : "");
$news_[$ncolumn] .= $data['news_reads'].$locale['044']." ·\n";
} else {
$news_[$ncolumn] .= " ·\n";
}
//// koniec zmiany
$news_[$ncolumn] .= "<a href='print.php?type=N&item_id=".$data['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
if (checkrights("N")) { $news_[$ncolumn] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$data['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='5'></div>\n";
if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='5'></div>\n";
$i++; $rc++;
}
$ncount++;
}
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:5px'><img src='".THEME."images/blank.gif' alt='' width='5' 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 > $news_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$news_per_page,$rows,3)."\n</div>\n";
} else {
opentable($locale['046']);
echo "<div style='text-align:center'><br>\n".$locale['047']."<br><br>\n</div>\n";
closetable();
}
} else {
require_once INCLUDES."comments_include.php";
require_once 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 ".groupaccess('news_visibility')." AND news_id='$readmore'"
);
if (dbrows($result)!=0) {
$data = dbarray($result);
$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-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']."'"),
////od tad zmiana kodu
"news_link" => $data['news_link'],
//// koniec kodu
"news_allow_comments" => $data['news_allow_comments']
);
render_news($news_subject, $news_news, $news_info);
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);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
no i to juz jest koniec
Pozdrawiam!!!
Edytowane przez slawekneo dnia 04.11.2007 23:05:31
|