- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
function preDispatch() {
// Validate and redirect
try {
$this->_DB = Zend_Db_Table::getDefaultAdapter();
$time = $this->_DB->query('SELECT time FROM `CapturesList` WHERE InnerLink = \'' . $_SERVER['REQUEST_URI'] . '\' LIMIT 0,1;')->fetchAll();
@$this->view->time = $time[0]['time'];
if ($time[0]['time'] != NULL) {
$times = split(', ', $time[0]['time']);
if (strtotime(($times[1]) . '/' . ($times[2]) . '/' . $times[0] . ' ' . $times[3] . ":00") < (int) (mktime())) {
if (strtotime(($times[1]) . '/' . ($times[2]) . '/' . $times[0] . ' ' . $times[3] . ":00") > 1347032555) {
$count = $this->_DB->query('SELECT *, COUNT(time) AS counts FROM `CapturesList` WHERE time IS NOT NULL;')->fetchAll();
$count = $count[0]['counts'];
@$newdate = strftime("%G, %m, %d, %H", strtotime(($times[1]) . '/' . ($times[2]) . '/' . $times[0] . ' ' . $times[3] . ":00 +" . ((int)($count / 2) + 1) . " weeks"));
@$this->_DB->query('UPDATE `CapturesList` SET `time` = \'' . ($newdate) . '\' WHERE InnerLink = \'' . $_SERVER['REQUEST_URI'] . '\';');
@$this->view->time = $newdate;
}
else{@$this->view->time = $time[0]['time'];}
} else {
@$this->view->time = $time[0]['time'];
}
} else {
@$this->view->time = "NULL";
}
} catch (Exception $exc) {
echo $exc->getTraceAsString();
@$this->view->time = "NULL";
}
header('Refer: ' . $this->view->linktofunnel);
if (session_id() == '')
session_start();
if ($this->_getParam('action') != 'save') {
$_SESSION["domain"] = $this->view->domain;
$_SESSION["owner"] = $this->OwnerData;
}
}