3.59 guestbook callback switch
This commit is contained in:
parent
3fbd211308
commit
a91973cfaa
5 changed files with 53 additions and 43 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
3.59:
|
||||||
|
-----
|
||||||
|
* Switch {call feedback} function to show success or error box
|
||||||
|
* Indent backend sidebar menu links markup
|
||||||
|
* Cleanup returning booleans where case expects break
|
||||||
|
|
||||||
|
|
||||||
3.58: & 1.25:
|
3.58: & 1.25:
|
||||||
-------------
|
-------------
|
||||||
* Added mysqli and check for supporting mysql and mysqli only
|
* Added mysqli and check for supporting mysql and mysqli only
|
||||||
|
|
|
@ -95,6 +95,15 @@ S9Y :: GUESTBOOK :: DESIGN
|
||||||
Happy designing!
|
Happy designing!
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------------
|
||||||
|
| Version 3.59 |
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Switch {call feedback} function to show success or error box
|
||||||
|
* Indent backend sidebar menu links markup
|
||||||
|
* Cleanup returning booleans where case expects break
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
| Version 3.58 & 1.25 sidebar |
|
| Version 3.58 & 1.25 sidebar |
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{*
|
{*
|
||||||
plugin_guestbook_backend_header.tpl v.3.57 2015-08-20 Ian
|
plugin_guestbook_backend_header.tpl v.3.59 2016-01-08 Ian
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{function name="feedback"}{* message and error feedback for approve, view, add issues *}
|
{function name="feedback"}{* message and error feedback for approve, view, add issues *}
|
||||||
<div class="msg_error">
|
<div class="msg_{if $msg_header == $CONST.THANKS_FOR_ENTRY}success{else}error{/if}">
|
||||||
<span class="icon-attention-circled"></span> <strong>{$msg_header}</strong>
|
<span class="icon-{if $msg_header == $CONST.THANKS_FOR_ENTRY}ok{else}attention{/if}-circled"></span> <strong>{$msg_header}</strong>
|
||||||
{if $guestbook_messages}
|
{if $guestbook_messages}
|
||||||
<ul>
|
<ul>
|
||||||
{foreach $guestbook_messages AS $msg}
|
{foreach $guestbook_messages AS $msg}
|
||||||
|
|
|
@ -67,7 +67,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
'dateformat'
|
'dateformat'
|
||||||
));
|
));
|
||||||
$propbag->add('author', 'Ian');
|
$propbag->add('author', 'Ian');
|
||||||
$propbag->add('version', '3.58');
|
$propbag->add('version', '3.59');
|
||||||
$propbag->add('requirements', array(
|
$propbag->add('requirements', array(
|
||||||
'serendipity' => '1.7.0',
|
'serendipity' => '1.7.0',
|
||||||
'smarty' => '3.1.0',
|
'smarty' => '3.1.0',
|
||||||
|
@ -383,8 +383,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -949,9 +948,9 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
if (is_numeric($_POST['guestbook']['id'])) $_POST['guestbook']['approved'] = 1;
|
if (is_numeric($_POST['guestbook']['id'])) $_POST['guestbook']['approved'] = 1;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
allow the spamblock wordfilter plugin to set an entry as non-approved,
|
Allow the spamblock plugin wordfilter to set an entry as non-approved,
|
||||||
accordingly to stopwords and content filter set to 'moderation' in spamblock plugin.
|
accordingly to stopwords and content filter set to 'moderation' in spamblock plugin.
|
||||||
extends new auto-moderate option setting to true in guestbooks config
|
Extends new auto-moderate option setting to true in guestbooks config
|
||||||
***/
|
***/
|
||||||
// keep this for future finetuning via SPAMBLOCK plugin
|
// keep this for future finetuning via SPAMBLOCK plugin
|
||||||
if (array_key_exists('moderate_comments', $ca)) {
|
if (array_key_exists('moderate_comments', $ca)) {
|
||||||
|
@ -984,7 +983,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
$showapptxt = ($showapp && !$authenticated_user) ? ' ' . PLUGIN_GUESTBOOK_DBDONE_APP : '';
|
$showapptxt = ($showapp && !$authenticated_user) ? ' ' . PLUGIN_GUESTBOOK_DBDONE_APP : '';
|
||||||
|
|
||||||
if (!$authenticated_user) {
|
if (!$authenticated_user) {
|
||||||
// be strict here, since it could be null also
|
// be strict here, since it could also be NULL
|
||||||
if (($showapp === false && $acapp === 0) || $serendipity['csuccess'] == 'moderate') {
|
if (($showapp === false && $acapp === 0) || $serendipity['csuccess'] == 'moderate') {
|
||||||
if (isset($serendipity[$forcemoderate[0]]) == 'moderate') {
|
if (isset($serendipity[$forcemoderate[0]]) == 'moderate') {
|
||||||
$showapptxt = '<br>' . $serendipity['moderate_reason'] . '<br>' . PLUGIN_GUESTBOOK_AUTOMODERATE_ERROR . PLUGIN_GUESTBOOK_DBDONE_APP;
|
$showapptxt = '<br>' . $serendipity['moderate_reason'] . '<br>' . PLUGIN_GUESTBOOK_AUTOMODERATE_ERROR . PLUGIN_GUESTBOOK_DBDONE_APP;
|
||||||
|
@ -992,8 +991,9 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is a success msg!
|
||||||
array_push($messages, PLUGIN_GUESTBOOK_MESSAGE . ': ' . PLUGIN_GUESTBOOK_DBDONE . $showapptxt);
|
array_push($messages, PLUGIN_GUESTBOOK_MESSAGE . ': ' . PLUGIN_GUESTBOOK_DBDONE . $showapptxt);
|
||||||
// flag global meassage header to have successfully checked and safed the entry
|
// flag global meassage header to have successfully checked and saved the entry
|
||||||
$serendipity['guestbook_message_header'] = true;
|
$serendipity['guestbook_message_header'] = true;
|
||||||
|
|
||||||
// reset post values
|
// reset post values
|
||||||
|
@ -1057,7 +1057,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate frontend admin header section - if user logged in and action == delete entry
|
// generate frontend admin header section - if user logged in and action is delete entry
|
||||||
if (!empty ($serendipity['GET']['adminAction']) && $_SESSION['serendipityAuthedUser'] === true) {
|
if (!empty ($serendipity['GET']['adminAction']) && $_SESSION['serendipityAuthedUser'] === true) {
|
||||||
// use permalink generally instead of subpage
|
// use permalink generally instead of subpage
|
||||||
$is_guestbook_url = ($serendipity['rewrite'] != 'errordocs') ? $this->get_config('permalink') : $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?serendipity[subpage]=' . $this->get_config('pagetitle');
|
$is_guestbook_url = ($serendipity['rewrite'] != 'errordocs') ? $this->get_config('permalink') : $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?serendipity[subpage]=' . $this->get_config('pagetitle');
|
||||||
|
@ -1085,7 +1085,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
#return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1319,7 +1319,6 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
$serendipity['head_title'] = $this->get_config('headline');
|
$serendipity['head_title'] = $this->get_config('headline');
|
||||||
$serendipity['head_subtitle'] = $this->html_specialchars($serendipity['blogTitle']);
|
$serendipity['head_subtitle'] = $this->html_specialchars($serendipity['blogTitle']);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'entry_display':
|
case 'entry_display':
|
||||||
|
@ -1331,15 +1330,12 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
$eventData = array('clean_page' => true);
|
$eventData = array('clean_page' => true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'entries_header':
|
case 'entries_header':
|
||||||
// this one really rolls up output: check form submit, generate entries and form
|
// this one really rolls up output: check form submit, generate entries and form
|
||||||
$this->generate_Page();
|
$this->generate_Page();
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'external_plugin':
|
case 'external_plugin':
|
||||||
|
@ -1375,9 +1371,9 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
$search = array('{TEMPLATE_PATH}', '{PLUGIN_PATH}');
|
$search = array('{TEMPLATE_PATH}', '{PLUGIN_PATH}');
|
||||||
$tfilecontent = str_replace($search, $serendipity['guestbook']['pluginpath'], @file_get_contents($tfile));
|
$tfilecontent = str_replace($search, $serendipity['guestbook']['pluginpath'], @file_get_contents($tfile));
|
||||||
}
|
}
|
||||||
if (!empty($tfilecontent)) $this->cssEventData($eventData, $tfilecontent);
|
if (!empty($tfilecontent)) {
|
||||||
|
$this->cssEventData($eventData, $tfilecontent);
|
||||||
return true;
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'backend_sidebar_entries':
|
case 'backend_sidebar_entries':
|
||||||
|
@ -1386,10 +1382,8 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($serendipity['version'][0] < 2) {
|
if ($serendipity['version'][0] < 2) {
|
||||||
echo "\n".'<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=guestbook">' . PLUGIN_GUESTBOOK_ADMIN_NAME . '</a></li>'."\n";
|
echo "\n".' <li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=guestbook">' . PLUGIN_GUESTBOOK_ADMIN_NAME . '</a></li>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'backend_sidebar_admin_appearance':
|
case 'backend_sidebar_admin_appearance':
|
||||||
|
@ -1398,10 +1392,8 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($serendipity['version'][0] > 1) {
|
if ($serendipity['version'][0] > 1) {
|
||||||
echo "\n".'<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=guestbook">' . PLUGIN_GUESTBOOK_ADMIN_NAME . '</a></li>'."\n";
|
echo "\n".' <li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=guestbook">' . PLUGIN_GUESTBOOK_ADMIN_NAME . '</a></li>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'backend_sidebar_entries_event_display_guestbook':
|
case 'backend_sidebar_entries_event_display_guestbook':
|
||||||
|
@ -1413,7 +1405,6 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
// show backend administration menu
|
// show backend administration menu
|
||||||
$this->gbadminpanel();
|
$this->gbadminpanel();
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// put here all you css stuff you need for the backend of guestbook pages
|
// put here all you css stuff you need for the backend of guestbook pages
|
||||||
|
@ -1438,6 +1429,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
// overwrite Serendipity 1.7 .serendipityAdminContent span !important
|
// overwrite Serendipity 1.7 .serendipityAdminContent span !important
|
||||||
if ($serendipity['version'][0] < '2') {
|
if ($serendipity['version'][0] < '2') {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
#wrapGB .gb_entryhead span {color: #CCDDE7 !important;}
|
#wrapGB .gb_entryhead span {color: #CCDDE7 !important;}
|
||||||
#wrapGB .gb_entrybody span {color: #222 !important;}
|
#wrapGB .gb_entrybody span {color: #222 !important;}
|
||||||
#wrapGB .msg_error,
|
#wrapGB .msg_error,
|
||||||
|
@ -1468,16 +1460,16 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
// add replaced css content to the end of serendipity_admin.css
|
// add replaced css content to the end of serendipity_admin.css
|
||||||
if (!empty($tfilecontent)) $this->cssEventData($eventData, $tfilecontent);
|
if (!empty($tfilecontent)) {
|
||||||
|
$this->cssEventData($eventData, $tfilecontent);
|
||||||
return true;
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1552,7 +1544,9 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
// view all approved(1) entries in a table
|
// view all approved(1) entries in a table
|
||||||
$ve = $this->backend_guestbook_view(1, 'gbview');
|
$ve = $this->backend_guestbook_view(1, 'gbview');
|
||||||
|
|
||||||
if ($ve === false) $serendipity['smarty']->assign('is_gbadmin_noviewresult', true);
|
if ($ve === false) {
|
||||||
|
$serendipity['smarty']->assign('is_gbadmin_noviewresult', true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'gbapp':
|
case 'gbapp':
|
||||||
|
@ -1576,7 +1570,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
// check form vars
|
// check form vars
|
||||||
$this->checkSubmit();
|
$this->checkSubmit();
|
||||||
}
|
}
|
||||||
|
// HÄH?????
|
||||||
if ($serendipity['guestbook_message_header'] === true) {
|
if ($serendipity['guestbook_message_header'] === true) {
|
||||||
if (count($messages) < 1 && $serendipity['guestbook_message_header'] === false) {
|
if (count($messages) < 1 && $serendipity['guestbook_message_header'] === false) {
|
||||||
array_push($messages, PLUGIN_GUESTBOOK_MESSAGE . ': ' . ERROR_UNKNOWN . '<br>' . ERROR_NOCAPTCHASET);
|
array_push($messages, PLUGIN_GUESTBOOK_MESSAGE . ': ' . ERROR_UNKNOWN . '<br>' . ERROR_NOCAPTCHASET);
|
||||||
|
@ -1648,7 +1642,6 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
echo $this->parseTemplate('plugin_guestbook_backend_form.tpl');
|
echo $this->parseTemplate('plugin_guestbook_backend_form.tpl');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'gbdb':
|
case 'gbdb':
|
||||||
|
@ -1662,8 +1655,6 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
// add event form
|
// add event form
|
||||||
$this->backend_guestbook_dbclean();
|
$this->backend_guestbook_dbclean();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'droptable':
|
case 'droptable':
|
||||||
|
@ -1674,7 +1665,6 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
$serendipity['GET']['guestbookdbclean'] = 'dberase';
|
$serendipity['GET']['guestbookdbclean'] = 'dberase';
|
||||||
$this->backend_guestbook_dbclean($reqbuild['month'], $reqbuild['year']);
|
$this->backend_guestbook_dbclean($reqbuild['month'], $reqbuild['year']);
|
||||||
|
|
||||||
return true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1790,6 +1780,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
|
|
||||||
case 'dbinsert':
|
case 'dbinsert':
|
||||||
$serendipity['smarty']->assign('is_guestbook_admin_insert', true);
|
$serendipity['smarty']->assign('is_guestbook_admin_insert', true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'dberase':
|
case 'dberase':
|
||||||
|
@ -1839,6 +1830,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
|
|
||||||
case 'dbnixda':
|
case 'dbnixda':
|
||||||
$serendipity['smarty']->assign('is_guestbook_admin_dbempty', true);
|
$serendipity['smarty']->assign('is_guestbook_admin_dbempty', true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1846,6 +1838,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($serendipity['dbType'] == 'mysql' || $serendipity['dbType'] == 'mysqli') {
|
if ($serendipity['dbType'] == 'mysql' || $serendipity['dbType'] == 'mysqli') {
|
||||||
// assign form array entries to smarty
|
// assign form array entries to smarty
|
||||||
$serendipity['smarty']->assign(
|
$serendipity['smarty']->assign(
|
||||||
|
@ -1900,6 +1893,7 @@ class serendipity_event_guestbook extends serendipity_event {
|
||||||
*/
|
*/
|
||||||
function backend_guestbook_questionaire($text, $url, $addno, $addyes) {
|
function backend_guestbook_questionaire($text, $url, $addno, $addyes) {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
if (!is_object($serendipity['smarty'])) {
|
if (!is_object($serendipity['smarty'])) {
|
||||||
serendipity_smarty_init();
|
serendipity_smarty_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ class serendipity_plugin_guestbook extends serendipity_plugin {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue