updated system reference, cleanup, all working besides search
This commit is contained in:
parent
177fe61988
commit
b41a0ed8d8
@ -1 +1 @@
|
||||
Subproject commit 59af1d3bb32e507fc51a3aaedabb764e5d6aca2b
|
||||
Subproject commit 45543a45b8bd0f6277edf66b66bf88e8dc29f086
|
||||
@ -1,6 +1,2 @@
|
||||
<?php
|
||||
|
||||
class api_neopolimatrix extends \SYSTEM\API\api_system {
|
||||
|
||||
|
||||
}
|
||||
class api_neopolimatrix extends \SYSTEM\API\api_system {}
|
||||
@ -1,3 +1,2 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/elements','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
class comments {
|
||||
public static function getUserComments($poll_ID, $c_choice){
|
||||
return \DBD\UVOTE_GENERATE_COMMENTS_PER_POLL::QA(array($poll_ID, $c_choice));}
|
||||
|
||||
public static function insertUserComment($c_choice, $poll_ID, $user_ID, $c_txt, $c_src, $timestamp){
|
||||
return \DBD\UVOTE_DATA_USER_COMMENT_INSERT::QI(array($c_choice, $poll_ID, $user_ID, $c_txt, $c_src, $timestamp));}
|
||||
|
||||
public static function get_commentrate($c_ID, $val){
|
||||
return \DBD\UVOTE_DATA_USER_COMMENTRATE_PER_COMMENT::Q1(array($c_ID, $val));}
|
||||
|
||||
|
||||
|
||||
public static function write_commentrate($c_ID, $val){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
throw new ERROR("You need to be logged in.");}
|
||||
return \DBD\UVOTE_DATA_USER_COMMENTRATE_INSERT::Q1(array($c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val, $c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val));}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
class elements {
|
||||
public static function getAllElementsOfTag($tag){
|
||||
return \DBD\NEOPOLIMATRIX_GENERATE_ELEMENTLIST::QA(array($tag));}
|
||||
|
||||
public static function getAllElementsOfSearch($search){
|
||||
return \DBD\NEOPOLIMATRIX_GENERATE_ELEMENTLIST_FULLTEXT_SEARCH::QA(array($search,$search));}
|
||||
|
||||
public static function getText($tag){
|
||||
return \DBD\NEOPOLIMATRIX_GET_TEXT::Q1(array($tag));}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
class graphs {
|
||||
|
||||
public static function graph_bt_to_uvote_overall_by_time ($timespan = 84600,$returnasjson = true){
|
||||
$result = array();
|
||||
$res = \DBD\UVOTE_DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME::QQ(array($timespan));
|
||||
while ($row = $res->next()){
|
||||
$result[] = array( 0 => $row['day'],
|
||||
'match' => $row['class_match'] > 0 ? round($row['class_match'] / ($row['class_match']+$row['class_mismatch']),2) : 0,
|
||||
'mismatch' => $row['class_match'] > 0 ? round($row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']),2) : 0);
|
||||
}
|
||||
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
|
||||
}
|
||||
|
||||
public static function graph_bt_to_user_overall_by_time ($timespan = 84600,$returnasjson = true){
|
||||
$result = array();
|
||||
$res = \DBD\UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id));
|
||||
while ($row = $res->next()){
|
||||
$result[] = array( 0 => $row['day'],
|
||||
'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1),
|
||||
'class_mismatch' => $row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']+1));
|
||||
}
|
||||
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
class should_be_in_backend {
|
||||
public static function insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){
|
||||
return \DBD\UVOTE_GENERATE_VOTELIST::QI(array($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice));}
|
||||
|
||||
public static function write_poll($ID, $title, $iframe_link ){
|
||||
if ($ID == -1){
|
||||
return \DBD\UVOTE_DATA_NEW_POLL::QI(array($title, $iframe_link));
|
||||
}
|
||||
return \DBD\UVOTE_DATA_UPDATE_POLL::QI(array($title, $iframe_link, $ID));
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
|
||||
//keep this
|
||||
require_once dirname(__FILE__).'/path/autoload.inc';
|
||||
require_once dirname(__FILE__).'/page/autoload.inc';
|
||||
require_once dirname(__FILE__).'/files/autoload.inc';
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/db/','DBD');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tbl/','DBD');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','DBD');
|
||||
//$autoload->registerFolder(dirname(__FILE__).'/tbl/definitions/','DBD\DEFINITIONS');
|
||||
//$autoload->registerFolder(dirname(__FILE__).'/tbl/data/','DBD\DATA');
|
||||
//$autoload->registerFolder(dirname(__FILE__).'/tbl/data_processed/','DBD\DATA_PROCESSED');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tbl/','DBD');
|
||||
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class NEOPOLIMATRIX_GENERATE_ELEMENTLIST extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM system_locale_string LEFT JOIN system_locale_string_tag_strings ON (system_locale_string.id = system_locale_string_tag_strings.id) WHERE tag_string like ? ORDER by timestamp DESC;';
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class NEOPOLIMATRIX_GET_TEXT extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM system_locale_string LEFT JOIN system_locale_string_tag_strings ON (system_locale_string.id = system_locale_string_tag_strings.id) WHERE tag_id = ?;';
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_list','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_article','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_impressum','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_search','');
|
||||
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
require_once dirname(__FILE__).'/default_page/autoload.inc';
|
||||
require_once dirname(__FILE__).'/default_list/autoload.inc';
|
||||
require_once dirname(__FILE__).'/default_article/autoload.inc';
|
||||
require_once dirname(__FILE__).'/default_impressum/autoload.inc';
|
||||
require_once dirname(__FILE__).'/default_search/autoload.inc';
|
||||
2
neopolimatrix/page/default_article/autoload.inc
Normal file
2
neopolimatrix/page/default_article/autoload.inc
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
@ -1,17 +1,16 @@
|
||||
<?php
|
||||
class default_article extends \SYSTEM\PAGE\Page {
|
||||
var $article_id = null;
|
||||
var $id = null;
|
||||
public function __construct($id) {
|
||||
$this->article_id = $id;}
|
||||
$this->id = $id;}
|
||||
public static function js(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_article/js/default_article.js'));}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$element = elements::getText($this->article_id);
|
||||
$element['title'] = $element['id'];
|
||||
$element['published'] = date_format(new DateTime($element['timestamp']), 'H:i d-m-Y');
|
||||
$element['ago'] = \SYSTEM\time::time_ago_string(strtotime($element['timestamp']));
|
||||
$element = \SYSTEM\PAGE\text::get_adv($this->id);
|
||||
$element['published'] = date_format(new DateTime($element['time_create']), 'H:i d-m-Y');
|
||||
$element['ago'] = \SYSTEM\time::time_ago_string(strtotime($element['time_create']));
|
||||
$vars['text'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_article/tpl/element.tpl'), $element);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_article/tpl/default_article.tpl'), $vars);
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
<button class="btn btn-default" id="backbtn">zurück</button><br><br>
|
||||
<div class="list_element" text_id="${tag_id}" style="width: 750px; margin: auto; margin-bottom: 50px; padding: 20px; text-align: justify;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author}</i></p>
|
||||
<button class="btn btn-default" id="backbtn">zurück</button>
|
||||
<br>
|
||||
<br>
|
||||
<div class="list_element" text_id="${id}" style="width: 750px; margin: auto; margin-bottom: 50px; padding: 20px; text-align: justify;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author_name}</i></p>
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">${ago}</p>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="border-top: solid 1px black; width: 100%;"></div>
|
||||
<h2>${title}</h2>
|
||||
<h2>${id}</h2>
|
||||
<br>
|
||||
${deDE}
|
||||
${text}
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">Veröffentlicht: ${published}</p>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<div class="fb-comments" data-href="http://www.neopolimatrix.eu/#article;article.${tag_id}" data-numposts="20" data-colorscheme="light"></div>
|
||||
<div class="fb-comments" data-href="http://www.neopolimatrix.eu/#article;article.${id}" data-numposts="20" data-colorscheme="light"></div>
|
||||
</div>
|
||||
2
neopolimatrix/page/default_impressum/autoload.inc
Normal file
2
neopolimatrix/page/default_impressum/autoload.inc
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
2
neopolimatrix/page/default_list/autoload.inc
Normal file
2
neopolimatrix/page/default_list/autoload.inc
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
@ -1,67 +1,38 @@
|
||||
<?php
|
||||
class default_list extends \SYSTEM\PAGE\Page {
|
||||
var $filter = null;
|
||||
public function __construct($filter) {
|
||||
$this->filter = $filter;}
|
||||
var $tag = null;
|
||||
public function __construct($tag = null) {
|
||||
$this->tag = $tag;}
|
||||
public static function js(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_list/js/default_list.js'));}
|
||||
|
||||
private function switch_filter($filter){
|
||||
switch($filter){
|
||||
case 1:
|
||||
return '%';
|
||||
case 2:
|
||||
return '%surveillance%';
|
||||
case 3:
|
||||
return '%verteilung%';
|
||||
case 4:
|
||||
return '%korruption%';
|
||||
case 5:
|
||||
return '%polizei%';
|
||||
case 6:
|
||||
return '%demokratie%';
|
||||
case 7:
|
||||
return '%fof%';
|
||||
case 8:
|
||||
return '%start%';
|
||||
default:
|
||||
return '%';}
|
||||
|
||||
}
|
||||
|
||||
private function switch_list_title($filter){
|
||||
switch($filter){
|
||||
case 1:
|
||||
return 'Neuheiten';
|
||||
case 2:
|
||||
private static function switch_list_title($tag){
|
||||
switch($tag){
|
||||
case 'surveillance':
|
||||
return 'Überwachungsstaat';
|
||||
case 3:
|
||||
case 'ungleichheit':
|
||||
return 'Ungerechtigkeiten';
|
||||
case 4:
|
||||
case 'korruption':
|
||||
return 'Filz und Vetternwirtschaft';
|
||||
case 5:
|
||||
case 'polizei':
|
||||
return 'Dein Freund und Helfer';
|
||||
case 6:
|
||||
case 'demokratie':
|
||||
return 'Demokratie';
|
||||
case 7:
|
||||
case 'fof':
|
||||
return 'Foes of Freedom';
|
||||
case 8:
|
||||
return '';
|
||||
default:
|
||||
return '';}
|
||||
|
||||
return 'Neuheiten';
|
||||
}
|
||||
}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['title'] = $this->switch_list_title($this->filter);
|
||||
|
||||
$vars['title'] = self::switch_list_title($this->tag);
|
||||
$vars['list'] = '';
|
||||
$elements = elements::getAllElementsOfTag($this->switch_filter($this->filter));
|
||||
$elements = \SYSTEM\PAGE\text::tag_adv($this->tag ? $this->tag : 'neopolimatrix');
|
||||
foreach($elements as $element){
|
||||
$element['title'] = $element['id'];
|
||||
$element['published'] = date_format(new DateTime($element['timestamp']), 'H:i d-m-Y');
|
||||
$element['ago'] = \SYSTEM\time::time_ago_string(strtotime($element['timestamp']));
|
||||
$element['published'] = date_format(new DateTime($element['time_create']), 'H:i d-m-Y');
|
||||
$element['ago'] = \SYSTEM\time::time_ago_string(strtotime($element['time_create']));
|
||||
$vars['list'] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_list/tpl/element.tpl'), $element);
|
||||
}
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<div class ="list_element" text_id="${tag_id}" style="">
|
||||
<div class="element_hover article" text_id="${tag_id}" style="border-bottom: 1px black solid; text-align: justify;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author}</i></p>
|
||||
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">${ago}</p>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="border-top: solid 1px black; width: 100%;"></div>
|
||||
<h2>${title}</h2>
|
||||
<br>
|
||||
${deDE}
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">Veröffentlicht: ${published}</p>
|
||||
<br>
|
||||
</div>
|
||||
<div class="btn btn-default" style="margin-top: 10px; width: 35%;">Weiterlesen...</div>
|
||||
<div class ="list_element" text_id="${id}" style="">
|
||||
<div class="element_hover article" text_id="${id}" style="border-bottom: 1px black solid; text-align: justify;">
|
||||
<p style="float: left; font-size: 10pt; margin-top: 7px;">Author: <i>${author_name}</i></p>
|
||||
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">${ago}</p>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="border-top: solid 1px black; width: 100%;"></div>
|
||||
<h2>${id}</h2>
|
||||
<br>
|
||||
${text}
|
||||
<p style="float: right; font-size: 10pt; margin-top: 7px;">Veröffentlicht: ${published}</p>
|
||||
<br>
|
||||
</div>
|
||||
<div class="btn btn-default" style="margin-top: 10px; width: 35%;">Weiterlesen...</div>
|
||||
</div>
|
||||
2
neopolimatrix/page/default_page/autoload.inc
Normal file
2
neopolimatrix/page/default_page/autoload.inc
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
@ -1,17 +1,10 @@
|
||||
$(document).ready(function() {
|
||||
new SYSTEM('./api.php',1,'start;filter.1');
|
||||
new SYSTEM('./api.php',1,'start');
|
||||
tabs();
|
||||
impressum();
|
||||
search();
|
||||
FB.XFBML.parse(document.body);
|
||||
});
|
||||
|
||||
|
||||
function impressum(){
|
||||
$("#btn_impressum").click(function(){
|
||||
system.load('impressum');});
|
||||
}
|
||||
|
||||
function search(){
|
||||
$("#nav_search_btn").click(function(){
|
||||
$('#contentframe').load('./?page=search¶m='+$('#nav_search').val());
|
||||
@ -29,7 +22,7 @@ function tabs(){
|
||||
$('#tabs_user_list li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
$(this).parent().addClass('active');
|
||||
system.load('start;filter.'+$(this).attr('filter'));
|
||||
//system.load('start;filter.'+$(this).attr('filter'));
|
||||
//btn_element();
|
||||
});
|
||||
}
|
||||
|
||||
@ -38,13 +38,13 @@
|
||||
<div class="div_menu tabbable">
|
||||
<p id="menu_heading">Nach Themen</p>
|
||||
<ul class="nav nav-tabs" id="tabs_user_list">
|
||||
<li class="active"><a href="#!start;filter.1" filter="1">Neu</a></li>
|
||||
<li><a href="#!start;filter.7" filter="7">Serie: FoF</a></li>
|
||||
<li><a href="#!start;filter.6" filter="6">Demokratie</a></li>
|
||||
<li><a href="#!start;filter.2" filter="2">Überwachung</a></li>
|
||||
<li><a href="#!start;filter.3" filter="3">Ungleichheit</a></li>
|
||||
<li><a href="#!start;filter.4" filter="4">Korruption</a></li>
|
||||
<li><a href="#!start;filter.5" filter="5">Polizei</a></li>
|
||||
<li class="active"><a href="#!start">Neu</a></li>
|
||||
<li><a href="#!start;tag.fof">Serie: FoF</a></li>
|
||||
<li><a href="#!start;tag.demokratie">Demokratie</a></li>
|
||||
<li><a href="#!start;tag.surveillance">Überwachung</a></li>
|
||||
<li><a href="#!start;tag.ungleichheit">Ungleichheit</a></li>
|
||||
<li><a href="#!start;tag.korruption">Korruption</a></li>
|
||||
<li><a href="#!start;tag.polizei">Polizei</a></li>
|
||||
<button style="float: right; margin-top: 7px; margin-right: 7px; padding: 2px;"class="btn btn-info" id="nav_search_btn">los geht's!</button>
|
||||
<input style="float: right; margin-top: 7px; margin-right: 7px;" type="text" id="nav_search" placeholder="Suchbegriff eingeben">
|
||||
</ul>
|
||||
|
||||
3
neopolimatrix/page/default_search/autoload.inc
Normal file
3
neopolimatrix/page/default_search/autoload.inc
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq','DBD');
|
||||
@ -9,7 +9,7 @@ class default_search extends \SYSTEM\PAGE\Page {
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['search'] = '';
|
||||
$elements = elements::getAllElementsOfSearch('%'.$this->param.'%');
|
||||
$elements = \DBD\NEOPOLIMATRIX_GENERATE_ELEMENTLIST_FULLTEXT_SEARCH::QA(array('%'.$this->param.'%','%'.$this->param.'%'));
|
||||
foreach($elements as $element){
|
||||
$element['title'] = $element['id'];
|
||||
$element['published'] = date_format(new DateTime($element['timestamp']), 'H:i d-m-Y');
|
||||
|
||||
@ -5,8 +5,8 @@ class page_neopolimatrix extends \SYSTEM\API\api_default {
|
||||
public static function default_page($_escaped_fragment_ = NULL){
|
||||
return (new default_page())->html($_escaped_fragment_);}
|
||||
|
||||
public static function page_list($filter=1){
|
||||
return (new default_list($filter))->html();}
|
||||
public static function page_list($tag = null){
|
||||
return (new default_list($tag))->html();}
|
||||
|
||||
public static function page_article($id){
|
||||
return (new default_article($id))->html();}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user