..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..
THC xConverter is a tool that makes use of (php) functions in order to calculate, fetch, convert and encrypt data
<?php
/* Shows (running) tasks and updates every second
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 14-11-2014
*/
if(!defined('IN_SCRIPT')){
exit;
}
if($_CONTEXT['rightdisplay']['show_tasks']){
$sDiv = "";
$sScript = "";
$_CONTEXT['htmlo'] .= " <div class=\"subname\" id=\"tsks\">tasks</div>\n";
$sDest = $_PATHS['data_root']."/running.txt";
if(@filesize($sDest)>0){
if(!function_exists("RawToArray")){
include_once($_PATHS['functions_root']."/raw_to_array.php");
}
if(false!==($aFileContentT = RawToArray($sDest))){
// generate the script and divs, first see if there are tasks that are currently running
$aFileContent = array();
$bRunning = false;
// ok we got a running.txt that isn't empty, but are there tasks that are still running?
if(0!=($iFileDataT = @count($aFileContentT))){
for($x=0;$x<$iFileDataT;$x++){
if($aFileContentT[$x][2]==0){
$bRunning = true;
$aFileContent[] = $aFileContentT[$x];
}
}
}
$iFileData = @count($aFileContent);
if($bRunning){
$sDiv = "";
$sScript = "<script>\n";
$sScript .= "\$(document).ready(function(){\n";
$sScript .= "var refreshId = setInterval(function()\n";
$sScript .= "{\n";
for($x=0;$x<$iFileData;$x++){
if($aFileContent[$x][2]==0){
// filter running tasks
$sDiv .= "<div id=\"".$aFileContent[$x][0].$aFileContent[$x][1]."\"></div>";
$sScript .= "\$('#".$aFileContent[$x][0].$aFileContent[$x][1]."').load('task_bot.php?module=".$aFileContent[$x][0]."&start=".$aFileContent[$x][1]."');\n";
}
}
$sScript .= "}, 1000);\n";
$sScript .= "});\n";
$sScript .= "</script>\n";
$_CONTEXT['htmlo'] .= $sScript." <div class=\"lnk\">".$sDiv."</div>\n";
}
else{
$_CONTEXT['htmlo'] .= " <div class=\"lnk\">present tasks ended</div>\n";
}
}
}
else{
$_CONTEXT['htmlo'] .= " <div class=\"lnk\">no tasks running</div>\n";
}
}
?>