1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 15:16:30 +02:00

Text To LANS #6 - FAQ

Text To LANS #6 - FAQ
Taking care here - there is more to do.
Cannot see where to test some of the legacy code.
Seems to work on Bootstrap and e107v4 front end.
This commit is contained in:
MikeyGMT
2016-12-30 19:48:05 +00:00
parent 274b822bf3
commit 340e2ed732
2 changed files with 31 additions and 24 deletions

View File

@@ -6,12 +6,8 @@
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* FAQ Core Plugin
* *
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
if (!defined('e107_INIT')) if (!defined('e107_INIT'))
@@ -233,7 +229,7 @@ class faq
if(!empty($this->pref['submit_question_limit']) && $existing >= $this->pref['submit_question_limit']) if(!empty($this->pref['submit_question_limit']) && $existing >= $this->pref['submit_question_limit'])
{ {
e107::getMessage()->setTitle('Sorry',E_MESSAGE_INFO)->addInfo("You have reached the maximum number of new questions. You may ask more once your existing questions have been answered."); e107::getMessage()->setTitle(LAN_WARNING,E_MESSAGE_INFO)->addInfo(LAN_FAQS_LIMIT_REACHED);
return; return;
} }
@@ -333,7 +329,7 @@ class faq
$insert = " AND (f.faq_question LIKE '%".$srch."%' OR f.faq_answer LIKE '%".$srch."%' OR FIND_IN_SET ('".$srch."', f.faq_tags) ) "; $insert = " AND (f.faq_question LIKE '%".$srch."%' OR f.faq_answer LIKE '%".$srch."%' OR FIND_IN_SET ('".$srch."', f.faq_tags) ) ";
$message = "<span class='label label-lg label-info'>".$srch." <a class='e-tip' title='Remove' href='".$removeUrl."'>×</a></span>"; $message = "<span class='label label-lg label-info'>".$srch." <a class='e-tip' title='".LAN_FAQS_REMOVE."' href='".$removeUrl."'>×</a></span>";
e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message); e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message);
$text = e107::getMessage()->render(); $text = e107::getMessage()->render();
@@ -359,7 +355,7 @@ class faq
$insert = " AND FIND_IN_SET ('".$srch."', f.faq_tags) "; $insert = " AND FIND_IN_SET ('".$srch."', f.faq_tags) ";
$message = "<span class='label label-lg label-info'>".$srch." <a class='e-tip' title='Remove' href='".$removeUrl."'>×</a></span>"; $message = "<span class='label label-lg label-info'>".$srch." <a class='e-tip' title='".LAN_FAQS_REMOVE."' href='".$removeUrl."'>×</a></span>";
e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message); e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message);
$text = e107::getMessage()->render(); $text = e107::getMessage()->render();
@@ -372,8 +368,8 @@ class faq
if(!$data = $sql->retrieve($query, true)) if(!$data = $sql->retrieve($query, true))
{ {
$message = (!empty($srch)) ? "<b>".$srch."</b> was not found in search results. <a class='e-tip' title='Reset' href='".$removeUrl."'>Reset</a>" : LAN_FAQS_NONE_AVAILABLE; $message = (!empty($srch)) ? e107::getParser()->lanVars(LAN_FAQS_X_NOT_FOUND, $srch)."<a class='e-tip' title='".LAN_FAQS_RESET."' href='".$removeUrl."'>".LAN_FAQS_RESET."</a>" : LAN_FAQS_NONE_AVAILABLE;
return "<div class='alert alert-warning alert-block'>".$message."</div>" ; //TODO LAN return "<div class='alert alert-warning alert-block'>".$message."</div>" ;
} }
// ----------------- // -----------------
@@ -605,7 +601,7 @@ class faq
if (ADMIN && getperms("B")) if (ADMIN && getperms("B"))
{ {
// bkwon 05-Jun-2004 fix URL to moderate comment // bkwon 05-Jun-2004 fix URL to moderate comment
echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?faq.$faq_id'>moderate comments</a></div><br />"; echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?faq.$faq_id'>".LAN_FAQS_MODERATE_COMMENTS."</a></div><br />";
} }
} }
$cobj->form_comment($action, $table, $idx.".".$id, $subject, $content_type); $cobj->form_comment($action, $table, $idx.".".$id, $subject, $content_type);
@@ -618,10 +614,10 @@ class faq
{ {
global $faqpref,$timing_start,$tp,$cust_footer, $CUSTOMPAGES, $CUSTOMHEADER, $CUSTOMHEADER; global $faqpref,$timing_start,$tp,$cust_footer, $CUSTOMPAGES, $CUSTOMHEADER, $CUSTOMHEADER;
$text_menu .= "<div style='text-align:center;' ><br /> $text_menu .= "<div style='text-align:center;' ><br />
&nbsp;&nbsp;[&nbsp;<a href=\"faqs.php?main\">Back to Categories</a>&nbsp;]&nbsp;&nbsp;"; &nbsp;&nbsp;[&nbsp;<a href='".faqs.php?main."'>".LAN_FAQS_BACK_TO_CATEGORIES."</a>&nbsp;]&nbsp;&nbsp;";
if(check_class($faqpref['add_faq'])){ if(check_class($faqpref['add_faq'])){
$text_menu .="[&nbsp;<a href=\"faqs.php?new.$id\">Submit a Question</a>&nbsp;]"; $text_menu .="[&nbsp;<a href='".faqs.php?new.$id."'>".LAN_FAQS_SUBMIT_A_QUESTION."</a>&nbsp;]";
} }
$text_menu .="</div>"; $text_menu .="</div>";
@@ -649,7 +645,7 @@ class faq
<table class='fborder' style=\"width:100%\"> <table class='fborder' style=\"width:100%\">
<tr> <tr>
<td class='fcaption' style=\"width:70%\">".FAQ_ADLAN_49."</td> <td class='fcaption' style=\"width:70%\">".FAQ_ADLAN_49."</td>
<td class='fcaption' style='text-align:center'>Options</td></tr> <td class='fcaption' style='text-align:center'>".LAN_SETTINGS."</td></tr>
"; ";
while ($rw = $sql->db_Fetch()) while ($rw = $sql->db_Fetch())
{ {
@@ -681,8 +677,8 @@ class faq
<tr> <tr>
<td class='fcaption' colspan='2' style='text-align:center'>"; <td class='fcaption' colspan='2' style='text-align:center'>";
$text .= (is_numeric($id)) ? "Edit" : "Add"; $text .= (is_numeric($id)) ? LAN_EDIT : LAN_ADD; //LAN_ADD may not exist on the front end, but I dont think this code is used - Mikey.
$text .= " an FAQ</td></tr>"; $text .= " FAQ</td></tr>";
$text .= " $text .= "
<tr> <tr>
@@ -763,10 +759,10 @@ class faq
$row = $sql->db_Fetch(); $row = $sql->db_Fetch();
extract($row); extract($row);
} }
$ns->tablerender("Frequently asked Questions".$faq_info_title, "<div style='text-align:center'>".$text."</div>".$this->faq_footer()); $ns->tablerender( LAN_PLUGIN_FAQS_FRONT_NAME.$faq_info_title, "<div style='text-align:center'>".$text."</div>".$this->faq_footer());
} }
} }
?> ?>

