From 3d975cd562488b10deca27393217549ad1b2dab9 Mon Sep 17 00:00:00 2001
From: Stephan Brunker Image Sync Right: " . serendipity_checkPermission('adminImagesSync') . " Onthefly Sync: " . $serendipity['onTheFlySynch'] . " Hash: " . $serendipity['current_image_hash'] . "!=" . $serendipity['last_image_hash']. " Image Sync Right: " . serendipity_checkPermission('adminImagesSync') . " Onthefly Sync: " . $serendipity['onTheFlySynch'] . " Hash: " . $serendipity['current_image_hash'] . "!=" . $serendipity['last_image_hash']. " Got images: " . print_r($aResultSet, true) . "
Got images:
" . print_r($aResultSet, true) . ""; + } if (is_array($aResultSet)) { foreach ($aResultSet AS $sKey => $sFile) { @@ -1585,14 +1589,18 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa $sFileName = $sFile['path'] . $sFile['name'] . (empty($sFile['extension']) ? '' : '.' . $sFile['extension']); - if ($debug) echo "
File name is $sFileName, thumbnail is $sThumbNailFile
"; + if ($debug) { + echo "File name is $sFileName, thumbnail is $sThumbNailFile
"; + } unset($aResultSet[$sKey]); if (isset($aFilesOnDisk[$sFileName])) { unset($aFilesOnDisk[$sFileName]); } else { - if ($debug) echo "Deleting Image {$sFile['id']}"; + if ($debug) { + echo "Deleting Image {$sFile['id']}"; + } serendipity_deleteImage($sFile['id']); ++$nCount; @@ -1602,21 +1610,29 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa } if ($nCount > 0){ - if ($debug) echo "Cleaned up ".$nCount." database entries
"; + if ($debug) { + echo "Cleaned up ".$nCount." database entries
"; + } } serendipity_set_config_var('last_image_hash', $serendipity['current_image_hash'], 0); $aUnmatchedOnDisk = array_keys($aFilesOnDisk); - if ($debug) echo "Got unmatched files:
" . print_r($aUnmatchedOnDisk, true) . ""; + if ($debug) { + echo "
Got unmatched files:
" . print_r($aUnmatchedOnDisk, true) . ""; + } $nCount = 0; foreach ($aUnmatchedOnDisk AS $sFile) { if (preg_match('@\.' . $serendipity['thumbSuffix'] . '\.@', $sFile)) { - if ($debug) echo "
Skipping thumbnailed file $sFile
"; + if ($debug) { + echo "Skipping thumbnailed file $sFile
"; + } continue; } else { - if ($debug) echo "Checking $sFile
"; + if ($debug) { + echo "Checking $sFile
"; + } } // MTG: 21/01/06: put files which have just 'turned up' into the database @@ -1631,7 +1647,9 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa $sFileName = substr($sFile, $nPos); $sDirectory = substr($sFile, 0, $nPos); } - if ($debug) echo "Inserting image $sFileName from $sDirectory
" . print_r($aImageData, true) . "into database"; + if ($debug) { + echo "
Inserting image $sFileName from $sDirectory
" . print_r($aImageData, true) . "into database"; + } # TODO: Check if the thumbnail generation goes fine with Marty's code serendipity_makeThumbnail($sFileName, $sDirectory); serendipity_insertImageInDatabase($sFileName, $sDirectory); @@ -1640,10 +1658,14 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa } if ($nCount > 0) { - if ($debug) echo "
Inserted ".$nCount." images into the database
"; + if ($debug) { + echo "Inserted ".$nCount." images into the database
"; + } } } else { - if ($debug) echo "Media Gallery database is up to date
"; + if ($debug) { + echo "Media Gallery database is up to date
"; + } } /* @@ -2924,7 +2946,9 @@ function serendipity_insertMediaProperty($property_group, $property_subgroup, $i if (is_array($media)) { foreach($media AS $key => $val) { - if ($key == 'image_id') continue; + if ($key == 'image_id') { + continue; + } if (is_array($val)) { $use_property_subgroup = $key; diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index aad3c4f0..facf0a11 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -672,7 +672,9 @@ class serendipity_event_spamblock extends serendipity_event $ret = false; require_once S9Y_PEAR_PATH . 'HTTP/Request2.php'; - if (function_exists('serendipity_request_start')) serendipity_request_start(); + if (function_exists('serendipity_request_start')) { + serendipity_request_start(); + } // this switch statement is a leftover from blogg.de support (i.e. there were more options than just one). Leaving it in place in case we get more options again in the future. switch($where) { @@ -700,7 +702,9 @@ class serendipity_event_spamblock extends serendipity_event break; } - if (function_exists('serendipity_request_end')) serendipity_request_end(); + if (function_exists('serendipity_request_end')) { + serendipity_request_end(); + } return $ret; } @@ -1478,7 +1482,9 @@ class serendipity_event_spamblock extends serendipity_event // Check for word filtering if ($filter_type = $this->get_config('contentfilter_activate', 'moderate')) { - if($ftc) $filter_type = 'reject'; + if($ftc) { + $filter_type = 'reject'; + } // Filter authors names $filter_authors = explode(';', $this->get_config('contentfilter_authors', $this->filter_defaults['authors']));