..one or more modules you must have seen the iframes used for realtime result display. In this tutorial I'm going to show you how to insert them into your module and how they..
xAnalyze is a module that can search through corrupt data and configuration files in order to find the exact position of errors
<?php
/* Time editor
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 22-02-2015
*/
session_cache_limiter('nocache');
header('Expires: '.gmdate('r',0));
header('Content-type: application/json');
$_DYNAMIC_ROOT = "..";
include_once("../header.php");
$aDataR = array();
$aDataR['jresult'] = false;
$aDataR['jmessage'] = "An error occured";
$aFiles = array($_PATHS['functions_root']."/fwrite.php",$_PATHS['functions_root']."/get_file_data.php");
for($x=0;$x<count($aFiles);$x++){
if(!file_exists($aFiles[$x])){
$aDataR['jmessage'] = "Missing required file: ".$aFiles[$x];
die(json_encode($aDataR));
}
@include_once($aFiles[$x]);
}
if(isset($_POST['sTime'])){
// update time pattern setting
$_POST['sTime'] = @trim($_POST['sTime']);
$sDest = $_PATHS['root']."/vars.php";
if($_POST['sTime']!="d-m-Y" && $_POST['sTime']!="m-d-Y"){
$aDataR['jmessage'] = "Invalid time pattern";
}
else{
// determine whether it's necessary to do the update
if(false==($sFileData = GetFileData($sDest))){
$aDataR['jmessage'] = "Failed to get data from vars.php";
}
else{
$sF1 = md5($sFileData);
$sSearch = "\$_CONTEXT['time_pattern'] = \"".$_CONTEXT['time_pattern']."\";";
$sReplace = "\$_CONTEXT['time_pattern'] = \"".$_POST['sTime']."\";";
$sFileData = str_replace($sSearch,$sReplace,$sFileData);
$sF2 = md5($sFileData);
if($sF1==$sF2){
$aDataR['jmessage'] = "Nothing to update";
}
else{
if(!WriteF($sDest,$sFileData,"w")){
$aDataR['jmessage'] = "Data file isn't writable";
}
else{
$aDataR['jresult'] = true;
$aDataR['jmessage'] = "Successfully changed pattern";
}
}
}
}
}
echo json_encode($aDataR);
?>