155
« on: March 12, 2009, 06:35:20 AM »
working my way through this...
Page 7 of this mod says to find:
$shout_message = (stripslashes(trim($HTTP_POST_VARS['shout_message'])));
in shout_editor.php ...
and after put this:
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
if ($captcha_enable_contact && !captcha_validate($captcha)) {
$shout_message .= (($shout_message != "") ? "<br />" : "").$lang['captcha_required'];
}
and it says to find "sh_message" => $shout['0']['message'],
and after it add "captcha_shout" => (bool)$captcha_enable_shout,
"lang_captcha" => $lang['captcha'],
"lang_captcha_desc" => $lang['captcha_desc'],
The only problem is I dont have this code! to modify in shout_editor.php
And the following styles were not included in the mod and had to be added to style.css:
shoutmsg
and
shoutusr
here is my shout_editor.php
<?php
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
define('SHOUTBOX_TABLE', $table_prefix.'shoutbox');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={charset}" />
<title>Shoutbox Editor</title>
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH."/style.css" ?>" />
<SCRIPT TYPE="text/javascript">
<!--
window.focus();
//-->
</SCRIPT>
</head>
<body style="margin: 0">
<?php
$shout_id = $HTTP_GET_VARS['shout_id'];
if ($action == "editupdate") {
$sql = "UPDATE ".SHOUTBOX_TABLE." SET message='".$HTTP_POST_VARS['shout_message']."' WHERE id = ".$shout_id."";
$result = $site_db->query($sql);
$action = "edit";
echo $lang['sh_edited'];
}
if ($action == "edit") {
unset($shout);
$sql = "SELECT * FROM ".SHOUTBOX_TABLE." WHERE id = ".$shout_id;
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$shout[] = $row;
}
if ($shout['0']['usrid'] == $session_info['session_user_id']) {
?>
<form method="post" action="<?php echo $site_sess->url(ROOT_PATH."shout_editor.php?action=editupdate&shout_id=".$shout_id) ?>">
<table>
<tr>
<td>
<?php echo $lang['sh_name'] ?><br>
<input type="text" name="shout_user" value="<?php echo $shout['0']['name'] ?>" class="shoutinput">
</td>
</tr>
<tr>
<td>
<?php echo $lang['sh_message'] ?><br>
<textarea name="shout_message" cols="21" rows="2" class="shouttextarea"><?php echo $errormsg; echo $shout['0']['message'] ?></textarea>
<input type="submit" name="shout" value="<?php echo $lang['sh_edit'] ?>" class="button">
<a href="<?php echo $site_sess->url(ROOT_PATH."shout_editor.php?action=delete&shout_id=".$shout_id) ?>"><input type="button" value="<?php echo $lang['sh_delete'] ?>" class="button"></a>
</td>
</tr>
</table>
</form>
<?php
unset($action);
}
}
if ($action == "delete") {
echo "<br /><br /><a href=\"".$site_sess->url(ROOT_PATH."shout_editor.php?action=deleteyes&shout_id=".$shout_id)."\">".$lang['sh_ask_delete']."</a>";
}
if ($action == "deleteyes") {
$sql = "DELETE FROM ".SHOUTBOX_TABLE."
WHERE id = ".$shout_id;
$result = $site_db->query($sql);
echo "<br /><br />".$lang['sh_deleted'];
}
echo "<br /><a href=\"#\" onClick=\"javascript: window.close();\">".$lang['sh_close']."</a>"
?>
</body>
</html>
<?php
include(ROOT_PATH.'includes/page_footer.php')
?>