$res .= "</tr>";
        }
        $res .= "</tbody></table></center>";
        print $res;
        exit;
    }
}
if ($action == "showenqueued") {
    $mg = mg_connect($config, "", "", "");
    if ($mg) {
        $stmt = new mg_stmt_select($mg, "sources");
        //$stmt->setWhereClause("enabled = 1 and deleted = 0 and (crawl_process_status='' or crawl_process_status='0') and id_account = " . $id_account_current);
        $query = array('$and' => array(array(enabled => "1"), array(deleted => "0"), array(id_account => intval($id_account_current)), array('$or' => array(array(crawl_process_status => null), array(crawl_process_status => "0")))));
        //$query = array('$and' => array(array(enabled => "1"), array(deleted => "0")));
        $stmt->setQuery($query);
        $stmt->setSort(array("crawl_priority" => -1, "crawl_nexttime" => 1));
        //$stmt->setSort(array( "crawl_nexttime" => 1 ));
        if ($limit != "0") {
            $stmt->setLimit($limit);
        }
        $count = $stmt->execute();
        if ($count == 0) {
            print "";
            exit;
        }
        $cursor = $stmt->getCursor();
        $res .= "<center><table>";
        $res .= "<tr><th>Title</th><th>Starting URL</th><th>Next crawl date</th><th class='priority'>Priority</th></tr><tbody>";
        while ($cursor->hasNext()) {
            $rs = $cursor->getNext();
            $query = array('$and' => array(array("type" => "cnx"), array("id" => intval($rs["type"]))));
Example #2
0
<?php

require_once "../init_gpc.inc.php";
require_once "../init.inc.php";
$id = $_GET['id'];
$row = $_GET['row'];
if ($id == '') {
    exit;
}
//TODO: V4 - Tester
$mg = mg_connect($config, "", "", "");
if ($mg) {
    $stmt = new mg_stmt_select($mg, "sources_log");
    $query = array("id_source" => intval($id));
    $stmt->setQuery($query);
    $stmt->setSort(array("createtime" => -1));
    $count = $stmt->execute();
    header('Content-type: text/html; charset=UTF-8');
    if ($count == 0) {
        print "No log available !";
        exit;
    }
    $cursor = $stmt->getCursor();
    if ($row == "") {
        $row = 0;
        while ($cursor->hasNext()) {
            $rs = $cursor->getNext();
            $t = $rs["createtime"] / 1000;
            $created = date('Y-m-d H:i:s', $t);
            //1.37271406957E+12
            print "<a href='log.php?id=" . $id . "&row=" . $row . "'>" . $created . "</a><br>";
//============================================================================
// (c) 2009-2010, Eolya - All Rights Reserved.
// This source code is the property of Eolya.
// The license applying to this source code is available at :
// http://www.crawl-anywhere.com/licenses/
//============================================================================
require_once "../../init_gpc.inc.php";
require_once "../../init.inc.php";
$action = POSTGET("action");
if ($action == "showaccountlist") {
    $mg = mg_connect($config, "", "", "");
    if ($mg) {
        $res = "<h2>Accounts</h2>";
        $stmt = new mg_stmt_select($mg, "accounts");
        $stmt->setFields(array("id" => "true", "name" => "true"));
        $stmt->setSort(array("name" => 1));
        $count = $stmt->execute();
        if ($count > 0) {
            $cursor = $stmt->getCursor();
            while ($cursor->hasNext()) {
                $rs = $cursor->getNext();
                $account = $rs["name"];
                $res .= $account;
                $res .= "&nbsp;<a href='#' onClick='editAccount(" . $rs["id"] . ");return false;' title='Edit'><img src='images/button_edit.png'></a>";
                $res .= "<br />";
            }
        }
    }
    $res .= "<br /><br /><br /><br /><br /><br />Add new account<a href='#' onClick='displayAddAccount(); return false;'><img src='images/edit_add_32.png'></a>&nbsp;&nbsp;";
    print $res;
    exit;
Example #4
0
function getAvailableEngines($config)
{
    $aEnginesFinal = null;
    $mg = mg_connect($config, "", "", "");
    if ($mg) {
        $stmt = new mg_stmt_select($mg, "accounts");
        $stmt->setFields(array("id" => "true", "name" => "true"));
        $stmt->setSort(array("name" => 1));
        $count = $stmt->execute();
        if ($count > 0) {
            $aAccountsFinal = array();
            $cursor = $stmt->getCursor();
            while ($cursor->hasNext()) {
                $rs = $cursor->getNext();
                $id = strtolower(trim($rs['id']));
                $name = trim($rs['name']);
                $aEnginesFinal[$id] = $name;
            }
        }
    }
    return $aEnginesFinal;
}
//============================================================================
// (c) 2009-2010, Eolya - All Rights Reserved.
// This source code is the property of Eolya.
// The license applying to this source code is available at :
// http://www.crawl-anywhere.com/licenses/
//============================================================================
require_once "../../init_gpc.inc.php";
require_once "../../init.inc.php";
$action = POSTGET("action");
if ($action == "showuserlist") {
    $mg = mg_connect($config, "", "", "");
    if ($mg) {
        $res = "<h2>Users</h2>";
        $stmt = new mg_stmt_select($mg, "users");
        $stmt->setFields(array("id" => "true", "user_name" => "true"));
        $stmt->setSort(array("user_name" => 1));
        $count = $stmt->execute();
        if ($count > 0) {
            $cursor = $stmt->getCursor();
            while ($cursor->hasNext()) {
                $rs = $cursor->getNext();
                $user = $rs["user_name"];
                $res .= $user;
                $res .= "&nbsp;<a href='#' onClick='editUser(" . $rs["id"] . ");return false;' title='Edit'><img src='images/button_edit.png'></a>";
                $res .= "<br />";
            }
        }
    }
    $res .= "<br /><br /><br /><br /><br /><br />Add new user<a href='#' onClick='displayAddUser(); return false;'><img src='images/edit_add_32.png'></a>&nbsp;&nbsp;";
    print $res;
    exit;