From c6034244b8d739a766c9f136ee81c479770d12e8 Mon Sep 17 00:00:00 2001 From: zlaxy Date: Sun, 20 May 2018 11:27:01 +0300 Subject: [PATCH] add feedback form mode --- LICENSE | 2 +- README | 7 ++++--- index.php | 25 +++++++++++++++---------- settings.php | 3 +++ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/LICENSE b/LICENSE index 15676dc..8a1c265 100644 --- a/LICENSE +++ b/LICENSE @@ -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. diff --git a/README b/README index 437ce50..99a5da6 100644 --- a/README +++ b/README @@ -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: diff --git a/index.php b/index.php index 2b75169..f957b53 100644 --- a/index.php +++ b/index.php @@ -233,16 +233,19 @@ function AddSearchBar() { global $Titles; global $GBsearch; global $GBcategoryfield; - if ($GBsearch) { - echo "
"; - if ($GBcategoryfield) { - echo ""; - echo ""; - foreach ($GBcategoryfield as $category) echo " "; - } else echo ""; - echo ""; - echo "
"; + global $GBfeedbackFormMode; + if (!$GBfeedbackFormMode) { + if ($GBsearch) { + echo "
"; + if ($GBcategoryfield) { + echo ""; + echo ""; + foreach ($GBcategoryfield as $category) echo " "; + } else echo ""; + echo ""; + echo "
"; + } } } @@ -320,6 +323,8 @@ function EntriesView() { global $GBcategoryfield; global $GBreplies; global $GBstickylocked; + global $GBfeedbackFormMode; + if ($GBfeedbackFormMode) return; if (isset($_SESSION["reply"])) { echo $Titles["Replying"],"
\n"; } diff --git a/settings.php b/settings.php index 85e3f8a..1cfe7ef 100644 --- a/settings.php +++ b/settings.php @@ -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 - все записи на одной странице