mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
FAQs initial rewrite done
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Copyright (c) e107 Inc. 2008-2009
|
||||
| http://e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs_shortcodes.php,v $
|
||||
| $Revision$
|
||||
| $Date$
|
||||
| $Author$
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage faqs
|
||||
* @version $Id$
|
||||
* @author e107inc
|
||||
*
|
||||
* FAQ shortcodes
|
||||
*/
|
||||
|
||||
|
||||
class faqs_shortcodes extends e_shortcode
|
||||
{
|
||||
// var $var;
|
||||
@@ -41,7 +45,7 @@ class faqs_shortcodes extends e_shortcode
|
||||
function sc_faq_question_link($parm='')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return "<a class='faq-question' href='faqs.php?cat.".$this->var['faq_info_id'].".".$this->var['faq_id']."' >".$tp -> toHtml($this->var['faq_question'])."</a>";
|
||||
return "<a class='faq-question' href='". e107::getUrl()->create('faqs/view/item', array('id' => $this->var['faq_id']))."' >".$tp -> toHtml($this->var['faq_question'])."</a>";
|
||||
}
|
||||
|
||||
function sc_faq_answer()
|
||||
@@ -56,20 +60,20 @@ class faqs_shortcodes extends e_shortcode
|
||||
$faqpref = e107::getPlugConfig('faqs')->getPref();
|
||||
if(($faqpref['add_faq'] && $this->var['faq_author'] == USERID) || ADMIN )
|
||||
{
|
||||
return "[ <a href='faqs.php?edit.".$this->var['faq_parent'].".".$this->var['faq_id']."'>Edit</a> ]";
|
||||
// UNDER CONSTRUCTION
|
||||
//return "[ <a href='faqs.php?edit.".$this->var['faq_parent'].".".$this->var['faq_id']."'>Edit</a> ]";
|
||||
}
|
||||
}
|
||||
|
||||
function sc_faq_category()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return "<a href='".e_SELF."?cat.".$this->var['faq_info_id']."'>".$tp->toHtml($this->var['faq_info_title'])."</a>";
|
||||
return "<a href='".e107::getUrl()->create('faqs/list/all', array('category' => $this->var['faq_info_id']))."'>".$tp->toHtml($this->var['faq_info_title'])."</a>";
|
||||
}
|
||||
|
||||
function sc_faq_catlink()
|
||||
function sc_faq_caturl()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return "<a href='".e_SELF."?cat.".$this->var['faq_info_id']."'>".($this->var['faq_info_title'] ? $tp -> toHtml($this->var['faq_info_title']) : "[".NWSLAN_42."]")."</a>";
|
||||
return e107::getUrl()->create('faqs/list/all', array('category' => $this->var['faq_info_id']));
|
||||
}
|
||||
|
||||
function sc_faq_count()
|
||||
@@ -81,16 +85,17 @@ class faqs_shortcodes extends e_shortcode
|
||||
function sc_faq_cat_diz()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return $tp->toHtml($this->var['faq_info_about'])." ";
|
||||
return $tp->toHtml($this->var['faq_info_about']);
|
||||
}
|
||||
|
||||
function sc_faq_icon()
|
||||
{
|
||||
return "<img src='".e_PLUGIN."faq/images/faq.png' alt='' />";
|
||||
return "<img src='".e_PLUGIN_ABS."faq/images/faq.png' alt='' />";
|
||||
}
|
||||
|
||||
function sc_faq_submit_question()
|
||||
{
|
||||
return ''; // UNDER CONSTRUCTION
|
||||
$faqpref = e107::getPlugConfig('faqs')->getPref();
|
||||
$frm = e107::getForm();
|
||||
|
||||
@@ -110,6 +115,7 @@ class faqs_shortcodes extends e_shortcode
|
||||
|
||||
function sc_faq_search()
|
||||
{
|
||||
return ''; // UNDER CONSTRUCTION
|
||||
$tp = e107::getParser();
|
||||
return "<div style='text-align:center'><br />".$tp->parseTemplate("{SEARCH=faqs}")."</div>";
|
||||
}
|
||||
|
Reference in New Issue
Block a user