Przedszkolak
Postów: 11
Data rejestracji: 19.05.2005 15:21
|
Witam.
Korzystam z systemu ogłoszeń, jest on optymalny do mojej strony, ponieważ każdy może dodawać swoje ogłoszenie bez rejestracji itd. Niestety od wczoraj pojawił się problem, zaczęły nas nawiedzać boty i spamują ile się da. Dodają ogłoszenia, a w tytule podają "none", natomiast w treści ogłoszenia są linki do stron porno.
W związku z tym mam pytanie: jak zrobić, żeby podczas dodawania ogłoszenia pojawiła się jeszcze jedna tabelka na wpisanie określonego słowa, coś jak token, z tym, że ja chciałbym, aby było to konkretne słowo np. fakty.
* Tytuł
* Treść
* Wpisz słowo "fakty"
itd.
zamieszczam kod
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| 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 BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (file_exists(INFUSIONS."announcements/locale/".$settings['locale'].".php"))
{
include INFUSIONS."announcements/locale/".$settings['locale'].".php";
} else {include INFUSIONS."announcements/locale/English.php";}
if (!isset($action)) $action = "";
if (iADMIN) {
$anno_date = array(
"mday" => isNum($_POST['anno_date']['mday']) ? $_POST['anno_date']['mday'] : "--",
"mon" => isNum($_POST['anno_date']['mon']) ? $_POST['anno_date']['mon'] : "--",
"year" => isNum($_POST['anno_date']['year']) ? $_POST['anno_date']['year'] : "----",
"hours" => isNum($_POST['anno_date']['hours']) ? $_POST['anno_date']['hours'] : "0",
"minutes" => isNum($_POST['anno_date']['minutes']) ? $_POST['anno_date']['minutes'] : "0",
);
$anno_exdate = array(
"mday" => isNum($_POST['anno_exdate']['mday']) ? $_POST['anno_exdate']['mday'] : "--",
"mon" => isNum($_POST['anno_exdate']['mon']) ? $_POST['anno_exdate']['mon'] : "--",
"year" => isNum($_POST['anno_exdate']['year']) ? $_POST['anno_exdate']['year'] : "----",
"hours" => isNum($_POST['anno_exdate']['hours']) ? $_POST['anno_exdate']['hours'] : "0",
"minutes" => isNum($_POST['anno_exdate']['minutes']) ? $_POST['anno_exdate']['minutes'] : "0",
);
}
if (iGUEST) {
$anno_date = array(
"mday" => isNum($_POST['anno_date']['mday']) ? $_POST['anno_date']['mday'] : "--",
"mon" => isNum($_POST['anno_date']['mon']) ? $_POST['anno_date']['mon'] : "--",
"year" => isNum($_POST['anno_date']['year']) ? $_POST['anno_date']['year'] : "----",
"hours" => isNum($_POST['anno_date']['hours']) ? $_POST['anno_date']['hours'] : "0",
"minutes" => isNum($_POST['anno_date']['minutes']) ? $_POST['anno_date']['minutes'] : "0",
);
$anno_exdate = array(
"mday" => isNum($_POST['anno_exdate']['mday']) ? $_POST['anno_exdate']['mday'] : "--",
"mon" => isNum($_POST['anno_exdate']['mon']) ? $_POST['anno_exdate']['mon'] : "--",
"year" => isNum($_POST['anno_exdate']['year']) ? $_POST['anno_exdate']['year'] : "----",
"hours" => isNum($_POST['anno_exdate']['hours']) ? $_POST['anno_exdate']['hours'] : "0",
"minutes" => isNum($_POST['anno_exdate']['minutes']) ? $_POST['anno_exdate']['minutes'] : "0",
);
}
if (iADMIN) {
if ($action == "delete")
{
$result = dbquery("DELETE FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
redirect(FUSION_SELF);
} elseif (isset($_POST['anno_submit']))
{
if ($_POST['anno_summary'] != "" && $_POST['anno_announcement'] != "")
{
$anno_summary = trim(stripinput($_POST['anno_summary']));
$anno_announcement = addslash($_POST['anno_announcement']);
if ($_POST['anno_date']['mday']!="--" && $_POST['anno_date']['mon']!="--" && $_POST['anno_date']['year']!="----")
{
$anno_date=mktime($_POST['anno_date']['hours'],$_POST['anno_date']['minutes'],0,$_POST['anno_date']['mon'],$_POST['anno_date']['mday'],$_POST['anno_date']['year']);
} else {$anno_date=time();}
if ($_POST['anno_exdate']['mday']!="--" && $_POST['anno_exdate']['mon']!="--" && $_POST['anno_exdate']['year']!="----")
{
$anno_exdate=mktime($_POST['anno_exdate']['hours'],$_POST['anno_exdate']['minutes'],0,$_POST['anno_exdate']['mon'],$_POST['anno_exdate']['mday'],$_POST['anno_exdate']['year']);
} else {$anno_exdate=0;}
$anno_breaks = isset($_POST['anno_breaks']) ? "y" : "n";
if ($anno_summary != "" && $anno_announcement != "")
{
if ($action == "edit")
{
$result = dbquery("UPDATE ".$db_prefix."announcements SET announcement_summary='$anno_summary', announcement_announcement='$anno_announcement', announcement_date='$anno_date', announcement_exdate='$anno_exdate',announcement_breaks='$anno_breaks' WHERE announcement_id='$anno_id'");
} else
{
$result=dbquery("INSERT INTO ".$db_prefix."announcements VALUES('', '$anno_summary', '$anno_announcement', '$anno_date','$anno_exdate','$anno_breaks')");
}
}
redirect(FUSION_SELF);
} else
{
opentable($locale['an200']);
echo "<div align='center'><b>".$locale['an400']."</b><br>\n<span class='small'>";
echo $locale['an401']."</span></div>\n";
closetable();
tablebreak();
}
} elseif ($action == "edit")
{
$result = dbquery("SELECT * FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
if (dbrows($result))
{
$data = dbarray($result);
$anno_summary = $data['announcement_summary'];
$anno_announcement = phpentities(stripslashes($data['announcement_announcement']));
if ($data['announcement_date'] > 0) $anno_date = getdate($data['announcement_date']);
if ($data['announcement_exdate'] > 0) $anno_exdate = getdate($data['announcement_exdate']);
$anno_breaks =$data['announcement_breaks'] == "y" ? " checked" : "";
$formaction = FUSION_SELF."?action=edit&anno_id=$anno_id";
} else
{
$action = "";
$formaction = FUSION_SELF;
}
} else //Insert
{
$action = "";
$anno_summary = "";
$anno_announcement = "";
$anno_date = getdate(time());
$anno_exdate = getdate(time()+(7*24*60*60)); //NextWeek
$anno_breaks = " checked";
$formaction = FUSION_SELF;
}
if (isset($new_announcement) || $action == "edit")
{
opentable($locale['an200']);
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td align='right' class='tbl'>".$locale['an201']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='anno_summary' value='$anno_summary' class='textbox' style='width:300px'>
</td>
</tr>
<tr>
<td align='right' valign='top' class='tbl'>".$locale['an202']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><textarea name='anno_announcement' cols='54' rows='10' class='textbox'>$anno_announcement</textarea></td>
</tr>
\n";
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
\n";
/*Start HTML Tag Buttons*/
echo "<tr>
<td class='tbl'> </td>
<td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px' onClick=\"addText('anno_announcement', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('anno_announcement', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('anno_announcement', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<img src=\'../../images/', '\' style=\'margin:5px\' align=\'left\'/>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('anno_announcement', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<span class=\'small2\'>', '</span>');\">
</td>
</tr>\n";
/*End HTML Tag Buttons*/
echo "<tr>
<td align='right' valign='top' class='tbl'><span class='small'>".$locale['an203']."<span style='color:#ff0000'>*</span></span></td>
<td class='tbl'><select name='anno_date[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_date['mday']) && $anno_date['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_date['mon']) && $anno_date['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_date['year']) && $anno_date['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_date[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_date['hours']) && $anno_date['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_date[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_date['minutes']) && $anno_date['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n";
echo"
<tr>
<td align='right' class='tbl'><span class='small'>".$locale['an204']."</span></td>
<td class='tbl'><select name='anno_exdate[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_exdate['mday']) && $anno_exdate['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_exdate['mon']) && $anno_exdate['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_exdate['year']) && $anno_exdate['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_exdate[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_exdate['hours']) && $anno_exdate['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_exdate[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_exdate['minutes']) && $anno_exdate['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n
<tr></table><table align='center' cellpadding='0' cellspacing='0'>
<td class='tbl'></td>
<td align='center' class='tbl'><br/><input type='submit' name='anno_submit' value='".$locale['an206']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
} //Form
} else {
if (iGUEST) {
if ($action == "delete")
{
$result = dbquery("DELETE FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
redirect(FUSION_SELF);
} elseif (isset($_POST['anno_submit']))
{
if ($_POST['anno_summary'] != "" && $_POST['anno_announcement'] != "")
{
$anno_summary = trim(stripinput($_POST['anno_summary']));
$anno_announcement = addslash($_POST['anno_announcement']);
if ($_POST['anno_date']['mday']!="--" && $_POST['anno_date']['mon']!="--" && $_POST['anno_date']['year']!="----")
{
$anno_date=mktime($_POST['anno_date']['hours'],$_POST['anno_date']['minutes'],0,$_POST['anno_date']['mon'],$_POST['anno_date']['mday'],$_POST['anno_date']['year']);
} else {$anno_date=time();}
if ($_POST['anno_exdate']['mday']!="--" && $_POST['anno_exdate']['mon']!="--" && $_POST['anno_exdate']['year']!="----")
{
$anno_exdate=mktime($_POST['anno_exdate']['hours'],$_POST['anno_exdate']['minutes'],0,$_POST['anno_exdate']['mon'],$_POST['anno_exdate']['mday'],$_POST['anno_exdate']['year']);
} else {$anno_exdate=0;}
$anno_breaks = isset($_POST['anno_breaks']) ? "y" : "n";
if ($anno_summary != "" && $anno_announcement != "")
{
if ($action == "edit")
{
$result = dbquery("UPDATE ".$db_prefix."announcements SET announcement_summary='$anno_summary', announcement_announcement='$anno_announcement', announcement_date='$anno_date', announcement_exdate='$anno_exdate',announcement_breaks='$anno_breaks' WHERE announcement_id='$anno_id'");
} else
{
$result=dbquery("INSERT INTO ".$db_prefix."announcements VALUES('', '$anno_summary', '$anno_announcement', '$anno_date','$anno_exdate','$anno_breaks')");
}
}
redirect(FUSION_SELF);
} else
{
opentable($locale['an200']);
echo "<div align='center'><b>".$locale['an400']."</b><br>\n<span class='small'>";
echo $locale['an401'].
$locale['an402']."</span></div>\n";
closetable();
tablebreak();
}
} elseif ($action == "edit")
{
$result = dbquery("SELECT * FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
if (dbrows($result))
{
$data = dbarray($result);
$anno_summary = $data['announcement_summary'];
$anno_announcement = phpentities(stripslashes($data['announcement_announcement']));
if ($data['announcement_date'] > 0) $anno_date = getdate($data['announcement_date']);
if ($data['announcement_exdate'] > 0) $anno_exdate = getdate($data['announcement_exdate']);
$anno_breaks =$data['announcement_breaks'] == "y" ? " checked" : "";
$formaction = FUSION_SELF."?action=edit&anno_id=$anno_id";
} else
{
$action = "";
$formaction = FUSION_SELF;
}
} else //Insert
{
$action = "";
$anno_summary = "";
$anno_announcement = "";
$anno_date = getdate(time());
$anno_exdate = getdate(time()+(7*24*60*60)); //NextWeek
$anno_breaks = " checked";
$formaction = FUSION_SELF;
}
if (isset($new_announcement) || $action == "edit")
{
opentable($locale['an200']);
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td align='right' class='tbl'>".$locale['an201']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='anno_summary' value='$anno_summary' class='textbox' style='width:300px'></td>
</tr>\n";
echo "<tr>
<td align='right' valign='top' class='tbl'>".$locale['an202']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><textarea name='anno_announcement' cols='54' rows='10' class='textbox'>$anno_announcement</textarea></td>
</tr>\n";
/*Start HTML Tag Buttons*/
echo "<tr>
<td class='tbl'> </td>
<td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px' onClick=\"addText('anno_announcement', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('anno_announcement', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('anno_announcement', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<img src=\'../../images/', '\' style=\'margin:5px\' align=\'left\'/>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('anno_announcement', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<span class=\'small2\'>', '</span>');\">
</td>
</tr>\n";
/*End HTML Tag Buttons*/
echo "<tr>
<td align='right' valign='top' class='tbl'><span class='small'>".$locale['an203']."<span style='color:#ff0000'>*</span></span></td>
<td class='tbl'><select name='anno_date[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_date['mday']) && $anno_date['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_date['mon']) && $anno_date['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_date['year']) && $anno_date['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_date[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_date['hours']) && $anno_date['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_date[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_date['minutes']) && $anno_date['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n";
echo"
<tr>
<td align='right' class='tbl'><span class='small'>".$locale['an204']."</span></td>
<td class='tbl'><select name='anno_exdate[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_exdate['mday']) && $anno_exdate['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_exdate['mon']) && $anno_exdate['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_exdate['year']) && $anno_exdate['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_exdate[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_exdate['hours']) && $anno_exdate['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_exdate[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_exdate['minutes']) && $anno_exdate['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n
<tr></table><table align='center' cellpadding='0' cellspacing='0'>
<td class='tbl'></td>
<td align='center' class='tbl'><br/><input type='submit' name='anno_submit' value='".$locale['an206']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
} //Form
}
}
opentable($locale['an300']);
$result = dbquery("SELECT * FROM ".$db_prefix."announcements");
$rows = dbrows($result);
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0)
{
if (iADMIN) {
echo "<center>[<a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a>]</center>\n";
} else {
echo "<center>[<a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a>]</center>\n";
}
tablebreak();
$i = 1;
$result = dbquery("SELECT * FROM ".$db_prefix."announcements ORDER BY announcement_date DESC LIMIT $rowstart,10");
$numrows = dbrows($result);
while ($data = dbarray($result))
{
$announcement_announcement = $data['announcement_breaks'] == "y" ? nl2br(parsesmileys(stripslashes($data['announcement_announcement']))) : parsesmileys(stripslashes($data['announcement_announcement']));
echo "<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl2'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='small'><a name='$i'><b>".$data['announcement_summary']."</b></td>\n";
echo "</tr>
</table>
</td>
</tr>
<tr>
<td class='tbl1'>".$announcement_announcement."</td>
</tr>
<tr>
<td class='tbl2'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='small'>".showdate("longdate",$data['announcement_date'])."</td>\n";
if (iADMIN)
{
echo "<td align='right' class='small'>[<a href='http://www.wgliwicach.pl/infusions/announcements/announcements.php?action=edit&anno_id=".$data['announcement_id']."'>".$locale['an301']."</a>] | [<a href='".FUSION_SELF."?action=delete&anno_id=".$data['announcement_id']."' onClick='return DeleteMessage();'>".$locale['an302']."</a>]</td>\n";
}
echo "</tr>
</table>
</td>
</tr>
</table>\n";
if ($i != $numrows) echo "<br>\n";
$i++;
}
} else {
echo "<center><br>\n".$locale['an303']."<br><br>\n";
if (iADMIN)
{
echo "[ <a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a> ]<br><br>\n";
} else {
echo "[ <a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a> ]<br><br>\n";
}
echo "</center>\n";
}
closetable();
if ($rows != 0) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,3,FUSION_SELF."?")."\n</div>\n";
echo "<script>
function DeleteMessage()
{
return confirm(\"".$locale['an304']."\");
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ...
Edytowane przez bartek124 dnia 16.03.2009 17:47:36
|
Bywalec
Postów: 915 Pomógł: 41
Data rejestracji: 12.03.2006 07:28
|
hyy udalo mi sie cos wymodzic skorzystalem z "tokena fusionowego" dodalem jeszcze zabespieczenie na zmienna $anno_id (przydalo by sie zglosic ten infusion ekipie "beta team polska" ) acha i token jest tylko w warunku iGUEST (czyli dla gosci)
dzialanie mozesz sprawdzoc na http://slawek.php...uncement=1
no to do dziela :D
w pliku maincore.php dodaj pod// Create Validation image if $vimage is set and die();
if (isset($vimage)) {
$check_url = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);
if (eregi("register.php", $check_url) && preg_match("/^[0-9a-z]{32}$/", $vimage)) {
$vres = dbquery("SELECT * FROM ".$db_prefix."vcode WHERE vcode_2='$vimage'");
if (dbrows($vres)) {
$vdata = dbarray($vres);
$imf = rand(3,5); $imx = rand(15,40); $imy = rand(2,7);
$im = ImageCreateFromJPEG("images/validate_bg.jpg");
$tcolor = ImageColorAllocate($im, 40, 40, 40);
Header("Content-type: image/jpeg");
ImageString ($im, $imf, $imx, $imy, $vdata['vcode_1'], $tcolor);
ImageJPEG($im, '', 80);
ImageDestroy($im);
}
}
die();
break;
} ten kod if (isset($vimagee)) {
if (preg_match("/^[0-9a-z]{32}$/", $vimagee)) {
$vres = dbquery("SELECT * FROM ".$db_prefix."vcode WHERE vcode_2='$vimagee'");
if (dbrows($vres)) {
$vdata = dbarray($vres);
$imf = rand(3,5); $imx = rand(15,40); $imy = rand(2,7);
$im = ImageCreateFromJPEG(BASEDIR."images/validate_bg.jpg");
$tcolor = ImageColorAllocate($im, 40, 40, 40);
Header("Content-type: image/jpeg");
ImageString ($im, $imf, $imx, $imy, $vdata['vcode_1'], $tcolor);
ImageJPEG($im, '', 80);
ImageDestroy($im);
}
}
die();
break;
}
ok zapisz i wyjdz teraz plik announcements.php
najszybciej bedzie jak usuniesz cala zawartosc i wkleisz tam ten kod <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| 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 BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (file_exists(INFUSIONS."announcements/locale/".$settings['locale'].".php"))
{
include INFUSIONS."announcements/locale/".$settings['locale'].".php";
} else {include INFUSIONS."announcements/locale/English.php";}
if (!isset($action)) $action = "";
if(isset($anno_id) && !isnum($anno_id)) fallback(BASEDIR."index.php");
if (iADMIN) {
$anno_date = array(
"mday" => isNum($_POST['anno_date']['mday']) ? $_POST['anno_date']['mday'] : "--",
"mon" => isNum($_POST['anno_date']['mon']) ? $_POST['anno_date']['mon'] : "--",
"year" => isNum($_POST['anno_date']['year']) ? $_POST['anno_date']['year'] : "----",
"hours" => isNum($_POST['anno_date']['hours']) ? $_POST['anno_date']['hours'] : "0",
"minutes" => isNum($_POST['anno_date']['minutes']) ? $_POST['anno_date']['minutes'] : "0",
);
$anno_exdate = array(
"mday" => isNum($_POST['anno_exdate']['mday']) ? $_POST['anno_exdate']['mday'] : "--",
"mon" => isNum($_POST['anno_exdate']['mon']) ? $_POST['anno_exdate']['mon'] : "--",
"year" => isNum($_POST['anno_exdate']['year']) ? $_POST['anno_exdate']['year'] : "----",
"hours" => isNum($_POST['anno_exdate']['hours']) ? $_POST['anno_exdate']['hours'] : "0",
"minutes" => isNum($_POST['anno_exdate']['minutes']) ? $_POST['anno_exdate']['minutes'] : "0",
);
}
if (iGUEST) {
$anno_date = array(
"mday" => isNum($_POST['anno_date']['mday']) ? $_POST['anno_date']['mday'] : "--",
"mon" => isNum($_POST['anno_date']['mon']) ? $_POST['anno_date']['mon'] : "--",
"year" => isNum($_POST['anno_date']['year']) ? $_POST['anno_date']['year'] : "----",
"hours" => isNum($_POST['anno_date']['hours']) ? $_POST['anno_date']['hours'] : "0",
"minutes" => isNum($_POST['anno_date']['minutes']) ? $_POST['anno_date']['minutes'] : "0",
);
$anno_exdate = array(
"mday" => isNum($_POST['anno_exdate']['mday']) ? $_POST['anno_exdate']['mday'] : "--",
"mon" => isNum($_POST['anno_exdate']['mon']) ? $_POST['anno_exdate']['mon'] : "--",
"year" => isNum($_POST['anno_exdate']['year']) ? $_POST['anno_exdate']['year'] : "----",
"hours" => isNum($_POST['anno_exdate']['hours']) ? $_POST['anno_exdate']['hours'] : "0",
"minutes" => isNum($_POST['anno_exdate']['minutes']) ? $_POST['anno_exdate']['minutes'] : "0",
);
}
if (iADMIN) {
if ($action == "delete")
{
$result = dbquery("DELETE FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
redirect(FUSION_SELF);
} elseif (isset($_POST['anno_submit']))
{
if ($_POST['anno_summary'] != "" && $_POST['anno_announcement'] != "")
{
$anno_summary = trim(stripinput($_POST['anno_summary']));
$anno_announcement = addslash($_POST['anno_announcement']);
if ($_POST['anno_date']['mday']!="--" && $_POST['anno_date']['mon']!="--" && $_POST['anno_date']['year']!="----")
{
$anno_date=mktime($_POST['anno_date']['hours'],$_POST['anno_date']['minutes'],0,$_POST['anno_date']['mon'],$_POST['anno_date']['mday'],$_POST['anno_date']['year']);
} else {$anno_date=time();}
if ($_POST['anno_exdate']['mday']!="--" && $_POST['anno_exdate']['mon']!="--" && $_POST['anno_exdate']['year']!="----")
{
$anno_exdate=mktime($_POST['anno_exdate']['hours'],$_POST['anno_exdate']['minutes'],0,$_POST['anno_exdate']['mon'],$_POST['anno_exdate']['mday'],$_POST['anno_exdate']['year']);
} else {$anno_exdate=0;}
$anno_breaks = isset($_POST['anno_breaks']) ? "y" : "n";
if ($anno_summary != "" && $anno_announcement != "")
{
if ($action == "edit")
{
$result = dbquery("UPDATE ".$db_prefix."announcements SET announcement_summary='$anno_summary', announcement_announcement='$anno_announcement', announcement_date='$anno_date', announcement_exdate='$anno_exdate',announcement_breaks='$anno_breaks' WHERE announcement_id='$anno_id'");
} else
{
$result=dbquery("INSERT INTO ".$db_prefix."announcements VALUES('', '$anno_summary', '$anno_announcement', '$anno_date','$anno_exdate','$anno_breaks')");
}
}
redirect(FUSION_SELF);
} else
{
opentable($locale['an200']);
echo "<div align='center'><b>".$locale['an400']."</b><br>\n<span class='small'>";
echo $locale['an401']."</span></div>\n";
closetable();
tablebreak();
}
} elseif ($action == "edit")
{
$result = dbquery("SELECT * FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
if (dbrows($result))
{
$data = dbarray($result);
$anno_summary = $data['announcement_summary'];
$anno_announcement = phpentities(stripslashes($data['announcement_announcement']));
if ($data['announcement_date'] > 0) $anno_date = getdate($data['announcement_date']);
if ($data['announcement_exdate'] > 0) $anno_exdate = getdate($data['announcement_exdate']);
$anno_breaks =$data['announcement_breaks'] == "y" ? " checked" : "";
$formaction = FUSION_SELF."?action=edit&anno_id=$anno_id";
} else
{
$action = "";
$formaction = FUSION_SELF;
}
} else //Insert
{
$action = "";
$anno_summary = "";
$anno_announcement = "";
$anno_date = getdate(time());
$anno_exdate = getdate(time()+(7*24*60*60)); //NextWeek
$anno_breaks = " checked";
$formaction = FUSION_SELF;
}
if (isset($new_announcement) || $action == "edit")
{
opentable($locale['an200']);
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td align='right' class='tbl'>".$locale['an201']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='anno_summary' value='$anno_summary' class='textbox' style='width:300px'>
</td>
</tr>
<tr>
<td align='right' valign='top' class='tbl'>".$locale['an202']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><textarea name='anno_announcement' cols='54' rows='10' class='textbox'>$anno_announcement</textarea></td>
</tr>
\n";
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
\n";
/*Start HTML Tag Buttons*/
echo "<tr>
<td class='tbl'>BB code</td>
<td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px' onClick=\"addText('anno_announcement', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('anno_announcement', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('anno_announcement', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<img src=\'../../images/', '\' style=\'margin:5px\' align=\'left\'/>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('anno_announcement', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<span class=\'small2\'>', '</span>');\">
</td>
</tr>\n";
/*End HTML Tag Buttons*/
echo "<tr>
<td align='right' valign='top' class='tbl'><span class='small'>".$locale['an203']."<span style='color:#ff0000'>*</span></span></td>
<td class='tbl'><select name='anno_date[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_date['mday']) && $anno_date['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_date['mon']) && $anno_date['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_date['year']) && $anno_date['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_date[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_date['hours']) && $anno_date['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_date[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_date['minutes']) && $anno_date['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n";
echo"
<tr>
<td align='right' class='tbl'><span class='small'>".$locale['an204']."</span></td>
<td class='tbl'><select name='anno_exdate[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_exdate['mday']) && $anno_exdate['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_exdate['mon']) && $anno_exdate['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_exdate['year']) && $anno_exdate['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_exdate[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_exdate['hours']) && $anno_exdate['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_exdate[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_exdate['minutes']) && $anno_exdate['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n
<tr></table><table align='center' cellpadding='0' cellspacing='0'>
<td class='tbl'></td>
<td align='center' class='tbl'><br/><input type='submit' name='anno_submit' value='".$locale['an206']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
} //Form
} else {
if (iGUEST) {
if($error) echo $error;
if ($action == "delete")
{
$result = dbquery("DELETE FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
redirect(FUSION_SELF);
} elseif (isset($_POST['anno_submit']))
{
if ($_POST['anno_summary'] != "" && $_POST['anno_announcement'] != "")
{
$anno_summary = trim(stripinput($_POST['anno_summary']));
$anno_announcement = addslash($_POST['anno_announcement']);
if ($_POST['anno_date']['mday']!="--" && $_POST['anno_date']['mon']!="--" && $_POST['anno_date']['year']!="----")
{
$anno_date=mktime($_POST['anno_date']['hours'],$_POST['anno_date']['minutes'],0,$_POST['anno_date']['mon'],$_POST['anno_date']['mday'],$_POST['anno_date']['year']);
} else {$anno_date=time();}
if ($_POST['anno_exdate']['mday']!="--" && $_POST['anno_exdate']['mon']!="--" && $_POST['anno_exdate']['year']!="----")
{
$anno_exdate=mktime($_POST['anno_exdate']['hours'],$_POST['anno_exdate']['minutes'],0,$_POST['anno_exdate']['mon'],$_POST['anno_exdate']['mday'],$_POST['anno_exdate']['year']);
} else {$anno_exdate=0;}
$anno_breaks = isset($_POST['anno_breaks']) ? "y" : "n";
if ($anno_summary != "" && $anno_announcement != "")
{
if ($action == "edit")
{
$result = dbquery("UPDATE ".$db_prefix."announcements SET announcement_summary='$anno_summary', announcement_announcement='$anno_announcement', announcement_date='$anno_date', announcement_exdate='$anno_exdate',announcement_breaks='$anno_breaks' WHERE announcement_id='$anno_id'");
} else
{
$user_code = stripinput($_POST['user_code']);
$result = dbquery("SELECT * FROM ".$db_prefix."vcode WHERE vcode_1='$user_code'");
if (dbrows($result) == 0) {
$error = "zle wpisano kod";
} else {
$error = "";
$result = dbquery("DELETE FROM ".$db_prefix."vcode WHERE vcode_1='$user_code'");
$result=dbquery("INSERT INTO ".$db_prefix."announcements VALUES('', '$anno_summary', '$anno_announcement', '$anno_date','$anno_exdate','$anno_breaks')");
}
}
}
redirect(FUSION_SELF);
} else
{
opentable($locale['an200']);
echo "<div align='center'><b>".$locale['an400']."</b><br>\n<span class='small'>";
echo $locale['an401'].
$locale['an402']."</span></div>\n";
closetable();
tablebreak();
}
} elseif ($action == "edit")
{
$result = dbquery("SELECT * FROM ".$db_prefix."announcements WHERE announcement_id='$anno_id'");
if (dbrows($result))
{
$data = dbarray($result);
$anno_summary = $data['announcement_summary'];
$anno_announcement = phpentities(stripslashes($data['announcement_announcement']));
if ($data['announcement_date'] > 0) $anno_date = getdate($data['announcement_date']);
if ($data['announcement_exdate'] > 0) $anno_exdate = getdate($data['announcement_exdate']);
$anno_breaks =$data['announcement_breaks'] == "y" ? " checked" : "";
$formaction = FUSION_SELF."?action=edit&anno_id=$anno_id";
} else
{
$action = "";
$formaction = FUSION_SELF;
}
} else //Insert
{
$action = "";
$anno_summary = "";
$anno_announcement = "";
$anno_date = getdate(time());
$anno_exdate = getdate(time()+(7*24*60*60)); //NextWeek
$anno_breaks = " checked";
$formaction = FUSION_SELF;
}
if(isset($new_announcement)){
srand((double)microtime()*1000000);
$temp_num = md5(rand(0,9999));
$vcode_1 = substr($temp_num, 17, 5);
$vcode_2 = md5($vcode_1);
unset($temp_num);
$result = dbquery("INSERT INTO ".$db_prefix."vcode VALUES('".time()."', '$vcode_1', '$vcode_2')");
}
if (isset($new_announcement) || $action == "edit")
{
opentable($locale['an200']);
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0' border=0>
<tr>
<td align='right' class='tbl'>".$locale['an201']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='anno_summary' value='$anno_summary' class='textbox' style='width:300px'></td>
</tr>\n";
echo "<tr>
<td align='right' valign='top' class='tbl'>".$locale['an202']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><textarea name='anno_announcement' cols='54' rows='10' class='textbox'>$anno_announcement</textarea></td>
</tr>\n
<tr><td class='tbl'>Kod potwierdzający:</td>
<td class='tbl'><img src='announcements.php?new_announcement=$new_announcement&vimagee=$vcode_2'></td>
</tr><tr>";
unset($vcode_1,$vcode_2);
echo"
<td class='tbl'>Wpisz Kod potwierdzający:</td>
<td class='tbl'><input type='text' name='user_code' class='textbox' style='width:100px'></td>
<tr>";
/*Start HTML Tag Buttons*/
echo "<tr>
<td class='tbl'>BB-code</td>
<td class='tbl'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px' onClick=\"addText('anno_announcement', '<b>', '</b>');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px' onClick=\"addText('anno_announcement', '<i>', '</i>');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px' onClick=\"addText('anno_announcement', '<u>', '</u>');\">
<input type='button' value='link' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<a href=\'', '\' target=\'_blank\'>Link</a>');\">
<input type='button' value='img' class='button' style='width:35px' onClick=\"addText('anno_announcement', '<img src=\'../../images/', '\' style=\'margin:5px\' align=\'left\'/>');\">
<input type='button' value='center' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<center>', '</center>');\">
<input type='button' value='small' class='button' style='width:40px' onClick=\"addText('anno_announcement', '<span class=\'small\'>', '</span>');\">
<input type='button' value='small2' class='button' style='width:45px' onClick=\"addText('anno_announcement', '<span class=\'small2\'>', '</span>');\">
</td>
</tr>\n";
/*End HTML Tag Buttons*/
echo "<tr>
<td align='right' valign='top' class='tbl'><span class='small'>".$locale['an203']."<span style='color:#ff0000'>*</span></span></td>
<td class='tbl'><select name='anno_date[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_date['mday']) && $anno_date['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_date['mon']) && $anno_date['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_date[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_date['year']) && $anno_date['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_date[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_date['hours']) && $anno_date['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_date[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_date['minutes']) && $anno_date['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n";
echo"
<tr>
<td align='right' class='tbl'><span class='small'>".$locale['an204']."</span></td>
<td class='tbl'><select name='anno_exdate[mday]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=31;$i++) echo "<option".(isset($anno_exdate['mday']) && $anno_exdate['mday'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[mon]' class='textbox'>\n<option>--</option>\n";
for ($i=1;$i<=12;$i++) echo "<option".(isset($anno_exdate['mon']) && $anno_exdate['mon'] == $i ? " selected" : "").">$i</option>\n";
echo "</select>
<select name='anno_exdate[year]' class='textbox'>\n<option>----</option>\n";
for ($i=2004;$i<=2010;$i++) echo "<option".(isset($anno_exdate['year']) && $anno_exdate['year'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> /
<select name='anno_exdate[hours]' class='textbox'>\n";
for ($i=0;$i<=24;$i++) echo "<option".(isset($anno_exdate['hours']) && $anno_exdate['hours'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> :
<select name='anno_exdate[minutes]' class='textbox'>\n";
for ($i=0;$i<=60;$i++) echo "<option".(isset($anno_exdate['minutes']) && $anno_exdate['minutes'] == $i ? " selected" : "").">$i</option>\n";
echo "</select> : 00 <span class='alt'>".$locale['416']."</span></td>
</tr>\n
<tr></table><table align='center' cellpadding='0' cellspacing='0'>
<td class='tbl'></td>
<td align='center' class='tbl'><br/><input type='submit' name='anno_submit' value='".$locale['an206']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
} //Form
}
}
opentable($locale['an300']);
$result = dbquery("SELECT * FROM ".$db_prefix."announcements");
$rows = dbrows($result);
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0)
{
if (iADMIN) {
echo "<center>[<a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a>]</center>\n";
} else {
echo "<center>[<a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a>]</center>\n";
}
tablebreak();
$i = 1;
$result = dbquery("SELECT * FROM ".$db_prefix."announcements ORDER BY announcement_date DESC LIMIT $rowstart,10");
$numrows = dbrows($result);
while ($data = dbarray($result))
{
$announcement_announcement = $data['announcement_breaks'] == "y" ? nl2br(parsesmileys(stripslashes($data['announcement_announcement']))) : parsesmileys(stripslashes($data['announcement_announcement']));
echo "<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl2'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='small'><a name='$i'><b>".$data['announcement_summary']."</b></td>\n";
echo "</tr>
</table>
</td>
</tr>
<tr>
<td class='tbl1'>".$announcement_announcement."</td>
</tr>
<tr>
<td class='tbl2'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='small'>".showdate("longdate",$data['announcement_date'])."</td>\n";
if (iADMIN)
{
echo "<td align='right' class='small'>[<a href='http://www.wgliwicach.pl/infusions/announcements/announcements.php?action=edit&anno_id=".$data['announcement_id']."'>".$locale['an301']."</a>] | [<a href='".FUSION_SELF."?action=delete&anno_id=".$data['announcement_id']."' onClick='return DeleteMessage();'>".$locale['an302']."</a>]</td>\n";
}
echo "</tr>
</table>
</td>
</tr>
</table>\n";
if ($i != $numrows) echo "<br>\n";
$i++;
}
} else {
echo "<center><br>\n".$locale['an303']."<br><br>\n";
if (iADMIN)
{
echo "[ <a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a> ]<br><br>\n";
} else {
echo "[ <a href='".$settings['siteurl']."infusions/announcements/announcements.php?new_announcement=1'>".$locale['an200']."</a> ]<br><br>\n";
}
echo "</center>\n";
}
closetable();
if ($rows != 0) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,3,FUSION_SELF."?")."\n</div>\n";
echo "<script>
function DeleteMessage()
{
return confirm(\"".$locale['an304']."\");
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ... zapisz i wyjdz
Pozdro!!
Edytowane przez bartek124 dnia 16.03.2009 17:49:44
|