Exemplo n.º 1
0
<?php

/**
 * Created by PhpStorm.
 * User: heyqule
 * Date: 09/01/16
 * Time: 10:32 PM
 */
ini_set('display_error', 1);
include 'saywut/config.php';
include 'saywut/bots/Slack_Bot.php';
$bot = new \Saywut\Slack_Bot(\Saywut\Core::getBotKey($GLOBALS['BOT_CONFIG'][1]), $GLOBALS['BOT_CONFIG'][1]);
if (!empty($_GET['run'])) {
    $bot->run();
}
$postCollection = new \Saywut\Post_Collection();
$limit = 50;
$offset = 0;
$anchorUrl = '?';
$query = '';
if (!empty($_GET['query'])) {
    $postCollection->addFullText($_GET['query']);
    $anchorUrl = '?query=' . urlencode($_GET['query']);
    $query = htmlentities($_GET['query'], ENT_HTML5);
}
$page = 0;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
    $offset = $page * $limit;
}
$posts = $postCollection->loadByQuery($offset, $limit);
Exemplo n.º 2
0
    }
    echo json_encode($rc);
    die;
}
//Get Post
$offset = $_REQUEST['offset'];
$from = $_REQUEST['fromDate'];
$to = $_REQUEST['toDate'];
$provider = $_REQUEST['provider'];
$query = $_REQUEST['query'];
$showHidden = $_REQUEST['showHidden'];
$onlyHidden = $_REQUEST['onlyHidden'];
if (empty($offset)) {
    $offset = 0;
}
$post_collector = new \Saywut\Post_Collection();
if (!empty($provider)) {
    $post_collector->addWhere('provider_id', '=', $provider)->addRaw('AND');
}
if (!empty($query)) {
    $tokens = explode(" ", $query);
    $first = true;
    $post_collector->addRaw('(');
    foreach ($tokens as $idx => $val) {
        if ($continue) {
            $post_collector->addRaw('OR');
        }
        $post_collector->addWhere('contents', 'LIKE', '%' . $val . '%', $idx);
        $continue = true;
    }
    $post_collector->addRaw(')');
Exemplo n.º 3
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: heyqule
 * Date: 7/3/13
 * Time: 11:47 PM
 * To change this template use File | Settings | File Templates.
 */
if (empty($_SESSION['is_logged'])) {
    die;
}
require_once SAYWUT_ROOT_PATH . DS . 'includes' . DS . 'Post.php';
require_once SAYWUT_ROOT_PATH . DS . 'includes' . DS . 'Post_Collection.php';
$collect = new \Saywut\Post_Collection();
$limit = 50;
$offset = 0;
$page = 0;
$anchorUrl = '?l=managepost';
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
if (isset($_POST['query'])) {
    $collect->addFullText($_POST['query']);
}
$system_message = '';
if (isset($page)) {
    $offset = $page * $limit;
}
if (isset($_GET['reindexall'])) {
    $system_message = 'Reindex completed. Affected Rows: ' . $collect->reindexAll();