Exemplo n.º 1
0
function myinviter_executeJob($job)
{
    $ret = myinviter_grabEmails($job['domain'], $job['provider'], $GLOBALS['myinviter']->getConfig('autocrawlfolder'), $job['start']);
    $log = "Job Executed: " . Xmf_Debug::dump($job, false, false);
    $GLOBALS['myinviter']->addLog($log);
    $log = "Job Results: " . Xmf_Debug::dump($ret, false, false);
    $GLOBALS['myinviter']->addLog($log);
    if (xoops_isActiveModule('log')) {
        $log = Xmf_Debug::dump($job, false) . Xmf_Debug::dump($ret, false);
        Xmf_Module_Helper::getInstance('log')->getHandler('item')->addItem('myinviter', 'autocrawler', $log);
    }
    $job['lasttime'] = time();
    $job['start']++;
    if ($job['start'] == $job['npages']) {
        $job['start'] = 0;
    }
    return $job;
}
Exemplo n.º 2
0
function index_grabemails()
{
    global $xoopsTpl;
    $session = $GLOBALS['myinviter']->getHelper('session');
    $start = $session->get('start');
    $npages = $session->get('limit');
    $res = myinviter_grabEmails($session->get('domain'), $session->get('provider'), 'notsent', $start, $npages);
    if ($res['error'] != '') {
        $xoopsTpl->assign('emails_error', $res['error']);
    }
    $xoopsTpl->assign('emails_added', $res['added']);
    $xoopsTpl->assign('emails_notadded', $res['notadded']);
    $session->set('start', $start + $npages);
    $session->set('status', MYINVITER_STATUS_NOTSENT);
}