add feedback form mode

This commit is contained in:
ivan 2018-05-20 11:27:01 +03:00
parent 6b15e03ac4
commit c6034244b8
4 changed files with 23 additions and 14 deletions

View File

@ -1,4 +1,4 @@
phpcsvguestbook is released under the DWTW license
PHPCSV Guestbook is released under the DWTW license
This program is free software; you can redistribute it and/or modify it under the terms of the Do What Thou Wilt License.

7
README
View File

@ -1,6 +1,6 @@
PHPCSV Guestbook version 0.99.6
PHPCSV Guestbook version 0.99.8
Simple php guestbook with csv file data storage.
Simple php guestbook/feedback form with csv file data storage.
Features:
- English, Arabic and Russian localization
@ -14,6 +14,7 @@ Features:
- Replies
- Locked and sticky posts
- Special fields
- Feedback form mode
Working examples:
http://arabic.freecluster.eu
@ -30,7 +31,7 @@ Archive: https://github.com/zlaxy/phpcsvguestbook/archive/master.zip
2. Edit settings.php: change $GBadmin and $GBpassword (and other variables if necessary)
3. Check privileges for access to files: data storage (default: gbdb.csv) must have write permissions. If you enabled upload feature, 'upload' directory must have rwx permissions. Other files need only read rights.
3. Check privileges for access to files: data storage (default: .htgbdb.csv) must have write permissions. If you enabled upload feature, 'upload' directory must have rwx permissions. Other files need only read rights.
Using:

View File

@ -233,16 +233,19 @@ function AddSearchBar() {
global $Titles;
global $GBsearch;
global $GBcategoryfield;
if ($GBsearch) {
echo "<form action=index.php method=post>";
if ($GBcategoryfield) {
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255 list=\"browsers\">";
echo "<datalist id=\"browsers\">";
foreach ($GBcategoryfield as $category) echo " <option value=\"",$category,"\">";
echo "</datalist>";
} else echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
echo "<input type=submit name=\"search\" value=\"",$Titles["Search"],"\">";
echo "</form>";
global $GBfeedbackFormMode;
if (!$GBfeedbackFormMode) {
if ($GBsearch) {
echo "<form action=index.php method=post>";
if ($GBcategoryfield) {
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255 list=\"browsers\">";
echo "<datalist id=\"browsers\">";
foreach ($GBcategoryfield as $category) echo " <option value=\"",$category,"\">";
echo "</datalist>";
} else echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
echo "<input type=submit name=\"search\" value=\"",$Titles["Search"],"\">";
echo "</form>";
}
}
}
@ -320,6 +323,8 @@ function EntriesView() {
global $GBcategoryfield;
global $GBreplies;
global $GBstickylocked;
global $GBfeedbackFormMode;
if ($GBfeedbackFormMode) return;
if (isset($_SESSION["reply"])) {
echo $Titles["Replying"],"<br>\n";
}

View File

@ -10,6 +10,9 @@ $GBdata=".htgbdb.csv";
$GBadmin="root";
$GBpassword="password";
$GBfeedbackFormMode=false; // feedback form mode (does not show any records)
// نموذج التعليقات (لا تظهر أي سجلات)
// режим формы обратной связи (не показывать опубликованные записи)
$GBpagination=10; // pagination for entries, 0 - disabled
// عدد الإدخالات في الصفحة الواحدة, 0 - معطل
// количество записей на странице, 0 - все записи на одной странице