initial
@ -1,2 +1,81 @@
|
||||
<?php
|
||||
class api_go_trainer extends \SYSTEM\API\api_system {}
|
||||
class api_go_trainer extends \SYSTEM\API\api_system {
|
||||
public static function call_guides_action_new($title, $cat, $text) {
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$res = $con->prepare( 'selGuide',
|
||||
'SELECT * FROM `go_trainer_guides` WHERE `title` = ?;',
|
||||
array($title));
|
||||
$res = $con->prepare( 'insertVote',
|
||||
'INSERT INTO `go_trainer_guides` (`id`, `cat`, `parent_type`, `parent_id`, `title`, `author`, `body`, `created`, `last_edit`) '
|
||||
. ' VALUES (NULL, ?, 0, 0, ?, ?, ?, NOW(), NOW());
|
||||
',
|
||||
array($cat, $title, \SYSTEM\SECURITY\Security::getUser()->id, $text));
|
||||
return JsonResult::ok();
|
||||
}
|
||||
}
|
||||
public static function call_guides_action_rate($rating, $guide) {
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$rated = \SQL\GO_TRAINER_GET_HASRATED::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id, $guide));
|
||||
if ($rating == $rated['rating']){
|
||||
return JsonResult::fail();
|
||||
}
|
||||
if ($rated){
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$res = $con->prepare( 'updateRate',
|
||||
'UPDATE go_trainer_rating SET rating=?, `timestamp`=NOW() WHERE id=?;',
|
||||
array($rating, $rated['id']));
|
||||
return JsonResult::ok();
|
||||
}
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$res = $con->prepare( 'selRate',
|
||||
'SELECT * FROM `go_trainer_rating` WHERE `user_id` = ?;',
|
||||
array(\SYSTEM\SECURITY\Security::getUser()->id));
|
||||
$res = $con->prepare( 'insertRate',
|
||||
'INSERT INTO `go_trainer_rating` (`id`, `user_id`, `rating`, `relation_type`, `relation_id`, `timestamp`)'
|
||||
. ' VALUES (NULL, ?, ?, 1, ?, NOW());',
|
||||
array(\SYSTEM\SECURITY\Security::getUser()->id, $rating, $guide));
|
||||
return JsonResult::ok();
|
||||
}
|
||||
}
|
||||
public static function call_guides_action_comment($text, $guide) {
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$res = $con->prepare( 'selGuide',
|
||||
'SELECT * FROM `go_trainer_guides` WHERE `id` = ?;',
|
||||
array($guide));
|
||||
$res = $con->prepare( 'insertComment',
|
||||
'INSERT INTO `go_trainer_guides` (`id`, `cat`, `parent_type`, `parent_id`, `title`, `author`, `body`, `created`, `last_edit`) '
|
||||
. ' VALUES (NULL, ?, 1, ?, ?, ?, ?, NOW(), NOW());
|
||||
',
|
||||
array('', $guide, '', \SYSTEM\SECURITY\Security::getUser()->id, $text));
|
||||
return JsonResult::ok();
|
||||
}
|
||||
}
|
||||
public static function call_guides_action_search ($searchstring){
|
||||
$result = lists::generate_guidelist($searchstring);
|
||||
return $result;
|
||||
}
|
||||
public static function call_guides_action_save_profile_picture ($url){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$res = $con->prepare( 'updateProfilePic',
|
||||
'INSERT INTO go_trainer_trainer (system_user_id, profile_picture_url, last_edit) VALUES(?, ?, NOW()) ON DUPLICATE KEY UPDATE profile_picture_url = ?;',
|
||||
array(\SYSTEM\SECURITY\Security::getUser()->id, $url, $url));
|
||||
return JsonResult::ok();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<?php
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/guides','');
|
||||
//SYSTEM\autoload::registerFolder(dirname(__FILE__).'/elements','');
|
||||
16
go_trainer/api/guides/comment.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class comment {
|
||||
public static function new_comment($id){
|
||||
$hasrated = \SQL\GO_TRAINER_GET_HASRATED::Q1(array(\SYSTEM\SECURITY\Security::getUser(), $id));
|
||||
if (\SYSTEM\SECURITY\Security::isLoggedIn() && $hasrated){
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_new_comment.tpl'))->SERVERPATH());
|
||||
}
|
||||
elseif (\SYSTEM\SECURITY\Security::isLoggedIn()) {
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_new_comment_loggedin.tpl'))->SERVERPATH());
|
||||
}
|
||||
else{
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_new_comment_loggedout.tpl'))->SERVERPATH());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
98
go_trainer/api/guides/lists.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
class lists{
|
||||
public static function generate_guidelist($filter){
|
||||
$result = '';
|
||||
if(!$filter){
|
||||
$guides = \SQL\GO_TRAINER_GENERATE_GUIDELIST::QQ();
|
||||
while($guide = $guides->next()){
|
||||
$avg_rating = \SQL\GO_TRAINER_GET_AVERAGE_GUIDE_RATING::Q1(array($guide['id']));
|
||||
if($avg_rating['AVG(rating)'] < 1.5 && $avg_rating['AVG(rating)'] > 0){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_1.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 1.5 && $avg_rating['AVG(rating)'] < 2.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_2.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 2.5 && $avg_rating['AVG(rating)'] < 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_3.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_4.jpg';
|
||||
}
|
||||
else{
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_none.jpg';
|
||||
}
|
||||
$guide['guide_created'] = \SYSTEM\time::time_ago_string(strtotime($guide['created']));
|
||||
$guide['guide_last_edit'] = \SYSTEM\time::time_ago_string(strtotime($guide['last_edit']));
|
||||
$guide['guide_author_arr'] = \SQL\GO_TRAINER_ID_TO_USERNAME::Q1(array($guide['author']));
|
||||
$guide['guide_author'] = $guide['guide_author_arr']['username'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guides/tpl/guide_list_item.tpl'))->SERVERPATH(), $guide);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
else{
|
||||
$searchstring = '%'.$filter.'%';
|
||||
$guides = \SQL\GO_TRAINER_GENERATE_GUIDELIST_SEARCH::QA(array($searchstring, $searchstring));
|
||||
foreach($guides as $guide){
|
||||
$avg_rating = \SQL\GO_TRAINER_GET_AVERAGE_GUIDE_RATING::Q1(array($guide['id']));
|
||||
if($avg_rating['AVG(rating)'] < 1.5 && $avg_rating['AVG(rating)'] > 0){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_1.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 1.5 && $avg_rating['AVG(rating)'] < 2.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_2.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 2.5 && $avg_rating['AVG(rating)'] < 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_3.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_4.jpg';
|
||||
}
|
||||
else{
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_none.jpg';
|
||||
}
|
||||
$guide['guide_created'] = \SYSTEM\time::time_ago_string(strtotime($guide['created']));
|
||||
$guide['guide_last_edit'] = \SYSTEM\time::time_ago_string(strtotime($guide['last_edit']));
|
||||
$guide['guide_author_arr'] = \SQL\GO_TRAINER_ID_TO_USERNAME::Q1(array($guide['author']));
|
||||
$guide['guide_author'] = $guide['guide_author_arr']['username'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guides/tpl/guide_list_item.tpl'))->SERVERPATH(), $guide);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
public static function generate_guidelist_by_author($author){
|
||||
$result = '';
|
||||
$guides = \SQL\GO_TRAINER_GENERATE_GUIDELIST_BY_AUTHOR::QA(array($author));
|
||||
foreach($guides as $guide){
|
||||
$avg_rating = \SQL\GO_TRAINER_GET_AVERAGE_GUIDE_RATING::Q1(array($guide['id']));
|
||||
if($avg_rating['AVG(rating)'] < 1.5 && $avg_rating['AVG(rating)'] > 0){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_1.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 1.5 && $avg_rating['AVG(rating)'] < 2.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_2.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 2.5 && $avg_rating['AVG(rating)'] < 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_3.jpg';
|
||||
}
|
||||
elseif($avg_rating['AVG(rating)'] >= 3.5){
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_4.jpg';
|
||||
}
|
||||
else{
|
||||
$guide['average_rating_img'] = './api.php?call=files&cat=rating&id=rating_none.jpg';
|
||||
}
|
||||
$guide['average_rating'] = $avg_rating['AVG(rating)'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account_panel/tpl/default_account_panel_guides_written_guide.tpl'))->SERVERPATH(), $guide);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
public static function generate_commentlist_by_author($author){
|
||||
$result = '';
|
||||
$comments = \SQL\GO_TRAINER_GENERATE_COMMENTLIST_BY_AUTHOR::QA(array($author));
|
||||
foreach($comments as $comment){
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account_panel/tpl/default_account_panel_comments_written_comment.tpl'))->SERVERPATH(), $comment);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
20
go_trainer/api/guides/rate.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
class rate{
|
||||
public static function rating($guide){
|
||||
$rating = \SQL\GO_TRAINER_GET_GUIDE_RATING::Q1(array($guide));
|
||||
if (!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_rating_loggedout.tpl'))->SERVERPATH(), $rating);
|
||||
}
|
||||
else{
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_rating.tpl'))->SERVERPATH(), $rating);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
\SYSTEM\FILES\files::registerFolder(dirname(__FILE__).'/img/','img','*.*');
|
||||
\SYSTEM\FILES\files::registerFolder(dirname(__FILE__).'/rating/','rating','*.*');
|
||||
BIN
go_trainer/files/img/50px-Sugimori_Hyperball.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
go_trainer/files/img/English_Pokémon_logo.svg.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
go_trainer/files/img/balltweet.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
go_trainer/files/img/construction.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
go_trainer/files/img/guides_start.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
go_trainer/files/img/logo.jpg
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
go_trainer/files/rating/rating_1.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
go_trainer/files/rating/rating_2.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
go_trainer/files/rating/rating_3.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
go_trainer/files/rating/rating_4.jpg
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
go_trainer/files/rating/rating_none.jpg
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
@ -2,6 +2,12 @@
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_start','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_guide','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_guides','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_new_guide','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_signup','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_pokedex','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_account_panel','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_about','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_impressum','');
|
||||
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
.guide_row{
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-bottom: 30px;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
}
|
||||
.menu_account_display{
|
||||
display: block;
|
||||
}
|
||||
.menu_account_display_none{
|
||||
display: none !important;
|
||||
}
|
||||
.account_panel_guide_row{
|
||||
|
||||
}
|
||||
.account_panel_guide_row:hover{
|
||||
background: #dbdbdb;
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
class default_account_panel extends SYSTEM\PAGE\Page {
|
||||
private $trainer = null;
|
||||
public function __construct($trainer){
|
||||
$this->trainer = $trainer;
|
||||
}
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_account_panel/js/default_account_panel.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_account_panel/css/default_account_panel.css'));}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$trainerdata = \SQL\GO_TRAINER_GET_TRAINER::Q1(array($this->trainer));
|
||||
$vars['id'] = $trainerdata['id'];
|
||||
$vars['title'] = $trainerdata['username'];
|
||||
$vars['profile_picture_url'] = $trainerdata['profile_picture_url'];
|
||||
$vars['joindate'] = $trainerdata['joindate'];
|
||||
$vars['guides_written'] = lists::generate_guidelist_by_author(\SYSTEM\SECURITY\Security::getUser()->id);
|
||||
$vars['comments_written'] = lists::generate_commentlist_by_author(\SYSTEM\SECURITY\Security::getUser()->id);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account_panel/tpl/default_account_panel.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
function init_account_panel(){
|
||||
save_profile_picture_url();
|
||||
}
|
||||
function save_profile_picture_url(){
|
||||
$('#btn_save_profile_picture_url').click(function(){
|
||||
var formData = new FormData($('#form_img'));
|
||||
$.ajax({
|
||||
url: './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat=img', //Server script to process data
|
||||
type: 'POST',
|
||||
//Ajax events
|
||||
success: function(){alert('ok');},
|
||||
error: function(){alert('fail');},
|
||||
// Form data
|
||||
data: formData,
|
||||
//Options to tell jQuery not to process data or worry about content-type.
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<div class="row guide_row">
|
||||
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-8">
|
||||
<h1>${title}</h1><p>Mitglied seit: ${joindate}</p>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4">
|
||||
<img id="profile_picture" src="${profile_picture_url}" alt="Du hast kein Profilbild hinterlegt">
|
||||
<p style="padding:0; margin: 0; margin-top: 10px;">URL deines Profilbilds</p>
|
||||
<input id="form_img" cat="img" type="file" />
|
||||
<a id="btn_save_profile_picture_url" cat="img" style="margin-top: 10px;" href="" class="btn btn-primary">speichern</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row guide_row">
|
||||
<div class="row">
|
||||
<h3 data-toggle="collapse" data-target="#written_guides_list" style="cursor: pointer;">Verfasste Beiträge</h3>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row collapse" id="written_guides_list">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="padding-left: 0;">
|
||||
<h4>Titel</h4>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12">
|
||||
<h4>Letzter Eintrag</h4>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12">
|
||||
<h4>Kommentare</h4>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12">
|
||||
<h4>Bewertung</h4>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
${guides_written}
|
||||
</div>
|
||||
<div class="row">
|
||||
<h3 data-toggle="collapse" data-target="#written_comments_list" style="cursor: pointer;">Verfasste Kommentare</h3>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row collapse" id="written_comments_list">
|
||||
${comments_written}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
<div class="row account_panel_guide_row">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
|
||||
${body}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
|
||||
Datum: ${last_edit}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
|
||||
<a class="btn btn-primary" href="#!guide;guide.${parent_id}" target="_blank">Zum Guide <span class="glyphicon glyphicon-arrow-right"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<a href="#!guide;guide.${id}">
|
||||
<div class="row account_panel_guide_row">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<h4>${title}</h4>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
|
||||
${last_edit}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
|
||||
${comments}
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
|
||||
<img src="${average_rating_img}" class="img-responsive">
|
||||
<p>Durchschnitt: ${average_rating}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
3
go_trainer/page/default_account_panel/tpl/text.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
${text}
|
||||
<br>
|
||||
<br>
|
||||
13
go_trainer/page/default_guide/css/default_guide.css
Normal file
@ -0,0 +1,13 @@
|
||||
.guide_row{
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-bottom: 30px;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
}
|
||||
.ratedparent1 .ratedclass1{
|
||||
display: none;
|
||||
}
|
||||
.vote_class{
|
||||
width: 95%;
|
||||
}
|
||||
41
go_trainer/page/default_guide/default_guide.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
class default_guide extends SYSTEM\PAGE\Page {
|
||||
private $guide = null;
|
||||
public function __construct($guide){
|
||||
$this->guide = $guide;
|
||||
}
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_guide/js/default_guide.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_guide/css/default_guide.css'));}
|
||||
public static function comments($guide){
|
||||
$result = '';
|
||||
$comments = \SQL\GO_TRAINER_GENERATE_COMMENTLIST::QA(array($guide));
|
||||
foreach($comments as $row){
|
||||
$comment['body'] = $row['body'];
|
||||
$comment['comment_created'] = \SYSTEM\time::time_ago_string(strtotime($row['created']));
|
||||
$comment['comment_last_edit'] = \SYSTEM\time::time_ago_string(strtotime($row['last_edit']));
|
||||
$comment['comment_author_arr'] = \SQL\GO_TRAINER_ID_TO_USERNAME::Q1(array($row['author']));
|
||||
$comment['comment_author'] = $comment['comment_author_arr']['username'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_comment.tpl'))->SERVERPATH(), $comment);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$guidedata = \SQL\GO_TRAINER_GET_GUIDE::Q1(array($this->guide));
|
||||
$vars['id'] = $guidedata['id'];
|
||||
$vars['title'] = $guidedata['title'];
|
||||
$vars['rating'] = rate::rating($guidedata['id']);
|
||||
$vars['last_edit'] = \SYSTEM\time::time_ago_string(strtotime($guidedata['last_edit']));
|
||||
$vars['text'] = $guidedata['body'];
|
||||
$vars['new_comment'] = comment::new_comment($vars['id']);
|
||||
$vars['commentlist'] = $this->comments($this->guide);
|
||||
$vars['guide_author_arr'] = \SQL\GO_TRAINER_ID_TO_USERNAME::Q1(array($guidedata['author']));
|
||||
$vars['author'] = $vars['guide_author_arr']['username'];
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guide/tpl/default_guide.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
84
go_trainer/page/default_guide/js/default_guide.js
Normal file
@ -0,0 +1,84 @@
|
||||
function init_guide(){
|
||||
rate_click_1();
|
||||
rate_click_2();
|
||||
rate_click_3();
|
||||
rate_click_4();
|
||||
new_comment_click();
|
||||
}
|
||||
|
||||
function rate_click_1(){
|
||||
$('#vote_class_1').click(function(){
|
||||
var rating = 1;
|
||||
var guide = $('#guide_tag').attr('guide');
|
||||
$.getJSON('./api.php?call=guides&action=rate&rating=' + rating + '&guide=' + guide, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function rate_click_2(){
|
||||
$('#vote_class_2').click(function(){
|
||||
var rating = 2;
|
||||
var guide = $('#guide_tag').attr('guide');
|
||||
$.getJSON('./api.php?call=guides&action=rate&rating=' + rating + '&guide=' + guide, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function rate_click_3(){
|
||||
$('#vote_class_3').click(function(){
|
||||
var rating = 3;
|
||||
var guide = $('#guide_tag').attr('guide');
|
||||
$.getJSON('./api.php?call=guides&action=rate&rating=' + rating + '&guide=' + guide, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function rate_click_4(){
|
||||
$('#vote_class_4').click(function(){
|
||||
var rating = 4;
|
||||
var guide = $('#guide_tag').attr('guide');
|
||||
$.getJSON('./api.php?call=guides&action=rate&rating=' + rating + '&guide=' + guide, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function new_comment_click(){
|
||||
$('#new_comment_send').click(function(){
|
||||
var text = $('#new_comment_textarea').val();
|
||||
var guide = $('#guide_tag').attr('guide');
|
||||
alert(text);
|
||||
$.getJSON('./api.php?call=guides&action=comment&text=' + text + '&guide=' + guide, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
14
go_trainer/page/default_guide/tpl/default_comment.tpl
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="row" style="padding-left: 15%;">
|
||||
<div class="row">
|
||||
${body}
|
||||
</div>
|
||||
<div class="row" style="margin-top: 7px;">
|
||||
<p style="font-style: italic; font-size: 0.8em; float: left;">${comment_author}</p>
|
||||
<p style="font-style: italic; font-size: 0.8em; float: right; padding-right: 5%;">${comment_created}</p>
|
||||
</div>
|
||||
<hr style="margin-top: 0;">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
22
go_trainer/page/default_guide/tpl/default_guide.tpl
Normal file
@ -0,0 +1,22 @@
|
||||
<div id="guide_tag" style="opacity: 0;" guide="${id}"></div>
|
||||
<div class="row guide_row">
|
||||
<h1>${title}</h1>
|
||||
<p style="font-style: italic">by ${author}, seit dem letzten Eintrag sind ${last_edit}</p>
|
||||
</div>
|
||||
<div class="row guide_row">
|
||||
${text}
|
||||
</div>
|
||||
<div class="row guide_row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
${rating}
|
||||
<hr>
|
||||
<h4>Beitrag kommentieren</h4>
|
||||
${new_comment}
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<h3>Kommentare</h3>
|
||||
<hr>
|
||||
${commentlist}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
<div class="row">
|
||||
<p>Um einen Kommentar zu schreiben musst du eingeloggt sein und den Beitrag bereits geratet haben.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<textarea id="new_comment_textarea" maxlength="2048" style="width: 100%"></textarea>
|
||||
</div>
|
||||
<div class="row" style="padding-top: 10px;">
|
||||
<a id="new_comment_send_button" class="btn btn-primary">abschicken</a>
|
||||
</div>
|
||||
@ -0,0 +1,3 @@
|
||||
<div class="row">
|
||||
<p>Um einen Kommentar zu schreiben musst du eingeloggt sein und den Beitrag bereits bewertet haben.</p>
|
||||
</div>
|
||||
35
go_trainer/page/default_guide/tpl/default_rating.tpl
Normal file
@ -0,0 +1,35 @@
|
||||
<div class="row" style="margin:0;">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_1}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_2}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_3}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_4}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div title="Veraltet, falsch, unlogisch, schlecht geschrieben. Ein Alptraum!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_1.jpg">
|
||||
<a id="vote_class_1" rating="1" class="vote_class btn btn-danger"><span class="glyphicon glyphicon-thumbs-up"></span></a>
|
||||
</div>
|
||||
<div title="It's something! Jemand hat sich hingesetzt und in halbwegs klarem Deutsch einen Beitrag geleistet. Weiter so!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_2.jpg">
|
||||
<a id="vote_class_2" rating="2" class="vote_class btn btn-danger"><span class="glyphicon glyphicon-thumbs-up"></span></a>
|
||||
</div>
|
||||
<div title="Da kennt sich jemand aus! Von diesem Guide kann und sollte man sich eine Scheibe abschneiden." class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_3.jpg">
|
||||
<a id="vote_class_3" rating="3" class="vote_class btn btn-danger"><span class="glyphicon glyphicon-thumbs-up"></span></a>
|
||||
</div>
|
||||
<div title="META verdächtig - Diesen Guide sollte man auf dem Weg zum Pokemon Meister auf jeden Fall gelesen haben!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_4.jpg">
|
||||
<a id="vote_class_4" rating="4" class="vote_class btn btn-danger"><span class="glyphicon glyphicon-thumbs-up"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,34 @@
|
||||
<div class="row" style="margin: 0;">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_1}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_2}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_3}
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
${class_4}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div title="Veraltet, falsch, unlogisch, schlecht geschrieben. Ein Alptraum!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_1.jpg">
|
||||
</div>
|
||||
<div title="It's something! Jemand hat sich hingesetzt und in halbwegs klarem Deutsch einen Beitrag geleistet. Weiter so!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_2.jpg">
|
||||
</div>
|
||||
<div title="Da kennt sich jemand aus! Von diesem Guide kann und sollte man sich eine Scheibe abschneiden." class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_3.jpg">
|
||||
</div>
|
||||
<div title="META verdächtig - Diesen Guide sollte man auf dem Weg zum Pokemon Meister auf jeden Fall gelesen haben!" class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<img class="img-responsive" src="./api.php?call=files&cat=rating&id=rating_4.jpg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p>Um eine Bewertung abzugeben, musst du eingeloggt sein!</p>
|
||||
</div>
|
||||
</div>
|
||||
3
go_trainer/page/default_guide/tpl/text.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
${text}
|
||||
<br>
|
||||
<br>
|
||||
@ -1,5 +1,30 @@
|
||||
#start_main{
|
||||
width: 100%;
|
||||
.guide_head_row{
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-bottom: 30px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
}
|
||||
.guide_row{
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-bottom: 30px;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
}
|
||||
.list_item{
|
||||
margin: 20px 0 20px 0;
|
||||
}
|
||||
.list_item p{
|
||||
|
||||
}
|
||||
.black_side{
|
||||
background: #333333;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
.black_side p{
|
||||
background: #333333;
|
||||
padding: 10px;
|
||||
color: white;
|
||||
}
|
||||
@ -1,12 +1,14 @@
|
||||
<?php
|
||||
class default_start extends SYSTEM\PAGE\Page {
|
||||
class default_guides extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_start/js/default_start.js'));}
|
||||
return array( new PPAGE('default_guides/js/default_guides.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_start/css/default_start.css'));}
|
||||
return array( new PPAGE('default_guides/css/default_guides.css'));}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['guidelist'] = lists::generate_guidelist('');
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_start/tpl/default_start.tpl'))->SERVERPATH(), $vars);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('time'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_guides/tpl/default_guides.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,10 @@
|
||||
function init_start(){
|
||||
|
||||
function init_guides(){
|
||||
search();
|
||||
}
|
||||
function search(){
|
||||
$('#search_btn').click(function(){
|
||||
var searchstring = $('#search_input').val();
|
||||
$('#guideslist_frame').load('./api.php?call=guides&action=search&searchstring=' + searchstring, function(data) {
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -1,3 +1,69 @@
|
||||
<div id="start_main">
|
||||
${start_content}
|
||||
|
||||
<div class="row guide_row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<div class="row guide_head_row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<a href="#!new_guide">
|
||||
<img src="./api.php?call=files&cat=img&id=guides_start.jpg" class="img-responsive">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<h2>
|
||||
Guides
|
||||
</h2>
|
||||
Hier findest du Guides und Hilfe aus der Community zu Pokemon, Spielweisen, Tipps & Tricks!
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<a href="#!new_guide">
|
||||
<img src="./api.php?call=files&cat=img&id=balltweet.jpg" class="img-responsive">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<h2>
|
||||
Contribute
|
||||
</h2>
|
||||
<a href="#!new_guide">Erstelle einen guide für die Community!</a>
|
||||
<p>Du musst dich <a href="">einloggen</a> um einen Beitrag erstellen zu können.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row guide_row">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<div class="input-group">
|
||||
|
||||
<input id="search_input" type="text" class="form-control" placeholder="Guide suchen...">
|
||||
<span class="input-group-btn" style="height: 100%;">
|
||||
<button id="search_btn" class="btn btn-default" type="button"><span style=" font-size: 20px;" class="glyphicon glyphicon-search"></span></button>
|
||||
</span>
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<button class="btn btn-primary">featured Guides</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row guide_row">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding: 0;">
|
||||
<div class="col-lg-6 col-md-6 col-sm-5 col-xs-12">
|
||||
<h4>Titel</h4>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4>Info</h4>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-12">
|
||||
<h4>Bewertung</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="margin-top: 3px;">
|
||||
<div id="guideslist_frame" class="row">
|
||||
${guidelist}
|
||||
</div>
|
||||
</div>
|
||||
16
go_trainer/page/default_guides/tpl/guide_list_item.tpl
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="row list_item">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<a href="#!guide;guide.${id}" target="_blank" title="${title} öffnen">
|
||||
<div class="col-lg-6 col-md-6 col-sm-5 col-xs-12" style="border: #333333 solid 1px; height: 73px;">
|
||||
<p style="text-decoration: none; color: #333333; font-size: 1.8em;"><strong>${title}</strong></p>
|
||||
</div>
|
||||
</a>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 black_side">
|
||||
<p style="margin: 0">geschrieben von ${guide_author}</p>
|
||||
<p style="margin: 0"><font style="font-size: 0.7em; font-style: italic;">${guide_last_edit}seit dem letzen edit am ${last_edit}</font></p>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-12">
|
||||
<img style="max-height: 73px;" class="img-responsive" src="${average_rating_img}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,5 +1,13 @@
|
||||
#start_main{
|
||||
width: 100%;
|
||||
.new_guide_row{
|
||||
background: white;
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
padding: 40px;
|
||||
}
|
||||
.new_guide_title{
|
||||
background: white;
|
||||
|
||||
}
|
||||
.new_guide_body{
|
||||
background: white;
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
class default_start extends SYSTEM\PAGE\Page {
|
||||
class default_new_guide extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_start/js/default_start.js'));}
|
||||
return array( new PPAGE('default_new_guide/js/default_new_guide.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_start/css/default_start.css'));}
|
||||
return array( new PPAGE('default_new_guide/css/default_new_guide.css'));}
|
||||
public function html(){
|
||||
if (!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_start/tpl/default_start.tpl'))->SERVERPATH(), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_new_guide/tpl/default_new_guide.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,101 @@
|
||||
function init_start(){
|
||||
|
||||
function init_new_guide(){
|
||||
init_tinymce();
|
||||
$('#btn_save').click(function(){
|
||||
var title = $('#title_text').val();
|
||||
var cat = $('#cat_text').val();
|
||||
var text = encodeURIComponent(tinymce.activeEditor.getContent({format : 'raw'}));
|
||||
if (title == "" || cat == "" || text == ""){
|
||||
alert('data missing');
|
||||
return;
|
||||
}
|
||||
$.getJSON('./api.php?call=guides&action=new&title=' + title + '&cat=' + cat + '&text=' + text, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function init_tinymce(){
|
||||
tinymce.remove();
|
||||
tinymce.init({ // General options
|
||||
/*
|
||||
formats : {
|
||||
italic : {inline : 'span', 'classes' : 'italic'}},
|
||||
// Theme options
|
||||
theme_modern_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
|
||||
theme_modern_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||
theme_modern_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
||||
theme_modern_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
|
||||
theme_modern_toolbar_location : "top",
|
||||
theme_modern_toolbar_align : "left",
|
||||
theme_modern_statusbar_location : "bottom",
|
||||
theme_modern_resizing : true,
|
||||
|
||||
// Example content CSS (should be your site CSS)
|
||||
content_css : "../../page/index.css"*/
|
||||
// General options
|
||||
/* mode : "textareas",
|
||||
|
||||
plugins : "autolink,lists,pagebreak,layer,table,save,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template,code",*/
|
||||
//xhtmlxtras,emotions,advimage,advlink,iespell,inlinepopups,advhr,style,spellchecker,
|
||||
|
||||
// Theme options
|
||||
/*theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
|
||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,*/
|
||||
|
||||
// Skin options
|
||||
//skin : "o2k7",
|
||||
//skin_variant : "silver",
|
||||
width: "99%",
|
||||
height: "250px",
|
||||
|
||||
// Example content CSS (should be your site CSS)
|
||||
//content_css : "css/example.css",
|
||||
//content_css : "../../page/index.css"
|
||||
|
||||
// Drop lists for link/image/media/template dialogs
|
||||
/*template_external_list_url : "js/template_list.js",
|
||||
external_link_list_url : "js/link_list.js",
|
||||
external_image_list_url : "js/image_list.js",
|
||||
media_external_list_url : "js/media_list.js",
|
||||
|
||||
// Replace values for the template plugin
|
||||
template_replace_values : {
|
||||
username : "Some User",
|
||||
staffid : "991234"
|
||||
}*/
|
||||
//extended_valid_elements: "iframe[title|class|type|width|height|src|frameborder|allowFullScreen]",
|
||||
//extended_valid_elements: "iframe[class|src|frameborder=0|alt|title|width|height|align|name]",
|
||||
//extended_valid_elements: "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]",
|
||||
selector: "textarea",
|
||||
theme: "modern",
|
||||
//theme : "advanced",
|
||||
plugins: [
|
||||
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
|
||||
"searchreplace wordcount visualblocks visualchars code fullscreen",
|
||||
"insertdatetime nonbreaking save table contextmenu directionality",//media
|
||||
"emoticons template paste textcolor"
|
||||
],
|
||||
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
|
||||
toolbar2: "print preview | forecolor backcolor emoticons",//media
|
||||
image_advtab: true,
|
||||
templates: [
|
||||
{title: 'Test template 1', content: 'Test 1'},
|
||||
{title: 'Test template 2', content: 'Test 2'}
|
||||
],
|
||||
//remove p tag
|
||||
forced_root_block : "",
|
||||
force_br_newlines : true,
|
||||
force_p_newlines : false
|
||||
});
|
||||
}
|
||||
@ -1,3 +1,48 @@
|
||||
<div id="start_main">
|
||||
${start_content}
|
||||
<div class="row new_guide_row">
|
||||
<div class="row new_guide_title">
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12" style="padding: 0;">
|
||||
<img src="./api.php?call=files&cat=img&id=balltweet.jpg" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-10 col-md-10 col-sm-9 col-xs-8" style="padding: 0;">
|
||||
<h2>
|
||||
Erstelle einen Guide
|
||||
</h2>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row new_guide_body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default">Titel</button>
|
||||
</div><!-- /btn-group -->
|
||||
<input id="title_text" style="width: 100%;" type="text" class="form-control" aria-label="...">
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Tags</button>
|
||||
</div><!-- /btn-group -->
|
||||
<input id="cat_text" style="width: 100%;" type="text" class="form-control" aria-label="...">
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<textarea id="body_text" style="width: 100%"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<button id="btn_save" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -18,10 +18,9 @@ body {
|
||||
|
||||
#menu {
|
||||
width: 100%;
|
||||
background: #cc3333;
|
||||
}
|
||||
|
||||
#menu_content {
|
||||
#nav {
|
||||
font-family: Arial;
|
||||
font-size: 16pt;
|
||||
width: 90%;
|
||||
@ -31,28 +30,24 @@ body {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#menu_content a:visited{
|
||||
#nav a:visited{
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#menu_content a:hover{
|
||||
#nav a:hover{
|
||||
text-decoration: none;
|
||||
text-shadow: 1px 0px white;
|
||||
}
|
||||
|
||||
#menu_content a:link{
|
||||
#nav a:link{
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#content {
|
||||
background: white;
|
||||
width: 55%;
|
||||
padding: 25px;
|
||||
margin: auto;
|
||||
color: #666666;
|
||||
box-shadow: 0 0px 0px 0px white, 0 0px 0px 0px white, 5px 0 5px -4px rgba(102, 102, 102, 0.8), -5px 0 5px -5px rgba(102, 102, 102, 0.8);
|
||||
}
|
||||
|
||||
#footer {
|
||||
@ -76,3 +71,7 @@ body {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.row{
|
||||
margin: 0;
|
||||
}
|
||||
@ -3,22 +3,45 @@ class default_page extends \SYSTEM\PAGE\Page {
|
||||
private static function js(){
|
||||
return \SYSTEM\HTML\html::script(\LIB\lib_jquery::js()->WEBPATH()).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_bootstrap::js()->WEBPATH()).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_jqbootstrapvalidation::js()->WEBPATH()).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_system::js()->WEBPATH()).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_tinymce::js()->WEBPATH(false)).
|
||||
\SYSTEM\HTML\html::script((new PPAGE('default_page/js/default_page.js'))->WEBPATH());
|
||||
}
|
||||
|
||||
private static function css(){
|
||||
return \SYSTEM\HTML\html::link(\LIB\lib_bootstrap::css()->WEBPATH()).
|
||||
return \SYSTEM\HTML\html::link(\LIB\lib_bootstrap::css()->WEBPATH(false)).
|
||||
\SYSTEM\HTML\html::link((new PPAGE('default_page/css/default_page.css'))->WEBPATH());
|
||||
}
|
||||
public function getloggedinform(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_page/tpl/login/loggedinform.tpl'))->SERVERPATH(), array());}
|
||||
|
||||
public function exchange_registerform(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_page/tpl/login/register_form.tpl'))->SERVERPATH(), array());}
|
||||
|
||||
public function getloginform(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_page/tpl/login/loginform.tpl'))->SERVERPATH(), array());}
|
||||
|
||||
public function exchange_loginform(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_page/tpl/login/loggedinformtop.tpl'))->SERVERPATH(), array());}
|
||||
public function html($_escaped_fragment_ = null){
|
||||
$vars = array();
|
||||
if (\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
$vars['menu_account_display_class'] = 'style="display: block"';
|
||||
$vars['registerform'] = $this->getloggedinform();
|
||||
$vars['loginform'] = $this->exchange_loginform();
|
||||
}
|
||||
else {
|
||||
$vars['menu_account_display_class'] = 'style="display: none"';
|
||||
$vars['registerform'] = $this->exchange_registerform();
|
||||
$vars['loginform'] = $this->getloginform() ;
|
||||
}
|
||||
$vars['js'] = '';
|
||||
if(!$_escaped_fragment_){
|
||||
$vars['js'] = self::js();}
|
||||
$vars['css'] = self::css();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('basic'));
|
||||
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_page/tpl/default_page.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,38 @@
|
||||
$(document).ready(function() {
|
||||
new SYSTEM('./api.php',1,'start');
|
||||
new SYSTEM('./api.php',1,'start');
|
||||
register_login();
|
||||
register_logout();
|
||||
});
|
||||
|
||||
|
||||
|
||||
function register_login(){
|
||||
$("#form_login input").not("[type=submit]").jqBootstrapValidation({
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get('./api.php?call=account&action=login&username=' + $('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
|
||||
if(data == 1){
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
function register_logout(){
|
||||
$('#btn_logout').click(function(){
|
||||
$.get('./api.php?call=account&action=logout', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
})
|
||||
}
|
||||
function encode_utf8(c) {
|
||||
return unescape(encodeURIComponent(c));
|
||||
}
|
||||
|
||||
function decode_utf8(c) {
|
||||
return decodeURIComponent(escape(c));
|
||||
}
|
||||
@ -10,7 +10,7 @@
|
||||
${js}
|
||||
<link rel="shortcut icon" href="./api.php?call=files&cat=img&id=favicon.png" type="image/x-icon" />
|
||||
</head>
|
||||
<body style="background: #cccccc; padding-top: 10px;">
|
||||
<body style="background: #cccccc;">
|
||||
<div class="modal fade" id="modal_text" style="" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@ -21,13 +21,32 @@
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<div id="menu">
|
||||
<div id="menu_content">
|
||||
<a href="#!start">${menu_start}</a>
|
||||
<a href="#!about">${menu_about}</a>
|
||||
<nav class="navbar navbar-default" style="background-color: #333333; max-width: 1200px; margin: auto;">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#" style="padding: 5px; width: 100%">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar_col" aria-expanded="false" style="float: right;">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<img alt="Brand" src="./api.php?call=files&cat=img&id=50px-Sugimori_Hyperball.png" class="img-responsive" style="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="navbar_col">
|
||||
<ul class="nav navbar-nav" style="width: 95%;">
|
||||
<li><a style="color: white;" href="#!start">Start<span class="sr-only">(current)</span></a></li>
|
||||
<li><a style="color: white;" href="#!guides">Guides</a></li>
|
||||
<li><a style="color: white;" href="#!pokedex">Pokedex</a></li>
|
||||
<li id="menu_acount" ${menu_account_display_class}><a style="color: white;" href="#!account_panel">Account</a></li>
|
||||
<li style="float: right; width: 50%;">${loginform}</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content"></div>
|
||||
</nav>
|
||||
<div id="content" style="background: none;"></div>
|
||||
<div id="footer">
|
||||
<a href="#!impressum" id="impressum">${menu_imprint}</a>
|
||||
</div>
|
||||
|
||||
66
go_trainer/page/default_page/tpl/login/loggedinform.tpl
Normal file
@ -0,0 +1,66 @@
|
||||
<div>
|
||||
|
||||
<form class="form-horizontal">
|
||||
|
||||
uVote kann die Repräsentativität der Daten
|
||||
<br>
|
||||
nur durch die freiwillige Angabe von
|
||||
<br>
|
||||
persöhnlichen Daten gewährleisten.
|
||||
<br>
|
||||
Zum Umgang mit diesen Daten lesen sie bitte
|
||||
<br>
|
||||
unsere AGBs.
|
||||
<br>
|
||||
<div class="row" id="row_loggedinform" style="padding-bottom: 20px;">
|
||||
<div class="span">
|
||||
<li class="dropdown">
|
||||
<a href="#" role="button" class="btn" data-toggle="dropdown">Alter <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" style="width: 20px;" aria-labelledby="drop1" >
|
||||
<li role="presentation"><a href="" >(<18) Jahre</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="">(18-25) Jahre</a></li>
|
||||
<li role="presentation"><a href="">(26-35) Jahre</a></li>
|
||||
<li role="presentation"><a href="">(35-45) Jahre</a></li>
|
||||
<li role="presentation"><a href="">(46-55) Jahre</a></li>
|
||||
<li role="presentation"><a href="">(56-65) Jahre</a></li>
|
||||
<li role="presentation"><a href="">(66-75) Jahre</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="">(>75) Jahre</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" role="button" class="btn" data-toggle="dropdown">Beruf/Ausbildung <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" style="width: 20px;" aria-labelledby="drop1" >
|
||||
<li role="presentation"><a href="" >Schüler</a></li>
|
||||
<li role="presentation"><a href="">Azubi</a></li>
|
||||
<li role="presentation"><a href="">Student</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="">Angestellt</a></li>
|
||||
<li role="presentation"><a href="">Selbstständig</a></li>
|
||||
<li role="presentation"><a href="">Rentner</a></li>
|
||||
<li role="presentation"><a href="">Arbeitslos</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="">Sonstiges</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" role="button" class="btn" data-toggle="dropdown">Geschlecht <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" style="width: 20px;" aria-labelledby="drop1" >
|
||||
<li role="presentation"><a href="" >männlich</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation"><a href="">weiblich</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<div class="span">
|
||||
<button type="submit" align="right" class="btn" id="btn_loggedinform">Daten absenden</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
<a id="btn_logout" style="float: right; color:white; cursor: pointer;"> Logout</a>
|
||||
|
||||
31
go_trainer/page/default_page/tpl/login/loginform.tpl
Normal file
@ -0,0 +1,31 @@
|
||||
<form class="" id="form_login" style="padding-top: 10px;">
|
||||
<div class="form-group">
|
||||
<div id="help-block"></div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 xs-12" style="text-align: left;">
|
||||
<input type="text"
|
||||
style=""
|
||||
id="bt_login_user"
|
||||
placeholder="${user_name_login}"
|
||||
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
|
||||
maxlength="16" data-validation-maxlength-message="${register_user_name_too_long}"
|
||||
required data-validation-required-message="${register_user_name_required}"/>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 xs-12">
|
||||
<input type="password"
|
||||
style=""
|
||||
id="bt_login_password"
|
||||
placeholder="${user_password_login}"
|
||||
minlength="5" data-validation-minlength-message="${register_password_too_short}"
|
||||
maxlength="16" data-validation-maxlength-message="${register_user_password_too_long}"
|
||||
required data-validation-required-message="${register_user_password_required}"/>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 xs-12">
|
||||
<button class="btn btn-sm btn-primary" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in"></span> ${basic_login}</button>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-12 xs-12">
|
||||
<a href="#!signup" class="btn btn-sm btn-primary" type="submit" id="login_register"><span class="glyphicon glyphicon-edit"></span> Signup</a>
|
||||
</div>
|
||||
</div> </div>
|
||||
</form>
|
||||
|
||||
48
go_trainer/page/default_page/tpl/login/register_form.tpl
Normal file
@ -0,0 +1,48 @@
|
||||
<div>
|
||||
<a class="btn" id="btn_register_form" align="left"></a>
|
||||
|
||||
<div class="control-group" id="control-group_register_form">
|
||||
<div class="controls">
|
||||
<input type="text"
|
||||
size="30"
|
||||
id="bt_login_user"
|
||||
placeholder="${loginUsername}"
|
||||
data-validation-email-message="${check_mail_format}"
|
||||
required data-validation-required-message="${email_required}"/>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<input type="password"
|
||||
name="login_password"
|
||||
size="30"
|
||||
id="bt_login_password"
|
||||
placeholder="${loginPassword}"
|
||||
minlength="5" data-validation-minlength-message="${login_password_too_short}"
|
||||
required data-validation-required-message="${login_password_required}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="control-group_register_form2">
|
||||
<div class="controls">
|
||||
<input type="password"
|
||||
size="30"
|
||||
id="bt_login_password2"
|
||||
placeholder="${loginPassword}"
|
||||
data-validation-matches-match="login_password"
|
||||
data-validation-matches-message="${register_password_dont_math}"/>
|
||||
|
||||
</div>
|
||||
<label><input type="checkbox" id="remember_me"> ${login_rememberMe}</label>
|
||||
<div class="help-block"></div>
|
||||
<div id="help-block-user-password-combi-wrong">${login_not_successfull}</div>
|
||||
|
||||
<button class="btn btn-primary" id="btn-primary_register_form" type="submit" id="login_submit">${login}</button>
|
||||
<input type="hidden" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
#start_main{
|
||||
width: 100%;
|
||||
background: white;
|
||||
}
|
||||
|
||||
6
go_trainer/page/default_pokedex/css/default_pokedex.css
Normal file
@ -0,0 +1,6 @@
|
||||
.pokedex_row{
|
||||
max-width: 1200px;
|
||||
background: white;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
class default_start extends SYSTEM\PAGE\Page {
|
||||
class default_pokedex extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_start/js/default_start.js'));}
|
||||
return array( new PPAGE('default_pokedex/js/default_pokedex.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_start/css/default_start.css'));}
|
||||
return array( new PPAGE('default_pokedex/css/default_pokedex.css'));}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_start/tpl/default_start.tpl'))->SERVERPATH(), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_pokedex/tpl/default_pokedex.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
function init_start(){
|
||||
function init_pokedex(){
|
||||
|
||||
}
|
||||
@ -1,3 +1,15 @@
|
||||
<div id="start_main">
|
||||
${start_content}
|
||||
<div id="pokedex_main" class="row pokedex_row">
|
||||
|
||||
<div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
|
||||
<h1>
|
||||
Under construction!
|
||||
</h1>
|
||||
<p>
|
||||
Hier entsteht in Kürze der Pokédex! Seid gespannt auf die Eigenschaften, Stats und Fähigkeiten eurer Pokémon!
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" style="padding-left: 50px;">
|
||||
<img src="./api.php?call=files&cat=img&id=construction.png" class="img-responsive">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
13
go_trainer/page/default_signup/css/default_signup.css
Normal file
@ -0,0 +1,13 @@
|
||||
.register_body{
|
||||
background: white;
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
padding: 40px;
|
||||
}
|
||||
.new_guide_title{
|
||||
background: white;
|
||||
|
||||
}
|
||||
.new_guide_body{
|
||||
background: white;
|
||||
}
|
||||
12
go_trainer/page/default_signup/default_signup.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class default_signup extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_signup/js/default_signup.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_signup/css/default_signup.css'));}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_signup/tpl/default_signup.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
}
|
||||
21
go_trainer/page/default_signup/js/default_signup.js
Normal file
@ -0,0 +1,21 @@
|
||||
function init_signup(){
|
||||
register_registerform();
|
||||
}
|
||||
function register_registerform(){
|
||||
//console.log("wegwegwegwegwegweg");
|
||||
$("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
|
||||
{
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) {
|
||||
if(data == 1){
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
91
go_trainer/page/default_signup/tpl/default_signup.tpl
Normal file
@ -0,0 +1,91 @@
|
||||
<div class="row register_body">
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-12">
|
||||
<img src="./api.php?call=files&cat=img&id=balltweet.jpg" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-10 col-md-10 col-sm-9 col-xs-8">
|
||||
<h2>
|
||||
Signup
|
||||
</h2>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div class="col-lg-4 col-md-4 col-sm-10 col-xs-11" style="margin: 0; padding: 0;">
|
||||
<form class="textbox" id="register_user_form">
|
||||
<div class="control-group" id="register_username_control_group">
|
||||
<div class="row" id="userRegisterTable" style="margin: 0; padding: 0;">
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
${basic_username}
|
||||
</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div class="control-group controls">
|
||||
<input type="text"
|
||||
style="margin-bottom: 15px; float: left;"
|
||||
id="register_username"
|
||||
placeholder="${basic_placeholder_username}"
|
||||
minlength="3" data-validation-minlength-message="${basic_username_short}"
|
||||
required data-validation-required-message="${basic_username_miss}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-username" class="help-block" style="float: left; margin-top: 3px;"></div>
|
||||
|
||||
</div></div>
|
||||
<div class="row" style="margin: 0; padding: 0;">E-Mail</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div class="control-group controls">
|
||||
<input type="email"
|
||||
style="margin-bottom: 15px; float: left;"
|
||||
id="register_email"
|
||||
placeholder="${basic_placeholder_email}"
|
||||
data-validation-email-message="${basic_email_wrong}"
|
||||
required data-validation-required-message="${basic_email_miss}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-email" class="help-block" style="float: left; margin-top: 3px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">${basic_password}</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div class="control-group" id="change_user_password">
|
||||
<div class="control-group controls" style="clear: both">
|
||||
<input type="password"
|
||||
style="margin-bottom: 15px; float: left;"
|
||||
id="user_register_password1"
|
||||
name="user_register_password1"
|
||||
placeholder="${basic_placeholder_password}"
|
||||
minlength="5" data-validation-minlength-message="${basic_password_short}"
|
||||
required data-validation-required-message="${basic_password_miss}"/>
|
||||
<br/>
|
||||
<div class="help-block" style="float: left; margin-top: 3px;"></div>
|
||||
</div></div></div>
|
||||
<div class="row" style="margin: 0; padding: 0;">Passwort wiederholen</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div class="control-group controls" style="clear: both">
|
||||
<input type="password"
|
||||
style="margin-bottom: 15px; float: left;"
|
||||
id="user_register_password2"
|
||||
name="user_register_password2"
|
||||
placeholder="${basic_placeholder_password}"
|
||||
data-validation-matches-match="user_register_password1"
|
||||
data-validation-matches-message="${basic_password_match}"/>
|
||||
<br/>
|
||||
<div class="help-block" style="float: left; margin-top: 3px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">${basic_locale}</div>
|
||||
<div class="row" style="margin: 0; padding: 0;">
|
||||
<div id="change_user_locale">
|
||||
<select size="1" id="register_locale_select">
|
||||
<option value="deDE">deDE</option>
|
||||
<option value="enUS">enUS</option>
|
||||
</select>
|
||||
</div>
|
||||
</div></div>
|
||||
<br>
|
||||
<button class="btn btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${basic_register}</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
3
go_trainer/page/default_signup/tpl/text.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
${text}
|
||||
<br>
|
||||
<br>
|
||||
@ -1,5 +1,32 @@
|
||||
#start_main{
|
||||
width: 100%;
|
||||
.start_row{
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-bottom: 30px;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.start_row_1{
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: visibility 0s, opacity 0.3s linear;
|
||||
}
|
||||
.start_row_2{
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: visibility 0s, opacity 0.6s linear;
|
||||
}
|
||||
.start_row_3{
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: visibility 0s, opacity 0.9s linear;
|
||||
}
|
||||
.start_row_4{
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: visibility 0s, opacity 1.2s linear;
|
||||
}
|
||||
.start_row_switch {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
class default_start extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_start/js/default_start.js'));}
|
||||
public static function css(){
|
||||
return array( new PPAGE('default_start/css/default_start.css'));}
|
||||
public static function js(){
|
||||
return array( new PPAGE('default_start/js/default_start.js'));}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
|
||||
@ -1,3 +1,13 @@
|
||||
function init_start(){
|
||||
|
||||
smoothload();
|
||||
}
|
||||
|
||||
function smoothload(){
|
||||
setTimeout(function () {
|
||||
|
||||
}, 5000);
|
||||
$(".start_row_1").addClass("start_row_switch");
|
||||
$(".start_row_2").addClass("start_row_switch");
|
||||
$(".start_row_3").addClass("start_row_switch");
|
||||
$(".start_row_4").addClass("start_row_switch");
|
||||
}
|
||||
@ -1,3 +1,62 @@
|
||||
<div id="start_main">
|
||||
${start_content}
|
||||
<div id="start_main" class="row start_row start_row_1">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<img src="./api.php?call=files&cat=img&id=logo.jpg" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
|
||||
<h1>
|
||||
Willkommen auf go-trainer.de!
|
||||
</h1>
|
||||
<p>
|
||||
Die deutsche Pokemon-Go Trainer Community - Hier erfährst du alles rund um das Game, kannst dich mit anderen Trainern austauschen und Pokemon handeln.
|
||||
</p>
|
||||
<p>
|
||||
Werde Teil der größten Videospielrevolution seit World of Warcraft!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row start_row start_row_2">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<a href="#!guides">
|
||||
<img src="./api.php?call=files&cat=img&id=guides_start.jpg" class="img-responsive">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
|
||||
<h1>
|
||||
Trainer Guides
|
||||
</h1>
|
||||
<p>
|
||||
Guides und Hilfe rund um Pokemon, Trainerskills, und alles was ihr wissen müsst! Tauscht euch über Strategien und Taktik aus und findet euren weg zum Pokemonmeister!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row start_row start_row_3">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<div class="embed-responsive embed-responsive-16by9">
|
||||
<iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/2sj2iQyBTQs" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
|
||||
<h1>
|
||||
Game Trailer
|
||||
</h1>
|
||||
<p>
|
||||
Hier kannst du dir den offiziellen Game Trailer von der Nintendo/ Niantic/ Pokemon-Company Pressekonferenz ansehen!
|
||||
</p>
|
||||
<p>
|
||||
Ob das Spiel wirklich so "real" werden wird darf bezweifelt werden. Trotzdem wird dieses Spiel das Zeitalter eines gar nicht so neuen Spielgenres bringen: Geogaming ist angesagt!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row start_row start_row_4">
|
||||
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
||||
<img src="./api.php?call=files&cat=img&id=balltweet.jpg" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-8 col-md-8 col-sm-6 col-xs-12">
|
||||
<h1>
|
||||
Social Media
|
||||
</h1>
|
||||
<p>
|
||||
Folgt uns auf twitter <a href="#">@go-trainer</a> um alle news in der Community zu bekommen. #go-trainer!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -10,7 +10,21 @@ class page_go_trainer extends \SYSTEM\API\api_default {
|
||||
|
||||
public static function page_start(){
|
||||
return (new default_start())->html();}
|
||||
|
||||
public static function page_guides (){
|
||||
return (new default_guides())->html();}
|
||||
public static function page_guide ($guide){
|
||||
return (new default_guide($guide))->html();}
|
||||
public static function page_new_guide (){
|
||||
return (new default_new_guide())->html();}
|
||||
public static function page_pokedex(){
|
||||
return (new default_pokedex())->html();}
|
||||
public static function page_account_panel(){
|
||||
if (!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return;
|
||||
}
|
||||
return (new default_account_panel(\SYSTEM\SECURITY\Security::getUser()->id))->html();}
|
||||
public static function page_signup(){
|
||||
return (new default_signup())->html();}
|
||||
public static function page_about(){
|
||||
return (new default_about())->html();}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
|
||||
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','SQL');
|
||||
\SYSTEM\SQL\setup::register('SQL\\DATA_DEMO_BASIC');
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GENERATE_COMMENTLIST.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_COMMENTLIST extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE parent_type = 1 and parent_id = ?;'
|
||||
;}}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_COMMENTLIST_BY_AUTHOR extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE author = ? & parent_type = 1;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GENERATE_GUIDELIST.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_GUIDELIST extends \SYSTEM\DB\QQ {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE parent_type = 0;'
|
||||
;}}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_GUIDELIST_BY_AUTHOR extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE author = ? AND parent_type = 0;'
|
||||
;}}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_GUIDELIST_BY_KEYWORDS extends \SYSTEM\DB\QQ {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE title like '%'?'%' OR body like '%'?'%';'
|
||||
;}}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GENERATE_GUIDELIST_SEARCH extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE parent_type = 0 AND title like ? OR parent_type = 0 AND body like ?;'
|
||||
;}}
|
||||
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GET_AVERAGE_GUIDE_RATING extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT AVG(rating) FROM go_trainer_rating where relation_type = 1 AND relation_id = ?;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GET_GUIDE.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GET_GUIDE extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_guides` WHERE id = ?;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GET_GUIDE_RATING.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GET_GUIDE_RATING extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT sum(case when go_trainer_rating.rating = 1 then 1 else 0 end) class_1, sum(case when go_trainer_rating.rating = 2 then 1 else 0 end) class_2, sum(case when go_trainer_rating.rating = 3 then 1 else 0 end) class_3, sum(case when go_trainer_rating.rating = 4 then 1 else 0 end) class_4 FROM go_trainer_rating INNER JOIN go_trainer_guides ON go_trainer_rating.relation_id = go_trainer_guides.id WHERE go_trainer_guides.id = ?;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GET_HASRATED.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GET_HASRATED extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_rating` WHERE user_id = ? AND relation_type = 1 AND relation_id = ? ;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_GET_TRAINER.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_GET_TRAINER extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `go_trainer_trainer` RIGHT JOIN system_user on(go_trainer_trainer.system_user_id = system_user.id) WHERE id = ?;'
|
||||
;}}
|
||||
8
go_trainer/sql/qq/GO_TRAINER_ID_TO_USERNAME.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class GO_TRAINER_ID_TO_USERNAME extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT username FROM `system_user` WHERE id = ?;'
|
||||
;}}
|
||||