_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
Gal yra toks scriptas ar kas kur pvz as adminas padarau kita oploaderiu kuris gali kelti tik naujienas, bet ju negali istrinti?
www.svarosspektras.lt |
ramon
Narys
Ekspertas
Pranešimai: 2977
Įstojęs: 2006 Gru. 18 11:12:50
|
Tai padarik su if`u...
if ($userdata['user_id'] == "1") echo "miktuko kodas";
|
_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
Gal galetumete padaryti kad neitu istrinti kitiems adminams naujienu?o galetu tik pagrindinis? stai mano news.php
<?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)) {
$news_cat_image = "";
$news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
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 (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 (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 (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 (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);
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'"
);
if (dbrows($result)!=0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$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>";
}
}
if(iMEMBER) {
$news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
} else {
echo "<b><center>Programas ar kita gali siųstis tik registrįuoti nariai! Tad reike <BR>
<a href='register.php'> Registruotis </a></center></b>"; }
if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
if(iMEMBER) {
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);
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";
?>
www.svarosspektras.lt |
Niger
Garbės narys
Antras po Dievo
Pranešimai: 3554
Įstojęs: 2005 Bir. 21 18:06:06
|
Taigi is ramon kodo duoto supratau kad ten nurodytas id 1 pagrindinis ir turetum buti...
s.k.y.p.e - pavojuz |
_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
Nelabai zinau kur kaip dedi
www.svarosspektras.lt |
pR
VIP narys
Buldozeris
Pranešimai: 297
Įstojęs: 2008 Kov. 16 20:03:33
|
Tai ka pas tave tokie adminai kad trina viska , ei tu pagrindinis pasakik kad netrintu ieko ir viskas va tau ir scriptas!
|
bruzgis
Narys
Ekspertas
Pranešimai: 3368
Įstojęs: 2006 Geg. 9 18:05:02
|
Duok news.php faila is adminkes o ne is rooto
|
_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
<?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 ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/news-articles.php";
if (!checkrights("N") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");
if (isset($news_id) && !isNum($news_id)) fallback(FUSION_SELF);
if ($settings['tinymce_enabled'] == 1) echo "<script language='javascript' 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";
$news_sticky = isset($_POST['news_sticky']) ? "1" : "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";
$news_ratings = isset($_POST['news_ratings']) ? "1" : "0";
if (isset($news_id)) {
if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'");
$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_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");
redirect(FUSION_SELF.$aidlink."&status=su");
} else {
if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'");
$result = dbquery("INSERT INTO ".$db_prefix."news (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_visibility, news_sticky, news_reads, news_allow_comments, news_allow_ratings) 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', '$news_sticky', '0', '$news_comments', '$news_ratings')");
redirect(FUSION_SELF.$aidlink."&status=sn");
}
} 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.$aidlink."&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_start = array(
"mday" => isNum($_POST['news_start']['mday']) ? $_POST['news_start']['mday'] : "--",
"mon" => isNum($_POST['news_start']['mon']) ? $_POST['news_start']['mon'] : "--",
"year" => isNum($_POST['news_start']['year']) ? $_POST['news_start']['year'] : "----",
"hours" => isNum($_POST['news_start']['hours']) ? $_POST['news_start']['hours'] : "0",
"minutes" => isNum($_POST['news_start']['minutes']) ? $_POST['news_start']['minutes'] : "0",
);
$news_end = array(
"mday" => isNum($_POST['news_end']['mday']) ? $_POST['news_end']['mday'] : "--",
"mon" => isNum($_POST['news_end']['mon']) ? $_POST['news_end']['mon'] : "--",
"year" => isNum($_POST['news_end']['year']) ? $_POST['news_end']['year'] : "----",
"hours" => isNum($_POST['news_end']['hours']) ? $_POST['news_end']['hours'] : "0",
"minutes" => isNum($_POST['news_end']['minutes']) ? $_POST['news_end']['minutes'] : "0",
);
$news_sticky = isset($_POST['news_sticky']) ? " checked" : "";
$news_comments = isset($_POST['news_comments']) ? " checked" : "";
$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.$aidlink."'>
<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" : "";
$news_ratings = $data['news_allow_ratings'] == "1" ? " checked" : "";
$news_visibility = $data['news_visibility'];
$news_sticky = $data['news_sticky'] == "1" ? " checked" : "";
}
}
if (isset($news_id)) {
$action = FUSION_SELF.$aidlink."&news_id=$news_id";
opentable($locale['400']);
} else {
if (!isset($_POST['preview'])) {
$news_subject = "";
$body = "";
$body2 = "";
$news_breaks = " checked";
$news_comments = " checked";
$news_ratings = " checked";
$news_visibility = 0;
$news_sticky = "";
}
$action = FUSION_SELF.$aidlink;
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>
</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('body', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('body', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('body', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('body', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('body', '<img src=\'".str_replace("../","",IMAGES_N)."', '\' style=\'margin:5px\' align=\'left\'>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('body', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('body', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('body', '<span class=\'small2\'>', '</span>');\">
<input type='button' value='alt' class='button' style='width:25px' onClick=\"addText('body', '<span class=\'alt\'>', '</span>');\"><br>
<select name='setcolor' class='textbox' style='margin-top:5px' onChange=\"addText('body', '<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('body', '<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>\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=\"addText('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".(isset($news_start['mday']) && $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".(isset($news_start['mon']) && $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".(isset($news_start['year']) && $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".(isset($news_start['hours']) && $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".(isset($news_start['minutes']) && $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".(isset($news_end['mday']) && $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".(isset($news_end['mon']) && $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".(isset($news_end['year']) && $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".(isset($news_end['hours']) && $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".(isset($news_end['minutes']) && $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'>
<input type='checkbox' name='news_sticky' value='yes'$news_sticky> ".$locale['426']."<br>\n";
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";
?>
www.svarosspektras.lt
Redagavo _MaZvE_ 2008 Spa. 4 20:10:24 |
_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
Galite padaryti matot kad nemoku, prashau žliumbiažliumbia
www.svarosspektras.lt |
Žmogus
Narys
Viršesnis už Dievą
Pranešimai: 5621
Įstojęs: 2006 Gru. 8 17:12:08
|
<?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 ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/news-articles.php";
if (!checkrights("N") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");
if (isset($news_id) && !isNum($news_id)) fallback(FUSION_SELF);
if ($settings['tinymce_enabled'] == 1) echo "<script language='javascript' 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";
$news_sticky = isset($_POST['news_sticky']) ? "1" : "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";
$news_ratings = isset($_POST['news_ratings']) ? "1" : "0";
if (isset($news_id)) {
if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'");
$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_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");
redirect(FUSION_SELF.$aidlink."&status=su");
} else {
if ($news_sticky == "1") $result = dbquery("UPDATE ".$db_prefix."news SET news_sticky='0' WHERE news_sticky='1'");
$result = dbquery("INSERT INTO ".$db_prefix."news (news_subject, news_cat, news_news, news_extended, news_breaks, news_name, news_datestamp, news_start, news_end, news_visibility, news_sticky, news_reads, news_allow_comments, news_allow_ratings) 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', '$news_sticky', '0', '$news_comments', '$news_ratings')");
redirect(FUSION_SELF.$aidlink."&status=sn");
}
} 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.$aidlink."&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_start = array(
"mday" => isNum($_POST['news_start']['mday']) ? $_POST['news_start']['mday'] : "--",
"mon" => isNum($_POST['news_start']['mon']) ? $_POST['news_start']['mon'] : "--",
"year" => isNum($_POST['news_start']['year']) ? $_POST['news_start']['year'] : "----",
"hours" => isNum($_POST['news_start']['hours']) ? $_POST['news_start']['hours'] : "0",
"minutes" => isNum($_POST['news_start']['minutes']) ? $_POST['news_start']['minutes'] : "0",
);
$news_end = array(
"mday" => isNum($_POST['news_end']['mday']) ? $_POST['news_end']['mday'] : "--",
"mon" => isNum($_POST['news_end']['mon']) ? $_POST['news_end']['mon'] : "--",
"year" => isNum($_POST['news_end']['year']) ? $_POST['news_end']['year'] : "----",
"hours" => isNum($_POST['news_end']['hours']) ? $_POST['news_end']['hours'] : "0",
"minutes" => isNum($_POST['news_end']['minutes']) ? $_POST['news_end']['minutes'] : "0",
);
$news_sticky = isset($_POST['news_sticky']) ? " checked" : "";
$news_comments = isset($_POST['news_comments']) ? " checked" : "";
$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.$aidlink."'>
<center>
<select name='news_id' class='textbox' style='width:250px'>
$editlist</select>
<input type='submit' name='edit' value='".$locale['409']."' 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" : "";
$news_ratings = $data['news_allow_ratings'] == "1" ? " checked" : "";
$news_visibility = $data['news_visibility'];
$news_sticky = $data['news_sticky'] == "1" ? " checked" : "";
}
}
if (isset($news_id)) {
$action = FUSION_SELF.$aidlink."&news_id=$news_id";
opentable($locale['400']);
} else {
if (!isset($_POST['preview'])) {
$news_subject = "";
$body = "";
$body2 = "";
$news_breaks = " checked";
$news_comments = " checked";
$news_ratings = " checked";
$news_visibility = 0;
$news_sticky = "";
}
$action = FUSION_SELF.$aidlink;
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>
</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('body', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('body', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('body', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('body', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('body', '<img src=\'".str_replace("../","",IMAGES_N)."', '\' style=\'margin:5px\' align=\'left\'>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('body', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('body', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('body', '<span class=\'small2\'>', '</span>');\">
<input type='button' value='alt' class='button' style='width:25px' onClick=\"addText('body', '<span class=\'alt\'>', '</span>');\"><br>
<select name='setcolor' class='textbox' style='margin-top:5px' onChange=\"addText('body', '<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('body', '<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>\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=\"addText('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".(isset($news_start['mday']) && $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".(isset($news_start['mon']) && $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".(isset($news_start['year']) && $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".(isset($news_start['hours']) && $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".(isset($news_start['minutes']) && $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".(isset($news_end['mday']) && $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".(isset($news_end['mon']) && $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".(isset($news_end['year']) && $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".(isset($news_end['hours']) && $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".(isset($news_end['minutes']) && $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'>
<input type='checkbox' name='news_sticky' value='yes'$news_sticky> ".$locale['426']."<br>\n";
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";
?>
|
_MaZvE_
VIP narys
Generolas
Pranešimai: 1002
Įstojęs: 2008 Sau. 14 17:01:39
|
Aciu, +10
www.svarosspektras.lt
Redagavo _MaZvE_ 2008 Spa. 5 15:10:34 |