diff --git a/fp-plugins/accessibleantispam/plugin.accessibleantispam.php b/fp-plugins/accessibleantispam/plugin.accessibleantispam.php index 1fe73c7..86fc524 100755 --- a/fp-plugins/accessibleantispam/plugin.accessibleantispam.php +++ b/fp-plugins/accessibleantispam/plugin.accessibleantispam.php @@ -1,22 +1,20 @@ append('error', $lang['plugin']['accessibleantispam']['error']); + + $smarty->append('error', $lang ['plugin'] ['accessibleantispam'] ['error']); } - - if ( AASPAM_DEBUG && $f=@fopen(AASPAM_LOG, 'a') ) { - $arr['aaspam-q'] = $_POST['aaspam']; - $arr['aaspam-a'] = $v; - $arr['SUCCESS'] = $ret; - - $s = date('r'). "|" . session_id().'|'.utils_kimplode($arr)."\r\n"; - @fwrite($f, $s); - @fclose($f); - } - - + + if (AASPAM_DEBUG && $f = @fopen(AASPAM_LOG, 'a')) { + $arr ['aaspam-q'] = $_POST ['aaspam']; + $arr ['aaspam-a'] = $v; + $arr ['SUCCESS'] = $ret; + + $s = date('r') . "|" . session_id() . '|' . utils_kimplode($arr) . "\r\n"; + @fwrite($f, $s); + @fclose($f); + } + return $ret; } function plugin_aaspam_comment_form() { - + // we get a random arithmetic operation // between sum, subtraction and multiplication; - + // we intentionally left out division because // it can lead to situations like division by zero // or floating point numbers + $myop = array_rand($ops = array( + '+', + '-', + '*' + )); + $op = $ops [$myop]; - $myop = array_rand($ops=array('+','-','*')); - $op=$ops[$myop]; - // we get two random integers between 1 and 10 $v1 = mt_rand(1, 10); - // we rand $v2 until it differs from $v1 - // (otherwise result for subtractions is zero) - while (($v2 = mt_rand(1, 10))==$v1); - + // we rand $v2 until it differs from $v1 + // (otherwise result for subtractions is zero) + while (($v2 = mt_rand(1, 10)) == $v1) + ; + // if operation is subtraction // the higher number must always come first // or you'll get a negative integer - if ($v2>$v1 && $op=='-') { + if ($v2 > $v1 && $op == '-') { $tmp = $v1; $v1 = $v2; $v2 = $tmp; - } // execute the operation - switch($op) { - case '+' : - $v = $v1+$v2; + switch ($op) { + case '+': + $v = $v1 + $v2; break; - case '-' : - $v = $v1-$v2; + case '-': + $v = $v1 - $v2; break; - case '*' : - $v = $v1*$v2; + case '*': + $v = $v1 * $v2; break; - } - + } - sess_add('aaspam', $v); - + // load plugin strings // they're located under plugin.PLUGINNAME/lang/LANGID/ $lang = lang_load('plugin:accessibleantispam'); - - $langstrings =& $lang['plugin']['accessibleantispam']; - + + $langstrings = & $lang ['plugin'] ['accessibleantispam']; + // get the correct question depending on the operation - switch($op) { - case '+' : - $question = $langstrings['sum']; + switch ($op) { + case '+': + $question = $langstrings ['sum']; break; - case '-' : - $question = $langstrings['sub']; + case '-': + $question = $langstrings ['sub']; break; - case '*' : - $question = $langstrings['prod']; + case '*': + $question = $langstrings ['prod']; break; - } - + } + // format the question with numbers at the proper positions $question = sprintf($question, $v1, $v2); - - if ( AASPAM_DEBUG && $f=@fopen(AASPAM_LOG, 'a') ) { - $arr['aaspam-q'] = $v; - @fwrite($f, date('r'). '|'.session_id() .'|'. utils_kimplode($arr)."\r\n"); + + if (AASPAM_DEBUG && $f = @fopen(AASPAM_LOG, 'a')) { + $arr ['aaspam-q'] = $v; + @fwrite($f, date('r') . '|' . session_id() . '|' . utils_kimplode($arr) . "\r\n"); @fclose($f); } - + // echoes the question and the form part echo <<
-

-STR; - +


+

+ STR; } - ?> diff --git a/fp-plugins/adminarea/plugin.adminarea.php b/fp-plugins/adminarea/plugin.adminarea.php index 5d8d10c..f446f9e 100644 --- a/fp-plugins/adminarea/plugin.adminarea.php +++ b/fp-plugins/adminarea/plugin.adminarea.php @@ -2,11 +2,11 @@ /* * Plugin Name: AdminArea - * Plugin URI: http://www.nowhereland.it/ - * Description: AdminArea plugin. Part of the standard distribution ;) - * Author: NoWhereMan + * Plugin URI: https://www.flatpress.org + * Author: FlatPress + * Author URI: https://www.flatpress.org + * Description: AdminArea plugin. Part of the standard distribution. * Version: 1.0 - * Author URI: http://www.nowhereland.it/ */ function plugin_adminarea_widget() { diff --git a/fp-plugins/akismet/plugin.akismet.php b/fp-plugins/akismet/plugin.akismet.php index 20d4401..890bb51 100644 --- a/fp-plugins/akismet/plugin.akismet.php +++ b/fp-plugins/akismet/plugin.akismet.php @@ -1,14 +1,12 @@ setAuthor($contents['name']); - $akismet->setAuthorEmail(isset($contents['email'])? $contents['email'] : ''); - $akismet->setAuthorURL(isset($contents['url'])? $contents['url'] : ''); - $akismet->setContent($contents['content']); - - if ($v= $akismet->isSpam()){ - global $smarty; - $smarty->assign('error', array('ERROR: Comment is invalid')); + if (!$bool) return false; - } + + global $fp_config; + + $akismet = new Akismet($fp_config ['general'] ['www'], plugin_getoptions('akismet', 'apikey')); + $akismet->setAuthor($contents ['name']); + $akismet->setAuthorEmail(isset($contents ['email']) ? $contents ['email'] : ''); + $akismet->setAuthorURL(isset($contents ['url']) ? $contents ['url'] : ''); + $akismet->setContent($contents ['content']); + + if ($v = $akismet->isSpam()) { + global $smarty; + $smarty->assign('error', array( + 'ERROR: Comment is invalid' + )); + return false; + } return true; } -if (class_exists('AdminPanelAction')){ +if (class_exists('AdminPanelAction')) { + + class admin_plugin_akismet extends AdminPanelAction { - class admin_plugin_akismet extends AdminPanelAction { - var $langres = 'plugin:akismet'; - + function setup() { $this->smarty->assign('admin_resource', "plugin:akismet/admin.plugin.akismet"); } - + function main() { $akismetconf = plugin_getoptions('akismet'); $this->smarty->assign('akismetconf', $akismetconf); } - + function onsubmit() { global $fp_config; - - if ($_POST['wp-apikey']){ - - plugin_addoption('akismet', 'apikey', $_POST['wp-apikey']); + + if ($_POST ['wp-apikey']) { + + plugin_addoption('akismet', 'apikey', $_POST ['wp-apikey']); plugin_saveoptions('akismet'); - + $this->smarty->assign('success', 1); } else { - $this->smarty->assign('success', -1); + $this->smarty->assign('success', -1); } - + return 2; } - + } admin_addpanelaction('plugin', 'akismet', true); - } diff --git a/fp-plugins/archives/plugin.archives.php b/fp-plugins/archives/plugin.archives.php index d00061d..760fd37 100644 --- a/fp-plugins/archives/plugin.archives.php +++ b/fp-plugins/archives/plugin.archives.php @@ -1,86 +1,84 @@ _directory === $directory) { - // add year to the list (do not closes li, because - // we may have nested elements) - $this->_year = $file; - $lnk = get_year_link($file); - $this->_htmllist[$this->_year] = "
  • 20$file"; - return 1; - } elseif (is_dir($f)) { - $this->_months[] = $file; - return 0; - } + + var $_directory = CONTENT_DIR; + + var $_list = array(); + + var $_htmllist = array(); + + var $_months = array(); + + var $_year = ''; + + function _checkFile($directory, $file) { + $f = "$directory/$file"; + + if (ctype_digit($file)) { + if ($this->_directory === $directory) { + // add year to the list (do not closes li, because + // we may have nested elements) + $this->_year = $file; + $lnk = get_year_link($file); + $this->_htmllist [$this->_year] = "
  • 20$file"; + return 1; + } elseif (is_dir($f)) { + $this->_months [] = $file; + return 0; } } - - function _exitingDir($directory = null, $file=null) { - - $y = $this->_year; - - if ($mos =& $this->_months) { - sort($mos); - $list = ''; - $linearlist = array(); - foreach($mos as $mth) { - $lnk = get_month_link($y, $mth); - $the_month = theme_date_format( mktime(0, 0, 0, $mth, 1, 0 ), '%B'); - $list = "
  • ". - $the_month - .'
  • ' . $list; - $linearlist["$the_month 20{$this->_year}"] = $lnk; - } - $list = ''; + } + + function _exitingDir($directory = null, $file = null) { + $y = $this->_year; + + if ($mos = & $this->_months) { + sort($mos); + $list = ''; + $linearlist = array(); + foreach ($mos as $mth) { + $lnk = get_month_link($y, $mth); + $the_month = theme_date_format(mktime(0, 0, 0, $mth, 1, 0), '%B'); + $list = "
  • " . $the_month . '
  • ' . $list; + $linearlist ["$the_month 20{$this->_year}"] = $lnk; } - - $mos = array(); - - // we close year's li - $this->_list[$y] = $linearlist; - $this->_htmllist[$y] .= $list . ''; + $list = ''; } - function getList() { - krsort($this->_list); - return $this->_list; - } - - function getHtmlList() { - krsort($this->_htmllist); - return implode($this->_htmllist); - } - - + $mos = array(); + + // we close year's li + $this->_list [$y] = $linearlist; + $this->_htmllist [$y] .= $list . ''; + } + + function getList() { + krsort($this->_list); + return $this->_list; + } + + function getHtmlList() { + krsort($this->_htmllist); + return implode($this->_htmllist); + } + } - function plugin_archives_head() { - global $PLUGIN_ARCHIVES_MONTHLIST; - $PLUGIN_ARCHIVES_MONTHLIST = new plugin_archives_monthlist; + $PLUGIN_ARCHIVES_MONTHLIST = new plugin_archives_monthlist(); echo "\n\n"; - foreach($PLUGIN_ARCHIVES_MONTHLIST->getList() as $y => $months) { + foreach ($PLUGIN_ARCHIVES_MONTHLIST->getList() as $y => $months) { foreach ($months as $ttl => $link) echo "\n"; } @@ -90,19 +88,14 @@ function plugin_archives_head() { add_filter('wp_head', 'plugin_archives_head'); function plugin_archives_widget() { - lang_load('plugin:archives'); global $lang, $PLUGIN_ARCHIVES_MONTHLIST; - - + return array( - 'subject' => $lang['plugin']['archives']['subject'], - - 'content' => ($list = $PLUGIN_ARCHIVES_MONTHLIST->getHtmlList()) ? - '' - : - "

    {$lang['plugin']['archives']['no_posts']}

    " - ); + 'subject' => $lang ['plugin'] ['archives'] ['subject'], + + 'content' => ($list = $PLUGIN_ARCHIVES_MONTHLIST->getHtmlList()) ? '' : "

    {$lang['plugin']['archives']['no_posts']}

    " + ); } register_widget('archives', 'Archives', 'plugin_archives_widget'); diff --git a/fp-plugins/bbcode/plugin.bbcode.php b/fp-plugins/bbcode/plugin.bbcode.php index 2b6a2d3..8da1d52 100644 --- a/fp-plugins/bbcode/plugin.bbcode.php +++ b/fp-plugins/bbcode/plugin.bbcode.php @@ -1,11 +1,11 @@ BBCode markup; provides automatic integration with lightbox. - * Author: Hydra, NoWhereMan - * Author URI: http://flatpress.sf.net + * Version: 1.6 + * Plugin URI: https://www.flatpress.org + * Author: FlatPress + * Author URI: https://www.flatpress.org + * Description: Allows using BBCode markup; provides automatic integration with lightbox. Part of the standard distribution. */ require (plugin_getdir('bbcode') . '/inc/stringparser_bbcode.class.php'); require (plugin_getdir('bbcode') . '/panels/admin.plugin.panel.bbcode.php'); diff --git a/fp-plugins/blockparser/plugin.blockparser.php b/fp-plugins/blockparser/plugin.blockparser.php index 3947524..ccc463b 100644 --- a/fp-plugins/blockparser/plugin.blockparser.php +++ b/fp-plugins/blockparser/plugin.blockparser.php @@ -2,12 +2,12 @@ /* * Plugin Name: BlockParser - * Plugin URI: http://www.nowhereland.it/ * Type: Block - * Description: BlockParser plugin. Part of the standard distribution ;) This allow you to use simple non-plugin custom blocks :) - * Author: NoWhereMan real_nowhereman at user dot sf dot net * Version: 1.0 - * Author URI: http://www.nowhereland.it/ + * Plugin URI: https://www.flatpress.org + * Author: FlatPress + * Author URI: https://www.flatpress.org + * Description: Allows you to use simple non-plugin custom blocks. Part of the standard distribution. */ // define('BLOCKS_DIR', CONTENT_DIR . 'blocks/'); diff --git a/fp-plugins/calendar/plugin.calendar.php b/fp-plugins/calendar/plugin.calendar.php index 86a3cc0..a8cb584 100755 --- a/fp-plugins/calendar/plugin.calendar.php +++ b/fp-plugins/calendar/plugin.calendar.php @@ -3,11 +3,11 @@ /* * Plugin Name: Calendar * Version: 1.1 - * Plugin URI: http://flatpress.sf.net * Type: Block - * Description: Adds a Calendar block level element - * Author: NoWhereMan - * Author URI: http://flatpress.sf.net + * Plugin URI: https://www.flatpress.org + * Author: FlatPress + * Author URI: https://www.flatpress.org + * Description: Adds a calendar widget. Part of the standard distribution. */ // PHP Calendar (version 2.3), written by Keith Devens @@ -19,17 +19,17 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3, // remember that mktime will automatically correct if invalid dates are entered // for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998 // this provides a built in "rounding" feature to generate_calendar() - + $day_names = array(); // generate all the day names according to the current locale for($n = 0, $t = (3 + $first_day) * 86400; $n < 7; $n++, $t += 86400) // January 4, 1970 was a Sunday $day_names [$n] = ucfirst(date_strformat('%A', $t)); // %A means full textual day name - + list ($month, $year, $month_name, $weekday) = explode(',', date_strformat('%m,%Y,%B,%w', $first_of_month)); $weekday = ($weekday + 7 - $first_day) % 7; // adjust for $first_day $title = htmlentities(ucfirst($month_name)) . ' ' . $year; // note that some locales don't capitalize month and day names - + // Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 - + // PHP7 compatibility: Since $pn is never passed, we do not need to create "previous" and "next" elements. $p = ''; $n = ''; @@ -37,16 +37,16 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3, // @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable // if($p) $p = ''.($pl ? ''.$p.'' : $p).' '; // if($n) $n = ' '.($nl ? ''.$n.'' : $n).''; - + $calendar = '' . "\n" . '\n"; - + if ($day_name_length) { // if the day names should be shown ($day_name_length > 0) // if day_name_length is >3, the full name of the day will be printed foreach ($day_names as $d) $calendar .= ''; $calendar .= "\n"; } - + if ($weekday > 0) $calendar .= ''; // initial 'empty' days for($day = 1, $days_in_month = gmdate('t', $first_of_month); $day <= $days_in_month; $day++, $weekday++) { @@ -64,49 +64,49 @@ function generate_calendar($year, $month, $days = array(), $day_name_length = 3, } if ($weekday != 7) $calendar .= ''; // remaining "empty" days - + return $calendar . "\n
    ' . $p . ($month_href ? '' . $title . '' : $title) . $n . "
    ' . htmlentities($day_name_length < 4 ? substr($d, 0, $day_name_length) : $d) . '
      
    \n"; } function plugin_calendar_widget() { global $fp_params; - + $y = isset($fp_params ['y']) ? $fp_params ['y'] : date('y'); $m = isset($fp_params ['m']) ? $fp_params ['m'] : date('m'); - + global $fpdb; - + $q = new FPDB_Query(array( 'fullparse' => false, 'y' => $y, 'm' => $m, 'count' => -1 ), null); - + $days = array(); - + while ($q->hasmore($queryId)) { - + list ($id, $entry) = $q->getEntry($queryId); $date = date_from_id($id); $d = (int) $date ['d']; - + $days [$d] = array( get_day_link($y, $m, str_pad($d, 2, '0', STR_PAD_LEFT)), 'linked-day' ); - + $count++; } - + // load plugin strings // they're located under plugin.PLUGINNAME/lang/LANGID/ $lang = lang_load('plugin:calendar'); - + $widget = array(); $widget ['subject'] = $lang ['plugin'] ['calendar'] ['subject']; $widget ['content'] = ''; - + return $widget; } diff --git a/fp-plugins/categories/plugin.categories.php b/fp-plugins/categories/plugin.categories.php index 4425057..25b4446 100755 --- a/fp-plugins/categories/plugin.categories.php +++ b/fp-plugins/categories/plugin.categories.php @@ -1,34 +1,32 @@ assign('categories_showcount', false); - + // load plugin strings // they're located under plugin.PLUGINNAME/lang/LANGID/ $lang = lang_load('plugin:categories'); - - $entry['subject'] = $lang['plugin']['categories']['subject']; - $entry['content'] = $smarty->fetch('plugin:categories/widget'); + + $entry ['subject'] = $lang ['plugin'] ['categories'] ['subject']; + $entry ['content'] = $smarty->fetch('plugin:categories/widget'); return $entry; } diff --git a/fp-plugins/commentcenter/plugin.commentcenter.php b/fp-plugins/commentcenter/plugin.commentcenter.php index 33f6b68..a15ba3d 100644 --- a/fp-plugins/commentcenter/plugin.commentcenter.php +++ b/fp-plugins/commentcenter/plugin.commentcenter.php @@ -4,9 +4,9 @@ * Plugin Name: Comment Center * Version: 1.1.2 * Plugin URI: https://www.flatpress.org - * Description: Manage your blog's comments: Set policies, publish or reject comments. - * Author: FlatPress (credits to Piero VDFN) + * Author: FlatPress * Author URI: https://www.flatpress.org + * Description: Manage your blog's comments: Set policies, publish or reject comments. Part of the standard distribution. */ /** diff --git a/fp-plugins/favicon/plugin.favicon.php b/fp-plugins/favicon/plugin.favicon.php index 6e949d7..c1e4cde 100755 --- a/fp-plugins/favicon/plugin.favicon.php +++ b/fp-plugins/favicon/plugin.favicon.php @@ -1,21 +1,20 @@ '; + echo ''; } - + add_action('wp_head', 'plugin_favicon_head'); - + ?> diff --git a/fp-plugins/footnotes/plugin.footnotes.php b/fp-plugins/footnotes/plugin.footnotes.php index 47a1d27..f7dda8c 100755 --- a/fp-plugins/footnotes/plugin.footnotes.php +++ b/fp-plugins/footnotes/plugin.footnotes.php @@ -1,11 +1,11 @@ jQuery locally. -Author: Piero VDFN -Author URI: http://www.vdfn.altervista.org/ -JQuery and JQueryUI version bump by Arvid Zimmermann -*/ - -## Original author: NoWhereMan (http://www.nowhereland.it) + * Plugin Name: jQuery + * Version: 2.0.1 + * Plugin URI: https://www.flatpress.org + * Author: FlatPress + * Author URI: https://www.flatpress.org + * Description: Provides jQuery locally. Part of the standard distribution. + */ +// # Original author: NoWhereMan (http://www.nowhereland.it) add_action('wp_head', 'plugin_jquery_head', 0); - function plugin_jquery_head() { - - $pdir=plugin_geturl('jquery'); + $pdir = plugin_geturl('jquery'); echo << - - - -JSUTILS; + + + + + JSUTILS; } ?> diff --git a/fp-plugins/lastcomments/plugin.lastcomments.php b/fp-plugins/lastcomments/plugin.lastcomments.php index 1f6c72e..e15d462 100644 --- a/fp-plugins/lastcomments/plugin.lastcomments.php +++ b/fp-plugins/lastcomments/plugin.lastcomments.php @@ -1,32 +1,30 @@ '; - + // cimangi Aggiunta traduzione stringhe // load plugin strings @@ -36,48 +34,47 @@ function plugin_lastcomments_widget() { if ($count = count($list)) { while ($arr = array_pop($list)) { theme_comments_filters($arr, $id); - - - $q = new FPDB_Query(array('id' => $arr['entry']), null); + + $q = new FPDB_Query(array( + 'id' => $arr ['entry'] + ), null); // first element of the array is dropped, as it is the ID, which // we already know - @list(, $entry) = $q->getEntry($query); - - if (!$entry){ + @list (, $entry) = $q->getEntry($query); + + if (!$entry) { $count--; - $update = true; + $update = true; continue; } - $content .= - "
  • + $content .= "
  • {$arr['content']} -

    {$arr['name']} - {$entry['subject']}

    +

    {$arr['name']} - {$entry['subject']}

  • \n"; } - $subject = $lang['plugin']['lastcomments']['last'] . ' ' . $count . ' '. $lang['plugin']['lastcomments']['comments']; + $subject = $lang ['plugin'] ['lastcomments'] ['last'] . ' ' . $count . ' ' . $lang ['plugin'] ['lastcomments'] ['comments']; } - + if (!$count) { if ($update) fs_delete(LASTCOMMENTS_CACHE_FILE); - $content .= '
  • ' . $lang['plugin']['lastcomments']['no_comments'] .'
  • '; - $subject = $lang['plugin']['lastcomments']['no_new_comments']; - } - + $content .= '
  • ' . $lang ['plugin'] ['lastcomments'] ['no_comments'] . '
  • '; + $subject = $lang ['plugin'] ['lastcomments'] ['no_new_comments']; + } + $content .= ''; - $entry['subject'] = $subject; - $entry['content'] = $content; - + $entry ['subject'] = $subject; + $entry ['content'] = $content; + return $entry; } /** * function plugin_lastcomments_cache - * + * * comment cache is a reverse queue; we put * element on the top, and we delete elements * from bottom; this is because the output @@ -85,104 +82,102 @@ function plugin_lastcomments_widget() { * All this headache stuff just to say that * in the end the widget will show up elements ordered * from newer to older :P - * - * @param $entryid string entry id i.e. entryNNNNNN-NNNNNN - * @param $comment array where $comment[0] is $commentid i.e. commentNNNNNN-NNNNNN - * and $comment[1] is the actual content array + * + * @param $entryid string + * entry id i.e. entryNNNNNN-NNNNNN + * @param $comment array + * where $comment[0] is $commentid i.e. commentNNNNNN-NNNNNN + * and $comment[1] is the actual content array */ - - function plugin_lastcomments_cache($entryid, $comment) { // max num of chars per comment $CHOP_AT = 30; - - list($id, $content) = $comment; - + list ($id, $content) = $comment; + comment_clean($content); - - - if (false===($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) { + + if (false === ($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) { // no comments in cache - $list = array(); + $list = array(); } else { // if file exists and its correctly read, we get the stored list // (it is stored in encoded form) $list = unserialize($f); - - if (count($list)+1 > LASTCOMMENTS_MAX) { + + if (count($list) + 1 > LASTCOMMENTS_MAX) { // comments are more than allowed maximum: - // we delete the last in queue. + // we delete the last in queue. array_shift($list); } } - - if (strlen($content['content']) > $CHOP_AT) { - $string = substr($content['content'], 0, $CHOP_AT) . '...'; - } else {$string = $content['content'];} - - array_push($list, array('name'=>$content['name'], - 'content'=>$string, - 'id'=> $id, - 'entry'=> $entryid) - ); - + + if (strlen($content ['content']) > $CHOP_AT) { + $string = substr($content ['content'], 0, $CHOP_AT) . '...'; + } else { + $string = $content ['content']; + } + + array_push($list, array( + 'name' => $content ['name'], + 'content' => $string, + 'id' => $id, + 'entry' => $entryid + )); + return io_write_file(LASTCOMMENTS_CACHE_FILE, serialize($list)); - - } register_widget('lastcomments', 'LastComments', 'plugin_lastcomments_widget'); -function plugin_lastcomments_rss () { +function plugin_lastcomments_rss() { global $smarty; - - - if (false===($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) { + + if (false === ($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) { // no comments in cache - $list = array(); + $list = array(); } else { // if file exists and its correctly read, we get the stored list // (it is stored in encoded form) $list = unserialize($f); } - + $newlist = array(); - foreach($list as $c) { - $newlist[] = comment_parse($list['entryid'], $list['id']); + foreach ($list as $c) { + $newlist [] = comment_parse($list ['entryid'], $list ['id']); } - + $smarty->assign('lastcomments_list', $newlist); } /* - -function plugin_lastcomments_def_rss_link() { - return BLOG_BASEURL . "?feed=lastcomments-rss2"; -} - -function plugin_lastcomments_rss_link() { - return apply_filters('plugin_lastcomments_rss_link', ''); -} - -add_action('wp_head', 'plugin_lastcomments_rsshead'); -function plugin_lastcomments_rsshead() { - echo "\n\n"; -} - -add_action('init', 'plugin_lastcomments_rssinit'); -function plugin_lastcomments_rssinit() { - global $smarty; - - if (isset($_GET['feed']) && $_GET['feed']=='lastcomments-rss2') { - $smarty->display('plugin:lastcomments/plugin.lastcomments-feed'); - exit(); - } -} - -*/ + * + * function plugin_lastcomments_def_rss_link() { + * return BLOG_BASEURL . "?feed=lastcomments-rss2"; + * } + * + * function plugin_lastcomments_rss_link() { + * return apply_filters('plugin_lastcomments_rss_link', ''); + * } + * + * add_action('wp_head', 'plugin_lastcomments_rsshead'); + * function plugin_lastcomments_rsshead() { + * echo "\n\n"; + * } + * + * add_action('init', 'plugin_lastcomments_rssinit'); + * function plugin_lastcomments_rssinit() { + * global $smarty; + * + * if (isset($_GET['feed']) && $_GET['feed']=='lastcomments-rss2') { + * $smarty->display('plugin:lastcomments/plugin.lastcomments-feed'); + * exit(); + * } + * } + * + */ ?> diff --git a/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php b/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php index 647e4bfb..330a55c 100644 --- a/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php +++ b/fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php @@ -1,65 +1,68 @@ smarty->assign('admin_resource', "plugin:lastcommentsadmin/admin.plugin.lastcommentsadmin"); } - + function main() { - if (!function_exists('plugin_lastcomments_cache')){ + if (!function_exists('plugin_lastcomments_cache')) { $this->smarty->assign('success', -2); } } - + function onsubmit($data = NULL) { global $fp_config; - - if (isset($_POST['lastcommentadmin_clear'])){ + + if (isset($_POST ['lastcommentadmin_clear'])) { fs_delete(LASTCOMMENTS_CACHE_FILE); $this->smarty->assign('success', 1); } - - if (isset($_POST['lastcommentadmin_rebuild'])){ + + if (isset($_POST ['lastcommentadmin_rebuild'])) { fs_delete(LASTCOMMENTS_CACHE_FILE); $coms = Array(); - - $q = new FPDB_Query(array('fullparse'=>false,'start'=>0,'count'=>-1), null); + + $q = new FPDB_Query(array( + 'fullparse' => false, + 'start' => 0, + 'count' => -1 + ), null); while ($q->hasmore()) { - list($id,$e) = $q->getEntry(); + list ($id, $e) = $q->getEntry(); $obj = new comment_indexer($id); - foreach($obj->getList() as $value){ - $coms[$value]=$id; + foreach ($obj->getList() as $value) { + $coms [$value] = $id; } ksort($coms); - $coms = array_slice($coms, -LASTCOMMENTS_MAX ); + $coms = array_slice($coms, -LASTCOMMENTS_MAX); } - foreach($coms as $cid=>$eid){ + foreach ($coms as $cid => $eid) { $c = comment_parse($eid, $cid); - plugin_lastcomments_cache($eid, array($cid, $c)); + plugin_lastcomments_cache($eid, array( + $cid, + $c + )); } $this->smarty->assign('success', 2); } - + return 2; } - + } admin_addpanelaction('plugin', 'lastcommentsadmin', true); - } \ No newline at end of file diff --git a/fp-plugins/lastentries/plugin.lastentries.php b/fp-plugins/lastentries/plugin.lastentries.php index 6a8fae8..1afd343 100755 --- a/fp-plugins/lastentries/plugin.lastentries.php +++ b/fp-plugins/lastentries/plugin.lastentries.php @@ -1,65 +1,68 @@ query("fullparse:false,start:0,count:$num"); - $fpdb->doquery($queryId); - - $fpdb->getQuery - */ - - $q = new FPDB_Query(array('fullparse'=>false,'start'=>0,'count'=>$num), null); - + * $queryId = $fpdb->query("fullparse:false,start:0,count:$num"); + * $fpdb->doquery($queryId); + * + * $fpdb->getQuery + */ + + $q = new FPDB_Query(array( + 'fullparse' => false, + 'start' => 0, + 'count' => $num + ), null); + $string = '