Files
Testing/bwadmin/community_message.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

116 lines
3.4 KiB
PHP

<?php
/* $Id: admin_viewreports.php 8 2009-01-11 06:02:53Z john $ */
$page = "admin_general1";
include "admin_header.php";
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }
// DELETE SINGLE REPORT
if($task == "update") {
if($_POST["activate"]=="Y"){$active="Y";}else{$active="N";}
$cresult=$database->database_query("UPDATE `cp_sitemessage` SET cp_sitemsg='".$database->database_real_escape_string(html_entity_decode($_POST["message"]))."', cp_active='".$active."' WHERE `cp_id` = 1") or $em=$em.$database->database_error();
}
function general()
{
global $ads, $database, $task;
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
if(isset($_POST['usage'])) { $usage = $_POST['usage']; } elseif(isset($_GET['usage'])) { $usage = $_GET['usage']; } else { $usage = ""; }
if(isset($_POST['from'])) { $from = $_POST['from']; } elseif(isset($_GET['from'])) { $from = $_GET['from']; } else { $from = ""; }
?>
<h2>Community Message</h2>
<?
$csql="SELECT * FROM `cp_sitemessage` WHERE `cp_id` = 1";
$cresult=$database->database_query($csql) or $em=$em.$database->database_error();
$row=$database->database_fetch_assoc($cresult);
?>
<script src="../include/ckeditor/ckeditor.js"></script>
<br /><br />
<form action="community_message.php" method="POST">
<textarea name="message" style="width:700px; height:450px;"><?php echo $row["cp_sitemsg"];?></textarea>
<br />
<br />
<input type="checkbox" name="activate" id="activate" value="Y" onclick="activate_annoucement();" <?php if($row["cp_active"]=="Y"){?>checked="checked"<?php }?>/>Active
<input type="hidden" name="task" value="update"><br />
<br />
<input type="submit" value="Update"></form>
<script>
//CKFinder.setupCKEditor( );
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
var editor = CKEDITOR.replace( 'message',
{
contentsCss : 'body{background-color:#000000;}',
height:"750px",
allowedContent: true,
filebrowserBrowseUrl : '../include/filemanager/dialog.php?type=1&editor=ckeditor&fldr=',
//filebrowserUploadUrl : '../include/filemanager/dialog.php?type=1&editor=ckeditor&fldr=',
filebrowserImageBrowseUrl : '../include/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
}
);
</script>
<?
}
// CONSTRUCT QUERY USING FILTERS
if($f_object != "") { $where_clause[] = "se_reports.report_object='$f_object'"; }
if($f_reason != "") { $where_clause[] = "se_reports.report_reason='$f_reason'"; }
if($f_details != "") { $where_clause[] = " se_reports.report_details LIKE '%$f_details%'"; }
if(count($where_clause) != 0) { $reports_query .= " WHERE ".implode(" AND ", $where_clause); }
// ASSIGN VARIABLES AND SHOW VIEW REPORTS PAGE
$smarty->assign('total_reports', $total_reports);
$smarty->assign('pages', $page_array);
$smarty->assign('reports', $report_array);
$smarty->assign('i', $i);
$smarty->assign('u', $u);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('s', $s);
$smarty->assign('f_object', $f_object);
$smarty->assign('f_reason', $f_reason);
$smarty->assign('f_details', $f_details);
include "admin_footer.php";
?>