diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index 863e7e3..b625386 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -16,6 +16,26 @@ class api_mojotrollz extends \SYSTEM\API\api_system { throw new ERROR("You need to be logged in to view this ressource.");} $creature = creature::data($entry); return $creature;} + public static function call_topic_create($parent_type, $parent_id, $relationflag, $title, $text, $link){ + if (\SYSTEM\SECURITY\Security::isLoggedIn()) { + echo JsonResult::ok(); + return \DBD\TOPIC_CREATE::Q1(array($parent_type, $parent_id, $relationflag, $title, $text, $link, \SYSTEM\SECURITY\Security::getUser()->id)); + } + else{ + new SYSTEM\LOG\WARNING('called create function without rights'); + } + + } + public static function call_topic_tag($type, $value){ + if (\SYSTEM\SECURITY\Security::isLoggedIn()) { + echo JsonResult::ok(); + return tags::set(7, $type, $value); + } + else{ + new SYSTEM\LOG\WARNING('called create function without rights'); + } + + } public static function call_positions($type,$map=null,$entry=null){ return map::positions($type,$map,$entry);} public static function call_tooltip($type,$id){ diff --git a/mojotrollz/api/api_mojotrollz.sql b/mojotrollz/api/api_mojotrollz.sql index 76e0baf..378ecff 100644 --- a/mojotrollz/api/api_mojotrollz.sql +++ b/mojotrollz/api/api_mojotrollz.sql @@ -24,4 +24,15 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (142, 0, 3, 10, 'positions', 'entry', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (150, 0, 2, 10, 'tooltip', 'type', 'INT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (151, 0, 2, 10, 'tooltip', 'id', 'INT'); \ No newline at end of file +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (151, 0, 2, 10, 'tooltip', 'id', 'INT'); + + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (160, 0, 2, 10, 'topic_create', 'parent_type', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (161, 0, 2, 10, 'topic_create', 'parent_id', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (163, 0, 2, 10, 'topic_create', 'relationflag', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (164, 0, 2, 10, 'topic_create', 'title', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (165, 0, 2, 10, 'topic_create', 'text', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (166, 0, 2, 10, 'topic_create', 'link', 'STRING'); + +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (180, 0, 2, 10, 'topic_tag', 'type', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (181, 0, 2, 10, 'topic_tag', 'value', 'STRING'); diff --git a/mojotrollz/dbd/qq/GET_TOPICS_BY_FAQ.php b/mojotrollz/dbd/qq/GET_TOPICS_BY_FAQ.php new file mode 100644 index 0000000..70d63d1 --- /dev/null +++ b/mojotrollz/dbd/qq/GET_TOPICS_BY_FAQ.php @@ -0,0 +1,16 @@ + + + +

New Topic

+ + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + + + + + + + diff --git a/mojotrollz/page/user_nexus_content/user_nexus_content.php b/mojotrollz/page/user_nexus_content/user_nexus_content.php new file mode 100644 index 0000000..3ef7e21 --- /dev/null +++ b/mojotrollz/page/user_nexus_content/user_nexus_content.php @@ -0,0 +1,49 @@ +menu = $menu; + $this->filter = $filter; + } + /*public static function js(){ + return array( \SYSTEM\WEBPATH(new PPAGE(),'user_achievements_content/js/user_achievements_content.js'), + \SYSTEM\WEBPATH(new PAPI(),'database/js/wow.js'));} + + public static function css (){ + return array();}*/ + + private function menu_new(){ + switch($this->filter){ + case 1: + $result = ''; + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_content/tpl/new.tpl'), array()); + default: + return 'filter fail'; + case 2: + $result = ''; + $topics = \DBD\GET_TOPICS_BY_FAQ::QQ(array(\SYSTEM\SECURITY\Security::getUser()->id)); + while ($rel = $topics->next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics_bulletin.tpl'), $rel); + } + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_content/tpl/faq.tpl'), array('content' => $result)); + default: + return 'filter fail'; + + } + + } + + + public function html(){ + + switch($this->menu){ + case 1: + return $this->menu_new(); + default: + return 'menu fail'; + } + + } +} \ No newline at end of file diff --git a/mojotrollz/page/user_nexus_menu_sub/js/user_nexus_menu_sub.js b/mojotrollz/page/user_nexus_menu_sub/js/user_nexus_menu_sub.js index 6ee5238..a2e27b2 100644 --- a/mojotrollz/page/user_nexus_menu_sub/js/user_nexus_menu_sub.js +++ b/mojotrollz/page/user_nexus_menu_sub/js/user_nexus_menu_sub.js @@ -1,9 +1,39 @@ function init_user_nexus_menu_sub(){ $(".btn_nexus_menu").click(function(){ $('#nexus_list').load('./?page=user_nexus_content&menu=' + $(this).attr('menu') + '&filter=' + $(this).attr('filter'), function(){ + btn_new_topic(); }); }); - + function btn_new_topic(){ + $("#btn_new_topic").click(function(){ + $.ajax({ type :'GET', + url : './api.php?call=topic_create'+ + '&parent_type='+$(this).attr('parent_type')+ + '&parent_id='+$(this).attr('parent_id')+ + '&relationflag='+$(this).attr('relationflag')+ + '&title='+$('#_title').val()+ + '&text='+$('#_text').val()+ + '&link='+$('#_link').val(), + success : function(data) { + if(data.status){ + load_visuals_tab(race); + }else{ + alert('Problem: '+data);} + } + }); + $.ajax({ type :'GET', + url : './api.php?call=topic_tag'+ + '&type='+$(this).attr('type')+ + '&value='+$('#_title').val(), + success : function(data) { + if(data.status){ + load_visuals_tab(race); + }else{ + alert('Problem: '+data);} + } + }); + }); + } } diff --git a/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl b/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl index 7f2679f..51a16e9 100644 --- a/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl +++ b/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl @@ -1 +1 @@ - \ No newline at end of file +${content} \ No newline at end of file diff --git a/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics.tpl b/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics.tpl index aa0260b..7e6900d 100644 --- a/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics.tpl +++ b/mojotrollz/page/user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics.tpl @@ -1 +1,2 @@ - + + \ No newline at end of file diff --git a/mojotrollz/page/user_nexus_menu_sub/user_nexus_menu_sub.php b/mojotrollz/page/user_nexus_menu_sub/user_nexus_menu_sub.php index 7cd421d..70535ee 100644 --- a/mojotrollz/page/user_nexus_menu_sub/user_nexus_menu_sub.php +++ b/mojotrollz/page/user_nexus_menu_sub/user_nexus_menu_sub.php @@ -15,9 +15,19 @@ class user_nexus_menu_sub extends SYSTEM\PAGE\Page { public function html(){ switch ($this->menu){ case 1: - return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl'), array()); + $result = ''; + $topics = \DBD\GET_TOPICS_BY_SELF::QQ(array(\SYSTEM\SECURITY\Security::getUser()->id)); + while ($rel = $topics->next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics_bulletin.tpl'), $rel); + } + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_start.tpl'), array('content' => $result)); case 2: - return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_characters.tpl'), array()); + $result = ''; + $topics = \DBD\GET_TOPICS_BY_TAG_FAQ::QQ(array()); + while ($rel = $topics->next()){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_topics_bulletin.tpl'), $rel); + } + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_faq.tpl'), array()); case 3: return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_nexus_menu_sub/tpl/user_nexus_menu_sub_friendlist.tpl'), array()); case 4: diff --git a/mojotrollz/sai/saimod_mojotrollz_db_tags/tpl/saimod_mojotrollz_db_tags.tpl b/mojotrollz/sai/saimod_mojotrollz_db_tags/tpl/saimod_mojotrollz_db_tags.tpl index fb786a2..e7503b4 100644 --- a/mojotrollz/sai/saimod_mojotrollz_db_tags/tpl/saimod_mojotrollz_db_tags.tpl +++ b/mojotrollz/sai/saimod_mojotrollz_db_tags/tpl/saimod_mojotrollz_db_tags.tpl @@ -7,6 +7,7 @@
  • Items
  • Quests
  • Spells
  • +
  • Topics