Beispiel #1
0
<?php

// VORC :: NEWS JP :: CTL
header('Content-Type: text/html; charset=utf-8');
session_start();
require __DIR__ . "/../../vendor/autoload.php";
$VORC = new VORC\Vorc();
switch ($_POST['do']) {
    case 'search':
        //print_r($_POST);
        $WHERE = [];
        $WHERE[] = '1=1';
        $WHERE[] = 'newsbody<>""';
        if ($_POST['search']) {
            $WHERE[] = '(title LIKE ' . $VORC->db()->quote($_POST['search']) . ' OR newsbody LIKE ' . $VORC->db()->quote($_POST['search']) . ')';
        }
        if ($_POST['flag_wiki']) {
            $WHERE[] = 'flag_wiki LIKE "%' . $_POST['flag_wiki'] . '%" ';
        }
        if ($_POST['user']) {
            $WHERE[] = 'user_modified LIKE "' . $_POST['user'] . '" ';
        }
        $WHERE = implode(' AND ', $WHERE);
        // FIND //
        $sql = "SELECT * FROM news_jp WHERE {$WHERE} ORDER BY user_modified DESC;";
        //echo "<pre>$sql</pre>";
        $q = $VORC->db()->query($sql) or die("Error:" . print_r($VORC->db()->errorInfo(), true) . "<hr />{$sql}");
        $htm = [];
        $htm[] = "<table class='table table-condensed table-hover'>";
        $htm[] = "<thead>";
        //$htm[]= "<th>Date</th>";
<?php

// VORC :: NEWS EN
header('Content-Type: text/html; charset=utf-8');
session_start();
require __DIR__ . "/../../vendor/autoload.php";
$admin = new LTE\AdminLte2();
echo $admin;
$VORC = new VORC\Vorc();
$id = $_GET['id'];
$sql = "SELECT * FROM vorc.news_en WHERE nid={$id} LIMIT 1;";
$q = $VORC->db()->query($sql) or die("Error");
$r = $q->fetch(PDO::FETCH_ASSOC);
if (!$r) {
    die("Error");
}
?>
<section class="content-header">
  <h1><i class='fa fa-newspaper-o'></i> NEWS - EN 
  <small>#<?php 
echo $r['nid'];
?>
</small>
  </h1>
</section>

<section class="content">
<?php 
$htm = [];
$htm[] = $VORC->process_en($r['newsbody']);
//$htm[]="<i class='text-muted'>".$r['newsbody']."</i>";
 $WHERE[] = '1=1';
 if ($_POST['platform']) {
     $WHERE[] = 'flag_platform LIKE "%' . $_POST['platform'] . '%" ';
 }
 if ($_POST['extension']) {
     $WHERE[] = 'flag_extension LIKE "%' . $_POST['extension'] . '%" ';
 }
 if ($_POST['url']) {
     $WHERE[] = '( url_tune1 LIKE "%' . $_POST['url'] . '%" OR url_tune2 LIKE "%' . $_POST['url'] . '%" )';
 }
 //if($_POST['user'])$WHERE[]='user_modified LIKE "'.$_POST['user'].'" ';
 $WHERE = implode(' AND ', $WHERE);
 $LIMIT = 1000;
 // FIND //
 $sql = "SELECT * FROM tune_index WHERE {$WHERE} ORDER BY tid DESC LIMIT {$LIMIT};";
 $q = $VORC->db()->query($sql) or die("Error:" . print_r($VORC->db()->errorInfo(), true) . "<hr />{$sql}");
 //echo "<pre>$sql</pre>";
 $rows = [];
 while ($r = $q->fetch(PDO::FETCH_ASSOC)) {
     //trim crap
     if ($r['flag_platform']) {
         $r['flag_platform'] = preg_replace("/^;|;\$/", '', $r['flag_platform']);
     }
     if ($r['flag_extension']) {
         $r['flag_extension'] = preg_replace("/^;|;\$/", '', $r['flag_extension']);
     }
     $Y = substr($r['date'], 0, 4);
     $M = substr($r['date'], 4, 2);
     $D = substr($r['date'], 6, 2);
     $r['date'] = "{$Y}-{$M}-{$D}";
     $rows[] = $r;