Witam, męcze się już troche nad tym i wciąż nie moge sobie poradzić. Jak zmodyfikować ten plik, by nie było wymagane pole email?
Treść pliku guestbook.php:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 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 BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (file_exists(INFUSIONS."guestbook/locale/".$settings['locale'].".php")) {
include INFUSIONS."guestbook/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."guestbook/locale/English.php";
}
if (!isset($action)) $action = "";
if ($action == "delete") {
if (iADMIN) {
$result = dbquery("DELETE FROM ".$db_prefix."guestbook WHERE guestbook_id='$guestbook_id'");
redirect(FUSION_SELF);
}
} elseif (isset($_POST['guest_submit'])) {
$error = false;
if ($action != "edit" && !iADMIN) {
$guest_code = stripinput($_POST['guest_code']);
$result = dbquery("SELECT * FROM ".$db_prefix."vcode WHERE vcode_1='$guest_code'");
if (dbrows($result) == 0) {
$error = true;
} else {
$result = dbquery("DELETE FROM ".$db_prefix."vcode WHERE vcode_1='$guest_code'");
}
}
if (!$error && $_POST['guest_name'] != "" && $_POST['guest_email'] != "" && $_POST['guest_message'] != "") {
$guest_name = trim(stripinput($_POST['guest_name']));
$guest_email = trim(stripinput($_POST['guest_email']));
$guest_weburl = trim(stripinput($_POST['guest_weburl']));
$guest_webtitle = trim(stripinput($_POST['guest_webtitle']));
$guest_message = trim(stripinput($_POST['guest_message']));
if ($guest_name != "" && $guest_message != "") {
if ($action == "edit" && iADMIN) {
$result = dbquery("UPDATE ".$db_prefix."guestbook SET guestbook_name='$guest_name', guestbook_email='$guest_email', guestbook_weburl='$guest_weburl', guestbook_webtitle='$guest_webtitle', guestbook_message='$guest_message' WHERE guestbook_id='$guestbook_id'");
} else {
$result = dbquery("INSERT INTO ".$db_prefix."guestbook (guestbook_name, guestbook_email, guestbook_weburl, guestbook_webtitle, guestbook_message, guestbook_datestamp, guestbook_ip) VALUES('$guest_name', '$guest_email', '$guest_weburl', '$guest_webtitle', '$guest_message', '".time()."', '".USER_IP."')");
}
}
redirect(FUSION_SELF);
} else {
opentable($locale['gb400']);
echo "<div align='center'><b>".$locale['gb430']."</b><br>\n<span class='small'>";
if ($error) { echo $locale['gb431']."<br>\n"; } echo $locale['gb432']."</span></div>\n";
closetable();
tablebreak();
}
} elseif ($action == "edit" && iADMIN) {
$result = dbquery("SELECT * FROM ".$db_prefix."guestbook WHERE guestbook_id='$guestbook_id'");
if (dbrows($result)) {
$data = dbarray($result);
$guestbook_name = $data['guestbook_name'];
$guestbook_email = $data['guestbook_email'];
$guestbook_weburl = $data['guestbook_weburl'];
$guestbook_webtitle = $data['guestbook_webtitle'];
$guestbook_message = $data['guestbook_message'];
$formaction = FUSION_SELF."?action=edit&guestbook_id=$guestbook_id";
} else {
$action = "";
$formaction = FUSION_SELF;
}
} else {
$action = "";
$guestbook_name = "";
$guestbook_email = "";
$guestbook_weburl = "";
$guestbook_webtitle = "";
$guestbook_message = "";
$formaction = FUSION_SELF;
}
if (isset($new_message) || $action == "edit") {
if ($action != "edit" && !iADMIN) {
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')");
}
opentable($locale['gb400']);
echo "<form name='inputform' method='post' action=$formaction>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td align='right' class='tbl'>".$locale['gb401']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='guest_name' value='$guestbook_name' class='textbox' style='width:200px'></td>
</tr>
<tr>
<td align='right' class='tbl'>".$locale['gb402']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='guest_email' value='$guestbook_email' class='textbox' style='width:200px'></td>
</tr>
<tr>
<td align='right' class='tbl'>".$locale['gb403']."</td>
<td class='tbl'><input type='text' name='guest_weburl' value='$guestbook_weburl' class='textbox' style='width:200px'></td>
</tr>
<tr>
<td align='right' class='tbl'>".$locale['gb404']."</td>
<td class='tbl'><input type='text' name='guest_webtitle' value='$guestbook_webtitle' class='textbox' style='width:200px'></td>
</tr>\n";
if ($action != "edit" && !iADMIN) {
echo "<tr>\n<td class='tbl'>".$locale['gb407']."<span style='color:#ff0000'>*</span></td>\n<td class='tbl'>";
if ($settings['validation_method'] == "image") {
echo "<img src='".INFUSIONS."guestbook/validate.php?gbvimage=$vcode_2'>\n";
} else {
echo "<b>$vcode_1</b>\n";
}
unset($vcode_1,$vcode_2);
echo "</td>
</tr>
<tr>
<td class='tbl'>".$locale['gb408']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='guest_code' class='textbox' style='width:100px'></td>
</tr>\n";
}
echo "<tr>
<td align='right' valign='top' class='tbl'>".$locale['gb405']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><textarea name='guest_message' rows='5' class='textbox' style='width:250px'>$guestbook_message</textarea><br><br>
".displaysmileys("guest_message")."
</td>
</tr>
<tr>
<td class='tbl'></td>
<td class='tbl'><input type='submit' name='guest_submit' value='".$locale['gb406']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
}
opentable($locale['gb420']);
$result = dbquery("SELECT * FROM ".$db_prefix."guestbook");
$rows = dbrows($result);
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
echo "<center>[ <a href='".FUSION_SELF."?new_message=1'>".$locale['gb400']."</a> ]</center>\n";
tablebreak();
$i = 1;
$result = dbquery("SELECT * FROM ".$db_prefix."guestbook ORDER BY guestbook_datestamp DESC LIMIT $rowstart,10");
$numrows = dbrows($result);
while ($data = dbarray($result)) {
if ($data['guestbook_weburl']) {
$weburl = str_replace("http://", "", $data['guestbook_weburl']);
$web = "\n | <a href='http://$weburl' target='_blank'>";
if ($data['guestbook_webtitle']) {
$web .= $data['guestbook_webtitle']."</a>\n";
} else {
$web .= $weburl."</a>\n";
}
} else {
$web = "";
}
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'><b><a href='mailto:".$data['guestbook_email']."'>".$data['guestbook_name']."</a></b>$web</td>\n";
if (iADMIN && $data['guestbook_ip'] != "0.0.0.0") echo "<td align='right' class='small'>IP: ".$data['guestbook_ip']."</td>\n";
echo "</tr>
</table>
</td>
</tr>
<tr>
<td class='tbl1'>".nl2br(parsesmileys(parseubb($data['guestbook_message'])))."</td>
</tr>
<tr>
<td class='tbl2'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='small'>
".showdate("longdate", $data['guestbook_datestamp'])."</td>\n";
if (iADMIN) {
echo "<td align='right' class='small'><a href='".FUSION_SELF."?action=edit&guestbook_id=".$data['guestbook_id']."'>".$locale['gb421']."</a> |
<a href='".FUSION_SELF."?action=delete&guestbook_id=".$data['guestbook_id']."' onClick='return DeleteMessage();'>".$locale['gb422']."</a></td>\n";
}
echo "</tr>
</table>
</td>
</tr>
</table>\n";
if ($i != $numrows) echo "<br>\n";
$i++;
}
} else {
echo "<center><br>\n".$locale['gb423']."<br><br>\n[ <a href='".FUSION_SELF."?new_message=1'>".$locale['gb400']."</a> ]<br><br>\n</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['gb424']."\");
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
Edytowane przez Pieka dnia 23.11.2008 12:50:28
|