Getting FlatPress ready for PHP 8: Added a lot of missing checks for undefined variables and array keys in template and PHP files.
This commit is contained in:
parent
9332d78fd1
commit
5a0b7541e7
@ -18,7 +18,7 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{if $submenu}
|
{if isset($submenu)}
|
||||||
<ul id="admin-submenu">
|
<ul id="admin-submenu">
|
||||||
{foreach from=$submenu key=subtab item=item}
|
{foreach from=$submenu key=subtab item=item}
|
||||||
{if $item}
|
{if $item}
|
||||||
@ -34,6 +34,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div id="admin-content">
|
<div id="admin-content">
|
||||||
{include file=$admin_resource|default:"admin:$panel/$action"}
|
{if isset($action)}
|
||||||
|
{include file=$admin_resource|default:"admin:$panel/$action"}
|
||||||
|
{else}
|
||||||
|
{include file=$admin_resource|default:"admin:$panel"}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{if !isset($catdefs)}
|
||||||
|
{assign var=catdefs value=""}
|
||||||
|
{/if}
|
||||||
{html_form}
|
{html_form}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<p>{$panelstrings.descr}</p>
|
<p>{$panelstrings.descr}</p>
|
||||||
|
|
||||||
<form method="get" action="{$smarty.request.PHP_SELF}?p=entry">
|
<form method="get" action="{$smarty.server.PHP_SELF}?p=entry">
|
||||||
<p> <input type="hidden" name="p" value="entry" /> </p>
|
<p> <input type="hidden" name="p" value="entry" /> </p>
|
||||||
<fieldset><legend>{$panelstrings.filter}</legend>
|
<fieldset><legend>{$panelstrings.filter}</legend>
|
||||||
<select name="category" class="alignleft">
|
<select name="category" class="alignleft">
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{entry_block}
|
{entry_block}
|
||||||
<div id="admin-post-preview">
|
<div id="admin-post-preview">
|
||||||
{if $preview}
|
{if isset($preview)}
|
||||||
<fieldset id="post-preview"><legend>{$panelstrings.preview}</legend>
|
<fieldset id="post-preview"><legend>{$panelstrings.preview}</legend>
|
||||||
{include file=preview.tpl}
|
{include file=preview.tpl}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@ -13,9 +13,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{html_form}
|
{html_form}
|
||||||
|
{if !isset($post)}
|
||||||
{entry content=$post alwaysshow=true}
|
{assign var=post value=""}
|
||||||
|
{/if}
|
||||||
|
{entry content=$post alwaysshow=true}
|
||||||
|
|
||||||
<div id="admin-editor">
|
<div id="admin-editor">
|
||||||
<p><label for="subject">{$panelstrings.subject}</label><br />
|
<p><label for="subject">{$panelstrings.subject}</label><br />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h2>{$panelstrings.head}</h2>
|
<h2>{$panelstrings.head}</h2>
|
||||||
{include file=shared:errorlist.tpl}
|
{include file=shared:errorlist.tpl}
|
||||||
{if $files}
|
{if isset($files)}
|
||||||
<p>{$panelstrings.chmod_info}</p>
|
<p>{$panelstrings.chmod_info}</p>
|
||||||
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
||||||
<ul>
|
<ul>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
||||||
{elseif $phpinfo}
|
{elseif isset($phpinfo)}
|
||||||
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
||||||
{$phpinfo}
|
{$phpinfo}
|
||||||
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
<p><a href="admin.php?p=maintain">{$panelstrings.opt0}</a></p>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,174 +1,142 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block-Managing Functions
|
* Block-Managing Functions
|
||||||
*/
|
*/
|
||||||
|
class widget_indexer extends fs_filelister {
|
||||||
|
|
||||||
|
var $_varname = 'fp_widgets';
|
||||||
class widget_indexer extends fs_filelister {
|
|
||||||
|
var $_enabledlist = null;
|
||||||
var $_varname = 'fp_widgets';
|
|
||||||
var $_enabledlist = null;
|
function __construct() {
|
||||||
|
if (!file_exists(CONFIG_DIR . 'widgets.conf.php'))
|
||||||
function __construct() {
|
trigger_error('widgets.conf.php not found. Blog may not work as expected, create a widgetlist.conf.php
|
||||||
if (!file_exists(CONFIG_DIR. 'widgets.conf.php'))
|
|
||||||
trigger_error('widgets.conf.php not found. Blog may not work as expected, create a widgetlist.conf.php
|
|
||||||
or reinstall completely FlatPress. If you have just installed FlatPress, the package you
|
or reinstall completely FlatPress. If you have just installed FlatPress, the package you
|
||||||
downloaded may be corrupted.', E_USER_WARNING);
|
downloaded may be corrupted.', E_USER_WARNING);
|
||||||
$this->_enabledlist = CONFIG_DIR . 'widgets.conf.php';
|
$this->_enabledlist = CONFIG_DIR . 'widgets.conf.php';
|
||||||
$this->getEnableds();
|
$this->getEnableds();
|
||||||
}
|
|
||||||
|
|
||||||
function getEnableds() {
|
|
||||||
|
|
||||||
if (!file_exists($this->_enabledlist))
|
|
||||||
return;
|
|
||||||
|
|
||||||
include($this->_enabledlist);
|
|
||||||
|
|
||||||
$this->_list = ${$this->_varname};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasMore($hor) {
|
|
||||||
|
|
||||||
return is_array($this->_list[$hor]) && (current($this->_list[$hor]) !== false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function get($hor) {
|
|
||||||
|
|
||||||
global $fp_registered_widgets;
|
|
||||||
|
|
||||||
do {
|
|
||||||
$content = array();
|
|
||||||
|
|
||||||
$id = array_shift($this->_list[$hor]);
|
|
||||||
|
|
||||||
$newid=$id;# @list($newid, $params) = explode(":", $id);
|
|
||||||
if (@$params) $params = explode(',', $params); else $params = array();
|
|
||||||
// $var = 'plugin_' . $newid . '_widget';
|
|
||||||
$var = $fp_registered_widgets[ $newid ]['func'];
|
|
||||||
if (is_callable($var)) {
|
|
||||||
$content = call_user_func_array($var, $params);
|
|
||||||
if (!isset($content['id'])) {
|
|
||||||
$content['id'] = "widget-$newid";
|
|
||||||
}
|
|
||||||
} /*
|
|
||||||
else $content = array(
|
|
||||||
'subject' => "Sidebar::Error",
|
|
||||||
'content' => "<ul class=\"widget-error\"><li>No $var function found for plugin $newid.
|
|
||||||
Plugin may not have been loaded.
|
|
||||||
Verify whether it is enabled.</li></ul>",
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
} while(!$content && $id);
|
|
||||||
|
|
||||||
return array_change_key_case($content, CASE_LOWER);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getEnableds() {
|
||||||
function register_widgetset($widgetset) {
|
if (!file_exists($this->_enabledlist))
|
||||||
global $fp_registered_widgetsets;
|
return;
|
||||||
if (!$fp_registered_widgetsets) {
|
|
||||||
$fp_registered_widgetsets = array();
|
include ($this->_enabledlist);
|
||||||
}
|
|
||||||
|
$this->_list = ${$this->_varname};
|
||||||
if (!in_array($widgetset, $fp_registered_widgetsets))
|
|
||||||
$fp_registered_widgetsets[] = $widgetset;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hasMore($hor) {
|
||||||
|
return array_key_exists($hor, $this->_list) && is_array($this->_list [$hor]) && (current($this->_list [$hor]) !== false);
|
||||||
function get_registered_widgetsets($widgetset) {
|
|
||||||
global $fp_registered_widgetsets;
|
|
||||||
if (!$fp_registered_widgetsets) {
|
|
||||||
$fp_registered_widgetsets = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $fp_registered_widgetsets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get($hor) {
|
||||||
|
|
||||||
function register_widget(
|
|
||||||
$widgetid, // widget id
|
|
||||||
$widgetname, // name to show
|
|
||||||
$widget_func, // function/method to call
|
|
||||||
$num_params = 0, // number of eventually needed parameters
|
|
||||||
// -1 means optional,
|
|
||||||
// 0 means no parameters
|
|
||||||
// each N>0 means *at least* N parameters
|
|
||||||
|
|
||||||
$limit_params_to=array()// indexed array of arrays, containing
|
|
||||||
// allowed parameters (not impl.)
|
|
||||||
) {
|
|
||||||
|
|
||||||
global $fp_registered_widgets;
|
global $fp_registered_widgets;
|
||||||
if (!$fp_registered_widgets)
|
|
||||||
$fp_registered_widgets = array();
|
do {
|
||||||
|
$content = array();
|
||||||
/* we won't mind about collisions, for now */
|
|
||||||
|
$id = array_shift($this->_list [$hor]);
|
||||||
$fp_registered_widgets[$widgetid] = array(
|
|
||||||
'name' => $widgetname,
|
$newid = $id; // @list($newid, $params) = explode(":", $id);
|
||||||
'func' => $widget_func,
|
if (@$params)
|
||||||
'nparams'=> $num_params,
|
$params = explode(',', $params);
|
||||||
//'needed'=> $params_needed,
|
else
|
||||||
'params'=> $limit_params_to
|
$params = array();
|
||||||
);
|
// $var = 'plugin_' . $newid . '_widget';
|
||||||
|
$var = $fp_registered_widgets [$newid] ['func'];
|
||||||
}
|
if (is_callable($var)) {
|
||||||
|
$content = call_user_func_array($var, $params);
|
||||||
|
if (!isset($content ['id'])) {
|
||||||
|
$content ['id'] = "widget-$newid";
|
||||||
function get_registered_widgets($widget=null) {
|
}
|
||||||
global $fp_registered_widgets;
|
} /*
|
||||||
|
* else $content = array(
|
||||||
if (!$fp_registered_widgets)
|
* 'subject' => "Sidebar::Error",
|
||||||
$fp_registered_widgets = array();
|
* 'content' => "<ul class=\"widget-error\"><li>No $var function found for plugin $newid.
|
||||||
|
* Plugin may not have been loaded.
|
||||||
|
* Verify whether it is enabled.</li></ul>",
|
||||||
ksort($fp_registered_widgets);
|
* );
|
||||||
|
*/
|
||||||
if ($widget)
|
} while (!$content && $id);
|
||||||
return isset($fp_registered_widgets[$widget])?
|
|
||||||
$fp_registered_widgets[$widget]
|
return array_change_key_case($content, CASE_LOWER);
|
||||||
:
|
|
||||||
false;
|
|
||||||
|
|
||||||
return $fp_registered_widgets;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function register_widgetset($widgetset) {
|
||||||
|
global $fp_registered_widgetsets;
|
||||||
|
if (!$fp_registered_widgetsets) {
|
||||||
|
$fp_registered_widgetsets = array();
|
||||||
|
}
|
||||||
|
|
||||||
function smarty_block_widgets($params, $content, &$smarty, &$repeat) {
|
if (!in_array($widgetset, $fp_registered_widgetsets))
|
||||||
global $fp_widgets;
|
$fp_registered_widgetsets [] = $widgetset;
|
||||||
|
}
|
||||||
if($repeat = $fp_widgets->hasMore(($params['pos']))) {
|
|
||||||
|
|
||||||
$entry = $fp_widgets->get(($params['pos']));
|
|
||||||
$smarty->assign($entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $content;
|
function get_registered_widgetsets($widgetset) {
|
||||||
|
global $fp_registered_widgetsets;
|
||||||
}
|
if (!$fp_registered_widgetsets) {
|
||||||
|
$fp_registered_widgetsets = array();
|
||||||
|
}
|
||||||
$smarty->register_block('widgets','smarty_block_widgets');
|
|
||||||
|
return $fp_registered_widgetsets;
|
||||||
|
}
|
||||||
|
|
||||||
|
function register_widget($widgetid, // widget id
|
||||||
|
$widgetname, // name to show
|
||||||
|
$widget_func, // function/method to call
|
||||||
|
$num_params = 0, // number of eventually needed parameters
|
||||||
|
// -1 means optional,
|
||||||
|
// 0 means no parameters
|
||||||
|
// each N>0 means *at least* N parameters
|
||||||
|
|
||||||
|
$limit_params_to = array()) // indexed array of arrays, containing
|
||||||
|
// allowed parameters (not impl.)
|
||||||
|
{
|
||||||
|
global $fp_registered_widgets;
|
||||||
|
if (!$fp_registered_widgets)
|
||||||
|
$fp_registered_widgets = array();
|
||||||
|
|
||||||
|
/* we won't mind about collisions, for now */
|
||||||
|
|
||||||
|
$fp_registered_widgets [$widgetid] = array(
|
||||||
|
'name' => $widgetname,
|
||||||
|
'func' => $widget_func,
|
||||||
|
'nparams' => $num_params,
|
||||||
|
// 'needed'=> $params_needed,
|
||||||
|
'params' => $limit_params_to
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_registered_widgets($widget = null) {
|
||||||
|
global $fp_registered_widgets;
|
||||||
|
|
||||||
|
if (!$fp_registered_widgets)
|
||||||
|
$fp_registered_widgets = array();
|
||||||
|
|
||||||
|
ksort($fp_registered_widgets);
|
||||||
|
|
||||||
|
if ($widget)
|
||||||
|
return isset($fp_registered_widgets [$widget]) ? $fp_registered_widgets [$widget] : false;
|
||||||
|
|
||||||
|
return $fp_registered_widgets;
|
||||||
|
}
|
||||||
|
|
||||||
|
function smarty_block_widgets($params, $content, &$smarty, &$repeat) {
|
||||||
|
global $fp_widgets;
|
||||||
|
|
||||||
|
if ($repeat = $fp_widgets->hasMore(($params ['pos']))) {
|
||||||
|
|
||||||
|
$entry = $fp_widgets->get(($params ['pos']));
|
||||||
|
$smarty->assign($entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
$smarty->register_block('widgets', 'smarty_block_widgets');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,157 +1,155 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty plugin
|
* Smarty plugin
|
||||||
* -------------------------------------------------------------
|
* -------------------------------------------------------------
|
||||||
* File: function.list_categories.php
|
* File: function.list_categories.php
|
||||||
* Type: function
|
* Type: function
|
||||||
* Name: list_categories
|
* Name: list_categories
|
||||||
* Purpose: print out the comment form
|
* Purpose: print out the comment form
|
||||||
*
|
*
|
||||||
* @param string after
|
* @param
|
||||||
* @param string before
|
* string after
|
||||||
* -------------------------------------------------------------
|
* @param
|
||||||
|
* string before
|
||||||
|
* -------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
function smarty_function_list_categories($params) //, &$smarty)
|
function smarty_function_list_categories($params) // , &$smarty)
|
||||||
{
|
{
|
||||||
$cat_params = array(
|
$cat_params = array(
|
||||||
'ild'=>'<li>','ird'=>"</li>\n",
|
'ild' => '<li>',
|
||||||
'old'=>"<ul>\n",'ord'=>"</ul>\n",
|
'ird' => "</li>\n",
|
||||||
'name' => isset($params['name'])? $params['name'] : '',
|
'old' => "<ul>\n",
|
||||||
'selected' => array()
|
'ord' => "</ul>\n",
|
||||||
);
|
'name' => isset($params ['name']) ? $params ['name'] : '',
|
||||||
|
'selected' => array()
|
||||||
|
);
|
||||||
|
|
||||||
$cat_params = array_merge($cat_params, $params);
|
$cat_params = array_merge($cat_params, $params);
|
||||||
|
|
||||||
// makese 'selected' an arr
|
// makese 'selected' an arr
|
||||||
$cat_params['selected'] = (array)$params['selected'];
|
$cat_params ['selected'] = array_key_exists('selected', $params) ? (array) $params ['selected'] : array();
|
||||||
|
|
||||||
|
// echo "<pre>" . print_r(entry_categories_get()) . "</pre>";
|
||||||
|
|
||||||
//echo "<pre>" . print_r(entry_categories_get()) . "</pre>";
|
|
||||||
|
|
||||||
if (file_exists(CONTENT_DIR . 'categories.txt')) {
|
if (file_exists(CONTENT_DIR . 'categories.txt')) {
|
||||||
$cats = trim(io_load_file(CONTENT_DIR . 'categories.txt'));
|
$cats = trim(io_load_file(CONTENT_DIR . 'categories.txt'));
|
||||||
$stack=array(0);
|
$stack = array(
|
||||||
$arr=array();
|
0
|
||||||
|
);
|
||||||
|
$arr = array();
|
||||||
|
|
||||||
$line36error = explode("\n", $cats);
|
$line36error = explode("\n", $cats);
|
||||||
$line35error = '<ul>'.do_print_categories_list($line36error, $stack, $arr, $cat_params).'</ul>';
|
$line35error = '<ul>' . do_print_categories_list($line36error, $stack, $arr, $cat_params) . '</ul>';
|
||||||
|
|
||||||
return $line35error;
|
return $line35error;
|
||||||
} else {
|
} else {
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
$content = '<a href="'.BLOG_BASEURL.'">Unfiled</a>';
|
$content = '<a href="' . BLOG_BASEURL . '">Unfiled</a>';
|
||||||
if (isset($lang['admin']['entry']['publish']['nocategories']))
|
if (isset($lang ['admin'] ['entry'] ['publish'] ['nocategories']))
|
||||||
$content = $lang['admin']['entry']['publish']['nocategories'];
|
$content = $lang ['admin'] ['entry'] ['publish'] ['nocategories'];
|
||||||
return '<ul><li>' . $content .'</li></ul>' ;
|
return '<ul><li>' . $content . '</li></ul>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//<label><input name="cats[{$catId}]"
|
// <label><input name="cats[{$catId}]"
|
||||||
//{if (bool)array_intersect(array($catId),$categories) }
|
// {if (bool)array_intersect(array($catId),$categories) }
|
||||||
//checked="checked"{/if} type="checkbox" /> {$cat} </label><br />
|
// checked="checked"{/if} type="checkbox" /> {$cat} </label><br />
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
|
function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
|
||||||
|
|
||||||
global $smarty, $fpdb;
|
global $smarty, $fpdb;
|
||||||
|
|
||||||
extract($params);
|
extract($params);
|
||||||
|
|
||||||
if (empty($lines)) {
|
if (empty($lines)) {
|
||||||
$l = count($indentstack)-1;
|
$l = count($indentstack) - 1;
|
||||||
if ($l > 0)
|
if ($l > 0)
|
||||||
$arr = array_fill(0, $l, $ord.$ird);
|
$arr = array_fill(0, $l, $ord . $ird);
|
||||||
else
|
else
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
$result = array_merge($result, $arr);
|
$result = array_merge($result, $arr);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$str = '';
|
$str = '';
|
||||||
$v = reset($lines);
|
$v = reset($lines);
|
||||||
$vt = ltrim($v);
|
$vt = ltrim($v);
|
||||||
|
|
||||||
$indent = utils_countdashes($vt, $text);
|
$indent = utils_countdashes($vt, $text);
|
||||||
$indent_old = end($indentstack);
|
$indent_old = end($indentstack);
|
||||||
|
|
||||||
$val = explode(':', $text);
|
$val = explode(':', $text);
|
||||||
$vt = $val[0];
|
$vt = $val [0];
|
||||||
$vid = trim($val[1]);
|
$vid = trim($val [1]);
|
||||||
|
|
||||||
$catname = $params['name'];
|
$catname = $params ['name'];
|
||||||
|
|
||||||
if ($indent > $indent_old) {
|
if ($indent > $indent_old) {
|
||||||
array_push($indentstack, $indent);
|
array_push($indentstack, $indent);
|
||||||
|
|
||||||
array_pop($result);
|
array_pop($result);
|
||||||
array_push($result, $old);
|
array_push($result, $old);
|
||||||
//array_push($result, $ild);
|
// array_push($result, $ild);
|
||||||
do_print_categories_list($lines, $indentstack, $result, $params);
|
do_print_categories_list($lines, $indentstack, $result, $params);
|
||||||
}elseif($indent < $indent_old) {
|
} elseif ($indent < $indent_old) {
|
||||||
array_pop($indentstack);
|
array_pop($indentstack);
|
||||||
|
|
||||||
array_push($result, $ord);
|
array_push($result, $ord);
|
||||||
array_push($result, $ird);
|
array_push($result, $ird);
|
||||||
|
|
||||||
do_print_categories_list($lines, $indentstack, $result, $params);
|
do_print_categories_list($lines, $indentstack, $result, $params);
|
||||||
}else{
|
} else {
|
||||||
array_push($result, $ild);
|
array_push($result, $ild);
|
||||||
|
|
||||||
|
$cat_entry = $params ['selected'];
|
||||||
$cat_entry = $params['selected'];
|
|
||||||
|
if (isset($params ['type']) && ($params ['type'] == 'form' || $params ['type'] == 'check')) {
|
||||||
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) {
|
$string = '<label><input name="' . $catname . 'cats[' . $vid . ']" ';
|
||||||
$string = '<label><input name="'.$catname.'cats['.$vid.']" ';
|
|
||||||
|
if ((bool) array_intersect(array(
|
||||||
if ((bool) array_intersect(array($vid), $cat_entry))
|
$vid
|
||||||
|
), $cat_entry))
|
||||||
$string .= 'checked="checked" ';
|
$string .= 'checked="checked" ';
|
||||||
|
|
||||||
$string .= 'type="checkbox" />';
|
$string .= 'type="checkbox" />';
|
||||||
$before = $string;
|
$before = $string;
|
||||||
}elseif (isset($params['type']) && $params['type']=='radio') {
|
} elseif (isset($params ['type']) && $params ['type'] == 'radio') {
|
||||||
$string = '<label><input name="'.$catname.'cats" type="radio" value="'.$vid.'"';
|
$string = '<label><input name="' . $catname . 'cats" type="radio" value="' . $vid . '"';
|
||||||
if ((bool) array_intersect(array($vid), $cat_entry))
|
if ((bool) array_intersect(array(
|
||||||
|
$vid
|
||||||
|
), $cat_entry))
|
||||||
$string .= 'checked="checked" ';
|
$string .= 'checked="checked" ';
|
||||||
|
|
||||||
$string .= ' />';
|
$string .= ' />';
|
||||||
$before = $string;
|
$before = $string;
|
||||||
|
} elseif (isset($params ['type']) && $params ['type'] == 'linked') {
|
||||||
|
$before = '<a href="' . get_category_link($vid) . '">';
|
||||||
}elseif(isset($params['type']) && $params['type']=='linked'){
|
|
||||||
$before = '<a href="'.get_category_link($vid).'">';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
array_push($result, $before);
|
array_push($result, $before);
|
||||||
|
|
||||||
|
array_push($result, $vt);
|
||||||
array_push($result, $vt);
|
|
||||||
|
if (isset($params ['type']) && ($params ['type'] == 'form' || $params ['type'] == 'check' || $params ['type'] == 'radio')) {
|
||||||
if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check' || $params['type']=='radio')) {
|
|
||||||
$string = '</label>';
|
$string = '</label>';
|
||||||
$after = $string;
|
$after = $string;
|
||||||
}elseif(isset($params['type']) && $params['type']=='linked'){
|
} elseif (isset($params ['type']) && $params ['type'] == 'linked') {
|
||||||
$after='</a>';
|
$after = '</a>';
|
||||||
if (isset($params['count']) && $params['count']) {
|
if (isset($params ['count']) && $params ['count']) {
|
||||||
$index =& $fpdb->get_index($vid);
|
$index = & $fpdb->get_index($vid);
|
||||||
$count = ($index)? $index->length() : 0;
|
$count = ($index) ? $index->length() : 0;
|
||||||
$after = " ($count) ". $after;
|
$after = " ($count) " . $after;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push($result, $after);
|
array_push($result, $after);
|
||||||
|
|
||||||
array_push($result, $ird);
|
|
||||||
array_shift($lines);
|
|
||||||
do_print_categories_list($lines, $indentstack, $result, $params);
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode($result);
|
array_push($result, $ird);
|
||||||
|
array_shift($lines);
|
||||||
|
do_print_categories_list($lines, $indentstack, $result, $params);
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode($result);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div id="errorlist">
|
<div id="errorlist">
|
||||||
{if $error}
|
{if isset($error)}
|
||||||
<ul class="msgs errors">
|
<ul class="msgs errors">
|
||||||
{foreach from=$error key=field item=msg}
|
{foreach from=$error key=field item=msg}
|
||||||
<li>
|
<li>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $warnings}
|
{if isset($warnings)}
|
||||||
<ul class="msgs warnings">
|
<ul class="msgs warnings">
|
||||||
{foreach from=$warnings key=field item=msg}
|
{foreach from=$warnings key=field item=msg}
|
||||||
<li>
|
<li>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $notifications}
|
{if isset($notifications)}
|
||||||
<ul class="msgs notifications">
|
<ul class="msgs notifications">
|
||||||
{foreach from=$notifications item=msg}
|
{foreach from=$notifications item=msg}
|
||||||
<li>{$msg}</li>
|
<li>{$msg}</li>
|
||||||
|
@ -62,8 +62,8 @@ class plugin_commentcenter {
|
|||||||
function lock() {
|
function lock() {
|
||||||
global $fp_params, $post, $smarty;
|
global $fp_params, $post, $smarty;
|
||||||
$this->loadPolicies();
|
$this->loadPolicies();
|
||||||
$cats = is_array($post ['categories']) ? $post ['categories'] : array();
|
$cats = array_key_exists('categories', $post) && is_array($post ['categories']) ? $post ['categories'] : array();
|
||||||
$behavoir = $this->behavoirFromPolicies($fp_params ['entry'], $cats);
|
$behavoir = array_key_exists('entry', $fp_params) ? $this->behavoirFromPolicies($fp_params ['entry'], $cats) : 1;
|
||||||
if ($behavoir == -1 && !user_loggedin()) {
|
if ($behavoir == -1 && !user_loggedin()) {
|
||||||
$smarty->assign('entry_commslock', true);
|
$smarty->assign('entry_commslock', true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user