gb document doc headers and minors for later

This commit is contained in:
Ian 2013-08-27 15:11:58 +02:00
parent 36f1cef800
commit 077a8a8424
4 changed files with 322 additions and 235 deletions

View file

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* serendipty_event_guestbook.php, README, last modified 2013-08-24 * * serendipty_event_guestbook.php, README, last modified 2013-08-25 *
* if you have a interesting hack or want to help, * * if you have a interesting hack or want to help, *
* please leave a message in http://www.s9y.org/forums/ * * please leave a message in http://www.s9y.org/forums/ *
* have fun! Ian * * have fun! Ian *
@ -7,56 +7,72 @@
PLEASE NOTE PLEASE NOTE
This Serendipity guestbook plugin is TEMPLATE based, configurable by its own stylesheet, has a FRONTEND and a BACKEND. This Serendipity guestbook plugin is TEMPLATE based, configurable by its own stylesheet, has a FRONTEND and a BACKEND. Please read the Config, Admin, Design and last modified entry Changelog Section of this file carefully.
Please read the Config, Admin, Design and last modified entry Changelog Section of this file carefully.
S9Y :: GUESTBOOK :: CONFIG SETTINGS S9Y :: GUESTBOOK :: CONFIG SETTINGS
* The 'Permalink' setting defines a permalink for the URL. Needs the absolute HTTP path and needs to end with .htm or .html! * The 'Permalink' defines a permalink for the URL. Needs the absolute HTTP path and needs
The Serendipity default value is "/blogname/pages/guestbook.html", or, in case you are not using mod_rewrite, "/blogname/index.php?/pages/guestbook.html". to end with .htm or .html! The Serendipity default value is "/blogname/pages/guestbook.html",
* The 'Static Pagetitle & URL' setting defines the staticpage title of the page. or, in case you are not using mod_rewrite, "/blogname/index.php?/pages/guestbook.html".
Attention: this also defines the URL of the page (index.php?serendipity[subpage]=name). Just one short name without whitespaces (default: guestbook). * The 'Static Pagetitle & URL' defines the staticpage title of the page.
* The 'Headline' setting defines the headline of the page inside your blog with your normal blog design (optional). Attention: this also defines the URL of the page (index.php?serendipity[subpage]=name).
* The 'Intro' setting defines additional introductory Text (optional). Just one short name without whitespaces (default: guestbook).
* The 'Guestbook form order' setting defines the place of your guestbook form, on top or bottom of the entries (default: top). * The 'Headline' defines a headline for the frontpage view (optional).
* The 'Entries per page' setting defines how many entries to display per page (default: 10). * The 'Intro' defines additional introductory Text (optional).
* The 'Characters per line (Wordwrap)' setting defines after how many characters a guestbook text line will be automatically wrapped (default: 120). * The 'Guestbook form order' defines the place of your guestbook form (default: top).
* The 'Format as article' setting defines if the output is automatically formatted as an article (colors, borders, etc.) (default: yes). * The 'Entries per page' defines how many entries to display per page (default: 10).
* The 'Send e-mail to admin' setting defines email information of entries. The admin gets an e-mail for each new entry. Insert email address on next step (default: false). * The 'Entries per page' backend defines how many entries to display per page (default: 15).
* The 'User Email' setting defines a form field for the e-mail of the user (default: yes). * The 'Characters per line (Wordwrap)' defines after how many chars a guestbook text line will
* The 'User Homepage' setting defines a form field for the homepage of the user (default: false). be automatically wrapped (default: 120).
* The 'Show Captchas' setting defines the use of Serendipity CAPTCHAS (requires Spamblock plugin activated) to prevent comment SPAM (default: yes). * The 'Format as article' defines if the output is automatically formatted as an article
* The 'Approve entries' setting defines the guestbook entries to be verified by admin generally before they show up in frontend (default: false). (colors, borders, etc.) (default: yes).
* The 'Auto-moderate' setting defines the same behaviour for a single entry, if the SPAMBLOCK-plugin wordfilter option is activ and set to 'moderate', caused by stopword matches (default: false). The guestbook content evaluation will still return captcha checking, if any spam check evaluates true. This differs from normal spamblock behaviour! * The 'Send e-mail to admin' defines email information of new entries (default: false).
* The 'Entry checks' setting sets an active and individual wordfilter array (default: pre-filled). Regular Expressions are allowed, separate strings by semicolons (;). You have to escape special chars with "\". If you leave this field empty, no special checks are done. (Bypassed by USERLEVEL_ADMIN only!) * The 'E-mail of admin' set the email adress to send to.
* The 'Date format' setting defines an individual strftime() code for the entry datetime (default: %a, %d.%m.%Y %H:%M). * The 'Ask for User Email' defines a form field for the e-mail of the user (default: yes).
* The 'Show Captchas' defines the use of Serendipity CAPTCHAS (requires Spamblock plugin activated)
to prevent comment SPAM (default: yes).
* The 'Ask for User Homepage' defines a form field for the homepage of the user (default: false).
* The 'Approve entries' defines the guestbook entries to be verified by admin in general,
before they show up in frontend (default: false).
* The 'Auto-moderate' defines the same behaviour for a single entry, if the SPAMBLOCK-plugin
wordfilter option is activ and set to 'moderate', caused by stopword matches (default: false).
The guestbook content evaluation will still return captcha checking, if any spam check
evaluates true. This differs from normal spamblock behaviour!
* The 'Entry checks' sets an active and individual guestbook wordfilter array (default: pre-filled).
Regular Expressions are allowed, separate strings by semicolons (;). You have to escape special
chars with "\". If you leave this field empty, no special checks are done. This check is bypassed
for authenticated users with USERLEVEL_ADMIN only!
* The 'Date format' sets a strftime() code for the entry datetime (default: %a, %d.%m.%Y %H:%M).
S9Y :: GUESTBOOK :: ADMINISTRATION S9Y :: GUESTBOOK :: ADMINISTRATION
* Backend and frontend administration is possible, if logged in. The frontend administration allows erasing entries only, but will ask you to proceed. Frontend administration got removed with 3.24 version. * Backend and frontend administration is possible, if logged in. The frontend administration allows
purging entries only, but will ask you to proceed. No frontend administration.
* The backend sidebar has a new link to administer the guestbook. There are 4 main points to show up: * The backend sidebar has a new link to administer the guestbook. There are 4 main points to show up:
1. view approved entries, 1. view approved entries,
2. view unapproved entries (if 'Approve entries' is set to true), 2. view unapproved entries (if 'Approve entries' is set to true),
3. edit or insert an entry, 3. edit or insert an entry,
4. the database section. 4. the database section.
* Each of the first two, have the ability to (confirm,) erase (immediately!), or re-edit a single entry. * Each of the first two, have the ability to (confirm,) erase (immediately!), or re-edit a single entry.
* The database section will allow: backup and download the plugin database table, or erase the SQL table instantly. Be careful working here! * The database section will allow: backup and download, or erase the SQL table instantly. (Be careful!)
* A link to SQL insert is shown, but not active, since this isn't trivial enough by now. * A link to SQL insert is shown, but not active, since this isn't trivial enough by now.
S9Y :: GUESTBOOK :: DESIGN S9Y :: GUESTBOOK :: DESIGN
* All smarty tpls, images and the one main stylesheet of this plugin are located in the plugin folder and remain to stay there. * All smarty tpls, images and the one main stylesheet of this plugin are located in the plugin folder
* If you are skilled and wish to have an individual frontend design, copy the files to change to your template folder only and remain to stay there.
( plugin_guestbook_entries.tpl, plugin_guestbook_form.tpl, style_guestbook_backend.css ). * If you are skilled and wish to have an individual frontend design, copy these files to change to your
* In case you wish to change the frontend entry background colors only, copy these neutral white css directives: template ( plugin_guestbook_entries.tpl, plugin_guestbook_form.tpl, style_guestbook_frontend.css ).
* For changing the frontend entry background colors only, copy these neutral white css directives:
/* styles guestbook entry colors neutral */ /* styles guestbook entry colors neutral */
/* the entry headline */ .guestbook_entrytop { background:none repeat scroll 0 0 #FFF; } /* the entry headline */ .guestbook_entrytop { background:none repeat scroll 0 0 #FFF; }
/* the entry background color */ .guestbook_entrybottom { background:none repeat scroll 0 0 #FFF; } /* the entry background color */ .guestbook_entrybottom { background:none repeat scroll 0 0 #FFF; }
/* the admin comment line */ span.guestbook_admin_comment { background:none repeat scroll 0 0 #FFF; } /* the admin comment line */ span.guestbook_admin_comment { background:none repeat scroll 0 0 #FFF; }
/* the bottom shadow line */ #guestbook_entrybundle { -moz-border-radius: 0 0; background:none repeat scroll 0 0 #FFF; } /* the bottom shadow line */
#guestbook_entrybundle { -moz-border-radius: 0 0; background:none repeat scroll 0 0 #FFF; }
to the end of your templates user.css file, if you have one (suggested approach!). to the end of your templates user.css file, if you have one (suggested approach!).
If your template does not support an individual stylesheet, copy the style_guestbook_backend.css file to your template folder, In the other case copy the style_guestbook_frontend.css file to your template folder,
set the directives to the end and change the #FFF to your prefered color (#FFF is neutral white). set above directives to the end and change the #FFF to your prefered color (#FFF is neutral white).
* If you want to purge the frontend entry borders too, add: border: 0 none; to each of them. * If you want to purge the frontend entry borders too, add: border: 0 none; to each of them.
* If you even wish to change all frontend entry text colors, add: * If you even wish to change all frontend entry text colors, add:
#guestbook_entrybundle table, #guestbook_entrybundle table,
@ -68,9 +84,12 @@ S9Y :: GUESTBOOK :: DESIGN
#guestbook_entrybundle .guestbook_admin_comment blockquote p, #guestbook_entrybundle .guestbook_admin_comment blockquote p,
#guestbook_entrybundle .guestbook_admin_comment blockquote p q { color: #000; } #guestbook_entrybundle .guestbook_admin_comment blockquote p q { color: #000; }
for a black text color (#000). for a black text color (#000).
* No space between frontend entry blocks? Add: .guestbook_splitentries { display: none; visibility: hidden; } * No space between frontend entry blocks?
* The Intro, if set in config, can be modified with: #guestbook_wrapper .guestbook_intro { padding: 0 none; text-align: left; border: 0 none; background:none repeat scroll 0 0 #FFF; } Add: .guestbook_splitentries { display: none; visibility: hidden; }
* You can find a very nice list of available web colours here http://www.wackerart.de/rgbfarben.html. Happy designing! * The Intro, if set in config, can be modified with: #guestbook_wrapper .guestbook_intro {
padding: 0 none; text-align: left; border: 0 none; background:none repeat scroll 0 0 #FFF; }
* You can find a nice list of available web colours here: http://www.wackerart.de/rgbfarben.html.
Happy designing!
------------------------------------- -------------------------------------
@ -140,8 +159,10 @@ S9Y :: GUESTBOOK :: DESIGN
| Version 3.27 [ 2011-06-27 ] | | Version 3.27 [ 2011-06-27 ] |
------------------------------------- -------------------------------------
* changed backend/frontend templates including changes to the backend.css from table to list style and be some more up to date. * changed backend/frontend templates including changes to the backend.css
* changed config option markup internally to also set the {$plugin_guestbook_articleformat} as default(true) in frontend plugin_guestbook_entries.tpl. from table to list style and be some more up to date.
* changed config option markup internally to also set the {$plugin_guestbook_articleformat}
as default(true) in frontend plugin_guestbook_entries.tpl.
* changed sidebar plugin linebreak. * changed sidebar plugin linebreak.
* fixed sql alter update and remove procedure. * fixed sql alter update and remove procedure.
* changed backend display to admin group instead admin only. * changed backend display to admin group instead admin only.
@ -151,13 +172,16 @@ S9Y :: GUESTBOOK :: DESIGN
| Version 3.26 [ 2011-03-08 ] | | Version 3.26 [ 2011-03-08 ] |
------------------------------------- -------------------------------------
* fixed spamblock call entry timestamp to be -8 day in past, while captchas_ttl checks normally set captchas true beyond 7 days. * fixed spamblock call entry timestamp to be -8 day in past,
while captchas_ttl checks normally set captchas true beyond 7 days.
* fixed backend admin entry; POST vars to form got lost in some error cases. * fixed backend admin entry; POST vars to form got lost in some error cases.
* changed ERROR_DATANOTAGS lang constant in <en>, <de> and <de-utf8> to support new wordfilter option. * changed ERROR_DATANOTAGS lang constant in <en>, <de> and <de-utf8> to support new wordfilter option.
* added new pre-filled config option to disallow plugin only filter words in entry body, which was done internally before. * added new pre-filled config option to disallow plugin only filter words in entry body,
which was done internally before.
* added internal var to function to support an incomplete error message properly. * added internal var to function to support an incomplete error message properly.
* changed lang constant in <en>, <de> and <de-utf8> to better explain auto-moderation issues. * changed lang constant in <en>, <de> and <de-utf8> to better explain auto-moderation issues.
* changed documentation_en.html to explain differs in captchas check in contrast to spamblocks auto-moderation pass-through and new option 'entrychecks'. * changed documentation_en.html to explain differs in captchas check in contrast to spamblocks
auto-moderation pass-through and new option 'entrychecks'.
------------------------------------- -------------------------------------
@ -166,13 +190,17 @@ S9Y :: GUESTBOOK :: DESIGN
* moved some internal vars to a better place. * moved some internal vars to a better place.
* changed plugin_guestbook_backend_entries.tpl to support a moderate hidden var * changed plugin_guestbook_backend_entries.tpl to support a moderate hidden var
* erased moderate option in sidebar plugin, which came with v.3.21, while sidebar now extends event plugin option setting. * erased moderate option in sidebar plugin, which came with v.3.21, while sidebar now extends
* rebuild sidebar <serendipity_plugin_guestbook> to support event plugins 'auto-moderation' and 'showapp option' changes. event plugin option setting.
* rebuild sidebar <serendipity_plugin_guestbook> to support event plugins 'auto-moderation'
and 'showapp option' changes.
* added lang constant in <en>, <de> and <de-utf8> * added lang constant in <en>, <de> and <de-utf8>
* added new config option to allow entry set auto-moderate via spamblock plugin, if its wordfilter option is activ and set to 'moderate' * added new config option to allow entry set auto-moderate via spamblock plugin, if its
wordfilter option is activ and set to 'moderate'
* corrected small typo in german lang files * corrected small typo in german lang files
* tweaked some small issues in guestbook CSS file * tweaked some small issues in guestbook CSS file
* added spamblock return 'moderate_comments' value, to support adding entries to non-approved; this extends guestbooks config setting * added spamblock return 'moderate_comments' value, to support adding entries to non-approved;
this extends guestbooks config setting
------------------------------------- -------------------------------------
@ -197,7 +225,8 @@ S9Y :: GUESTBOOK :: DESIGN
| Version 3.22 [ 2011-02-15 ] | | Version 3.22 [ 2011-02-15 ] |
------------------------------------- -------------------------------------
* changed smarty->fetch method call to be less strict to support smarty 2 to smarty3 parameter order change - removed param 4 * changed smarty->fetch method call to be less strict to support smarty 2 to smarty3 parameter
order change - removed param 4
* Added restriction of backend functionality and administration sidebar link to admin only * Added restriction of backend functionality and administration sidebar link to admin only
------------------------------------- -------------------------------------
@ -205,7 +234,8 @@ S9Y :: GUESTBOOK :: DESIGN
------------------------------------- -------------------------------------
* Fixed send entry to email, which did not show entry body properly. * Fixed send entry to email, which did not show entry body properly.
* Backported fake call to spamblock and other comment plugins again, which was removed in 3.20 to prevent bots capturing Captchas. * Backported fake call to spamblock and other comment plugins again, which was removed in 3.20
to prevent bots capturing Captchas.
* Fixed serendipity_plugin_guestbook.php to truly show approved events only, if set in config. * Fixed serendipity_plugin_guestbook.php to truly show approved events only, if set in config.
* Fixed a small typo in lang_en.* file and made the documentation helppage W3C XHTML conform. * Fixed a small typo in lang_en.* file and made the documentation helppage W3C XHTML conform.
@ -217,13 +247,16 @@ S9Y :: GUESTBOOK :: DESIGN
- ATTENTION: This version needs you to verify and set/submit the guestbook config again! - ATTENTION: This version needs you to verify and set/submit the guestbook config again!
- This edition adds backend administration and now supports admin moderation to guestbook entries. - This edition adds backend administration and now supports admin moderation to guestbook entries.
- Therefor it adds a new database table field 'approve' and a new config variable 'showapp' to true or false (default is false). - Therefor it adds a new database table field 'approve' and a new config variable 'showapp' to true
or false (default is false).
- Changes will affect old entries to be set as approved. - Changes will affect old entries to be set as approved.
- Updated Serendipity guestbook sidebar plugin to select these entries only to v.1.12. - Updated Serendipity guestbook sidebar plugin to select these entries only to v.1.12.
- Changed and added lang constants. The lang files <en>, <de> and <de-utf8> are now up to date. - Changed and added lang constants. The lang files <en>, <de> and <de-utf8> are now up to date.
- Some small tweaks to both of the frontend tpls and some more to the stylesheet. - Some small tweaks to both of the frontend tpls and some more to the stylesheet.
- Some small tweaks to the frontend paginator and the url building, to be more friendly to mod_rewrite setting via permalink or subpage. - Some small tweaks to the frontend paginator and the url building, to be more friendly to mod_rewrite
- This upgrade may effect individual design settings. Please make sure to have a look to your frontend tpls and the stylesheet! setting via permalink or subpage.
- This upgrade may effect individual design settings. Please make sure to have a look to your frontend
tpls and the stylesheet!
------------------------------------- -------------------------------------
@ -239,35 +272,35 @@ S9Y :: GUESTBOOK :: DESIGN
- ATTENTION: This version needs you to verify and set/submit the guestbook config again! - ATTENTION: This version needs you to verify and set/submit the guestbook config again!
- Changed lang files. The lang files <en>, <de> and <de-utf8> are now up to date. - Changed lang files. The lang files <en>, <de> and <de-utf8> are now up to date.
*** If you update other lang files please change the first line to * If you update other lang files please change the first line to
$Id: serendipity_event_guestbook.php, langfile(short name) v2.8 200x/xx/xx name $Id: serendipity_event_guestbook.php, langfile(short name) v2.8 200x/xx/xx name
- Images new and moved and old files clean up. - Images new and moved and old files clean up.
*** Deleted the very old 'plugin_guestbook.tpl' file: this confuses newbies. Please do the same! * Deleted the very old 'plugin_guestbook.tpl' file: this confuses newbies. Please do the same!
*** button_background.png and shorttime.gif belong into plugins img folder. * button_background.png and shorttime.gif belong into plugins img folder.
*** Please delete them in plugin folder to not confuse anybody. * Please delete them in plugin folder to not confuse anybody.
*** Added a blank.gif and a info.gif, which actually is the config help picture, into plugins img folder. * Added a blank.gif and a info.gif, which actually is the config help picture, into plugins img folder.
- Changed plugin_guestbook_form.tpl. - Changed plugin_guestbook_form.tpl.
*** make use of the new smarty vars * make use of the new smarty vars
*** if set: popup and show messages * if set: popup and show messages
*** Now a user using the popup issue can view his entry after DB INSERT. * Now a user using the popup issue can view his entry after DB INSERT.
*** changed action="{$plugin_guestbook_action}#entry" to action="{$commentform_action}?frontpage#feedback" inside * changed action="{$plugin_guestbook_action}#entry" to action="{$commentform_action}?frontpage#feedback"
plugin_guestbook_form.tpl. This seems necessary if you use a static page as your start page. inside plugin_guestbook_form.tpl. This seems necessary if you use a static page as your start page.
Be sure to have the staticpage plugin in order before the contactform and guestbook plugin. Be sure to have the staticpage plugin in order before the contactform and guestbook plugin.
Well, actually the '?frontpage' will be done in serendipity_event_guestbook.php. Well, actually the '?frontpage' will be done in serendipity_event_guestbook.php.
*** added admin stuff * added admin stuff
*** modified some css * modified some css
- Changed plugin_guestbook_entries.tpl. - Changed plugin_guestbook_entries.tpl.
*** make use of the new smarty vars * make use of the new smarty vars
*** if set: order form on top or end and be able to even link to the form * if set: order form on top or end and be able to even link to the form
*** moved some things around * moved some things around
*** added admin stuff and a missing <td></td>, which seems nessessary! * added admin stuff and a missing <td></td>, which seems nessessary!
*** modified some css * modified some css
- Changed, cleaned and modified the style_guestbook_backend.css - Changed, cleaned and modified the style_guestbook_backend.css
*** you may put a very own version of both tpl and css files inside your template folder. * you may put a very own version of both tpl and css files inside your template folder.
>> GH: TEMPORARILY DEACTIVATED >> GH: TEMPORARILY DEACTIVATED
- One extra dynamic field added (dyn). - One extra dynamic field added (dyn).
@ -275,22 +308,22 @@ S9Y :: GUESTBOOK :: DESIGN
- In order to make things more configurable, these vars were changed or added (see also the lang files): - In order to make things more configurable, these vars were changed or added (see also the lang files):
*** 'headline' *** staticpage headline on top of page, by Garvin (v. 2.7). * 'headline' * staticpage headline on top of page, by Garvin (v. 2.7).
*** 'intro' *** is used for free additional text entry on top of guestbook page. * 'intro' * is used for free additional text entry on top of guestbook page.
*** 'pageurl' *** now called permalink, while pagetitle is used as the original (1.x) pageurl and for * 'pageurl' * now called permalink, while pagetitle is used as the original (1.x) pageurl and for
staticpage_pagetitle, see below. (Sounds a bit messy, I know, but this is more straight!) staticpage_pagetitle, see below. (Sounds a bit messy, I know, but this is more straight!)
*** 'pagetitle' *** is used in staticpages and other templates and defines the URL of the page * 'pagetitle' * is used in staticpages and other templates and defines the URL of the page
'index.php?serendipity[subpage]=name'. 'index.php?serendipity[subpage]=name'.
*** 'formorder' *** decide to have form appear first, default is form at end of entries. * 'formorder' * decide to have form appear first, default is form at end of entries.
*** 'formpopup' *** decide to have the form appear in a popup page, default (yes) is no popup. * 'formpopup' * decide to have the form appear in a popup page, default (yes) is no popup.
>>GH:TEMPORARILY DEACTIVATED! >>GH:TEMPORARILY DEACTIVATED!
*** 'showdynfield' *** this is a basic dynamic field as a mysql varchar(100) field. * 'showdynfield' * this is a basic dynamic field as a mysql varchar(100) field.
Use with a input field in plugin_guestbook_form.tpl Use with a input field in plugin_guestbook_form.tpl
and as a text output in plugin_guestbook_entries.tpl. and as a text output in plugin_guestbook_entries.tpl.
I tried it with a tinyblob field, but it is not a very good idea I tried it with a tinyblob field, but it is not a very good idea
@ -302,11 +335,11 @@ S9Y :: GUESTBOOK :: DESIGN
- General code clean up and moved things around. More documented code. - General code clean up and moved things around. More documented code.
- Now this really is a fully template version (99.9% ;-)). - Now this really is a fully template version (99.9% ;-)).
*** Moved some remaining divs and some admin stuff into the tpls. * Moved some remaining divs and some admin stuff into the tpls.
*** Sorry, there are still some needs inside functions for remaining line breaks and the urls of the paginator function. * Sorry, there are still some needs inside functions for remaining line breaks and the urls of the paginator function.
- Good news! The code for the staticpage plugin at the end oft this page is obsolet by now. - Good news! The code for the staticpage plugin at the end oft this page is obsolet by now.
*** We'll keep the compatibility to 1.x until next 3.x release. Well, actually this version should be 3.0..... * We'll keep the compatibility to 1.x until next 3.x release. Well, actually this version should be 3.0.
------------------------------------- -------------------------------------
@ -326,23 +359,29 @@ S9Y :: GUESTBOOK :: DESIGN
- Guestbookform tpl action url is now: $serendipity['baseURL'] . $serendipity['indexFile'] . '#entry' - Guestbookform tpl action url is now: $serendipity['baseURL'] . $serendipity['indexFile'] . '#entry'
- Changed sidebar serendipity_event_staticpage.php to be compatible to guestbook 2.0 version too (code1). In case you allready used this plugin to show a link to the guestbook plugin in your sidebar, please go into admin panel, go to static pages, and say yes again to show guestbook plugin. Doing this, changes to code will take effect. - Changed sidebar serendipity_event_staticpage.php to be compatible to guestbook 2.0 version too (code1).
In case you allready used this plugin to show a link to the guestbook plugin in your sidebar,
please go into admin panel, go to static pages, and say yes again to show guestbook plugin.
Doing this, changes to code will take effect.
- Made sidebar serendipity_plugin_guestbook work with 2.0 version only - Made sidebar serendipity_plugin_guestbook work with 2.0 version only
- Target admin mail address should now be compatible to old guestbook version 1.38 - just one targetmail used - Target admin mail address should now be compatible to old guestbook version 1.38 - just one targetmail used
- Markup config var makes tpl based entries textfield output get parsed through S9y standard text formatting and converting standard smilies - Markup config var makes tpl based entries textfield output get parsed through S9y standard text formatting
and converting standard smilies
- Change old guestbook table now works for mysql (only?) - Change old guestbook table now works for mysql (only?)
- More cleanup / renaming and reconfigured wordwrap in config for 2.0 final - More cleanup / renaming and reconfigured wordwrap in config for 2.0 final
- Now the guestbook should work well with/without CAPTCHAS - this needed a new config variable so please check your Captchas settings in spamblock and! guestbook plugins - Now the guestbook should work well with/without CAPTCHAS - this needed a new config variable
so please check your Captchas settings in spamblock and! guestbook plugins
- Generell clean up and messages tweaks. - Generell clean up and messages tweaks.
- Now serendipity_event_guestbook is nearly full template based (see plugin_guestbook_entries.tpl and plugin_guestbook_form.tpl) - Now serendipity_event_guestbook is nearly full template based (see plugin_guestbook_entries.tpl
and plugin_guestbook_form.tpl)
- You will find images shorttime.gif, button_background.png and delete.png in $this_plugin/img dir now. - You will find images shorttime.gif, button_background.png and delete.png in $this_plugin/img dir now.
@ -350,7 +389,8 @@ S9Y :: GUESTBOOK :: DESIGN
- Please check other lang files - actualy only <en>, <de> and <de-utf8> will work! - Please check other lang files - actualy only <en>, <de> and <de-utf8> will work!
- Permalink ("pageurl") is a full path from http root eg. "/serendipity/pages/guestbook.html" or "/serendipity/index.php?/pages/guestbook.html" (see mod_rewrite) - Permalink ("pageurl") is a full path from http root eg. "/serendipity/pages/guestbook.html"
or "/serendipity/index.php?/pages/guestbook.html" (see mod_rewrite)
- Please Note: This version is making use of plugin::spamblock features and captchas (disabled for admins), - Please Note: This version is making use of plugin::spamblock features and captchas (disabled for admins),

View file

@ -34,7 +34,7 @@
<body> <body>
<div><a name="top" id="top"></a></div> <div><a name="top" id="top"></a></div>
<div id="wrapper"> <div id="wrapper">
<div class="doc_edited">serendipity_event_guestbook/documentation_en.html, last modified 2013-08-24</div> <div class="doc_edited">serendipity_event_guestbook/documentation_en.html, last modified 2013-08-25</div>
<div class="doc_block"><span class="white">PLEASE NOTE</span><br /> <div class="doc_block"><span class="white">PLEASE NOTE</span><br />
<br /> <br />
This Serendipity guestbook plugin is TEMPLATE based, configurable by its own stylesheet, has a FRONTEND and a BACKEND.<br /> This Serendipity guestbook plugin is TEMPLATE based, configurable by its own stylesheet, has a FRONTEND and a BACKEND.<br />
@ -45,24 +45,25 @@
<div class="skip"><a href="#top">Top</a></div> <div class="skip"><a href="#top">Top</a></div>
<div class="readme_title">S9Y :: GUESTBOOK :: CONFIG SETTINGS</div> <div class="readme_title">S9Y :: GUESTBOOK :: CONFIG SETTINGS</div>
<ul class="readme config"> <ul class="readme config">
<li>The <span class="eye">'Permalink'</span> setting defines a permalink for the URL. Needs the absolute HTTP path and needs to end with .htm or .html!<br /> <li>The <span class="eye">'Permalink'</span> defines a permalink for the URL. Needs the absolute HTTP path and needs to end with .htm or .html!<br />
The Serendipity default value is "<em>/blogname/pages/guestbook.html</em>", or, in case you are not using mod_rewrite, "<em>/blogname/index.php?/pages/guestbook.html</em>".</li> The Serendipity default value is "<em>/blogname/pages/guestbook.html</em>", or, in case you are not using mod_rewrite, "<em>/blogname/index.php?/pages/guestbook.html</em>".</li>
<li>The <span class="eye">'Static Pagetitle &amp; URL'</span> setting defines the staticpage title of the page.<br /> <li>The <span class="eye">'Static Pagetitle &amp; URL'</span> defines the staticpage title of the page.<br />
Attention: this also defines the URL of the page (<em>index.php?serendipity[subpage]=name</em>). Just one short name without whitespaces (<em>default: guestbook</em>).</li> Attention: this also defines the URL of the page (<em>index.php?serendipity[subpage]=name</em>). Just one short name without whitespaces (<em>default: guestbook</em>).</li>
<li>The <span class="eye">'Headline'</span> setting defines the headline of the page inside your blog with your normal blog design (<em>optional</em>).</li> <li>The <span class="eye">'Headline'</span> defines the headline of the guestbooks frontpage page view with your normal blog design (<em>optional</em>).</li>
<li>The <span class="eye">'Intro'</span> setting defines additional introductory Text (<em>optional</em>).</li> <li>The <span class="eye">'Intro'</span> defines additional introductory Text (<em>optional</em>).</li>
<li>The <span class="eye">'Guestbook form order'</span> setting defines the place of your guestbook form, on top or bottom of the entries (<em>default: top</em>).</li> <li>The <span class="eye">'Guestbook form order'</span> defines the place of your guestbook form, on top or bottom of the entries (<em>default: top</em>).</li>
<li>The <span class="eye">'Entries per page'</span> setting defines how many entries to display per page (<em>default: 10</em>).</li> <li>The <span class="eye">'Entries per page'</span> defines how many entries to display per page (<em>default: 10</em>)</li>
<li>The <span class="eye">'Characters per line (Wordwrap)'</span> setting defines after how many characters a guestbook text line will be automatically wrapped (<em>default: 120</em>).</li> <li>The <span class="eye">'Entries per page (backend)'</span> dito (<em>default: 15</em>).</li>
<li>The <span class="eye">'Format as article'</span> setting defines if the output is automatically formatted as an article (colors, borders, etc.) (<em>default: yes</em>).</li> <li>The <span class="eye">'Characters per line (Wordwrap)'</span> defines after how many characters a guestbook text line will be automatically wrapped (<em>default: 120</em>).</li>
<li>The <span class="eye">'Send e-mail to admin'</span> setting defines email information of entries. The admin gets an e-mail for each new entry. Insert email address on next step (<em>default: false</em>).</li> <li>The <span class="eye">'Format as article'</span> defines if the output is automatically formatted as an article (colors, borders, etc.) (<em>default: yes</em>).</li>
<li>The <span class="eye">'User Email'</span> setting defines a form field for the e-mail of the user (<em>default: yes</em>).</li> <li>The <span class="eye">'Send e-mail to admin'</span> defines email information of each new entry. Insert email address on next step (<em>default: false</em>).</li>
<li>The <span class="eye">'User Homepage'</span> setting defines a form field for the homepage of the user (<em>default: false</em>).</li> <li>The <span class="eye">'User Email'</span> defines a form field for the e-mail of the user (<em>default: yes</em>).</li>
<li>The <span class="eye">'Show Captchas'</span> setting defines the use of Serendipity CAPTCHAS (requires Spamblock plugin activated) to prevent comment SPAM (<em>default: yes</em>).</li> <li>The <span class="eye">'Show Captchas'</span> defines the use of Serendipity CAPTCHAS (requires Spamblock plugin activated) to prevent comment SPAM (<em>default: yes</em>).</li>
<li>The <span class="eye">'Approve entries'</span> setting defines the guestbook entries to be verified by admin generally before they show up in frontend (<em>default: false</em>).</li> <li>The <span class="eye">'User Homepage'</span> defines a form field for the homepage of the user (<em>default: false</em>).</li>
<li>The <span class="eye">'Auto-moderate'</span> setting defines the same behaviour for a single entry, if the SPAMBLOCK-plugin wordfilter option is activ and set to 'moderate', caused by stopword matches (<em>default: false</em>). The guestbook content evaluation will still return captcha checking, if any spam check evaluates true. This differs from normal spamblock behaviour!</li> <li>The <span class="eye">'Approve entries'</span> defines the guestbook entries to be verified by admin generally before they show up in frontend (<em>default: false</em>).</li>
<li>The <span class="eye">'Entry checks'</span> setting sets an active and individual wordfilter array (<em>default: pre-filled</em>). Regular Expressions are allowed, separate strings by semicolons (;). You have to escape special chars with "\". If you leave this field empty, no special checks are done. (Bypassed by USERLEVEL_ADMIN only!)</li> <li>The <span class="eye">'Auto-moderate'</span> defines the same behaviour for a single entry, if the SPAMBLOCK-plugin wordfilter option is activ and set to 'moderate', caused by stopword matches (<em>default: false</em>). The guestbook content evaluation will still return captcha checking, if any spam check evaluates true. This differs from normal spamblock behaviour!</li>
<li>The <span class="eye">'Date format'</span> setting defines an individual strftime() code for the entry datetime (<em>default: %a, %d.%m.%Y %H:%M</em>).</li> <li>The <span class="eye">'Entry checks'</span> sets an active and individual wordfilter array (<em>default: pre-filled</em>). Regular Expressions are allowed, separate strings by semicolons (;). You have to escape special chars with "\". If you leave this field empty, no special checks are done. This check is bypassed for users with USERLEVEL_ADMIN only!</li>
<li>The <span class="eye">'Date format'</span> defines an individual strftime() code for the entry datetime (<em>default: %a, %d.%m.%Y %H:%M</em>).</li>
</ul> </ul>
<a name="admin" id="admin"></a> <a name="admin" id="admin"></a>
<div class="skip"><a href="#top">Top</a></div> <div class="skip"><a href="#top">Top</a></div>
@ -84,7 +85,7 @@
<ul class="readme design"> <ul class="readme design">
<li>All smarty tpls, images and the one main stylesheet of this plugin are located in the plugin folder and remain to stay there.</li> <li>All smarty tpls, images and the one main stylesheet of this plugin are located in the plugin folder and remain to stay there.</li>
<li>If you are skilled and wish to have an individual frontend design, copy the files to change to your template folder only<br /> <li>If you are skilled and wish to have an individual frontend design, copy the files to change to your template folder only<br />
( plugin_guestbook_entries.tpl, plugin_guestbook_form.tpl, style_guestbook_backend.css ).</li> ( plugin_guestbook_entries.tpl, plugin_guestbook_form.tpl, style_guestbook_frontend.css ).</li>
<li>In case you wish to change the <span class="eye">frontend entry background colors</span> only, copy these neutral white css directives:<br /> <li>In case you wish to change the <span class="eye">frontend entry background colors</span> only, copy these neutral white css directives:<br />
<span class="cssblock"><em>/* styles guestbook entry colors neutral */</em><br /> <span class="cssblock"><em>/* styles guestbook entry colors neutral */</em><br />
<span style="background-color: #FFB90F;;">/* the entry headline */</span> <em>.guestbook_entrytop { background:none repeat scroll 0 0 #FFF; }</em><br /> <span style="background-color: #FFB90F;;">/* the entry headline */</span> <em>.guestbook_entrytop { background:none repeat scroll 0 0 #FFF; }</em><br />
@ -92,7 +93,7 @@
<span style="background-color: wheat;color: #444">/* the admin comment line */</span> <em>span.guestbook_admin_comment { background:none repeat scroll 0 0 #FFF; }</em><br /> <span style="background-color: wheat;color: #444">/* the admin comment line */</span> <em>span.guestbook_admin_comment { background:none repeat scroll 0 0 #FFF; }</em><br />
<span style="background-color: #555555;color: #A8A8A8">/* the bottom shadow line */</span> <em>#guestbook_entrybundle { -moz-border-radius: 0 0; background:none repeat scroll 0 0 #FFF; }</em></span> <span style="background-color: #555555;color: #A8A8A8">/* the bottom shadow line */</span> <em>#guestbook_entrybundle { -moz-border-radius: 0 0; background:none repeat scroll 0 0 #FFF; }</em></span>
to the end of your templates user.css file, if you have one (suggested approach!).<br /> to the end of your templates user.css file, if you have one (suggested approach!).<br />
If your template does not support an individual stylesheet, <u>copy</u> the style_guestbook_backend.css file to your template folder,<br /> If your template does not support an individual stylesheet, <u>copy</u> the style_guestbook_frontend.css file to your template folder,<br />
set the directives to the end and change the #FFF to your prefered color (#FFF is neutral white).</li> set the directives to the end and change the #FFF to your prefered color (#FFF is neutral white).</li>
<li>If you want to purge the <span class="eye">frontend entry borders</span> too, add: <em>border: 0 none;</em> to each of them.</li> <li>If you want to purge the <span class="eye">frontend entry borders</span> too, add: <em>border: 0 none;</em> to each of them.</li>
<li>If you even wish to change all <span class="eye">frontend entry text colors</span>, add:<br /> <li>If you even wish to change all <span class="eye">frontend entry text colors</span>, add:<br />

View file

@ -23,6 +23,11 @@ class serendipity_event_guestbook extends serendipity_event {
var $title = PLUGIN_GUESTBOOK_TITLE; var $title = PLUGIN_GUESTBOOK_TITLE;
var $filter_defaults; var $filter_defaults;
/**
* Declare Serendipity backend properties.
*
* @param serendipity_property_bag $propbag
*/
function introspect(&$propbag) { function introspect(&$propbag) {
global $serendipity; global $serendipity;
@ -74,6 +79,10 @@ class serendipity_event_guestbook extends serendipity_event {
} }
/**
* serendipity_plugin::example method
*
*/
function example() { function example() {
echo "\n<ul>\n"; echo "\n<ul>\n";
echo " <li><strong>Note to v. 3.40:</strong> If have, please update copied guestbook tpl files in your template!</li>\n"; echo " <li><strong>Note to v. 3.40:</strong> If have, please update copied guestbook tpl files in your template!</li>\n";
@ -81,6 +90,11 @@ class serendipity_event_guestbook extends serendipity_event {
} }
/**
* serendipity_plugin::cleanup method
*
* @return boolean
*/
function cleanup() { function cleanup() {
global $serendipity; global $serendipity;
@ -98,13 +112,18 @@ class serendipity_event_guestbook extends serendipity_event {
} }
/**
* serendipity_plugin::install method
*
*/
function install() { function install() {
$this->createTable(); $this->createTable();
} }
/** /**
* event hook:::guestbook table install * Create table install
*
*/ */
function createTable() { function createTable() {
global $serendipity; global $serendipity;
@ -123,7 +142,12 @@ class serendipity_event_guestbook extends serendipity_event {
} }
function alter_db($db_config_version) { /**
* Upgrade Alter Table
*
* @param string version
*/
function alter_db($db_config_version) {
global $serendipity; global $serendipity;
if ($db_config_version == '1.0') { if ($db_config_version == '1.0') {
$q = "ALTER TABLE {$serendipity['dbPrefix']}guestbook CHANGE name name varchar(100)"; $q = "ALTER TABLE {$serendipity['dbPrefix']}guestbook CHANGE name name varchar(100)";
@ -155,7 +179,9 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* event hook::guestbook table uninstall * serendipity_plugin::uninstall method
*
* @return boolean
*/ */
function uninstall(&$propbag) { function uninstall(&$propbag) {
global $serendipity; global $serendipity;
@ -172,7 +198,44 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* guestbook config items::$propbag->add('configuration') * This function is a s9y plugin standard starter
* sets $serendipity['GET']['subpage']
*
* @return boolean
*/
function selected() {
global $serendipity;
if (!empty($serendipity['POST']['subpage'])) {
$serendipity['GET']['subpage'] = $serendipity['POST']['subpage'];
}
if ($serendipity['GET']['subpage'] == $this->get_config('pagetitle') ||
preg_match('@^' . preg_quote($this->get_config('permalink')) . '@i', $serendipity['GET']['subpage'])) {
return true;
}
return false;
}
/**
* serendipity_plugin::generate_content
* This function is used for sidebar plugins only
*
* @param string $title is somehow important to indicate the title of a plugin in the plugin configuration manager.
*/
function generate_content(&$title) {
$title = PLUGIN_GUESTBOOK_TITLE.' (' . $this->get_config('pagetitle') . ')'; // do we need to set this to headline now?
}
/**
* Generate backend configuration fields
*
* @param string $name field name
* @param serendipity_property_bag $propbag properties
* @return boolean
*/ */
function introspect_config_item($name, &$propbag) { function introspect_config_item($name, &$propbag) {
global $serendipity; global $serendipity;
@ -324,7 +387,6 @@ class serendipity_event_guestbook extends serendipity_event {
* Try to make email address printing safe (protect from spammers) * Try to make email address printing safe (protect from spammers)
* *
* @param string $string entry email checks * @param string $string entry email checks
*
* @return string * @return string
*/ */
function safeEmail($email) { function safeEmail($email) {
@ -350,8 +412,7 @@ class serendipity_event_guestbook extends serendipity_event {
* Check if email is valid * Check if email is valid
* *
* @param string $string entry email checks * @param string $string entry email checks
* * @return mixed string/boolean
* @return boolean/string
*/ */
function is_valid_email($postmail) { function is_valid_email($postmail) {
// Email needs to match this pattern to be a good email address // Email needs to match this pattern to be a good email address
@ -371,7 +432,6 @@ class serendipity_event_guestbook extends serendipity_event {
* Adds match to $serendipity['messagestack']['comments'] array, if not in admin group * Adds match to $serendipity['messagestack']['comments'] array, if not in admin group
* *
* @param string $string mostly entry body checks * @param string $string mostly entry body checks
*
* @return boolean * @return boolean
*/ */
function strip_input($string) { function strip_input($string) {
@ -405,8 +465,7 @@ class serendipity_event_guestbook extends serendipity_event {
* @param array $keys array of keys only * @param array $keys array of keys only
* @param boolean $single loop array or return string * @param boolean $single loop array or return string
* @param boolean $compare allow is stripped by key note * @param boolean $compare allow is stripped by key note
* * @return mixed array $serendipity['POST'] or single string
* @return $serendipity['POST'] array or single string
*/ */
function strip_security($parr = null, $keys = null, $single = false, $compare = true) { function strip_security($parr = null, $keys = null, $single = false, $compare = true) {
$authenticated_user = serendipity_userLoggedIn() ? true : false; $authenticated_user = serendipity_userLoggedIn() ? true : false;
@ -428,6 +487,50 @@ class serendipity_event_guestbook extends serendipity_event {
} }
/**
* BBCode replacements
* old preg_replace had issues with whitespaces
*
* @param string $string entry comment replacements
* @return string
*/
function text_pattern_bbc($text) {
$pattern = array('[b]', '[/b]', '[u]', '[/u]', '[i]', '[/i]', '[s]', '[/s]', '[q]', '[/q]', '[ac]', '[/ac]');
$replacement = array('<strong>', '</strong>', '<u>', '</u>', '<em>', '</em>', '<del>', '</del>', '<q>', '</q>', '<br /><span class="guestbook_admin_comment"><blockquote cite="#"><p>', '</p></blockquote></span>');
return str_replace($pattern, $replacement, $text);
}
/**
* BBCode reverse
*
* @param string $string entry comment replacements
* @return string
*/
function bbc_reverse($text) {
$pattern = '|[[\/]*?[^\[\]]*?]|si';
$replace = '';
return preg_replace($pattern, $replace, $text);
}
/**
* Cut string between two other strings
*
* @param string $str given string
* @param string $from left string for cutting
* @param string $to right string for cutting
* @return string cut part
*/
function cut_string($str, $from, $to){
$start = strpos($str,$from) + strlen($from);
if (strpos($str,$from) === false) return false;
$length = strpos($str,$to,$start) - $start;
if (strpos($str,$to,$start) === false) return false;
return substr($str,$start,$length);
}
/** /**
* Set frontend pagination to global var * Set frontend pagination to global var
* *
@ -435,8 +538,7 @@ class serendipity_event_guestbook extends serendipity_event {
* @param boolean $ap approved yes/no = 1/0 * @param boolean $ap approved yes/no = 1/0
* @param string $pname frontend Url with ? or & depending mod_rewrite settings * @param string $pname frontend Url with ? or & depending mod_rewrite settings
* @param int $maxpp max entries per page * @param int $maxpp max entries per page
* * @return array $entries
* @return entries array
*/ */
function frontend_guestbook_paginator($c, $ap, $pname, $maxpp) { function frontend_guestbook_paginator($c, $ap, $pname, $maxpp) {
global $serendipity; global $serendipity;
@ -495,93 +597,13 @@ class serendipity_event_guestbook extends serendipity_event {
} // function frontend paginator end } // function frontend paginator end
/**
* This function is a s9y plugin standard starter
* sets $serendipity['GET']['subpage']
*
* @return boolean
*/
function selected() {
global $serendipity;
if (!empty($serendipity['POST']['subpage'])) {
$serendipity['GET']['subpage'] = $serendipity['POST']['subpage'];
}
if ($serendipity['GET']['subpage'] == $this->get_config('pagetitle') ||
preg_match('@^' . preg_quote($this->get_config('permalink')) . '@i', $serendipity['GET']['subpage'])) {
return true;
}
return false;
}
/**
* This function is used for sidebar plugins only
*
* @param string $title is somehow important to indicate the title of a plugin in the plugin configuration manager.
*/
function generate_content(&$title) {
$title = PLUGIN_GUESTBOOK_TITLE.' (' . $this->get_config('pagetitle') . ')'; // do we need to set this to headline now?
}
/**
* BBCode replacements
* old preg_replace had issues with whitespaces
*
* @param string $string entry comment replacements
*
* @return string
*/
function text_pattern_bbc($text) {
$pattern = array('[b]', '[/b]', '[u]', '[/u]', '[i]', '[/i]', '[s]', '[/s]', '[q]', '[/q]', '[ac]', '[/ac]');
$replacement = array('<strong>', '</strong>', '<u>', '</u>', '<em>', '</em>', '<del>', '</del>', '<q>', '</q>', '<br /><span class="guestbook_admin_comment"><blockquote cite="#"><p>', '</p></blockquote></span>');
return str_replace($pattern, $replacement, $text);
}
/**
* BBCode reverse
*
* @param string $string entry comment replacements
*
* @return string
*/
function bbc_reverse($text) {
$pattern = '|[[\/]*?[^\[\]]*?]|si';
$replace = '';
return preg_replace($pattern, $replace, $text);
}
/**
* Cut string between two other strings
*
* @param string $str given string
* @param string $from left string for cutting
* @param string $to right string for cutting
*
* @return cut string part
*/
function cut_string($str, $from, $to){
$start = strpos($str,$from) + strlen($from);
if (strpos($str,$from) === false) return false;
$length = strpos($str,$to,$start) - $start;
if (strpos($str,$to,$start) === false) return false;
return substr($str,$start,$length);
}
/** /**
* Generate entries checks * Generate entries checks
* *
* @param array $entries given string * @param array $entries given string
* @param string $is_guestbook_ url create url * @param string $is_guestbook_ url create url
* @param int $wordwrap linebreak * @param int $wordwrap linebreak
* * @return array $entries for output
* @return array entries for output
*/ */
function generate_EntriesArray($entries, $is_guestbook_url, $wordwrap) { function generate_EntriesArray($entries, $is_guestbook_url, $wordwrap) {
global $serendipity; global $serendipity;
@ -626,16 +648,15 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Insert guestbook entry into database and send mail * Insert guestbook entry into database and send mail
* *
* @param int $id * @param int $id
* @param string $ip * @param string $ip
* @param string $name * @param string $name
* @param string $url * @param string $url
* @param string $email * @param string $email
* @param string $body * @param string $body
* @param int $app approved * @param int $app approved
* @param int $ts timestamp * @param int $ts timestamp
* @param boolean $old Insert/Replace * @param boolean $old Insert/Replace
*
* @return boolean * @return boolean
*/ */
function insertEntriesDB($id=false, $ip=false, $name, $url, $email, $body, $app=false, $ts=false, $old=false) { function insertEntriesDB($id=false, $ip=false, $name, $url, $email, $body, $app=false, $ts=false, $old=false) {
@ -687,8 +708,7 @@ class serendipity_event_guestbook extends serendipity_event {
* Guestbook entries count db * Guestbook entries count db
* *
* @param int $ap approved * @param int $ap approved
* * @return mixed boolean/int
* @return boolean/int
*/ */
function countEntriesDB($ap) { function countEntriesDB($ap) {
global $serendipity; global $serendipity;
@ -709,8 +729,7 @@ class serendipity_event_guestbook extends serendipity_event {
* @param int $cp limit from * @param int $cp limit from
* @param int $rp limit to * @param int $rp limit to
* @param int $ap approved * @param int $ap approved
* * @return mixed boolean/array $entries
* @return boolean/array entries
*/ */
function getEntriesDB($cp, $rp, $ap) { function getEntriesDB($cp, $rp, $ap) {
global $serendipity; global $serendipity;
@ -732,7 +751,7 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Guestbook form submit POST checks, validate & insert into db * Guestbook form submit POST checks, validate & insert into db
* *
* @return boolean * @return boolean on error
*/ */
function checkSubmit() { function checkSubmit() {
global $serendipity; global $serendipity;
@ -956,6 +975,8 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Guestbook create output page assignment and fetch template file * Guestbook create output page assignment and fetch template file
*
* @return boolean on error
*/ */
function generate_Page() { function generate_Page() {
global $serendipity; global $serendipity;
@ -1049,6 +1070,7 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Guestbook create form page assignment and fetch template file * Guestbook create form page assignment and fetch template file
*
*/ */
function generate_FormPage() { function generate_FormPage() {
@ -1181,7 +1203,13 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* event hook items::$propbag->add('event_hooks') * Hook for Serendipity events, initialize plug-in features
*
* @param string $event
* @param serendipity_property_bag $bag
* @param array $eventData
* @param array $addData
* @return boolean
*/ */
function event_hook($event, &$bag, &$eventData, $addData = null) { function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity; global $serendipity;
@ -1376,8 +1404,8 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Add front- and backend css to serendipity(_admin).css * Add front- and backend css to serendipity(_admin).css
* *
* @param array $eventSata * @param array $eventData
* @param array $addata * @param array $addData
* *
*/ */
function cssEventData(&$eventData, &$becss) { function cssEventData(&$eventData, &$becss) {
@ -1400,10 +1428,15 @@ class serendipity_event_guestbook extends serendipity_event {
serendipity_smarty_init(); // if not set to avoid member function assign() on a non-object error, start Smarty templating serendipity_smarty_init(); // if not set to avoid member function assign() on a non-object error, start Smarty templating
} }
$moderate = ( serendipity_db_bool($this->get_config('showapp')) || serendipity_db_bool($this->get_config('automoderate')) ) ? true : false; $moderate = (serendipity_db_bool($this->get_config('showapp')) || serendipity_db_bool($this->get_config('automoderate'))) ? true : false;
$attention = '<img class="backend_attention" src="' . $serendipity['serendipityHTTPPath'] . 'templates/default/admin/img/admin_msg_note.png" alt="" />'; $attention = '<img class="backend_attention" src="' . $serendipity['serendipityHTTPPath'] . 'templates/default/admin/img/admin_msg_note.png" alt="" />';
$gbcat = !empty($serendipity['GET']['guestbookcategory']) ? $serendipity['GET']['guestbookcategory'] : $serendipity['POST']['guestbookcategory']; $gbcat = !empty($serendipity['GET']['guestbookcategory']) ? $serendipity['GET']['guestbookcategory'] : $serendipity['POST']['guestbookcategory'];
$gbviewact = (!isset($serendipity['GET']['guestbookcategory']) || $serendipity['GET']['guestbookcategory'] == 'gbview') ? ' id="active"' : '';
$gbappact = ($serendipity['GET']['guestbookcategory'] == 'gbapp' || $serendipity['POST']['guestbook_category'] == 'gbapp') ? ' id="active"' : '';
$gbaddact = (($serendipity['GET']['guestbookcategory'] == 'gbadd' || $serendipity['POST']['guestbookcategory'] == 'gbadd') && $serendipity['POST']['guestbook_category'] != 'gbapp') ? ' id="active"' : '';
$gbgbact = $serendipity['GET']['guestbookcategory'] == 'gbdb' ? ' id="active"' : '';
echo "\n<div id='backend_guestbook_wrapper'>\n\n"; echo "\n<div id='backend_guestbook_wrapper'>\n\n";
echo '<div class="backend_guestbook_menu"><h3>'. sprintf(PLUGIN_GUESTBOOK_ADMIN_NAME_MENU, $serendipity['plugin_guestbook_version']) .'</h3></div>'."\n"; echo '<div class="backend_guestbook_menu"><h3>'. sprintf(PLUGIN_GUESTBOOK_ADMIN_NAME_MENU, $serendipity['plugin_guestbook_version']) .'</h3></div>'."\n";
@ -1411,18 +1444,24 @@ class serendipity_event_guestbook extends serendipity_event {
if (!isset($serendipity['POST']['guestbookadmin'])) { if (!isset($serendipity['POST']['guestbookadmin'])) {
echo ' echo '
<div class="backend_guestbook_nav"> <div class="backend_guestbook_nav">
<ul> <ul>
<li '.(@$serendipity['GET']['guestbookcategory'] == 'gbview' ? 'id="active"' : '').'><a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbview">'.PLUGIN_GUESTBOOK_ADMIN_VIEW.'</a></li> <li'.$gbviewact.'>
'; <a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbview">'.PLUGIN_GUESTBOOK_ADMIN_VIEW.'</a>
</li>';
if ($moderate === true) { if ($moderate === true) {
echo ' echo '
<li '.((@$serendipity['GET']['guestbookcategory'] == 'gbapp' || @$serendipity['POST']['guestbook_category'] == 'gbapp') ? 'id="active"' : '').'><a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbapp">'.PLUGIN_GUESTBOOK_ADMIN_APP.'</a></li> <li'.$gbappact.'>
'; <a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbapp">'.PLUGIN_GUESTBOOK_ADMIN_APP.'</a>
</li>';
} }
echo ' echo '
<li '.(((@$serendipity['GET']['guestbookcategory'] == 'gbadd' || @$serendipity['POST']['guestbookcategory'] == 'gbadd') && @$serendipity['POST']['guestbook_category'] != 'gbapp') ? 'id="active"' : '').'><a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbadd">'.PLUGIN_GUESTBOOK_ADMIN_ADD.'</a></li> <li'.$gbaddact.'>
<li '.(@$serendipity['GET']['guestbookcategory'] == 'gbdb' ? 'id="active"' : '').'><a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbdb">'.PLUGIN_GUESTBOOK_ADMIN_DBC.'</a></li> <a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbadd">'.PLUGIN_GUESTBOOK_ADMIN_ADD.'</a>
</ul> </li>
<li'.$gbgbact.'>
<a href="'.$serendipity['serendipityHTTPPath'].'serendipity_admin.php?serendipity[adminModule]=event_display&amp;serendipity[adminAction]=guestbook&amp;serendipity[guestbookcategory]=gbdb">'.PLUGIN_GUESTBOOK_ADMIN_DBC.'</a>
</li>
</ul>
</div> </div>
'."\n"; '."\n";
} }
@ -1607,10 +1646,9 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Get sql results and assign them to smarty * Get sql results and assign them to smarty
* *
* @param $ap = approved yes/no = 1/0 * @param int $ap approved yes/no = 1/0
* @param $cat = serendipity[guestbookcategory] * @param string $cat serendipity[guestbookcategory]
* * @return boolean is_arrray($entries)
* @return (true/false)
*/ */
function backend_guestbook_view($ap, $cat) { function backend_guestbook_view($ap, $cat) {
global $serendipity; global $serendipity;
@ -1628,7 +1666,7 @@ class serendipity_event_guestbook extends serendipity_event {
if (isset($result['paginator'])) { if (isset($result['paginator'])) {
// slice and save last element of $result // slice and save last element of $result
$paginator = array_pop($result);#print_r($result); $paginator = array_pop($result);
} }
// this assigns db entries output to guestbooks smarty array: {$entries} in entries.tpl // this assigns db entries output to guestbooks smarty array: {$entries} in entries.tpl
@ -1675,6 +1713,7 @@ class serendipity_event_guestbook extends serendipity_event {
* plugins panel administration * plugins panel administration
* switch into dump, insert, erase, download * switch into dump, insert, erase, download
* *
* @return boolean
*/ */
function backend_guestbook_dbclean() { function backend_guestbook_dbclean() {
global $serendipity; global $serendipity;
@ -1811,6 +1850,9 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* Read the sqldump backup directory - function scanDir() >= php5 * Read the sqldump backup directory - function scanDir() >= php5
*
* @param string $dpath relative path
* @param string $delpath url path
*/ */
function backend_read_backup_dir($dpath, $delpath) { function backend_read_backup_dir($dpath, $delpath) {
global $serendipity; global $serendipity;
@ -1834,7 +1876,6 @@ class serendipity_event_guestbook extends serendipity_event {
* @param string url - the url string to pass * @param string url - the url string to pass
* @param string addno - the add to url string in case of no proceed * @param string addno - the add to url string in case of no proceed
* @param string addyes - the add to url string in case of YES * @param string addyes - the add to url string in case of YES
*
* @return string * @return string
*/ */
function backend_guestbook_questionaire($text, $url, $addno, $addyes) { function backend_guestbook_questionaire($text, $url, $addno, $addyes) {
@ -1916,7 +1957,7 @@ class serendipity_event_guestbook extends serendipity_event {
* @param int $ap = approved yes/no = 1/0 * @param int $ap = approved yes/no = 1/0
* @param string $cat = serendipity[guestbookcategory] * @param string $cat = serendipity[guestbookcategory]
* *
* @return result array * @return mixed array/boolean $result
*/ */
function backend_guestbook_paginator($c, $ap, $cat) { function backend_guestbook_paginator($c, $ap, $cat) {
global $serendipity; global $serendipity;
@ -1982,7 +2023,8 @@ class serendipity_event_guestbook extends serendipity_event {
/** /**
* set global $serendipity['guestbook_message_header'] to true in case of approve or erase entry * set global $serendipity['guestbook_message_header'] to true in case of approve or erase entry
* return entry array to re-edit and change *
* @return array $entry to re-edit and change
*/ */
function backend_request_checks() { function backend_request_checks() {
global $serendipity; global $serendipity;

View file

@ -136,9 +136,13 @@ span.frontend_guestbook_paginator_right { color: #BBB; }
} }
#backend_guestbook_wrapper .guestbook_entries dt { display: inline-block; } #backend_guestbook_wrapper .guestbook_entries dt { display: inline-block; }
#backend_guestbook_wrapper .guestbook_move { #backend_guestbook_wrapper .guestbook_move {
padding: 0 4px; background: none repeat scroll 0 0 ButtonFace;
margin: 0 4px; //neu auf margin
vertical-align: text-top; vertical-align: text-top;
} }
#backend_guestbook_wrapper img.guestbook_move {
background: none repeat scroll 0 0 transparent;
}
div.backend_guestbook_nav { div.backend_guestbook_nav {
border: thin solid; border: thin solid;
float: right; float: right;