View File

@@ -1,12 +1,23 @@
<?php <?php
/* /*
* Copyright (c) e107 Inc 2008-2015 - e107.org, * e107 website system
* Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) *
* * Copyright (C) 2008-2016 e107 Inc (e107.org)
* 'FAQ plugin' global language definitions * Released under the terms and conditions of the
*/ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* FAQ Plugin Global Language Definitions
*
*/
define("LAN_FAQS_TAGS", "Tags"); define("LAN_FAQS_TAGS", "Tags");
define("LAN_FAQS_FILTER_ACTIVE", "Filter Active"); define("LAN_FAQS_FILTER_ACTIVE", "Filter Active");
define("LAN_FAQS_NONE_AVAILABLE", "There are currently no FAQs available."); define("LAN_FAQS_NONE_AVAILABLE", "There are currently no FAQs available.");
define("LAN_FAQS_ASKQUESTION_AFTER", "Thank you. Your question has been saved and will be answered as soon as possible."); define("LAN_FAQS_ASKQUESTION_AFTER", "Thank you. Your question has been saved and will be answered as soon as possible.");
define("LAN_FAQS_LIMIT_REACHED", "You have reached the maximum number of new questions. You may ask more once your existing questions have been answered.");
define("LAN_FAQS_REMOVE", "Remove");
define("LAN_FAQS_RESET", "Reset");
define("LAN_FAQS_X_NOT_FOUND", "[x]: Not found in search results.");
define("LAN_FAQS_MODERATE_COMMENTS", "moderate comments");
define("LAN_FAQS_BACK_TO_CATEGORIES", "Back to Categories");
define("LAN_FAQS_SUBMIT_A_QUESTION", "Submit a Question");