mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
FAQs category meta description and meta keywords
This commit is contained in:
@@ -62,8 +62,6 @@ class faq_cat_ui extends e_admin_ui
|
||||
protected $perPage = 5; //no limit
|
||||
protected $listOrder = 'faq_info_order ASC';
|
||||
protected $sortField = 'faq_info_order';
|
||||
// protected $listQry = "SELECT * FROM #faq_info"; // without any Order or Limit.
|
||||
// protected $editQry = "SELECT * FROM #faq_info WHERE faq_info_id = {ID}";
|
||||
|
||||
protected $fields = array(
|
||||
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
||||
@@ -73,6 +71,8 @@ class faq_cat_ui extends e_admin_ui
|
||||
'faq_info_about' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
|
||||
'faq_info_parent' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'width' => '5%', 'writeParms'=>''),
|
||||
'faq_info_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'inline'=>true),
|
||||
'faq_info_metad' => array('title'=> LANA_FAQ_METAD, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readParms'=>'editable=1'),
|
||||
'faq_info_metak' => array('title'=> LANA_FAQ_METAK, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readParms'=>'editable=1'),
|
||||
'faq_info_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => '5%', 'thclass' => 'left' ),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1')
|
||||
);
|
||||
|
@@ -114,10 +114,25 @@ class plugin_faqs_list_controller extends eControllerFront
|
||||
$text .= $tp->parseTemplate($FAQ_LISTALL['item'], true);
|
||||
$prevcat = $rw['faq_info_order'];
|
||||
$sc->counter++;
|
||||
if($category) $meta = $rw;
|
||||
}
|
||||
$text .= $tp->parseTemplate($FAQ_LISTALL['end'], true);
|
||||
$text .= $tp->parseTemplate($FAQ_END, true);
|
||||
|
||||
// add meta data if there is parent category
|
||||
if(!empty($meta))
|
||||
{
|
||||
$response = $this->getResponse();
|
||||
if($meta['faq_info_metad'])
|
||||
{
|
||||
$response->addMetaDescription($meta['faq_info_metad']);
|
||||
}
|
||||
if($meta['faq_info_metak'])
|
||||
{
|
||||
$response->addMetaKeywords($meta['faq_info_metak']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->addTitle(LAN_PLUGIN_FAQS_FRONT_NAME);
|
||||
|
||||
$this->addBody($text);
|
||||
|
@@ -34,9 +34,10 @@ class faqs_setup
|
||||
$mes->add("Adding Default table data to table: faqs",$status);
|
||||
|
||||
|
||||
$query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`) VALUES
|
||||
(1, 'General', 'General Faqs', 0, 0, 0, ''),
|
||||
(2, 'Misc', 'Other FAQs', 0, 0, 1, '');";
|
||||
$query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`, `faq_info_metad`, `faq_info_metak`) VALUES
|
||||
(1, 'General', 'General Faqs', 0, 0, 0, '', '', ''),
|
||||
(2, 'Misc', 'Other FAQs', 0, 0, 1, '', '', '');
|
||||
";
|
||||
|
||||
$status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
$mes->add("Adding Default table data to table: faqs_info",$status);
|
||||
|
@@ -18,7 +18,9 @@ CREATE TABLE faqs_info (
|
||||
faq_info_parent int(10) unsigned default '0',
|
||||
faq_info_class int(5) default '0',
|
||||
faq_info_order tinyint(3) unsigned NOT NULL default '0',
|
||||
faq_info_icon varchar(255) NOT NULL,
|
||||
faq_info_icon varchar(255) NOT NULL default '',
|
||||
faq_info_metad varchar(255) NOT NULL default '',
|
||||
faq_info_metak varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (faq_info_id)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
|
@@ -15,6 +15,8 @@ define('LANA_FAQ_UNAME', 'User name'); //FIXME Use generic
|
||||
define('LANA_FAQ_ULOGINNAME', 'User login'); //FIXME Use generic
|
||||
define('LANA_FAQ_TAGS', 'Tags');
|
||||
define('LANA_FAQ_TAGS_HELP', 'Comma separated tag list');
|
||||
define('LANA_FAQ_METAD', 'Meta Description');
|
||||
define('LANA_FAQ_METAK', 'Meta Keywords');
|
||||
|
||||
define('LANA_FAQ_PREF_1', 'Allow submitting of FAQs by:');
|
||||
define('LANA_FAQ_PREF_2', 'Allow submitting of Questions by:');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<e107Plugin name="FAQs" lan="LAN_PLUGIN_FAQS_NAME" version="1.0" date="2012-08-01" compatibility="2.0" installRequired="true">
|
||||
<e107Plugin name="FAQs" lan="LAN_PLUGIN_FAQS_NAME" version="1.1" date="2012-08-01" compatibility="2.0" installRequired="true">
|
||||
<author name="e107 Inc" url="http://www.e107.org" email="security@e107.org" />
|
||||
<description lan="LAN_PLUGIN_FAQS_DESCRIPTION">A simple plugin to add Frequently Asked Questions to your website.</description>
|
||||
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
|
||||
|
Reference in New Issue
Block a user