1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-15 10:02:02 +02:00

FAQs category meta description and meta keywords

This commit is contained in:
SecretR 2013-04-01 15:12:15 +03:00
parent e5ded966cc
commit cebe1810a9
6 changed files with 33 additions and 13 deletions

View File

@ -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,7 +71,9 @@ 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_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => '5%', 'thclass' => 'left' ),
'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')
);

View File

@ -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);

View File

@ -25,18 +25,19 @@ class faqs_setup
$mes = e107::getMessage();
$query = "INSERT INTO #faqs (`faq_id`, `faq_parent`, `faq_question`, `faq_answer`, `faq_comment`, `faq_datestamp`, `faq_author`, `faq_order`) VALUES
(1, 1, 'What is FAQs?', 'FAQs is a plugin that you can use on your e107 0.8+ website to manage Frequently Asked Questions', 0, 1230918231, 1, 0),
(2, 1, 'How can I use e107?', 'You can use e107 if you have a running server with PHP and MySQL installed. Read more about installation requirements.\r\n\r\ne107 is a Content Management System (CMS). You can use it to make consistent web pages. The advantage is you don''t have to write HTML or create CSS files. The programs of e107 take care of all the presentation through the theme. All your entered data is saved into a MySQL database.\r\n\r\ne107 has active plugin and theme resources which grow every day. The software is completely and totally free and always will be, you don''t even need to register anywhere to download it. There are hundreds of content management systems to choose from, if you''re not sure e107 suits your needs, head over to OpenSourceCMS and try a few out.\r\n\r\nWith e107 you are totally in control with a powerful but easy to understand Admin Area and you can add functionalities to your website by adding plugins. e107 has an easy step-by-step installation procedure to install it on your server. ', 0, 0, 1, 1),
(3, 1, 'What is a plugin?', 'A plugin is an additional program that integrates with the e107 core system.\r\n\r\nActually plugins are enhancements to the existing system. Some other CMS systems call it extensions, components or modules.\r\n\r\nAlready some core plugins are included in the full install package of e107.\r\n\r\nYou can activate them using Admin > Plugin Manager, and click on Install for the ones you want. They will appear in your Admin Area for configuration.\r\n\r\nThere are all kinds of plugins: small and large, core plugins and third party plugins. There are plugins for all kinds of purposes. ', 0, 123123123, 1, 2);
";
(1, 1, 'What is FAQs?', 'FAQs is a plugin that you can use on your e107 0.8+ website to manage Frequently Asked Questions', 0, 1230918231, 1, 0),
(2, 1, 'How can I use e107?', 'You can use e107 if you have a running server with PHP and MySQL installed. Read more about installation requirements.\r\n\r\ne107 is a Content Management System (CMS). You can use it to make consistent web pages. The advantage is you don''t have to write HTML or create CSS files. The programs of e107 take care of all the presentation through the theme. All your entered data is saved into a MySQL database.\r\n\r\ne107 has active plugin and theme resources which grow every day. The software is completely and totally free and always will be, you don''t even need to register anywhere to download it. There are hundreds of content management systems to choose from, if you''re not sure e107 suits your needs, head over to OpenSourceCMS and try a few out.\r\n\r\nWith e107 you are totally in control with a powerful but easy to understand Admin Area and you can add functionalities to your website by adding plugins. e107 has an easy step-by-step installation procedure to install it on your server. ', 0, 0, 1, 1),
(3, 1, 'What is a plugin?', 'A plugin is an additional program that integrates with the e107 core system.\r\n\r\nActually plugins are enhancements to the existing system. Some other CMS systems call it extensions, components or modules.\r\n\r\nAlready some core plugins are included in the full install package of e107.\r\n\r\nYou can activate them using Admin > Plugin Manager, and click on Install for the ones you want. They will appear in your Admin Area for configuration.\r\n\r\nThere are all kinds of plugins: small and large, core plugins and third party plugins. There are plugins for all kinds of purposes. ', 0, 123123123, 1, 2);
";
$status = ($sql->db_Select_gen($query)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$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);

View File

@ -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;

View File

@ -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:');

View File

@ -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>