From 8a062fc41aacc075f4f08cec16dfb0a5025ac186 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sun, 8 Sep 2024 11:35:06 +0300
Subject: [PATCH 1/8] Update for PHP 8.x. Requires PmWiki 2.3.36.
---
cookbook/blogit/blogit.php | 83 +++++++++++++++++++++-----------------
1 file changed, 46 insertions(+), 37 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index 32649dd..4ec4ca8 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -6,10 +6,12 @@
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
For installation and usage instructions refer to: http://pmwiki.com/wiki/Cookbook/BlogIt
+
+Updated for recent PHP versions by Petko Yotov pmwiki.org/petko
*/
-$RecipeInfo['BlogIt']['Version'] = '20160330'; //1.9.5
-if ($VersionNum < 2001950)
- Abort("
You are running PmWiki version {$Version}. In order to use BlogIt please update to 2.2.1 or later.
");
+$RecipeInfo['BlogIt']['Version'] = '2024-09-06'; //1.9.6?
+if ($VersionNum < 2003036)
+ Abort("You are running PmWiki version {$Version}. In order to use BlogIt please update to 2.3.36 or later.
");
// ----------------------------------------
// - User settings
@@ -102,7 +104,7 @@
SDV($bi_TagSeparator, ', ');
SDV($bi_TitleSeparator, '-');
SDV($bi_EnablePostDirectives, true); //Set to true to allow posting of directives of form (: :) in blog entries.
-SDV($bi_StatAction, $TotalCounterAction); //set by TotalCounter cookbook
+SDV($bi_StatAction, @$TotalCounterAction); //set by TotalCounter cookbook
SDV($bi_Cookie, $CookiePrefix . 'blogit-');
SDV($bi_UnstyleFn, '');
SDV($bi_CharsetFn, 'bi_CharsetFn'); //Possibly replace with fn using mb_convert_encoding($v,$Charset,'UTF-8');
@@ -123,7 +125,7 @@
));
bi_SDVSA($bi_Hooks, array()); //processing hooks, pointers to a function(). Format: $bi_Hooks[$type][$stage][] $type=blog,comment $stage=pre-entry, pre-save, post-save
SDVA($bi_Paths, array(
- 'pmform' => "$FarmD/cookbook/pmform.php",
+ 'pmform' => "$FarmD/scripts/pmform.php",
'guiedit' => "$FarmD/scripts/guiedit.php",
'convert' => "$FarmD/cookbook/blogit/blogit_upgrade.php",
'feeds' => "$FarmD/scripts/feeds.php"
@@ -136,18 +138,15 @@
"/'/" => '', //strip single-quotes
"/[^" . $PageNameChars . "]+/" => $bi_TitleSeparator, //convert everything else to hyphen
"/(^\\" . $bi_TitleSeparator . "+)|(\\" . $bi_TitleSeparator . "+\$)/" => '', //trim hyphens front and back
- "/\\" . $bi_TitleSeparator . "{2,}/" => $bi_TitleSeparator //trim duplicate hyphens
+ "/\\" . $bi_TitleSeparator . "{2,}/" => $bi_TitleSeparator, //trim duplicate hyphens
+ '/^([a-z])/' => 'cb_toupper', //uppercase first letter
));
-if (function_exists('Markup_e'))
- SDVA($bi_MakePageNamePatterns, array(
- ($Charset == 'UTF-8' ? "/^([\\xc0-\\xdf].)/" : '//') => ($Charset == 'UTF-8' ? PCCF("return utf8toupper(\$m[1]);") : ''), //uppercase first letter
- "/^([a-z])/" => PCCF("return strtoupper(\$m[1]);")
- ));
-else
- SDVA($bi_MakePageNamePatterns, array(
- ($Charset == 'UTF-8' ? "/^([\\xc0-\\xdf].)/e" : '//') => ($Charset == 'UTF-8' ? "utf8toupper('$1')" : ''), //uppercase first letter
- "/^([a-z])/e" => "strtoupper('$1')"
- ));
+if ($Charset == 'UTF-8') {
+ SDVA($bi_MakePageNamePatterns, array(
+ '/^([\\xc0-\\xdf].)/' => 'utf8toupper',
+ ));
+}
+
SDVA($bi_FixPageTitlePatterns, array(
'/[.\\/#]/' => '' //remove dots, forward and backslashes in page titles as MakePageName returns '' when these characters are present
));
@@ -160,7 +159,7 @@
'dev' => false
));
-bi_debugLog('====== action: ' . $action . ' Target: ' . $_REQUEST['target'] . ' Save: ' . @$_REQUEST['save']);
+bi_debugLog('====== action: ' . $action . ' Target: ' . @$_REQUEST['target'] . ' Save: ' . @$_REQUEST['save']);
SDVA($bi_Pages, array(
'admin' => $SiteGroup . '.BlogIt-Admin',
'blog_list' => $SiteGroup . '.BlogList',
@@ -233,7 +232,7 @@
bi_setFmtPVA(array(
'$bi_SkinSettings' => $bi_SkinSettings
));
-$FmtPV['$bi_Mode'] = bi_Clean('mode', $_REQUEST['bi_mode']);
+$FmtPV['$bi_Mode'] = bi_Clean('mode', @$_REQUEST['bi_mode']);
// ----------------------------------------
// - PmWiki Config
@@ -345,7 +344,7 @@
// ----------------------------------------
// - Pagination
$bi_CurrentPage = intval(isset($_GET['page']) ? $_GET['page'] : 1);
-$bi_EntryCount = (intval($_GET['count']) > 0 ? intval($_GET['count']) : $bi_EntriesPerPage);
+$bi_EntryCount = (intval(@$_GET['count']) > 0 ? intval($_GET['count']) : $bi_EntriesPerPage);
$FmtPV['$bi_PageNext'] = $bi_CurrentPage + 1;
$FmtPV['$bi_PagePrev'] = ($bi_CurrentPage > 0 ? $bi_CurrentPage - 1 : 0);
$FmtPV['$bi_EntryStart'] = (($bi_CurrentPage - 1) * $bi_EntryCount) + 1;
@@ -357,15 +356,14 @@ function bi_blogitMU_Handler($m) {
$func = 'blogitMU_' . $m[1];
return $func($m[2], $m[3]);
}
-if (function_exists('Markup_e')) { //PmWiki 2.2.58+ / PHP5
- Markup_e('blogit', 'fulltext', '/\(:blogit (list|cleantext)\s?(.*?):\)(.*?)\(:blogitend:\)/si', "bi_blogitMU_Handler(\$m)"); //need to use an interim handler
- Markup_e('blogit-skin', 'fulltext', '/\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\s?(.*?):\)(.*?)\(:blogit-skinend:\)/si', "blogitSkinMU(\$m[1], \$m[2], \$m[3])");
- Markup_e('includesection', '>if', '/\(:includesection\s+(\S.*?):\)/i', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], \$m[1].' '.\$GLOBALS['bi_TemplateList']))");
-} else { //PmWiki 2.2.58-, pre PHP5
- Markup('blogit', 'fulltext', '/\(:blogit (list|cleantext)\s?(.*?):\)(.*?)\(:blogitend:\)/esi', "blogitMU_$1(PSS('$2'), PSS('$3'))");
- Markup('blogit-skin', 'fulltext', '/\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\s?(.*?):\)(.*?)\(:blogit-skinend:\)/esi', "blogitSkinMU('$1', PSS('$2'), PSS('$3'))");
- Markup('includesection', '>if', '/\(:includesection\s+(\S.*?):\)/ei', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], PSS('$1 '.\$GLOBALS['bi_TemplateList'])))");
-}
+
+Markup('blogit', 'fulltext', '/\(:blogit (list|cleantext)\s?(.*?):\)(.*?)\(:blogitend:\)/si', "bi_blogitMU_Handler"); //need to use an interim handler
+
+Markup('blogit-skin', 'fulltext', '/\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\s?(.*?):\)(.*?)\(:blogit-skinend:\)/si', "blogitSkinMU");
+
+Markup('includesection', '>if', '/\(:includesection\s+(\S.*?):\)/i', "bi_includeSection");
+
+
$SaveAttrPatterns['/\\(:includesection\\s.*?:\\)/i'] = ' '; //prevents include sections becoming part of page targets list
if (IsEnabled($EnableGUIButtons) && $FmtPV['$bi_Mode'] != 'ajax') {
if ($action == 'bi_be' || $action == 'bi_ne' || ($action == 'pmform' && $_REQUEST['target'] == 'blogit-entry'))
@@ -400,7 +398,7 @@ function bi_blogitMU_Handler($m) {
// Display of blogit forms is handled by page browse; when user clicks Submit, then pmforms takes over which then calls this function
function bi_HandleBrowse($src, $auth = 'read') {
global $bi_ResetPmFormField, $bi_OriginalFn, $bi_GroupFooterFmt, $bi_CommentGroup, $action, $Now, $bi_Name, $FmtPV, $HandleActions, $GroupPrintHeaderFmt, $GroupPrintFooterFmt, $GroupHeaderFmt, $GroupFooterFmt, $bi_Group, $CategoryGroup, $AsSpacedFunction, $bi_CommentsEnabled, $bi_CommentsAutoClose;
- bi_debugLog('HandleBrowse: ' . $action . '[' . $FmtPV['$bi_Mode'] . '] ' . $_REQUEST['target']);
+ bi_debugLog('HandleBrowse: ' . $action . '[' . $FmtPV['$bi_Mode'] . '] ' . @$_REQUEST['target']);
if ($bi_Group == $bi_CommentGroup) {
bi_Redirect();
return;
@@ -715,7 +713,8 @@ function bi_Link($pre, $page, $action, $txt, $post, $cls = '', $base = '') { //v
. ($ajax[1] > '' ? str_replace('$$mode$$', 'bi-ajax-mode ', $lnk) . $ajax[1] . ' | ' . $FarmPubDirUrl . '/blogit/link.gif]]' : '') //optional second image link
. $post;
}
-function blogitSkinMU($fn, $opt, $txt) {
+function blogitSkinMU($m) {
+ list($ignore, $fn, $opt, $txt) = $m;
global $bi_AuthorGroup, $bi_Pagename, $bi_CommentsEnabled, $bi_LinkToCommentSite, $bi_CommentPattern, $EnableBlocklist, $bi_Pages;
$args = ParseArgs($opt); //$args['p'], args[]['s']
$dateFmt = array(
@@ -769,13 +768,17 @@ function blogitSkinMU($fn, $opt, $txt) {
return 'bi_ID' . (preg_match($bi_CommentPattern, $txt, $m) ? $m[3] : $txt); //1-group; 2-name; 3-commentid, OR FullName for blog-list
}
}
-function bi_includeSection($pagename, $inclspec) {
+function bi_includeSection($m) {
+ global $bi_Pagename, $bi_TemplateList;
+ $inclspec = "{$m[1]} $bi_TemplateList";
+ PRR();
+
$args = ParseArgs($inclspec); //$inclspec: "params"
$anc = array_shift($args['']); //$anc: parameters for include; $args: include-paths
- if ($anc > '' && $anc{0} != "#")
+ if ($anc > '' && $anc[0] != "#")
return '';
foreach ($args[''] as $v) {
- $x = IncludeText($pagename, "$v$anc");
+ $x = IncludeText($bi_Pagename, "$v$anc");
if ($x > '')
return $x;
}
@@ -876,11 +879,11 @@ function bi_Auth($condparm) { //condparm: comma separated list of actions, and o
@list($bi_actions, $pn) = explode(' ', $condparm, 2);
$bi_actions = explode(',', trim($bi_actions, '\'"'));
if (!IsEnabled($EnableAuthUser))
- $pn = (in_array('*', $bi_actions) || in_array('sidebar', $bi_actions) || ($bi_Pagename == $bi_Pages['admin'] && in_array('blogit-admin', $bi_actions)) || ($bi_Pagename == $bi_Pages['admin'] && $action == 'bi_ne' && in_array('blog-new', $bi_actions))) ? $bi_Pages['auth'] : (isset($pn)) ? $pn : $bi_Pagename;
+ $pn = (in_array('*', $bi_actions) || in_array('sidebar', $bi_actions) || ($bi_Pagename == $bi_Pages['admin'] && in_array('blogit-admin', $bi_actions)) || ($bi_Pagename == $bi_Pages['admin'] && $action == 'bi_ne' && in_array('blog-new', $bi_actions))) ? $bi_Pages['auth'] : (isset($pn) ? $pn : $bi_Pagename);
foreach ($bi_actions as $a) {
foreach ($bi_Auth as $role => $action_list) {
if ($a == '*' || in_array($a, $action_list)) { //is the action assigned to a role?
- if ((IsEnabled($EnableAuthUser) && $AuthList['@' . $role] > 0) //the user is assigned to this role
+ if ((IsEnabled($EnableAuthUser) && @$AuthList['@' . $role] > 0) //the user is assigned to this role
|| (!IsEnabled($EnableAuthUser) && $bi_OriginalFn['AuthFunction']($pn, $role, false, READPAGE_CURRENT))) //the user has these role privs on this page
return true;
}
@@ -901,9 +904,13 @@ function preg_grep_keys($pattern, $input, $offset, $length = NULL) {
function bi_CategoryList() {
global $CategoryGroup;
$c = ListPages('/^' . $CategoryGroup . '\./');
- array_walk($c, create_function('&$v,$k,$l', '$v = substr($v,$l);'), strlen($CategoryGroup) + 1);
+ array_walk($c, 'bi_cbcatlist', strlen($CategoryGroup) + 1);
return implode(',', $c);
}
+function bi_cbcatlist(&$v,$k,$l) {
+ $v = substr($v,$l);
+}
+
function bi_ClearCache() {
global $PCache, $bi_Pagename;
if (is_array($PCache[$bi_Pagename])) {
@@ -975,7 +982,7 @@ function bi_storeCookie($url = '') {
$args = bi_Implode($_GET);
$url = FmtPageName('$PageUrl', $bi_Pagename) . (!empty($args) ? '?' . $args : ''); //current
}
- if ($url != $_COOKIE[$bi_Cookie . 'back-1'] && $FmtPV['$bi_Mode'] != 'ajax' && $action != 'pmform') { //don't record if reloading, ajax, or redirected from pmform
+ if ($url != @$_COOKIE[$bi_Cookie . 'back-1'] && $FmtPV['$bi_Mode'] != 'ajax' && $action != 'pmform') { //don't record if reloading, ajax, or redirected from pmform
if (!empty($_COOKIE[$bi_Cookie . 'back-1']))
setcookie($bi_Cookie . 'back-2', $_COOKIE[$bi_Cookie . 'back-1'], 0, '/');
setcookie($bi_Cookie . 'back-1', $url, 0, '/'); //don't replace cookies if user is reloading the current page
@@ -984,6 +991,7 @@ function bi_storeCookie($url = '') {
// Used to create a URL parameter string from an array, removing ?n= parameter.
//TODO: use http_build_query() php5+
function bi_Implode($a, $p = '&', $s = '=', $ignore = array('n' => '')) {
+ $o = '';
foreach ($a as $k => $v)
if (!isset($ignore[$k]) !== false)
$o .= $p . $k . $s . $v;
@@ -1056,6 +1064,7 @@ function bi_JXL() { //create javascript array holding all XL translations of tex
'Please enter a valid URL.',
'Error on edit return.'
);
+ $t = "";
foreach ($a as $k)
$t .= ($k != XL($k) ? 'BlogIt.xl["' . $k . '"]="' . XL($k) . "\";\n" : '');
return ($t);
From 010a42bfd5ad3bedab7c87bbe46c9af5d0ccde38 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sun, 8 Sep 2024 15:02:51 +0300
Subject: [PATCH 2/8] Fix interference with pub/css/Group.css, some
simplification of stylesheet declarations.
---
cookbook/blogit/blogit.php | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index 4ec4ca8..fc405ed 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -9,7 +9,7 @@
Updated for recent PHP versions by Petko Yotov pmwiki.org/petko
*/
-$RecipeInfo['BlogIt']['Version'] = '2024-09-06'; //1.9.6?
+$RecipeInfo['BlogIt']['Version'] = '2024-09-08'; //1.9.6?
if ($VersionNum < 2003036)
Abort("You are running PmWiki version {$Version}. In order to use BlogIt please update to 2.3.36 or later.
");
@@ -52,13 +52,10 @@
// ----------------------------------------
// - Skin settings
SDV($bi_Skin, ($Skin > '' ? $Skin : 'pmwiki')); //Needed if skin is set in group config, which is processed after main config
-SDV($PageCSSListFmt, array( //Auto-load BlogIt PmWiki css file
- 'pub/css/local.css' => '$PubDirUrl/css/local.css'
-));
if ($bi_Skin == 'pmwiki') //Auto-load BlogIt PmWiki css file
- SDV($PageCSSListFmt, array(
- 'pub/blogit/blogit-pmwiki.css' => '$FarmPubDirUrl/blogit/blogit-pmwiki.css'
- ));
+ SDVA($HTMLHeaderFmt, array(
+ 'blogit-pmwiki.css' => '',
+ ));
SDV($bi_AjaxMsgTimer, 3000); //Number of milli-seconds that the top ajax message is displayed for
//key: action; value: ajax style. Determines how an operation is handled, either ajax, normal (page reload), or by providing an option with normal-ajax, and ajax-normal
//Used to define how admin links are displayed and handled. Comment reply is always ajax.
@@ -268,17 +265,17 @@
// ----------------------------------------
// - Javascript - [1]
SDVA($HTMLHeaderFmt, array(
- 'jbox.css' => '',
- 'awesomplete.css' => '',
- 'blogit.css' => ''
+ 'jbox.css' => '',
+ 'awesomplete.css' => '',
+ 'blogit.css' => ''
));
SDVA($HTMLFooterFmt, array(
- 'jquery.js' => '',
- 'validate.js' => '',
- 'jbox.js' => '',
- 'awesomplete.js' => '',
- 'blogit.js' => '',
- 'blogit-core' => ''
+ 'jquery.js' => '',
+ 'validate.js' => '',
+ 'jbox.js' => '',
+ 'awesomplete.js' => '',
+ 'blogit.js' => '',
+ 'blogit-core' => ''
));
// ----------------------------------------
@@ -710,7 +707,7 @@ function bi_Link($pre, $page, $action, $txt, $post, $cls = '', $base = '') { //v
(substr($bi_Ajax[$action], strpos($bi_Ajax[$action], '-') + 1) == 'ajax' ? '&bi_mode=ajax' : '')
);
return $pre . str_replace('$$mode$$', ($ajax[0] > '' ? 'bi-ajax-mode ' : ''), $lnk) . $ajax[0] . ' | ' . $txt . ']]' //text link
- . ($ajax[1] > '' ? str_replace('$$mode$$', 'bi-ajax-mode ', $lnk) . $ajax[1] . ' | ' . $FarmPubDirUrl . '/blogit/link.gif]]' : '') //optional second image link
+ . ($ajax[1] > '' ? str_replace('$$mode$$', 'bi-ajax-mode ', $lnk) . $ajax[1] . ' | $FarmPubDirUrl/blogit/link.gif]]' : '') //optional second image link
. $post;
}
function blogitSkinMU($m) {
From e162bb7534712c93b5c25edd7c08d5a63ce1d147 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sun, 8 Sep 2024 15:08:06 +0300
Subject: [PATCH 3/8] Fix variable not evaluated.
---
cookbook/blogit/blogit.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index fc405ed..5e5b536 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -707,7 +707,7 @@ function bi_Link($pre, $page, $action, $txt, $post, $cls = '', $base = '') { //v
(substr($bi_Ajax[$action], strpos($bi_Ajax[$action], '-') + 1) == 'ajax' ? '&bi_mode=ajax' : '')
);
return $pre . str_replace('$$mode$$', ($ajax[0] > '' ? 'bi-ajax-mode ' : ''), $lnk) . $ajax[0] . ' | ' . $txt . ']]' //text link
- . ($ajax[1] > '' ? str_replace('$$mode$$', 'bi-ajax-mode ', $lnk) . $ajax[1] . ' | $FarmPubDirUrl/blogit/link.gif]]' : '') //optional second image link
+ . ($ajax[1] > '' ? str_replace('$$mode$$', 'bi-ajax-mode ', $lnk) . $ajax[1] . " | $FarmPubDirUrl/blogit/link.gif]]" : '') //optional second image link
. $post;
}
function blogitSkinMU($m) {
From e911103b878555d3c507324e87d758ccda4aa2f7 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Wed, 11 Sep 2024 13:05:46 +0300
Subject: [PATCH 4/8] Update for PHP 8, use PSFT() instead of
strftime/gmstrftime. PmForm template validation for recent versions.
---
cookbook/blogit/blogit.php | 11 +++++++----
cookbook/blogit/wikilib.d/Site.BlogIt-CoreTemplate | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index 5e5b536..98a49c2 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -162,7 +162,7 @@
'blog_list' => $SiteGroup . '.BlogList',
'blocklist' => $SiteAdminGroup . '.Blocklist'
));
-SDV($bi_TemplateList, (isset($bi_Skin) ? $SiteGroup . '.BlogIt-SkinTemplate-' . $bi_Skin . ' ' : '') . $SiteGroup . '.BlogIt-CoreTemplate');
+SDV($bi_TemplateList, (isset($bi_Skin) ? $SiteGroup . '.BlogIt-SkinTemplate-' . $bi_Skin . ' ' : '') . " " . $SiteGroup . '.BlogIt-CoreTemplate');
SDVA($bi_PageType, array(
'blog'
)); //Comment is not in PageType list, since we don't want bloggers to be able to select 'comment' types.
@@ -381,7 +381,7 @@ function bi_blogitMU_Handler($m) {
// ----------------------------------------
// - Markup Expressions
// if [0] is null or {$... then returns [1]; if [0] != null then returns ([2] or [0] if [2] is null)
-$MarkupExpr['bi_ifnull'] = '( bi_IsNull($args[0])!="" ?( bi_IsNull($args[2])=="" ?$args[0] :$args[2]) :$args[1])';
+$MarkupExpr['bi_ifnull'] = '( bi_IsNull($args[0])!="" ?( bi_IsNull(@$args[2])=="" ?$args[0] :@$args[2]) :$args[1])';
// Calls to bi_encode should NOT be quoted: {(bi_encode {*$Title})} NOT {(bi_encode '{*$Title}')}, as titles with ' will terminate early.
$MarkupExpr['bi_encode'] = 'htmlentities(bi_IsNull($params), ENT_QUOTES)'; //$params contains the full content of the ME before splitting to $args
// bi_param "group" "group_val" Returns: group="group_val" if group_val != ""; else returns "" 0:param name; 1:value
@@ -687,6 +687,7 @@ function blogitMU_intro($options, $text) {
function blogitMU_list($name, $text) {
list($var, $label) = explode('/', $text, 2);
$i = count($GLOBALS[$var]);
+ $t = '';
foreach ($GLOBALS[$var] as $k)
$t .= '(:input ' . ($i == 1 ? 'hidden' : 'select') . ' name=' . $name . ' value="' . $k . '" label="' . XL($k) . '" id="' . $var . '" tabindex=1:)';
return ($i == 1 ? '' : $label) . $t;
@@ -772,6 +773,7 @@ function bi_includeSection($m) {
$args = ParseArgs($inclspec); //$inclspec: "params"
$anc = array_shift($args['']); //$anc: parameters for include; $args: include-paths
+
if ($anc > '' && $anc[0] != "#")
return '';
foreach ($args[''] as $v) {
@@ -785,6 +787,7 @@ function bi_includeSection($m) {
// - Condition Functions
// ----------------------------------------
function bi_IsNull($e) {
+ $e = strval(@$e);
$e = trim($e, '\'\" ');
return (!empty($e) && substr($e, 0, 3) != '{*$' && substr($e, 0, 2) != '{$' && substr($e, 0, 3) != '{=$' ? $e : '');
}
@@ -813,7 +816,7 @@ function bi_IsDate($d, $f = '%d-%m-%Y %H:%M', $z = '') { //accepts a date, and a
if (empty($d))
return true; //false causes two date invalid messages.
if (preg_match('|\d{5,}|', $d))
- $d = strftime($f, $d); //Convert Unix timestamp to a std format (must not include regular expressions)
+ $d = PSFT($f, $d); //Convert Unix timestamp to a std format (must not include regular expressions)
$std = bi_StdDateFormat($d, $f, $z);
list($mon, $day, $yr) = explode('/', substr($std, 0, strpos($std, ' ')), 3); //remove time portion, ASSUME date and time are separated by space
return (preg_match('!^' . bi_DateFmtRE($f) . '$!', $d) && checkdate($mon, $day, $yr) ? true : false); //does %d match the regular expression version of $f, and chech the date
@@ -1078,7 +1081,7 @@ function bi_ProcessHooks($type, $stage, $src, $auth) {
function bi_GetPageVar($pagename, &$page, $tag) {
global $TimeISOZFmt, $RSSTimeFmt;
$d = (int) PageTextVar($pagename, 'entrydate');
- return "<$tag>" . ($tag == 'dc:date' ? gmstrftime($TimeISOZFmt, $d) : ($tag == 'pubDate' ? gmdate($RSSTimeFmt, $d) : ($tag == 'author' ? PageTextVar($pagename, 'entryauthor') : ''))) . "$tag>\n";
+ return "<$tag>" . ($tag == 'dc:date' ? PSFT($TimeISOZFmt, $d, null, 'GMT') : ($tag == 'pubDate' ? gmdate($RSSTimeFmt, $d) : ($tag == 'author' ? PageTextVar($pagename, 'entryauthor') : ''))) . "$tag>\n";
}
function bi_FeedText($pagename, &$page, $tag) {
return '<' . $tag . '>' . $tag . '>';
diff --git a/cookbook/blogit/wikilib.d/Site.BlogIt-CoreTemplate b/cookbook/blogit/wikilib.d/Site.BlogIt-CoreTemplate
index 05c84d2..fe1007f 100644
--- a/cookbook/blogit/wikilib.d/Site.BlogIt-CoreTemplate
+++ b/cookbook/blogit/wikilib.d/Site.BlogIt-CoreTemplate
@@ -8,5 +8,5 @@ host=127.0.0.1
name=Site.BlogIt-CoreTemplate
rev=1593
targets=
-text=[++%25red%25'''WARNING: Do not change this file.'''%25%25 ++]%0a* You can make skin specific changes by including the any of the sections below in [@{$Site}.BlogIt-SkinTemplate-skinname@]. %0a* Copy only specific sections you need to override. Do not copy the entire file, as you will not get the benefits of future releases of BlogIt.%0a%0a----%0a! LAYOUT TEMPLATES%0a----%0aThese will typically be over-ridden by skins in order to change layout.%0aNote: %0a* Unjoined [@(:if:)@] on meta-data-head prevents (:div9999end:) being displayed. Unknown why!%0a* [@{*$FullName}@]: {*$FullName}: The page in the URL for non-pagelists%0a* [@{=$FullName}@]: {=$FullName}: The page being managed in a pagelist%0a* [@{$FullName}@]: {$FullName}: Usually the name of this file Site.BlogIt-CoreTemplate%0a%0a%0a!! Blogs%0a%0a!!! #single-entry-view%0a[@%0a(:if false:)[[#single-entry-view]](:if:)%0a(:div9990 class="blogit-post":)%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){*$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){*$:entrydate}(:blogit-skinend:)%25%25(:if:) \%0a(:blogit-skin edit pre_text='%25item accesskey="$[ak_edit]"%25' post_text='%25%25' page='{*$FullName}':)$[edit](:blogit-skinend:)%0a(:div9999end:)%0a(:div9991 class="blogit-post-body":)%0a{*$:entrybody}%0a(:div9991end:)%0a(:div9999 class="blogit-meta-data-footer":)%0a(:blogit-skin tags pre_text='!!!!!%25block blogit-tags%25$[Tags:] ' page='{*$FullName}' post_text='%25%25':){*$:entrytags}(:blogit-skinend:)%0a(:blogit-skin commentcount status='{*$:entrycomments}' pre_text='!!!!!%25block blogit-comment-count%25' post_text='%25%25' group='{*$Group}' name='{*$Name}':) $[comment(s)](:blogit-skinend:)%0a(:div9999end:)%0a(:div9990end:)%0a(:includesection "#comments-pagelist pagename={*$Name} group={*$Group} entrycomments={*$:entrycomments} divid=commentblock":)%0a[[#single-entry-viewend]]%0a@]%0a%0a!!! #print-view%0aNB: Unjoined (:if:) on meta-data-head prevents (:div9999end:) being displayed. Unknown why!%0a%0a[@%0a(:if false:)[[#print-view]](:if:)%0a(:div9990 class="blogit-post":)%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){*$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){*$:entrydate}(:blogit-skinend:)%25%25(:if:) \%0a(:div9999end:)%0a(:div9991 class="blogit-post-body":)%0a{*$:entrybody}%0a(:div9991end:)%0a(:div9999 class="blogit-meta-data-footer":)%0a(:blogit-skin tags pre_text='!!!!!%25block blogit-tags%25$[Tags:] ' page='{*$FullName}' post_text='%25%25':){*$:entrytags}(:blogit-skinend:)%0a(:blogit-skin commentcount status='{*$:entrycomments}' pre_text='!!!!!%25block blogit-comment-count%25' post_text='%25%25' group='{*$Group}' name='{*$Name}':) $[comment(s)](:blogit-skinend:)%0a(:div9999end:)%0a(:div9990end:)%0a(:includesection "#comments-pagelist pagename={*$Name} group={*$Group} entrycomments={*$:entrycomments} divid=commentblock":)%0a[[#print-viewend]]%0a@]%0a%0a!!! #multi-entry-view%0aParameters: [pagenav], [perpage]%0a[@%0a(:if false:)[[#multi-entry-view]](:if:)%0a(:template defaults order=-$:entrydate:)%0a(:template each:)%0a(:div9990 class="blogit-post-summary":)%0a!! [[{=$FullName} | {=$Title}]]%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){=$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){=$:entrydate}(:blogit-skinend:)%25%25 \%0a(:blogit-skin edit pre_text='%25item accesskey="$[ak_edit]"%25' post_text='%25%25' page='{=$FullName}':)$[edit](:blogit-skinend:)%0a(:div9999end:)%0a(:blogit-skin intro class=blogit-post-intro page={=$FullName}:)%0a{=$:entrybody}(:blogit-skinend:)%0a(:div9990end:)%0a(:template last:)%0a(:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":)%0a[[#multi-entry-viewend]]%0a@]%0a%0a!!! #blog-list-view%0aParameters: pagenav, perpage, fullname (for single row)%0a[@%0a(:if false:)[[#blog-list-view]](:if:)%0a(:template defaults wrap=inline:)%0a(:template first:)%0a(:if bi_isnull {$$fullname}:)%0a(:div class="blogit-blog-list":)%0a(:table class="blog-list":)%0a(:cellnr class="blogit-blog-list-header":)$[Actions]%0a(:cell:)$[Title]%0a(:cell:)$[Author]%0a(:cell:)$[Date]%0a(:cell:)$[Tags]%0a(:template first {=$:entrystatus}:)%0a(:cellnr class="blog-list-header" colspan=5:)'''$[{=$:entrystatus}]'''%0a(:if:)%0a(:template each:)%0a(:cellnr class="blogit-actions":) %25apply=row class="blogit-blog-list-row" id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)"%25%0a* %25apply=list class="blogit-admin-links"%25(:blogit-skin edit page='{=$FullName}' post_text=" ":)$[edit](:blogit-skinend:)%0a* (:blogit-skin delete page='{=$FullName}':)$[delete](:blogit-skinend:)%0a(:cell class="blogit-title":)[[{=$FullName}|{=$Title}]]%0a(:cell class="blogit-author":)(:blogit-skin author:){=$:entryauthor}(:blogit-skinend:)%0a(:cell class="blogit-date":)(:blogit-skin date fmt='entry':){=$:entrydate}(:blogit-skinend:)%0a(:cell class="blogit-tags":)(:blogit-skin tags page='{=$FullName}':){=$:entrytags}(:blogit-skinend:)%0a(:cell class="blogit-commentcount":)\%0a(:blogit-skin commentcount status='true' group='{=$Group}' name='{=$Name}':)/(:blogit-skinend:)\%0a(:blogit-skin commentcount status='false' group='{=$Group}' name='{=$Name}':)(:blogit-skinend:)%0a(:template last:)%0a(:if bi_isnull {$$fullname}:)%0a(:tableend:)%0a(:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":)%0a(:divend:)%0a(:if:)%0a[[#blog-list-viewend]]%0a@]%0a%0a!!! #blog-summary-list%0aSimple bullet list of blog titles.%0aParameters: more, blogid%0a[@%0a(:if false:)[[#blog-summary-list]](:if:)%0a(:template each:)%0a* %25apply list class="blogit-blog-summary-list"%25[[{=$FullName} | {=$Title}]]%25%25%0a(:template last:)%0a(:if !equal "{$$more}" false:)(:div class="blogit-listmore":)[[Site.BlogList?blogid={$$blogid} | $[more...]]]%0a(:divend:)(:if:)%0a[[#blog-summary-listend]]%0a@]%0a%0a!!! #blog-yearly-archive%0aList of all pages grouped by year, ordered by date%0aParameters: none%0a[@%0a(:if false:)[[#blog-yearly-archive]](:if:)%0a(:template each:)%0a(:if !equal {(ftime fmt='$[%25Y]' @{=$:entrydate})} {(ftime fmt='$[%25Y]' @{%3c$:entrydate})}:)%0a!! %25block blogit-archive-year%25{(ftime fmt='$[%25Y]' @{=$:entrydate})}(:if:)%0a* %25apply list class="blogit-yearly-archive"%25[[{=$FullName} | {=$Title}]] %25blogit-entry-date%25(:blogit-skin date fmt='short':){=$:entrydate}(:blogit-skinend:)%25%25%0a[[#blog-yearly-archiveend]]%0a@]%0a%0a----%0a! Comments%0a----%0a!! #comment-view-all%0aDisplays a list of comments as part of the single entry view. Approved comments are visible to all. Unapproved comments are only shown to admins, and include an 'approve' link.%0a{=$FullName} refers to the comment page.%0a%0aParameters: name (refers to a comment page), base, commenttid (not from pagelist, only when called from bi_AjaxRedirect)%0a[@%0a(:if false:)[[#comment-view-all]](:if:)%0a(:template first:)%0a(:div9990 class="blogit-commentblock":)%0a!! (:if [ bi_auth comment-edit,comment-approve && !equal '{$Action}' 'print' ] :)%25apply=block class=blogit-admin%25(:if:)$[Comments]%0a(:template each:)%0a(:if9990 [ bi_isnull {$$commentid} || ( !bi_isnull {$$commentid} && equal '{=$Name}' '{$$commentid}' ) ] :)\%0a# %25apply=list class="blogit-comment-list"%25 %25apply=item id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)" class="comment blogit-comment-(:if9991 equal 'false' '{=$:commentapproved}':)un(:if9991end:)approved" (:if9991 bi_auth comment-edit,comment-approve:)blogit-admin(:if9991end:)%25 %25blogit-comment-header%25\%0a$[By] (:blogit-skin commentauthor website='{=$:website}' author='{=$:commentauthor}':)(:blogit-skinend:), \%0a$[on] (:blogit-skin date fmt='long':){=$:commentdate}(:blogit-skinend:)\%0a (:includesection "#admin-links commentstatus='{=$:commentapproved}' commentpage='{=$FullName}' base='{(bi_ifnull "{$$base}" "{*$FullName}")}'":)\%0a %25commenttext%25(:blogit-skin commenttext page='{=$FullName}':){=$:commenttext}(:blogit-skinend:)%25%25%0a(:if9990end:)%0a(:template last:)%0a(:div9990end:)%0a%0a[[#comment-view-allend]]%0a@]%0a%0a!! #comment-view-admin%0aDisplays a list of comments as part of the comment-view-pagelist. \\%0aEnsure title is only printed first time, not for each comment: if !equal {(bi_base {=$FullName})} {(bi_base {%3c$FullName})}\\%0a%0aParameters: name (commentid), base %0a[@%0a(:if false:)[[#comment-view-admin]](:if:)%0a(:template each:)%0a(:if !equal {(bi_base {=$FullName})} {(bi_base {%3c$FullName})} :)%0a!!! [[{(bi_base {=$FullName})} | {{(bi_base {=$FullName})}$Title}]](:if:)%0a# %25apply=list class="blogit-comment-list blogit-comment-admin-list"%25 %25apply=item id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)" class="comment blogit-comment-(:if9991 equal 'false' '{=$:commentapproved}':)un(:if9991end:)approved" blogit-admin%25 %25blogit-comment-header%25\%0a$[By] (:blogit-skin commentauthor website='{=$:website}' author='{=$:commentauthor}':)(:blogit-skinend:), \%0a$[on] (:blogit-skin date fmt='long':){=$:commentdate}(:blogit-skinend:)\%0a (:includesection "#admin-links commentstatus='{=$:commentapproved}' commentpage='{=$FullName}' base='{(bi_ifnull "{$$base}" "{*$FullName}")}'":)\%0a %25commenttext%25(:blogit-skin commenttext page='{=$FullName}':){=$:commenttext}(:blogit-skinend:)%25%25%0a[[#comment-view-adminend]]%0a@]%0a%0a!! #comment-summary-list%0aParameters: datestamp (true/false)%0a[@%0a(:if false:)[[#comment-summary-list]](:if:)%0a* %25apply list class="blogit-comment-summary-list"%25[[{(bi_base {=$FullName})}#(:blogit-skin commentid:){=$FullName}(:blogit-skinend:) | (:blogit cleantext:){=$:commenttext}(:blogitend:)$[...]]]%25%25%0a (:if equal '{$$datestamp}' true:)%25blogit-comment-timestamp%25(:blogit-skin date fmt='entry':){=$:commentdate}(:blogit-skinend:)%25%25(:if:)%0a[[#comment-summary-listend]]%0a@]%0a%0a----%0a! General%0a----%0a!! #no-results-found%0a[@%0a(:if false:)[[#no-results-found]](:if:)%0a!! $[No more pages found.]%0a[[{*$FullName} | $[Return to first page.]]].%0a[[#no-results-foundend]]%0a@]%0a%0a!! #page-navigation%0aParameters: itemsonpage (entries on this particular page set), [pagenav] (show page nav links? Default TRUE), [perpage] (override entries-per-page)%0a[@%0a(:if false:)[[#page-navigation]](:if:)%0a(:if1 !equal "{$$pagenav}" false:)(:div class="blogit-page-navigation force_contain":)\%0a(:if2 !bi_isnull {$bi_PagePrev}:)\%0a%25blogit-newer-entries%25[[{(bi_url {*$FullName} page {$bi_PagePrev})} | $[newer posts]]]\%0a(:if2:)\%0a(:if2 !bi_lt '{$$itemsonpage}' {(bi_ifnull "{$$perpage}" "{$bi_EntriesPerPage}")} :)\%0a%25blogit-older-entries%25[[{(bi_url {*$FullName} page {$bi_PageNext})} | $[older posts]]]\%0a(:if2:)%0a(:divend:)%0a(:div class="blogit-clear":)%0a(:divend:)%0a(:if1:)%0a[[#page-navigationend]]%0a@]%0a%0a----%0a! Admin%0a----%0a!! Control Panel%0aParameters: blogid%0a[@%0a(:if false:)[[#control-panel]](:if:)%0a(:blogid:blog1:)%0a* %25apply=item class="blogit-unapproved-comment-count"%25[[{$bi_Pages_ADMIN}?action=bi_admin&s=unapproved-comments&blogid={(bi_ifnull "{$$blogid}" {$:blogid})} | $[Unapproved Comments:] (:includesection "#comments-count-pagelist commentstatus=false blogid={(bi_ifnull '{$$blogid}' {$:blogid})}":)]]%0a(:blogit-skin newentry pre_text='* ':)$[New Entry](:blogit-skinend:)%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=draft | $[Drafts]]]%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=publish | $[Published]]]%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=sticky | $[Stickies]]]%0a(:if !bi_isnull {$bi_StatAction}:)* [[{*$FullName}?action={$bi_StatAction} | $[Statistics]]](:if:)%0a* [[{*$FullName}?action=logout | $[logout](:if !bi_isnull {$AuthId}:) [-''({$AuthId})''-](:if:)]]%0a[[#control-panelend]]%0a@]%0a%0a!! #admin-links%0aParameters: commentstatus (current status), commentpage (name of the comment page), base (name of the basepage).\\%0aNOTE: Classes are auto applied, which also adds (:nl:) at end of line. If this section is in HTML list ensure ' ' (as below) is at start of line to prevent PRE tag being inserted by PmWiki. \\%0aNOTE: basepage will be incorrect both when starting from BlogIt-Admin, and also when responding to ajax, with single comment. bi_Basepage() works this out.\\%0a%0a[@%0a(:if false:)[[#admin-links]](:if:)%0a(:if9 [ bi_auth comment-edit,comment-approve && !equal '{$Action}' 'print' ] :)%0a** %25apply=list class="blogit-admin-links"%25(:blogit-skin commentapprove post_text=' - ' status='{$$commentstatus}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentedit post_text=' - ' base='{$$base}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentreply post_text=' - ' base='{$$base}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentdelete:){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentblock pre_text=' - ':){$$commentpage}(:blogit-skinend:)\%0a(:if9:)%0a[[#admin-linksend]]%0a@]%0a%0a----%0a! Pagelists%0a----%0a!! BLOGS%0a!!! #blog-summary-pagelist%0aParameters: blogid, status, pagenav (true/false -- default is true), count (0 for default all; null for default defined in config), daterange, [group and name (if included, then returns only the specific page, no other parameters are needed)].%0a[@%0a(:if false:)[[#blog-summary-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#multi-entry-view\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a {(bi_param link "{$$link}")}\%0a {(bi_param perpage "{$$count}")}\%0a {(bi_param group "{$$group}")}\%0a {(bi_param name "{$$name}")}\%0a (:if !bi_isnull {$$daterange}:)if='date {$$daterange} @{=$:entrydate}' \%0a (:elseif equal {$bi_DisplayFuture} false:)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a (:if !equal '{$$count}' 0:){(bi_param pagenav "{$$pagenav}")}\%0a count={(bi_ifnull '{$$count}' "{$bi_EntryStart}..{$bi_EntryEnd}")}(:if:)\%0a {(bi_param cols "{$$cols}")}\%0a:)%0a[[#blog-summary-pagelistend]]%0a@]%0a%0a!!! #blog-summary-list-pagelist%0aParameters: blogid, count, status, more (include more link)%0a[@%0a(:if false:)[[#blog-summary-list-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-summary-list {(bi_param count "{$$count}")}\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a (:if equal {$bi_DisplayFuture} false:)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a {(bi_param blogid "{$$blogid}")}\%0a {(bi_param more "{$$more}")}\%0a:)%0a[[#blog-summary-list-pagelistend]]%0a@]%0a%0a!!! #blog-grid%0aAccepts parameters of status, count (really perpage), blogid, pagenav, OR group and name, in which case only a single row is returned, with no header (for ajax updates)%0a[@%0a(:if false:)[[#blog-grid]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-list-view \%0a order=$[$:entrystatus],-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a {(bi_param perpage "{$$count}")}\%0a {(bi_param group "{$$group}")}\%0a {(bi_param name "{$$name}")}\%0a (:if !bi_isnull {$$group}:)fullname={$$group}.{$$name}(:if:)\%0a (:if [ equal "{$$count}" "0" || !bi_isnull {$$group} ] :)pagenav=false\%0a (:else:){(bi_param pagenav "{$$pagenav}")}\%0a count={$bi_EntryStart}..{$bi_EntryEnd}\%0a (:if:)\%0a:)%0a[[#blog-gridend]]%0a@]%0a%0a!!! #blog-yearly-archive-pagelist%0aParameters: blogid, status, year%0a[@%0a(:if false:)[[#blog-yearly-archive-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-yearly-archive\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a (:if1 bi_isnull {$$year}:)(:if2 equal '{$bi_DisplayFuture}' false :)if='date ..@{$Now} @{=$:entrydate}'(:if2:)\%0a (:else1:)if=' [ date {$$year}-01-01..{$$year}-12-31 @{=$:entrydate} (:if2 equal {$bi_DisplayFuture} false:)&& date ..@{$Now} @{=$:entrydate}(:if2:) ] '\%0a (:if1:)\%0a:)%0a[[#blog-yearly-archive-pagelistend]]%0a@]%0a%0a!! COMMENTS%0a!!! #comments-pagelist%0aDisplays comments on the blog entry single-page view.%0aParameters: pagename, group, entrycomments, divid, commentid (to display a single comment, on ajax edit), base if displaying a single comment%0aIf providing a commentid (the $Name of the comment page, excluding the $Group), then pagename and group parameters are not needed.%0a%0a[@%0a(:if false:)[[#comments-pagelist]](:if:)\%0a(:if9990 [ !bi_isnull {$$commentid} || ( !equal "{$$entrycomments}" "none" && !equal "{$bi_CommentsEnabled}" "none" ) ] :)%0a(:if9991 bi_isnull {$$commentid}:)%0a(:if9992 !bi_isnull {$$divid}:)(:div9970 id="{$$divid}":)(:if9992:)%0a(:div9971 id="blogit-comment-list":)\%0a(:if9991:)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-view-all\%0a order=ctime\%0a name=(:if9981 bi_isnull {$$commentid}:){$$group}-{$$pagename}-* (:else9981:){$$commentid}(:if9981:) \%0a $:entrytype=comment\%0a {(bi_param base "{$$base}")}\%0a if="[ equal '{=$:commentapproved}' 'true' || !bi_isnull {$$commentid} || bi_auth comment-edit,comment-approve {$bi_Pages_AUTH} ]" \%0a:)%0a(:if9991 bi_isnull {$$commentid}:)%0a(:div9971end:)%0a(:if [ equal "{$$entrycomments}" "open" && equal "{$bi_CommentsEnabled}" "open" ] :)\%0a(:pmform blogit-comments:)(:if:)%0a(:if9992 !bi_isnull {$$divid}:)(:div9970end:)(:if9992:)\%0a(:if9991:)%0a(:if9990:)%0a[[#comments-pagelistend]]%0a@]%0a%0a%0a!!! #comment-summary-list-pagelist%0aParameters: blogid, count%0a[@%0a(:if false:)[[#comment-summary-list-pagelist]](:if:)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-summary-list {(bi_param count "{$$count}")}\%0a order=-ctime\%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param $:blogid "{$$blogid}")}\%0a $:commentapproved=true\%0a if="!bi_baseptv {=$FullName} draft"\%0a:)%0a[[#comment-summary-list-pagelistend]]%0a@]%0a%0a!!! #unapproved-comments%0aList of all unapproved comments, for admins.%0aParameters: blogid, commentid (to list a single comment), base if single comment%0aNB: If commentid is supplied a row is always returned regardless of approval status. This is so that if user edits an unapproved comment, and changes the status, we display the update on the page (even though the row should now not be displayed since status has changed).%0a[@%0a(:if false:)[[#unapproved-comments]](:if:)%0a(:if9 [ !equal "{$bi_CommentsEnabled}" "none" && bi_auth comment-edit,comment-approve {$bi_Pages_AUTH} ] :)%0a(:div9998 class="blogit-comment-summary":)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-view-admin\%0a order=name,-ctime\%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param name "{$$commentid}")}\%0a {(bi_param base "{$$base}")}\%0a {(bi_param $:blogid "{$$blogid}")}\%0a (:if10 bi_isnull {$$commentid}:)$:commentapproved=false(:if10:)\%0a:)%0a(:div9998end:)%0a(:if9:)%0a[[#unapproved-commentsend]]%0a@]%0a%0a!!! #comments-count-pagelist%0aParameters: commentstatus: true/false, [entrygroup, entryname], [blogid]%0a[@%0a(:if false:)[[#comments-count-pagelist]](:if:)\%0a(:if1 !equal "{$bi_CommentsEnabled}" "none":)\%0a(:pagelist list="blogit-comments" wrap=none fmt=count \%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param $:blogid "{$$blogid}")}\%0a (:if2 [ !bi_isnull {$$entrygroup} && !bi_isnull {$$entryname} ] :)name={$$entrygroup}-{$$entryname}-* (:if2:)\%0a {(bi_param $:commentapproved "{$$commentstatus}")}\%0a:)(:if1:)\%0a[[#comments-count-pagelistend]]%0a@]%0a%0a!! TAGS%0a!!! #tag-pagelist%0aParameters: count, tag (if not provided, uses the current page name, which would be the tag)%0aIncluded as part of $GroupFooterFmt, so when browsing a page in the Tag group, the pagelist shows up.%0a[@%0a(:if false:)[[#tag-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-yearly-archive\%0a order=-$:entrydate\%0a link={$CategoryGroup}.{(bi_ifnull "{$$tag}" "{*$Name}")} \%0a $:entrystatus=-draft\%0a $:entrytype=blog\%0a (:if equal '{$bi_DisplayFuture}' 'false':)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a {(bi_param count "{$$count}")}\%0a:)%0a[[#tag-pagelistend]]%0a@]%0a%0a!!! #tag-list-pagelist%0aParameters: count%0aUsed to generate the list of categories usually seen in the sidebar.%0a[@%0a(:if false:)[[#tag-list-pagelist]](:if:)%0a(:pagelist wrap=none fmt=#titlespaced group={$CategoryGroup} {(bi_param count "{$$count}")} :) %0a[[#tag-list-pagelistend]]%0a@]%0a%0a%0a!!! #tag-commalist-pagelist%0aParameters: links%0aUsed to generate the list of categories usually seen in the sidebar.%0a%0a[@%0a(:if false:)[[#tag-commalist-pagelist]](:if:)\%0a(:pagelist name={$$links} list=all fmt=#tag-commalist wrap=inline:)%0a[[#tag-commalist-pagelistend]]%0a@]%0a%0a!!! #tag-commalist%0aParameters: count%0aUsed to generate the comma-separated list of categories usually seen in the blog footer.%0a[@%0a(:if false:)[[#tag-commalist]](:if:)\%0a(:template each:)[[{=$FullName}|{=$Titlespaced}]]\%0a(:template ! last ...:), \%0a[[#tag-commalistend]]%0a@]%0a----%0a! Forms%0a----%0a!! #blog-form%0a[@%0a(:if false:)[[#blog-form]](:if:)%0a(:messages:)%0a$[Blog Title:] (:input text $:entrytitle size=70 class="inputbox blogit-title" id="entrytitle" focus=1 tabindex=1:)\%0a(:blogit list "$:entrytype":)bi_PageType/$[Type:] (:blogitend:)[==]\%0a(:blogit list "$:blogid":)bi_BlogList/$[BlogID:] (:blogitend:)\\%0a$[Tags:] (:input text $:entrytags size=20 id="entrytags" tabindex=1:)\%0a(:blogit list "$:entrystatus":)bi_StatusType/$[Status:] (:blogitend:)\%0a[==](:blogit list "$:entrycomments":)bi_CommentType/$[Comments:] (:blogitend:)\\%0a%0a(:div9989 class="blogit-guibuttons":)(:e_guibuttons:)%0a(:div9989end:)%0a(:input textarea $:entrybody rows=(:if9981 equal "{$bi_Mode}" ajax:){$bi_SkinSettings_AJAX_TEXTAREA_ROWS}(:else9981:)23(:if9981:) cols=80 id="text" tabindex=1:)\%0a$[Pagename (Group.Name):] (:input text $:entryurl size=70 id="entryurl" tabindex=1:)\\%0a$[Author:] (:input text $:entryauthor size=25 id="entryauthor" tabindex=1:)\%0a$[Date:] (:input text $:entrydate size=17 id="entrydate" value=(:if !bi_isnull {$bi_Default_ptv_entrydate}:)"{$bi_Default_ptv_entrydate}"(:else:)"{(ftime fmt='$[%25d-%25m-%25Y %25H:%25M]' @(bi_ifnull {*$:entrydate} {$Now}) )}"(:if:) tabindex=1:)\\%0a(:includesection "#blog-form-buttons":)%0a[[#blog-formend]]%0a@]%0a%0a!! #comment-form%0a[@%0a(:if false:)[[#comment-form]](:if:)%0a!! $[Leave a comment]%0a$[All comments are reviewed before being displayed.]%0a(:messages:)\\%0a'''$[Name]''' $[(required):]\\%0a(:input text $:commentauthor id="comment-author" tabindex=1 class="blogit-required":)\\%0a'''$[E-mail]''' $[(required, will not be published):]\\%0a(:input text $:email id="comment-email" tabindex=1 class="blogit-required":)\\%0a$[Website:]\\%0a(:input text $:website id="comment-website" tabindex=1:)\\%0a(:input textarea $:commenttext rows=10 cols=50 id="comment-text" tabindex=1:)%0a(:includesection "#comment-form-buttons":)%0a[[#comment-formend]]%0a@]%0a%0a----%0a! CORE TEMPLATES%0a----%0a'''You probably don't want to be changing these as they determine how blogit functions, rather than having anything to do with layout.'''%0a%0a!! BLOGS%0a!!! #blog-form-control%0a[@%0a(:if false:)[[#blog-form-control]](:if:)%0a(:div1 id="wikiedit" class="blogit-blog-form":)%0a(:input pmform target="blogit-entry":)\%0a(:input default source="{*$FullName}" request=1:)\%0a(:input default $:entrystatus "draft":)\%0a(:input default $:entryauthor "{$Author}":)\%0a(:input default $:entrydate "{(ftime fmt='$[%25d-%25m-%25Y %25H:%25M]' @{$Now} )}":)\%0a(:input default $:entryurl "(:if equal '{$Action}' 'bi_ne':){$bi_DefaultGroup}.(:else:){*$FullName}(:if:)":)\%0a(:includesection "#blog-form":)%0a(:input end:)%0a(:div1end:)%0a(:include {$SiteGroup}.EditQuickReference:)%0a[[#blog-form-controlend]]%0a@]%0a%0a!!! #blog-post-control%0a'''Note:''' Validation is performed here to trigger PmForms error, and stop processing. However, when the use enters an invalid date, it gets converted to a valid Unix timestamp, and thus the user sees a date they didn't enter. So, additional validation is performed in blogit.php. If the user enters an invalid date we pass pack the actual string they entered.%0a%0aIn this case don't use the 'if' condition to hide the anchor, because the closing if gets included as the first line in the blog-entry post.%0a[@%0a[[#blog-post-control]]%0a(:template defaults saveto="{$$ptv_entryurl}":)%0a(:template defaults successpage="{$$saveto}":)%0a(:template require $:entrytitle errmsg="$[Title is required.]":) %0a(:template require $:entryurl errmsg="$[Pagename is required.]":) %0a(:template require $:entryurl if="!bi_ispage {$$ptv_entryurl}" errmsg="$[Pagename already exists, or is invalid/blank.]":)%0a(:template require $:entrydate if="bi_isdate {$$ptv_entrydate}" errmsg="$[Invalid date.]":)%0a(:template defaults savevars=$:pmmarkup,$:blogid,$:entrytype,$:entrydate,$:entryauthor,$:entrytitle,$:entrystatus,$:entrycomments,$:entrytags,$:entrybody:)%0a[[#blog-post-controlend]]%0a@]%0a%0a!!! #blog-edit%0a[@%0a(:if false:)[[#blog-edit]](:if:)%0a(:pmform blogit-entry:)%0a[[#blog-editend]]%0a@]%0a%0a!!! #blog-form-buttons%0a[@%0a(:if false:)[[#blog-form-buttons]](:if:)%0a(:div9991 class="blogit-submit-row":)\%0a(:if9991 !equal 'ajax' '{$bi_Mode}':)\%0a(:input submit value="$[Save]" name="save" accesskey="s" id="blogit-save" tabindex=1:)\%0a(:input submit value="$[Cancel]" name="cancel" id="blogit-cancel" tabindex=1:)\%0a(:if9991end:)%0a(:div9991end:)%0a[[#blog-form-buttons]]%0a@]%0a%0a!! COMMENTS%0a!!! #comment-form-control%0a[@%0a(:if false:)[[#comment-form-control]](:if:)%0a(:input pmform target="blogit-comments":)\%0a(:input default source="{*$FullName}" request=1:)\%0a(:input default $:commentauthor "{$Author}":)\%0a(:input hidden class="blogit-required" $:blogid value="{*$:blogid}":)\%0a(:input hidden class="blogit-required" $:blogit_basepage value="{*$:blogit_basepage}":)\%0a(:if9 [ equal '{$Action}' 'bi_ce' && bi_auth comment-edit,comment-approve ] :)\%0a(:input hidden class="blogit-required" $:commentdate value="{*$:commentdate}":)\%0a(:if9:)%0a(:div9980 class='blogit-comment-form':)\%0a(:includesection "#comment-form":)%0a(:div9980end:)%0a(:if9 [ equal '{$Action}' 'bi_ce' && bi_auth comment-approve ] :)\%0a(:div9980 class='blogit-comment-status':)\%0a(:blogit list "$:commentapproved":)bi_CommentApprovalType/$[Comment Approved?] (:blogitend:)%0a(:div9980end:)%0a(:if9:)%0a(:input end:)%0a[[#comment-form-controlend]]%0a@]%0a%0a!!! #comment-post-control%0aIn this case don't use the 'if' condition to hide the anchor, because the closing if gets included as the first line in the blog-entry post.%0a%0a[@%0a[[#comment-post-control]]%0a(:template require $:blogid errmsg="$[BlogID is required.]":)%0a(:template require $:blogit_basepage errmsg="$[Basepage is required.]":)%0a(:template require $:commentauthor errmsg="$[Name is required.]":)%0a(:template require $:email errmsg="$[Email is required.]":)%0a(:template defaults savevars=$:blogit_basepage,$:blogid,$:entrytype,$:commentauthor,$:email,$:website,$:commenttext,$:commentapproved,$:commentdate:)%0a[[#comment-post-controlend]]%0a@]%0a%0a!!! #comment-edit%0a[@%0a(:if false:)[[#comment-edit]](:if:)%0a(:pmform blogit-comments:)%0a[[#comment-editend]]%0a@]%0a%0a!!! #comment-form-buttons%0a[@%0a(:if false:)[[#comment-form-buttons]](:if:)%0a(:div9991 class="blogit-submit-row":)\%0a(:if9991 !equal 'ajax' '{$bi_Mode}':)\\%0a(:if9992 [ equal '{$bi_ReCaptchaEnabled}' '1' && ( !bi_auth comment-edit,comment-approve || bi_dev ) ] :)(:recaptcha:)\\(:if9992end:)%0a(:if9992 [ equal '{$EnablePostCaptchaRequired}' '1' && ( !bi_auth comment-edit,comment-approve || bi_dev ) ] :)$[Enter value:] {$Captcha} (:input captcha tabindex=1:) (:if9992end:)\%0a(:input submit name=post value="$[Post]" id="comment-post" tabindex=1:)\%0a(:if9 [ equal '{$Action}' 'bi_ce' || equal '{$Action}' 'bi_cr' ] && bi_auth comment-edit :)\%0a(:input submit value="$[Cancel]" name="cancel" id="blogit-cancel" tabindex=1:)(:if9:)\\%0a(:if9991end:)%0a(:div9991end:)%0a[[#comment-form-buttons]]%0a@]%0a%0a
+text=[++%25red%25'''WARNING: Do not change this file.'''%25%25 ++]%0a* You can make skin specific changes by including the any of the sections below in [@{$Site}.BlogIt-SkinTemplate-skinname@]. %0a* Copy only specific sections you need to override. Do not copy the entire file, as you will not get the benefits of future releases of BlogIt.%0a%0a----%0a! LAYOUT TEMPLATES%0a----%0aThese will typically be over-ridden by skins in order to change layout.%0aNote: %0a* Unjoined [@(:if:)@] on meta-data-head prevents (:div9999end:) being displayed. Unknown why!%0a* [@{*$FullName}@]: {*$FullName}: The page in the URL for non-pagelists%0a* [@{=$FullName}@]: {=$FullName}: The page being managed in a pagelist%0a* [@{$FullName}@]: {$FullName}: Usually the name of this file Site.BlogIt-CoreTemplate%0a%0a%0a!! Blogs%0a%0a!!! #single-entry-view%0a[@%0a(:if false:)[[#single-entry-view]](:if:)%0a(:div9990 class="blogit-post":)%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){*$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){*$:entrydate}(:blogit-skinend:)%25%25(:if:) \%0a(:blogit-skin edit pre_text='%25item accesskey="$[ak_edit]"%25' post_text='%25%25' page='{*$FullName}':)$[edit](:blogit-skinend:)%0a(:div9999end:)%0a(:div9991 class="blogit-post-body":)%0a{*$:entrybody}%0a(:div9991end:)%0a(:div9999 class="blogit-meta-data-footer":)%0a(:blogit-skin tags pre_text='!!!!!%25block blogit-tags%25$[Tags:] ' page='{*$FullName}' post_text='%25%25':){*$:entrytags}(:blogit-skinend:)%0a(:blogit-skin commentcount status='{*$:entrycomments}' pre_text='!!!!!%25block blogit-comment-count%25' post_text='%25%25' group='{*$Group}' name='{*$Name}':) $[comment(s)](:blogit-skinend:)%0a(:div9999end:)%0a(:div9990end:)%0a(:includesection "#comments-pagelist pagename={*$Name} group={*$Group} entrycomments={*$:entrycomments} divid=commentblock":)%0a[[#single-entry-viewend]]%0a@]%0a%0a!!! #print-view%0aNB: Unjoined (:if:) on meta-data-head prevents (:div9999end:) being displayed. Unknown why!%0a%0a[@%0a(:if false:)[[#print-view]](:if:)%0a(:div9990 class="blogit-post":)%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){*$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){*$:entrydate}(:blogit-skinend:)%25%25(:if:) \%0a(:div9999end:)%0a(:div9991 class="blogit-post-body":)%0a{*$:entrybody}%0a(:div9991end:)%0a(:div9999 class="blogit-meta-data-footer":)%0a(:blogit-skin tags pre_text='!!!!!%25block blogit-tags%25$[Tags:] ' page='{*$FullName}' post_text='%25%25':){*$:entrytags}(:blogit-skinend:)%0a(:blogit-skin commentcount status='{*$:entrycomments}' pre_text='!!!!!%25block blogit-comment-count%25' post_text='%25%25' group='{*$Group}' name='{*$Name}':) $[comment(s)](:blogit-skinend:)%0a(:div9999end:)%0a(:div9990end:)%0a(:includesection "#comments-pagelist pagename={*$Name} group={*$Group} entrycomments={*$:entrycomments} divid=commentblock":)%0a[[#print-viewend]]%0a@]%0a%0a!!! #multi-entry-view%0aParameters: [pagenav], [perpage]%0a[@%0a(:if false:)[[#multi-entry-view]](:if:)%0a(:template defaults order=-$:entrydate:)%0a(:template each:)%0a(:div9990 class="blogit-post-summary":)%0a!! [[{=$FullName} | {=$Title}]]%0a(:div9999 class="blogit-meta-data-head":)%0a!!!!! (:blogit-skin author pre_text='$[By] ' post_text=', $[on] ':){=$:entryauthor}(:blogit-skinend:)\%0a%25blogit-date%25(:blogit-skin date fmt='long':){=$:entrydate}(:blogit-skinend:)%25%25 \%0a(:blogit-skin edit pre_text='%25item accesskey="$[ak_edit]"%25' post_text='%25%25' page='{=$FullName}':)$[edit](:blogit-skinend:)%0a(:div9999end:)%0a(:blogit-skin intro class=blogit-post-intro page={=$FullName}:)%0a{=$:entrybody}(:blogit-skinend:)%0a(:div9990end:)%0a(:template last:)%0a(:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":)%0a[[#multi-entry-viewend]]%0a@]%0a%0a!!! #blog-list-view%0aParameters: pagenav, perpage, fullname (for single row)%0a[@%0a(:if false:)[[#blog-list-view]](:if:)%0a(:template defaults wrap=inline:)%0a(:template first:)%0a(:if bi_isnull {$$fullname}:)%0a(:div class="blogit-blog-list":)%0a(:table class="blog-list":)%0a(:cellnr class="blogit-blog-list-header":)$[Actions]%0a(:cell:)$[Title]%0a(:cell:)$[Author]%0a(:cell:)$[Date]%0a(:cell:)$[Tags]%0a(:template first {=$:entrystatus}:)%0a(:cellnr class="blog-list-header" colspan=5:)'''$[{=$:entrystatus}]'''%0a(:if:)%0a(:template each:)%0a(:cellnr class="blogit-actions":) %25apply=row class="blogit-blog-list-row" id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)"%25%0a* %25apply=list class="blogit-admin-links"%25(:blogit-skin edit page='{=$FullName}' post_text=" ":)$[edit](:blogit-skinend:)%0a* (:blogit-skin delete page='{=$FullName}':)$[delete](:blogit-skinend:)%0a(:cell class="blogit-title":)[[{=$FullName}|{=$Title}]]%0a(:cell class="blogit-author":)(:blogit-skin author:){=$:entryauthor}(:blogit-skinend:)%0a(:cell class="blogit-date":)(:blogit-skin date fmt='entry':){=$:entrydate}(:blogit-skinend:)%0a(:cell class="blogit-tags":)(:blogit-skin tags page='{=$FullName}':){=$:entrytags}(:blogit-skinend:)%0a(:cell class="blogit-commentcount":)\%0a(:blogit-skin commentcount status='true' group='{=$Group}' name='{=$Name}':)/(:blogit-skinend:)\%0a(:blogit-skin commentcount status='false' group='{=$Group}' name='{=$Name}':)(:blogit-skinend:)%0a(:template last:)%0a(:if bi_isnull {$$fullname}:)%0a(:tableend:)%0a(:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":)%0a(:divend:)%0a(:if:)%0a[[#blog-list-viewend]]%0a@]%0a%0a!!! #blog-summary-list%0aSimple bullet list of blog titles.%0aParameters: more, blogid%0a[@%0a(:if false:)[[#blog-summary-list]](:if:)%0a(:template each:)%0a* %25apply list class="blogit-blog-summary-list"%25[[{=$FullName} | {=$Title}]]%25%25%0a(:template last:)%0a(:if !equal "{$$more}" false:)(:div class="blogit-listmore":)[[Site.BlogList?blogid={$$blogid} | $[more...]]]%0a(:divend:)(:if:)%0a[[#blog-summary-listend]]%0a@]%0a%0a!!! #blog-yearly-archive%0aList of all pages grouped by year, ordered by date%0aParameters: none%0a[@%0a(:if false:)[[#blog-yearly-archive]](:if:)%0a(:template each:)%0a(:if !equal {(ftime fmt='$[%25Y]' @{=$:entrydate})} {(ftime fmt='$[%25Y]' @{%3c$:entrydate})}:)%0a!! %25block blogit-archive-year%25{(ftime fmt='$[%25Y]' @{=$:entrydate})}(:if:)%0a* %25apply list class="blogit-yearly-archive"%25[[{=$FullName} | {=$Title}]] %25blogit-entry-date%25(:blogit-skin date fmt='short':){=$:entrydate}(:blogit-skinend:)%25%25%0a[[#blog-yearly-archiveend]]%0a@]%0a%0a----%0a! Comments%0a----%0a!! #comment-view-all%0aDisplays a list of comments as part of the single entry view. Approved comments are visible to all. Unapproved comments are only shown to admins, and include an 'approve' link.%0a{=$FullName} refers to the comment page.%0a%0aParameters: name (refers to a comment page), base, commenttid (not from pagelist, only when called from bi_AjaxRedirect)%0a[@%0a(:if false:)[[#comment-view-all]](:if:)%0a(:template first:)%0a(:div9990 class="blogit-commentblock":)%0a!! (:if [ bi_auth comment-edit,comment-approve && !equal '{$Action}' 'print' ] :)%25apply=block class=blogit-admin%25(:if:)$[Comments]%0a(:template each:)%0a(:if9990 [ bi_isnull {$$commentid} || ( !bi_isnull {$$commentid} && equal '{=$Name}' '{$$commentid}' ) ] :)\%0a# %25apply=list class="blogit-comment-list"%25 %25apply=item id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)" class="comment blogit-comment-(:if9991 equal 'false' '{=$:commentapproved}':)un(:if9991end:)approved" (:if9991 bi_auth comment-edit,comment-approve:)blogit-admin(:if9991end:)%25 %25blogit-comment-header%25\%0a$[By] (:blogit-skin commentauthor website='{=$:website}' author='{=$:commentauthor}':)(:blogit-skinend:), \%0a$[on] (:blogit-skin date fmt='long':){=$:commentdate}(:blogit-skinend:)\%0a (:includesection "#admin-links commentstatus='{=$:commentapproved}' commentpage='{=$FullName}' base='{(bi_ifnull "{$$base}" "{*$FullName}")}'":)\%0a %25commenttext%25(:blogit-skin commenttext page='{=$FullName}':){=$:commenttext}(:blogit-skinend:)%25%25%0a(:if9990end:)%0a(:template last:)%0a(:div9990end:)%0a%0a[[#comment-view-allend]]%0a@]%0a%0a!! #comment-view-admin%0aDisplays a list of comments as part of the comment-view-pagelist. \\%0aEnsure title is only printed first time, not for each comment: if !equal {(bi_base {=$FullName})} {(bi_base {%3c$FullName})}\\%0a%0aParameters: name (commentid), base %0a[@%0a(:if false:)[[#comment-view-admin]](:if:)%0a(:template each:)%0a(:if !equal {(bi_base {=$FullName})} {(bi_base {%3c$FullName})} :)%0a!!! [[{(bi_base {=$FullName})} | {{(bi_base {=$FullName})}$Title}]](:if:)%0a# %25apply=list class="blogit-comment-list blogit-comment-admin-list"%25 %25apply=item id="(:blogit-skin commentid:){=$FullName}(:blogit-skinend:)" class="comment blogit-comment-(:if9991 equal 'false' '{=$:commentapproved}':)un(:if9991end:)approved" blogit-admin%25 %25blogit-comment-header%25\%0a$[By] (:blogit-skin commentauthor website='{=$:website}' author='{=$:commentauthor}':)(:blogit-skinend:), \%0a$[on] (:blogit-skin date fmt='long':){=$:commentdate}(:blogit-skinend:)\%0a (:includesection "#admin-links commentstatus='{=$:commentapproved}' commentpage='{=$FullName}' base='{(bi_ifnull "{$$base}" "{*$FullName}")}'":)\%0a %25commenttext%25(:blogit-skin commenttext page='{=$FullName}':){=$:commenttext}(:blogit-skinend:)%25%25%0a[[#comment-view-adminend]]%0a@]%0a%0a!! #comment-summary-list%0aParameters: datestamp (true/false)%0a[@%0a(:if false:)[[#comment-summary-list]](:if:)%0a* %25apply list class="blogit-comment-summary-list"%25[[{(bi_base {=$FullName})}#(:blogit-skin commentid:){=$FullName}(:blogit-skinend:) | (:blogit cleantext:){=$:commenttext}(:blogitend:)$[...]]]%25%25%0a (:if equal '{$$datestamp}' true:)%25blogit-comment-timestamp%25(:blogit-skin date fmt='entry':){=$:commentdate}(:blogit-skinend:)%25%25(:if:)%0a[[#comment-summary-listend]]%0a@]%0a%0a----%0a! General%0a----%0a!! #no-results-found%0a[@%0a(:if false:)[[#no-results-found]](:if:)%0a!! $[No more pages found.]%0a[[{*$FullName} | $[Return to first page.]]].%0a[[#no-results-foundend]]%0a@]%0a%0a!! #page-navigation%0aParameters: itemsonpage (entries on this particular page set), [pagenav] (show page nav links? Default TRUE), [perpage] (override entries-per-page)%0a[@%0a(:if false:)[[#page-navigation]](:if:)%0a(:if1 !equal "{$$pagenav}" false:)(:div class="blogit-page-navigation force_contain":)\%0a(:if2 !bi_isnull {$bi_PagePrev}:)\%0a%25blogit-newer-entries%25[[{(bi_url {*$FullName} page {$bi_PagePrev})} | $[newer posts]]]\%0a(:if2:)\%0a(:if2 !bi_lt '{$$itemsonpage}' {(bi_ifnull "{$$perpage}" "{$bi_EntriesPerPage}")} :)\%0a%25blogit-older-entries%25[[{(bi_url {*$FullName} page {$bi_PageNext})} | $[older posts]]]\%0a(:if2:)%0a(:divend:)%0a(:div class="blogit-clear":)%0a(:divend:)%0a(:if1:)%0a[[#page-navigationend]]%0a@]%0a%0a----%0a! Admin%0a----%0a!! Control Panel%0aParameters: blogid%0a[@%0a(:if false:)[[#control-panel]](:if:)%0a(:blogid:blog1:)%0a* %25apply=item class="blogit-unapproved-comment-count"%25[[{$bi_Pages_ADMIN}?action=bi_admin&s=unapproved-comments&blogid={(bi_ifnull "{$$blogid}" {$:blogid})} | $[Unapproved Comments:] (:includesection "#comments-count-pagelist commentstatus=false blogid={(bi_ifnull '{$$blogid}' {$:blogid})}":)]]%0a(:blogit-skin newentry pre_text='* ':)$[New Entry](:blogit-skinend:)%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=draft | $[Drafts]]]%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=publish | $[Published]]]%0a* [[{$bi_Pages_ADMIN}?action=bi_admin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status=sticky | $[Stickies]]]%0a(:if !bi_isnull {$bi_StatAction}:)* [[{*$FullName}?action={$bi_StatAction} | $[Statistics]]](:if:)%0a* [[{*$FullName}?action=logout | $[logout](:if !bi_isnull {$AuthId}:) [-''({$AuthId})''-](:if:)]]%0a[[#control-panelend]]%0a@]%0a%0a!! #admin-links%0aParameters: commentstatus (current status), commentpage (name of the comment page), base (name of the basepage).\\%0aNOTE: Classes are auto applied, which also adds (:nl:) at end of line. If this section is in HTML list ensure ' ' (as below) is at start of line to prevent PRE tag being inserted by PmWiki. \\%0aNOTE: basepage will be incorrect both when starting from BlogIt-Admin, and also when responding to ajax, with single comment. bi_Basepage() works this out.\\%0a%0a[@%0a(:if false:)[[#admin-links]](:if:)%0a(:if9 [ bi_auth comment-edit,comment-approve && !equal '{$Action}' 'print' ] :)%0a** %25apply=list class="blogit-admin-links"%25(:blogit-skin commentapprove post_text=' - ' status='{$$commentstatus}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentedit post_text=' - ' base='{$$base}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentreply post_text=' - ' base='{$$base}':){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentdelete:){$$commentpage}(:blogit-skinend:)%0a** (:blogit-skin commentblock pre_text=' - ':){$$commentpage}(:blogit-skinend:)\%0a(:if9:)%0a[[#admin-linksend]]%0a@]%0a%0a----%0a! Pagelists%0a----%0a!! BLOGS%0a!!! #blog-summary-pagelist%0aParameters: blogid, status, pagenav (true/false -- default is true), count (0 for default all; null for default defined in config), daterange, [group and name (if included, then returns only the specific page, no other parameters are needed)].%0a[@%0a(:if false:)[[#blog-summary-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#multi-entry-view\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a {(bi_param link "{$$link}")}\%0a {(bi_param perpage "{$$count}")}\%0a {(bi_param group "{$$group}")}\%0a {(bi_param name "{$$name}")}\%0a (:if !bi_isnull {$$daterange}:)if='date {$$daterange} @{=$:entrydate}' \%0a (:elseif equal {$bi_DisplayFuture} false:)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a (:if !equal '{$$count}' 0:){(bi_param pagenav "{$$pagenav}")}\%0a count={(bi_ifnull '{$$count}' "{$bi_EntryStart}..{$bi_EntryEnd}")}(:if:)\%0a {(bi_param cols "{$$cols}")}\%0a:)%0a[[#blog-summary-pagelistend]]%0a@]%0a%0a!!! #blog-summary-list-pagelist%0aParameters: blogid, count, status, more (include more link)%0a[@%0a(:if false:)[[#blog-summary-list-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-summary-list {(bi_param count "{$$count}")}\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a (:if equal {$bi_DisplayFuture} false:)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a {(bi_param blogid "{$$blogid}")}\%0a {(bi_param more "{$$more}")}\%0a:)%0a[[#blog-summary-list-pagelistend]]%0a@]%0a%0a!!! #blog-grid%0aAccepts parameters of status, count (really perpage), blogid, pagenav, OR group and name, in which case only a single row is returned, with no header (for ajax updates)%0a[@%0a(:if false:)[[#blog-grid]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-list-view \%0a order=$[$:entrystatus],-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a {(bi_param perpage "{$$count}")}\%0a {(bi_param group "{$$group}")}\%0a {(bi_param name "{$$name}")}\%0a (:if !bi_isnull {$$group}:)fullname={$$group}.{$$name}(:if:)\%0a (:if [ equal "{$$count}" "0" || !bi_isnull {$$group} ] :)pagenav=false\%0a (:else:){(bi_param pagenav "{$$pagenav}")}\%0a count={$bi_EntryStart}..{$bi_EntryEnd}\%0a (:if:)\%0a:)%0a[[#blog-gridend]]%0a@]%0a%0a!!! #blog-yearly-archive-pagelist%0aParameters: blogid, status, year%0a[@%0a(:if false:)[[#blog-yearly-archive-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-yearly-archive\%0a order=-$:entrydate\%0a $:entrytype=blog\%0a {(bi_param $:blogid "{$$blogid}")}\%0a {(bi_param $:entrystatus "{$$status}")}\%0a (:if1 bi_isnull {$$year}:)(:if2 equal '{$bi_DisplayFuture}' false :)if='date ..@{$Now} @{=$:entrydate}'(:if2:)\%0a (:else1:)if=' [ date {$$year}-01-01..{$$year}-12-31 @{=$:entrydate} (:if2 equal {$bi_DisplayFuture} false:)&& date ..@{$Now} @{=$:entrydate}(:if2:) ] '\%0a (:if1:)\%0a:)%0a[[#blog-yearly-archive-pagelistend]]%0a@]%0a%0a!! COMMENTS%0a!!! #comments-pagelist%0aDisplays comments on the blog entry single-page view.%0aParameters: pagename, group, entrycomments, divid, commentid (to display a single comment, on ajax edit), base if displaying a single comment%0aIf providing a commentid (the $Name of the comment page, excluding the $Group), then pagename and group parameters are not needed.%0a%0a[@%0a(:if false:)[[#comments-pagelist]](:if:)\%0a(:if9990 [ !bi_isnull {$$commentid} || ( !equal "{$$entrycomments}" "none" && !equal "{$bi_CommentsEnabled}" "none" ) ] :)%0a(:if9991 bi_isnull {$$commentid}:)%0a(:if9992 !bi_isnull {$$divid}:)(:div9970 id="{$$divid}":)(:if9992:)%0a(:div9971 id="blogit-comment-list":)\%0a(:if9991:)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-view-all\%0a order=ctime\%0a name=(:if9981 bi_isnull {$$commentid}:){$$group}-{$$pagename}-* (:else9981:){$$commentid}(:if9981:) \%0a $:entrytype=comment\%0a {(bi_param base "{$$base}")}\%0a if="[ equal '{=$:commentapproved}' 'true' || !bi_isnull {$$commentid} || bi_auth comment-edit,comment-approve {$bi_Pages_AUTH} ]" \%0a:)%0a(:if9991 bi_isnull {$$commentid}:)%0a(:div9971end:)%0a(:if [ equal "{$$entrycomments}" "open" && equal "{$bi_CommentsEnabled}" "open" ] :)\%0a(:pmform blogit-comments:)(:if:)%0a(:if9992 !bi_isnull {$$divid}:)(:div9970end:)(:if9992:)\%0a(:if9991:)%0a(:if9990:)%0a[[#comments-pagelistend]]%0a@]%0a%0a%0a!!! #comment-summary-list-pagelist%0aParameters: blogid, count%0a[@%0a(:if false:)[[#comment-summary-list-pagelist]](:if:)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-summary-list {(bi_param count "{$$count}")}\%0a order=-ctime\%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param $:blogid "{$$blogid}")}\%0a $:commentapproved=true\%0a if="!bi_baseptv {=$FullName} draft"\%0a:)%0a[[#comment-summary-list-pagelistend]]%0a@]%0a%0a!!! #unapproved-comments%0aList of all unapproved comments, for admins.%0aParameters: blogid, commentid (to list a single comment), base if single comment%0aNB: If commentid is supplied a row is always returned regardless of approval status. This is so that if user edits an unapproved comment, and changes the status, we display the update on the page (even though the row should now not be displayed since status has changed).%0a[@%0a(:if false:)[[#unapproved-comments]](:if:)%0a(:if9 [ !equal "{$bi_CommentsEnabled}" "none" && bi_auth comment-edit,comment-approve {$bi_Pages_AUTH} ] :)%0a(:div9998 class="blogit-comment-summary":)%0a(:pagelist list="blogit-comments" wrap=none fmt=#comment-view-admin\%0a order=name,-ctime\%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param name "{$$commentid}")}\%0a {(bi_param base "{$$base}")}\%0a {(bi_param $:blogid "{$$blogid}")}\%0a (:if10 bi_isnull {$$commentid}:)$:commentapproved=false(:if10:)\%0a:)%0a(:div9998end:)%0a(:if9:)%0a[[#unapproved-commentsend]]%0a@]%0a%0a!!! #comments-count-pagelist%0aParameters: commentstatus: true/false, [entrygroup, entryname], [blogid]%0a[@%0a(:if false:)[[#comments-count-pagelist]](:if:)\%0a(:if1 !equal "{$bi_CommentsEnabled}" "none":)\%0a(:pagelist list="blogit-comments" wrap=none fmt=count \%0a group={$bi_CommentGroup}\%0a $:entrytype=comment\%0a {(bi_param $:blogid "{$$blogid}")}\%0a (:if2 [ !bi_isnull {$$entrygroup} && !bi_isnull {$$entryname} ] :)name={$$entrygroup}-{$$entryname}-* (:if2:)\%0a {(bi_param $:commentapproved "{$$commentstatus}")}\%0a:)(:if1:)\%0a[[#comments-count-pagelistend]]%0a@]%0a%0a!! TAGS%0a!!! #tag-pagelist%0aParameters: count, tag (if not provided, uses the current page name, which would be the tag)%0aIncluded as part of $GroupFooterFmt, so when browsing a page in the Tag group, the pagelist shows up.%0a[@%0a(:if false:)[[#tag-pagelist]](:if:)%0a(:pagelist list="blogit" wrap=none fmt=#blog-yearly-archive\%0a order=-$:entrydate\%0a link={$CategoryGroup}.{(bi_ifnull "{$$tag}" "{*$Name}")} \%0a $:entrystatus=-draft\%0a $:entrytype=blog\%0a (:if equal '{$bi_DisplayFuture}' 'false':)if='date ..@{$Now} @{=$:entrydate}'(:if:)\%0a {(bi_param count "{$$count}")}\%0a:)%0a[[#tag-pagelistend]]%0a@]%0a%0a!!! #tag-list-pagelist%0aParameters: count%0aUsed to generate the list of categories usually seen in the sidebar.%0a[@%0a(:if false:)[[#tag-list-pagelist]](:if:)%0a(:pagelist wrap=none fmt=#titlespaced group={$CategoryGroup} {(bi_param count "{$$count}")} :) %0a[[#tag-list-pagelistend]]%0a@]%0a%0a%0a!!! #tag-commalist-pagelist%0aParameters: links%0aUsed to generate the list of categories usually seen in the sidebar.%0a%0a[@%0a(:if false:)[[#tag-commalist-pagelist]](:if:)\%0a(:pagelist name={$$links} list=all fmt=#tag-commalist wrap=inline:)%0a[[#tag-commalist-pagelistend]]%0a@]%0a%0a!!! #tag-commalist%0aParameters: count%0aUsed to generate the comma-separated list of categories usually seen in the blog footer.%0a[@%0a(:if false:)[[#tag-commalist]](:if:)\%0a(:template each:)[[{=$FullName}|{=$Titlespaced}]]\%0a(:template ! last ...:), \%0a[[#tag-commalistend]]%0a@]%0a----%0a! Forms%0a----%0a!! #blog-form%0a[@%0a(:if false:)[[#blog-form]](:if:)%0a(:messages:)%0a$[Blog Title:] (:input text $:entrytitle size=70 class="inputbox blogit-title" id="entrytitle" focus=1 tabindex=1:)\%0a(:blogit list "$:entrytype":)bi_PageType/$[Type:] (:blogitend:)[==]\%0a(:blogit list "$:blogid":)bi_BlogList/$[BlogID:] (:blogitend:)\\%0a$[Tags:] (:input text $:entrytags size=20 id="entrytags" tabindex=1:)\%0a(:blogit list "$:entrystatus":)bi_StatusType/$[Status:] (:blogitend:)\%0a[==](:blogit list "$:entrycomments":)bi_CommentType/$[Comments:] (:blogitend:)\\%0a%0a(:div9989 class="blogit-guibuttons":)(:e_guibuttons:)%0a(:div9989end:)%0a(:input textarea $:entrybody rows=(:if9981 equal "{$bi_Mode}" ajax:){$bi_SkinSettings_AJAX_TEXTAREA_ROWS}(:else9981:)23(:if9981:) cols=80 id="text" tabindex=1:)\%0a$[Pagename (Group.Name):] (:input text $:entryurl size=70 id="entryurl" tabindex=1:)\\%0a$[Author:] (:input text $:entryauthor size=25 id="entryauthor" tabindex=1:)\%0a$[Date:] (:input text $:entrydate size=17 id="entrydate" value=(:if !bi_isnull {$bi_Default_ptv_entrydate}:)"{$bi_Default_ptv_entrydate}"(:else:)"{(ftime fmt='$[%25d-%25m-%25Y %25H:%25M]' @(bi_ifnull {*$:entrydate} {$Now}) )}"(:if:) tabindex=1:)\\%0a(:includesection "#blog-form-buttons":)%0a[[#blog-formend]]%0a@]%0a%0a!! #comment-form%0a[@%0a(:if false:)[[#comment-form]](:if:)%0a!! $[Leave a comment]%0a$[All comments are reviewed before being displayed.]%0a(:messages:)\\%0a'''$[Name]''' $[(required):]\\%0a(:input text $:commentauthor id="comment-author" tabindex=1 class="blogit-required":)\\%0a'''$[E-mail]''' $[(required, will not be published):]\\%0a(:input text $:email id="comment-email" tabindex=1 class="blogit-required":)\\%0a$[Website:]\\%0a(:input text $:website id="comment-website" tabindex=1:)\\%0a(:input textarea $:commenttext rows=10 cols=50 id="comment-text" tabindex=1:)%0a(:includesection "#comment-form-buttons":)%0a[[#comment-formend]]%0a@]%0a%0a----%0a! CORE TEMPLATES%0a----%0a'''You probably don't want to be changing these as they determine how blogit functions, rather than having anything to do with layout.'''%0a%0a!! BLOGS%0a!!! #blog-form-control%0a[@%0a(:if false:)[[#blog-form-control]](:if:)%0a(:div1 id="wikiedit" class="blogit-blog-form":)%0a(:input pmform target="blogit-entry":)\%0a(:input default source="{*$FullName}" request=1:)\%0a(:input default $:entrystatus "draft":)\%0a(:input default $:entryauthor "{$Author}":)\%0a(:input default $:entrydate "{(ftime fmt='$[%25d-%25m-%25Y %25H:%25M]' @{$Now} )}":)\%0a(:input default $:entryurl "(:if equal '{$Action}' 'bi_ne':){$bi_DefaultGroup}.(:else:){*$FullName}(:if:)":)\%0a(:includesection "#blog-form":)%0a(:input end:)%0a(:div1end:)%0a(:include {$SiteGroup}.EditQuickReference:)%0a[[#blog-form-controlend]]%0a@]%0a%0a!!! #blog-post-control%0a'''Note:''' Validation is performed here to trigger PmForms error, and stop processing. However, when the use enters an invalid date, it gets converted to a valid Unix timestamp, and thus the user sees a date they didn't enter. So, additional validation is performed in blogit.php. If the user enters an invalid date we pass pack the actual string they entered.%0a%0aIn this case don't use the 'if' condition to hide the anchor, because the closing if gets included as the first line in the blog-entry post.%0a[@%0a[[#blog-post-control]]%0a(:template defaults saveto="{$$ptv_entryurl}":)%0a(:template defaults successpage="{$$saveto}":)%0a(:template require $:entrytitle errmsg="$[Title is required.]":) %0a(:template require $:entryurl errmsg="$[Pagename is required.]":) %0a(:template require $:entryurl if="!bi_ispage" errmsg="$[Pagename already exists, or is invalid/blank.]":)%0a(:template require $:entrydate if="bi_isdate" errmsg="$[Invalid date.]":)%0a(:template defaults savevars=$:pmmarkup,$:blogid,$:entrytype,$:entrydate,$:entryauthor,$:entrytitle,$:entrystatus,$:entrycomments,$:entrytags,$:entrybody:)%0a[[#blog-post-controlend]]%0a@]%0a%0a!!! #blog-edit%0a[@%0a(:if false:)[[#blog-edit]](:if:)%0a(:pmform blogit-entry:)%0a[[#blog-editend]]%0a@]%0a%0a!!! #blog-form-buttons%0a[@%0a(:if false:)[[#blog-form-buttons]](:if:)%0a(:div9991 class="blogit-submit-row":)\%0a(:if9991 !equal 'ajax' '{$bi_Mode}':)\%0a(:input submit value="$[Save]" name="save" accesskey="s" id="blogit-save" tabindex=1:)\%0a(:input submit value="$[Cancel]" name="cancel" id="blogit-cancel" tabindex=1:)\%0a(:if9991end:)%0a(:div9991end:)%0a[[#blog-form-buttons]]%0a@]%0a%0a!! COMMENTS%0a!!! #comment-form-control%0a[@%0a(:if false:)[[#comment-form-control]](:if:)%0a(:input pmform target="blogit-comments":)\%0a(:input default source="{*$FullName}" request=1:)\%0a(:input default $:commentauthor "{$Author}":)\%0a(:input hidden class="blogit-required" $:blogid value="{*$:blogid}":)\%0a(:input hidden class="blogit-required" $:blogit_basepage value="{*$:blogit_basepage}":)\%0a(:if9 [ equal '{$Action}' 'bi_ce' && bi_auth comment-edit,comment-approve ] :)\%0a(:input hidden class="blogit-required" $:commentdate value="{*$:commentdate}":)\%0a(:if9:)%0a(:div9980 class='blogit-comment-form':)\%0a(:includesection "#comment-form":)%0a(:div9980end:)%0a(:if9 [ equal '{$Action}' 'bi_ce' && bi_auth comment-approve ] :)\%0a(:div9980 class='blogit-comment-status':)\%0a(:blogit list "$:commentapproved":)bi_CommentApprovalType/$[Comment Approved?] (:blogitend:)%0a(:div9980end:)%0a(:if9:)%0a(:input end:)%0a[[#comment-form-controlend]]%0a@]%0a%0a!!! #comment-post-control%0aIn this case don't use the 'if' condition to hide the anchor, because the closing if gets included as the first line in the blog-entry post.%0a%0a[@%0a[[#comment-post-control]]%0a(:template require $:blogid errmsg="$[BlogID is required.]":)%0a(:template require $:blogit_basepage errmsg="$[Basepage is required.]":)%0a(:template require $:commentauthor errmsg="$[Name is required.]":)%0a(:template require $:email errmsg="$[Email is required.]":)%0a(:template defaults savevars=$:blogit_basepage,$:blogid,$:entrytype,$:commentauthor,$:email,$:website,$:commenttext,$:commentapproved,$:commentdate:)%0a[[#comment-post-controlend]]%0a@]%0a%0a!!! #comment-edit%0a[@%0a(:if false:)[[#comment-edit]](:if:)%0a(:pmform blogit-comments:)%0a[[#comment-editend]]%0a@]%0a%0a!!! #comment-form-buttons%0a[@%0a(:if false:)[[#comment-form-buttons]](:if:)%0a(:div9991 class="blogit-submit-row":)\%0a(:if9991 !equal 'ajax' '{$bi_Mode}':)\\%0a(:if9992 [ equal '{$bi_ReCaptchaEnabled}' '1' && ( !bi_auth comment-edit,comment-approve || bi_dev ) ] :)(:recaptcha:)\\(:if9992end:)%0a(:if9992 [ equal '{$EnablePostCaptchaRequired}' '1' && ( !bi_auth comment-edit,comment-approve || bi_dev ) ] :)$[Enter value:] {$Captcha} (:input captcha tabindex=1:) (:if9992end:)\%0a(:input submit name=post value="$[Post]" id="comment-post" tabindex=1:)\%0a(:if9 [ equal '{$Action}' 'bi_ce' || equal '{$Action}' 'bi_cr' ] && bi_auth comment-edit :)\%0a(:input submit value="$[Cancel]" name="cancel" id="blogit-cancel" tabindex=1:)(:if9:)\\%0a(:if9991end:)%0a(:div9991end:)%0a[[#comment-form-buttons]]%0a@]%0a%0a
time=1459473892
From 0728387e4dc32c0fffd7a61ef90b68a0006e8a6d Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sat, 14 Sep 2024 17:46:43 +0300
Subject: [PATCH 5/8] Update for PHP 8, some simplifications.
---
cookbook/blogit/blogit.php | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index 98a49c2..f64b9b5 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -9,7 +9,7 @@
Updated for recent PHP versions by Petko Yotov pmwiki.org/petko
*/
-$RecipeInfo['BlogIt']['Version'] = '2024-09-08'; //1.9.6?
+$RecipeInfo['BlogIt']['Version'] = '2024-09-14'; //1.9.6?
if ($VersionNum < 2003036)
Abort("You are running PmWiki version {$Version}. In order to use BlogIt please update to 2.3.36 or later.
");
@@ -507,12 +507,12 @@ function bi_HandleAdmin($src, $auth = 'blogit-admin') {
HandleDispatch($src, 'browse');
}
function bi_HandleProcessForm($src, $auth = 'read') { //performs submit action for comments and blogs
- global $bi_ResetPmFormField, $_POST, $_REQUEST, $ROSPatterns, $CategoryGroup, $bi_DefaultGroup, $bi_CommentsEnabled, $Now, $bi_OriginalFn, $GroupHeaderFmt, $bi_Forms, $bi_EnablePostDirectives, $PmFormPostPatterns, $AutoCreate, $bi_DefaultCommentStatus, $bi_FixPageTitlePatterns, $bi_CommentPattern, $Author, $EnablePostAuthorRequired, $bi_Hooks, $bi_MakePageNamePatterns;
+ global $bi_ResetPmFormField, $ROSPatterns, $CategoryGroup, $bi_DefaultGroup, $bi_CommentsEnabled, $Now, $bi_OriginalFn, $GroupHeaderFmt, $bi_Forms, $bi_EnablePostDirectives, $PmFormPostPatterns, $AutoCreate, $bi_DefaultCommentStatus, $bi_FixPageTitlePatterns, $bi_CommentPattern, $Author, $EnablePostAuthorRequired, $bi_Hooks, $bi_MakePageNamePatterns;
- $bi_Mode = bi_Clean('mode', $_POST['bi_mode']);
+ $bi_Mode = bi_Clean('mode', @$_POST['bi_mode']);
bi_debugLog('HandleProcessForm: ' . $bi_Mode. '::'. @$_POST['target']);
- if ($_POST['cancel'] && in_array($_REQUEST['target'], $bi_Forms))
+ if (@$_POST['cancel'] && in_array(@$_REQUEST['target'], $bi_Forms))
bi_Redirect(); //ajax cancel is handled client-side
$bi_ResetPmFormField = array();
//Include GroupHeader on blog entry errors, as &action= is overriden by PmForms action.
@@ -541,7 +541,7 @@ function bi_HandleProcessForm($src, $auth = 'read') { //performs submit action f
else
list($gr, $pg) = explode('.', $_POST['ptv_entryurl']);
- $title = preg_replace(array_keys($bi_FixPageTitlePatterns), array_values($bi_FixPageTitlePatterns), $_POST['ptv_entrytitle']);
+ $title = PPRA($bi_FixPageTitlePatterns, $_POST['ptv_entrytitle']);
// If valid date, then convert from user entered format to Unix format; otherwise force an error to be triggered in PmForms
// NB: If page subsequently fails to post (due to incorrect p/w or captcha) then entrydate is already in unix time format.
@@ -826,7 +826,7 @@ function bi_IsDate($d, $f = '%d-%m-%Y %H:%M', $z = '') { //accepts a date, and a
// - Date Helper Functions
function bi_DateFmtRE($f = '%d-%m-%Y %H:%M') { //converts a date format into a regular expression
global $bi_DateFmtRE;
- return preg_replace(array_keys($bi_DateFmtRE), array_values($bi_DateFmtRE), $f);
+ return PPRA($bi_DateFmtRE, $f);
}
function bi_StdDateFormat($d, $f = '%d-%m-%Y %H:%M', $z = 'mdy') { //converts date format into a standard US m/d/y format usable by PHP functions
global $bi_DateSequences;
@@ -966,8 +966,11 @@ function bi_Redirect($src = '', $result = '') {
} //don't redirect ajax requests, just send back json object
$history = ($_POST['cancel'] && in_array($_REQUEST['target'], $bi_Forms) ? @$_COOKIE[$bi_Cookie . 'back-2'] : @$_COOKIE[$bi_Cookie . 'back-1']);
//use $src if provided, or history is empty; use pagename if $src and history are empty; use history if no $src and history exists.
- $r = ($src > '' || empty($history) ? FmtPageName('$PageUrl', bi_BasePage($src > '' ? $src : $bi_Pagename)) : $history);
+ if($src > '') $r = FmtPageName('$PageUrl', $src);
+ elseif(empty($history)) $r = FmtPageName('$PageUrl', $bi_Pagename);
+ else $r = $history;
bi_debugLog('Redirecting: ' . $r);
+
header("Location: $r");
header("Content-type: text/html");
echo "Redirect";
@@ -1012,9 +1015,11 @@ function bi_SaveTags($body, $user_tags, $pn, $mode = 'save') {
// Read tags from body, strip [[!...]]
if ($body)
$bodyTags = (preg_match_all('/\[\[\!(.*?)\]\]/', $body, $match) ? $match[1] : array()); //array of tags contained in [[!...]] markup.
+ else $bodyTags = array();
// Make sure tag-field entries are in standard separated format, and place in array
if ($user_tags)
$fieldTags = explode($bi_TagSeparator, preg_replace('/' . trim($bi_TagSeparator) . '\s*/', $bi_TagSeparator, trim($user_tags)));
+ else $fieldTags= array();
// Concatenate the tag-field tags, with those in the body, PPRA removes all non-pagename chars
$allTags = PPRA($bi_MakePageNamePatterns, array_unique(array_merge((array) $fieldTags, (array) $bodyTags)));
sort($allTags);
@@ -1072,6 +1077,7 @@ function bi_JXL() { //create javascript array holding all XL translations of tex
// Functions processed for different entry $types (blog, comment), at different $stages (pre-entry, pre-save, post-save)
function bi_ProcessHooks($type, $stage, $src, $auth) {
global $bi_Hooks;
+ if(!isset($bi_Hooks[$type]) || !is_array($bi_Hooks[$type])) return;
foreach ((array) $bi_Hooks[$type][$stage] as $fn)
$fn($src, $auth);
}
@@ -1142,7 +1148,7 @@ function bi_CharsetFn($val, $src = '', $tgt = 'UTF-8') {
//jQuery will always POST with UTF8, even if charset parameter is set, since it uses encodeURIComponent() ref: http://stackoverflow.com/questions/657871/another-jquery-encoding-problem-on-ie
function bi_decodeUTF8(&$a, $p = 'ptv_') {
global $Charset, $bi_CharsetFn;
- if (bi_Clean('mode', $_POST['bi_mode']) == 'ajax' && $Charset != 'UTF-8') //Conversion only required is submitted from jquery ajax request
+ if (bi_Clean('mode', @$_POST['bi_mode']) == 'ajax' && $Charset != 'UTF-8') //Conversion only required is submitted from jquery ajax request
foreach ($a as $k => $v)
if (substr($k, 0, strlen($p)) == $p)
$a[$k] = $bi_CharsetFn($v);
From 42b8dc3289f5fb66979f848f04196bf9a4d44ff5 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sat, 14 Sep 2024 18:20:37 +0300
Subject: [PATCH 6/8] Update for PmWiki 2.3.37 with $EnableCommonEnhancements.
---
cookbook/blogit/blogit.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index f64b9b5..6163cab 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -362,7 +362,7 @@ function bi_blogitMU_Handler($m) {
$SaveAttrPatterns['/\\(:includesection\\s.*?:\\)/i'] = ' '; //prevents include sections becoming part of page targets list
-if (IsEnabled($EnableGUIButtons) && $FmtPV['$bi_Mode'] != 'ajax') {
+if (IsEnabled($EnableGUIButtons, IsEnabled($EnableCommonEnhancements)) && $FmtPV['$bi_Mode'] != 'ajax') {
if ($action == 'bi_be' || $action == 'bi_ne' || ($action == 'pmform' && $_REQUEST['target'] == 'blogit-entry'))
include_once($bi_Paths['guiedit']); //PmWiki only includes this automatically if action=edit.
} else
From a8851a3acd2e87320efc77598019091893ecbbd3 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sat, 14 Sep 2024 18:41:40 +0300
Subject: [PATCH 7/8] Updates for PHP 8.
---
cookbook/blogit/blogit.php | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index 6163cab..b8b2528 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -363,8 +363,11 @@ function bi_blogitMU_Handler($m) {
$SaveAttrPatterns['/\\(:includesection\\s.*?:\\)/i'] = ' '; //prevents include sections becoming part of page targets list
if (IsEnabled($EnableGUIButtons, IsEnabled($EnableCommonEnhancements)) && $FmtPV['$bi_Mode'] != 'ajax') {
- if ($action == 'bi_be' || $action == 'bi_ne' || ($action == 'pmform' && $_REQUEST['target'] == 'blogit-entry'))
+ if ($action == 'bi_be' || $action == 'bi_ne' || ($action == 'pmform' && $_REQUEST['target'] == 'blogit-entry')) {
+ SDV($EnableGUIButtons, IsEnabled($EnableCommonEnhancements, 0));
include_once($bi_Paths['guiedit']); //PmWiki only includes this automatically if action=edit.
+ }
+
} else
Markup('e_guibuttons', 'directives', '/\(:e_guibuttons:\)/', ''); //Prevent (:e_guibuttons:) markup appearing if guiedit not enabled.
@@ -376,7 +379,7 @@ function bi_blogitMU_Handler($m) {
$Conditions['bi_isnull'] = 'bi_IsNull($condparm)==\'\'';
$Conditions['bi_lt'] = 'bi_LT($condparm)';
$Conditions['bi_baseptv'] = 'bi_BasePTV($condparm)';
-$Conditions['bi_dev'] = "(boolean)\$GLOBALS[bi_Internal]['dev']==1";
+$Conditions['bi_dev'] = "(boolean)\$GLOBALS['bi_Internal']['dev']==1";
// ----------------------------------------
// - Markup Expressions
@@ -732,22 +735,22 @@ function blogitSkinMU($m) {
//PmWiki will apply the last class in a line to all links, regardless of the class requested for each link.
//So putting a class on a link means we need to ensure links are on separate lines either with (:nl:) or using LI lists
case 'edit':
- return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_be', $txt, $args['post_text'], 'bi-link-blog-edit') : '');
+ return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_be', $txt, $args['post_text'], 'bi-link-blog-edit') : '');
case 'newentry':
- return (bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link($args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, $args['post_text'], 'bi-link-blog-new') : '');
+ return (bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link(@$args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, $args['post_text'], 'bi-link-blog-new') : '');
//blog delete function on blog-grid
case 'delete':
- return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link($args['pre_text'], $args['page'], 'bi_del', $txt, $args['post_text'], 'bi-link-blog-delete') : '');
+ return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_del', $txt, @$args['post_text'], 'bi-link-blog-delete') : '');
case 'commentedit':
- return (bi_Auth('comment-edit ' . $txt) ? bi_Link($args['pre_text'], $txt, 'bi_ce', '$[edit]', $args['post_text'], 'bi-link-comment-edit', bi_BasePage($txt, $args['base'])) : '');
+ return (bi_Auth('comment-edit ' . $txt) ? bi_Link(@$args['pre_text'], $txt, 'bi_ce', '$[edit]', @$args['post_text'], 'bi-link-comment-edit', bi_BasePage($txt, @$args['base'])) : '');
case 'commentdelete':
- return (bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_del', '$[delete]', $args['post_text'], 'bi-link-comment-delete') : '');
+ return (bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link(@$args['pre_text'], $txt, 'bi_del', '$[delete]', @$args['post_text'], 'bi-link-comment-delete') : '');
case 'commentreply':
- return (bi_Auth('comment-edit ' . bi_BasePage($txt, $args['base'])) ? bi_Link($args['pre_text'], bi_BasePage($txt, $args['base']), 'bi_cr', '$[reply]', $args['post_text'], 'bi-link-comment-reply') : '');
+ return (bi_Auth('comment-edit ' . bi_BasePage($txt, @$args['base'])) ? bi_Link(@$args['pre_text'], bi_BasePage($txt, $args['base']), 'bi_cr', '$[reply]', @$args['post_text'], 'bi-link-comment-reply') : '');
case 'commentapprove':
- return (bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_' . ($args['status'] == 'true' ? 'cua' : 'ca'), '$[' . ($args['status'] == 'true' ? 'un' : '') . 'approve]', $args['post_text'], 'bi-link-comment-' . ($args['status'] == 'true' ? '' : 'un') . 'approved') : '');
+ return (bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link(@$args['pre_text'], $txt, 'bi_' . (@$args['status'] == 'true' ? 'cua' : 'ca'), '$[' . (@$args['status'] == 'true' ? 'un' : '') . 'approve]', @$args['post_text'], 'bi-link-comment-' . ($args['status'] == 'true' ? '' : 'un') . 'approved') : '');
case 'commentblock':
- return (IsEnabled($EnableBlocklist) && bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link($args['pre_text'], $txt, 'bi_bip', '$[block]', $args['post_text'], 'bi-link-comment-block') : '');
+ return (IsEnabled($EnableBlocklist) && bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link(@$args['pre_text'], $txt, 'bi_bip', '$[block]', @$args['post_text'], 'bi-link-comment-block') : '');
case 'tags':
return ($txt > '' ? $args['pre_text'] . bi_SaveTags('', $txt, $args['page'], 'display') . $args['post_text'] : '');
//TODO: Why is this split by name/group? So #comments-count-pagelist can create group-name-* wildcard. Better to use basepage?
@@ -932,7 +935,7 @@ function bi_SendAjax($markup, $msg = '', $dom = '') {
}
function bi_AjaxRedirect($result = '') {
global $bi_Pagename, $_REQUEST, $bi_CommentPage, $EnablePost, $MessagesFmt, $action, $bi_Name, $bi_Group, $bi_Pages, $bi_SkinClasses, $bi_FrmAction, $_POST;
- bi_debugLog('AjaxRedirect: ' . $_REQUEST['bi_context'] . '::' . $_REQUEST['target'] . '::' . $action);
+ bi_debugLog('AjaxRedirect: ' . @$_REQUEST['bi_context'] . '::' . @$_REQUEST['target'] . '::' . $action);
if ($EnablePost && count($MessagesFmt) == 0) { //set to 0 if pmform failed (invalid captcha, etc)
//Translate the class of the html element being updated (bi_context) to the template to be used to generate new data on includesection from pmwiki
//bi_context: class determines which includesection template to use
@@ -941,12 +944,12 @@ function bi_AjaxRedirect($result = '') {
//$bi_SkinClasses['blog-entry-summary'] - '.blogit-post-summary': '#blog-summary-pagelist
//$bi_SkinClasses['blog-list-row'] - '.blogit-blog-list-row': '#blog-grid
// otherwise ('.blogit-post'): '#single-entry-view'
- if ($_REQUEST['target'] == 'blogit-comments') { //determine which pmform is requested
- bi_SendAjax('(:includesection "' . ($_REQUEST['bi_context'] == $bi_SkinClasses['comment-admin-list'] ? '#unapproved-comments' : '#comments-pagelist') . ' commentid=' . $bi_CommentPage . ' entrycomments=readonly base=' . IsEnabled($_POST['ptv_blogit_basepage']) . '":)', ($bi_FrmAction == 'bi_ce' ? XL('Successfully updated comment.') : XL('Successfully added new comment.') . (PageTextVar($bi_CommentPage, 'commentapproved') == 'false' ? '
' . XL('All comments are reviewed before being displayed.') : '')), MarkupToHTML($bi_Pagename, '{$Captcha} (:input captcha tabindex=1:)'));
- } elseif ($_REQUEST['target'] == 'blogit-entry') {
+ if (@$_REQUEST['target'] == 'blogit-comments') { //determine which pmform is requested
+ bi_SendAjax('(:includesection "' . (@$_REQUEST['bi_context'] == $bi_SkinClasses['comment-admin-list'] ? '#unapproved-comments' : '#comments-pagelist') . ' commentid=' . $bi_CommentPage . ' entrycomments=readonly base=' . IsEnabled($_POST['ptv_blogit_basepage']) . '":)', ($bi_FrmAction == 'bi_ce' ? XL('Successfully updated comment.') : XL('Successfully added new comment.') . (PageTextVar($bi_CommentPage, 'commentapproved') == 'false' ? '
' . XL('All comments are reviewed before being displayed.') : '')), MarkupToHTML($bi_Pagename, '{$Captcha} (:input captcha tabindex=1:)'));
+ } elseif (@$_REQUEST['target'] == 'blogit-entry') {
bi_SendAjax((isset($_REQUEST['bi_context']) //might have clicked from many places. We only care about a few.
- ? '(:includesection "' . ($_REQUEST['bi_context'] == $bi_SkinClasses['blog-entry-summary'] ? '#blog-summary-pagelist group=' . $bi_Group . ' name=' . $bi_Name //main blog summary page
- : ($_REQUEST['bi_context'] == $bi_SkinClasses['blog-list-row'] //blog list from admin page
+ ? '(:includesection "' . (@$_REQUEST['bi_context'] == $bi_SkinClasses['blog-entry-summary'] ? '#blog-summary-pagelist group=' . $bi_Group . ' name=' . $bi_Name //main blog summary page
+ : (@$_REQUEST['bi_context'] == $bi_SkinClasses['blog-list-row'] //blog list from admin page
? '#blog-grid group=' . $bi_Group . ' name=' . $bi_Name : '#single-entry-view') //single entry blog view
) . '":)' : 'No context set on comment submit.'), 'Successfully ' . ($bi_FrmAction == 'bi_ne' ? 'added' : 'updated') . ' blog entry.');
} else
From db02dc06abbb84b80a8b051324c0c971e2b863a7 Mon Sep 17 00:00:00 2001
From: Petko Yotov <5ko@5ko.fr>
Date: Sat, 14 Sep 2024 18:44:46 +0300
Subject: [PATCH 8/8] Updates for PHP 8.
---
cookbook/blogit/blogit.php | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cookbook/blogit/blogit.php b/cookbook/blogit/blogit.php
index b8b2528..de20c85 100644
--- a/cookbook/blogit/blogit.php
+++ b/cookbook/blogit/blogit.php
@@ -731,22 +731,22 @@ function blogitSkinMU($m) {
case 'intro':
return '(:div999991 class="' . $args['class'] . '":)' . blogitMU_intro('', $txt) . '%blogit-more%' . blogitMU_more($args['page'], $txt) . "%%\n(:div99991end:)";
case 'author':
- return ($txt > '' ? $args['pre_text'] . (PageExists(MakePageName($bi_Pagename, "$bi_AuthorGroup/$txt")) ? "[[$bi_AuthorGroup/$txt]]" : $txt) . $args['post_text'] : '');
+ return ($txt > '' ? @$args['pre_text'] . (PageExists(MakePageName($bi_Pagename, "$bi_AuthorGroup/$txt")) ? "[[$bi_AuthorGroup/$txt]]" : $txt) . $args['post_text'] : '');
//PmWiki will apply the last class in a line to all links, regardless of the class requested for each link.
//So putting a class on a link means we need to ensure links are on separate lines either with (:nl:) or using LI lists
case 'edit':
- return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_be', $txt, $args['post_text'], 'bi-link-blog-edit') : '');
+ return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_be', $txt, @$args['post_text'], 'bi-link-blog-edit') : '');
case 'newentry':
- return (bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link(@$args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, $args['post_text'], 'bi-link-blog-new') : '');
+ return (bi_Auth('blog-new ' . $bi_Pages['auth']) ? bi_Link(@$args['pre_text'], $bi_Pages['admin'], 'bi_ne', $txt, @$args['post_text'], 'bi-link-blog-new') : '');
//blog delete function on blog-grid
case 'delete':
- return (bi_Auth('blog-edit ' . $args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_del', $txt, @$args['post_text'], 'bi-link-blog-delete') : '');
+ return (bi_Auth('blog-edit ' . @$args['page']) ? bi_Link(@$args['pre_text'], $args['page'], 'bi_del', $txt, @$args['post_text'], 'bi-link-blog-delete') : '');
case 'commentedit':
return (bi_Auth('comment-edit ' . $txt) ? bi_Link(@$args['pre_text'], $txt, 'bi_ce', '$[edit]', @$args['post_text'], 'bi-link-comment-edit', bi_BasePage($txt, @$args['base'])) : '');
case 'commentdelete':
return (bi_Auth('comment-edit ' . bi_BasePage($txt)) ? bi_Link(@$args['pre_text'], $txt, 'bi_del', '$[delete]', @$args['post_text'], 'bi-link-comment-delete') : '');
case 'commentreply':
- return (bi_Auth('comment-edit ' . bi_BasePage($txt, @$args['base'])) ? bi_Link(@$args['pre_text'], bi_BasePage($txt, $args['base']), 'bi_cr', '$[reply]', @$args['post_text'], 'bi-link-comment-reply') : '');
+ return (bi_Auth('comment-edit ' . bi_BasePage($txt, @$args['base'])) ? bi_Link(@$args['pre_text'], bi_BasePage($txt, @$args['base']), 'bi_cr', '$[reply]', @$args['post_text'], 'bi-link-comment-reply') : '');
case 'commentapprove':
return (bi_Auth('comment-approve ' . bi_BasePage($txt)) ? bi_Link(@$args['pre_text'], $txt, 'bi_' . (@$args['status'] == 'true' ? 'cua' : 'ca'), '$[' . (@$args['status'] == 'true' ? 'un' : '') . 'approve]', @$args['post_text'], 'bi-link-comment-' . ($args['status'] == 'true' ? '' : 'un') . 'approved') : '');
case 'commentblock':