Dotclear

Changeset 2204


Ignore:
Timestamp:
04/22/10 21:51:17 (14 years ago)
Author:
JcDenis
Message:

zoneclearFeedServer 0.7:

  • Added icon on dashboard if some feeds are disabled
  • Added public page of feed description (first step)
  • Added update of existing entries
  • Added settings to add "aftercontent" and ajax options
  • Added uninstall features
  • Fixed duplicate entry (I hope so) using php flock
  • Fixed feeds actions on admin
  • Fixed typo (closes #441)
  • Fixed user settings (closes #442)
Location:
plugins/zoneclearFeedServer
Files:
5 added
15 edited

Legend:

Unmodified
Added
Removed
  • plugins/zoneclearFeedServer/_admin.php

    r2178 r2204  
    1818# Admin menu 
    1919$_menu['Plugins']->addItem( 
    20      __('Zoneclear feed server'), 
     20     __('Feeds server'), 
    2121     'plugin.php?p=zoneclearFeedServer','index.php?pf=zoneclearFeedServer/icon.png', 
    2222     preg_match('/plugin.php\?p=zoneclearFeedServer(&.*)?$/',$_SERVER['REQUEST_URI']), 
     
    2424); 
    2525 
    26 # Add info about feed on post page sidebar 
    27 $core->addBehavior('adminPostFormSidebar',array('zoneclearFeedServerAdminBehaviors','adminPostFormSidebar')); 
     26if ($core->auth->check('admin',$core->blog->id)) 
     27{ 
     28     # Dashboard icon 
     29     $core->addBehavior('adminDashboardIcons',array('zoneclearFeedServerAdminBehaviors','adminDashboardIcons')); 
     30     # Add info about feed on post page sidebar 
     31     $core->addBehavior('adminPostFormSidebar',array('zoneclearFeedServerAdminBehaviors','adminPostFormSidebar')); 
     32} 
    2833# Delete related info about feed post in meta table 
    2934$core->addBehavior('adminBeforePostDelete',array('zoneclearFeedServerAdminBehaviors','adminBeforePostDelete')); 
     
    3136class zoneclearFeedServerAdminBehaviors 
    3237{ 
     38     # Add icon on dashboard if there are disabled feeds 
     39     public static function adminDashboardIcons($core,$icons) 
     40     { 
     41          $zcfs = new zoneclearFeedServer($core); 
     42          $count = $zcfs->getFeeds(array('feed_status'=>'0'),true)->f(0); 
     43          if (!$count) return; 
     44 
     45          $str = ($count > 1) ? __('%s disabled feeds') : __('one disable feed'); 
     46 
     47          $icons['zcfs'] = new ArrayObject(array( 
     48               sprintf($str,$count), 
     49               'plugin.php?p=zoneclearFeedServer&part=feeds&sortby=feed_status&order=asc', 
     50               'index.php?pf=zoneclearFeedServer/icon-b.png' 
     51          )); 
     52     } 
     53 
    3354     # Add info about feed on post page sidebar 
    3455     public static function adminPostFormSidebar(&$post) 
  • plugins/zoneclearFeedServer/_define.php

    r2178 r2204  
    1414 
    1515$this->registerModule( 
    16      /* Name */               "Zoneclear feed server", 
     16     /* Name */               "Feeds server", 
    1717     /* Description*/         "Mix your blog with a feeds planet", 
    1818     /* Author */             "JC Denis, BG", 
    19      /* Version */            '0.6', 
     19     /* Version */            '0.7', 
    2020     /* Permissions */        'admin' 
    2121); 
    22      /* date */          #20100411 
     22     /* date */          #20100422 
    2323?> 
  • plugins/zoneclearFeedServer/_install.php

    r2178 r2204  
    108108     $s = zoneclearFeedServer::settings($core); 
    109109     $s->put('zoneclearFeedServer_active',false,'boolean','Enable zoneclearBlogServer',false,true); 
    110      $s->put('zoneclearFeedServer_timer',0,'integer','Timer between 2 updates',false,true); 
     110     $s->put('zoneclearFeedServer_pub_active',false,'boolean','Enable public page of list of feeds',false,true); 
    111111     $s->put('zoneclearFeedServer_post_status_new',true,'boolean','Enable auto publish new posts',false,true); 
    112      $s->put('zoneclearFeedServer_dis_pub_upd',false,'boolean','Disable auto update on public side',false,true); 
    113      $s->put('zoneclearFeedServer_update_limit',5,'integer','Number of feeds to update at one time',false,true); 
     112     $s->put('zoneclearFeedServer_bhv_pub_upd',2,'string','Auto update on public side (disable/before/after)',false,true); 
     113     $s->put('zoneclearFeedServer_update_limit',1,'integer','Number of feeds to update at one time',false,true); 
    114114     $s->put('zoneclearFeedServer_user','','string','User id that has right on post',false,true); 
    115115     $s->put('zoneclearFeedServer_post_full_tpl',serialize(array('post','category','tag','archive')),'string','List of templates types for full feed',false,true); 
  • plugins/zoneclearFeedServer/_prepend.php

    r2032 r2204  
    1919 
    2020# public url for page of description of the flux 
    21 //$core->url->register('zoneclearFeedOverview','feedsoverview','^feedsoverview(/|)$',array('zoneclearFeedServerURL','feedsOverview')); 
     21$core->url->register('zoneclearFeedsPage','zcfeeds','^zcfeeds(.*?)$',array('zoneclearFeedServerURL','zcFeedsPage')); 
    2222 
    2323# Add to report on plugin activityReport 
  • plugins/zoneclearFeedServer/_public.php

    r2178 r2204  
    1616require_once dirname(__FILE__).'/_widgets.php'; 
    1717 
     18$core->addBehavior('coreBlogGetPosts',array('zoneclearFeedServerPublicBehaviors','coreBlogGetPosts')); 
     19 
    1820$s = zoneclearFeedServer::settings($core); 
    1921if (!$s->zoneclearFeedServer_active){return;} 
    2022 
    21 $core->addBehavior('publicBeforeDocument',array('zoneclearFeedServerPublicBehaviors','publicBeforeDocument')); 
    22 $core->addBehavior('coreBlogGetPosts',array('zoneclearFeedServerPublicBehaviors','coreBlogGetPosts')); 
     23if (1 == $s->zoneclearFeedServer_bhv_pub_upd) { 
     24     $core->addBehavior('publicBeforeDocument',array('zoneclearFeedServerPublicBehaviors','publicDocument')); 
     25} 
     26elseif (2 == $s->zoneclearFeedServer_bhv_pub_upd) { 
     27     $core->addBehavior('publicAfterDocument',array('zoneclearFeedServerPublicBehaviors','publicAfterDocument')); 
     28} 
     29elseif (3 == $s->zoneclearFeedServer_bhv_pub_upd) { 
     30     $core->addBehavior('publicHeadContent',array('zoneclearFeedServerPublicBehaviors','publicHeadContent')); 
     31} 
     32 
     33$core->tpl->addBlock('zcFeeds',array('zoneclearFeedServerTpl','Feeds')); 
     34$core->tpl->addValue('zcFeedsCount',array('zoneclearFeedServerTpl','FeedsCount')); 
     35$core->tpl->addValue('zcFeedsEntriesCount',array('zoneclearFeedServerTpl','FeedsEntriesCount')); 
     36$core->tpl->addBlock('zcFeedsFooter',array('zoneclearFeedServerTpl','FeedsFooter')); 
     37$core->tpl->addBlock('zcFeedsHeader',array('zoneclearFeedServerTpl','FeedsHeader')); 
     38$core->tpl->addValue('zcFeedEntriesCount',array('zoneclearFeedServerTpl','FeedEntriesCount')); 
     39$core->tpl->addValue('zcFeedCategory',array('zoneclearFeedServerTpl','FeedCategory')); 
     40$core->tpl->addValue('zcFeedCategoryID',array('zoneclearFeedServerTpl','FeedCategoryID')); 
     41$core->tpl->addValue('zcFeedCategoryURL',array('zoneclearFeedServerTpl','FeedCategoryURL')); 
     42$core->tpl->addValue('zcFeedCategoryShortURL',array('zoneclearFeedServerTpl','FeedCategoryShortURL')); 
     43$core->tpl->addValue('zcFeedID',array('zoneclearFeedServerTpl','FeedID')); 
     44$core->tpl->addBlock('zcFeedIf',array('zoneclearFeedServerTpl','FeedIf')); 
     45$core->tpl->addValue('zcFeedIfFirst',array('zoneclearFeedServerTpl','FeedIfFirst')); 
     46$core->tpl->addValue('zcFeedIfOdd',array('zoneclearFeedServerTpl','FeedIfOdd')); 
     47$core->tpl->addValue('zcFeedLang',array('zoneclearFeedServerTpl','FeedLang')); 
     48$core->tpl->addValue('zcFeedName',array('zoneclearFeedServerTpl','FeedName')); 
     49$core->tpl->addValue('zcFeedOwner',array('zoneclearFeedServerTpl','FeedOwner')); 
     50$core->tpl->addValue('zcFeedDesc',array('zoneclearFeedServerTpl','FeedDesc')); 
     51$core->tpl->addValue('zcFeedSiteURL',array('zoneclearFeedServerTpl','FeedSiteURL')); 
     52$core->tpl->addValue('zcFeedFeedURL',array('zoneclearFeedServerTpl','FeedFeedURL')); 
    2353 
    2454class zoneclearFeedServerPublicBehaviors 
    2555{ 
     56     # Remember others post extension 
    2657     public static function coreBlogGetPosts(&$rs) 
    2758     { 
     
    3061     } 
    3162 
    32      public static function publicBeforeDocument(&$core) 
    33      { 
    34           $s = zoneclearFeedServer::settings($core); 
    35           if ($s->zoneclearFeedServer_dis_pub_upd){return;} 
    36  
     63     # Update feeds after contents 
     64     public static function publicAfterDocument($core) 
     65     { 
     66          # Limit feeds update to home page et feed page 
     67          # Like publishScheduledEntries 
     68          if (!in_array($core->url->type,array('default','feed'))) return; 
     69 
     70          self::publicDocument($core); 
     71     } 
     72 
     73     # Generic behavior for before and after public content 
     74     public static function publicDocument($core) 
     75     { 
    3776          $zc = new zoneclearFeedServer($core); 
    3877          $zc->checkFeedsUpdate(); 
    3978          return; 
     79     } 
     80 
     81     # Update feeds by an Ajax request (background) 
     82     public static function publicHeadContent($core,$_ctx) 
     83     { 
     84          # Limit update to home page 
     85          if ($core->url->type != 'default') return; 
     86 
     87          $blog_url = html::escapeJS($core->blog->url.$core->url->getBase('zoneclearFeedsPage').'/zcfsupd'); 
     88          $blog_id = html::escapeJS($core->blog->id); 
     89 
     90          echo 
     91          "\n<!-- JS for zoneclearFeedServer --> \n". 
     92          "<script type=\"text/javascript\" src=\"". 
     93               $core->blog->url.$core->url->getBase('zoneclearFeedsPage').'/zcfsupd.js">'. 
     94          "</script> \n". 
     95          "<script type=\"text/javascript\"> \n". 
     96          "//<![CDATA[\n". 
     97          " \$(function(){if(!document.getElementById){return;} ". 
     98          " $('body').zoneclearFeedServer({blog_url:'".$blog_url."',blog_id:'".$blog_id."'}); ". 
     99          " })\n". 
     100          "//]]>\n". 
     101          "</script>\n"; 
    40102     } 
    41103} 
     
    128190     } 
    129191} 
     192 
     193class zoneclearFeedServerURL extends dcUrlHandlers 
     194{ 
     195     public static function zcFeedsPage($args) 
     196     { 
     197          global $core, $_ctx; 
     198          $s = zoneclearFeedServer::settings($core); 
     199 
     200          # Not active 
     201          if (!$s->zoneclearFeedServer_active) { 
     202               self::p404(); 
     203               return; 
     204          } 
     205 
     206          # Update feeds (from ajax or other post resquest) 
     207          if ($args == '/zcfsupd' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) 
     208          { 
     209               $msg = ''; 
     210               if (!empty($_POST['blogId']) && html::escapeJS($core->blog->id) == $_POST['blogId']) 
     211               { 
     212                    try { 
     213                         $zc = new zoneclearFeedServer($core); 
     214                         if ($zc->checkFeedsUpdate()) { 
     215                              $msg = '<status>ok</status><message>Feeds updated successfully</message>'; 
     216                         } 
     217                    } 
     218                    catch (Exception $e) {} 
     219               } 
     220               if (empty($msg)) { 
     221                    $msg = '<status>failed</status><message>Failed to update feeds</message>'; 
     222               } 
     223 
     224               header('Content-Type: application/xml; charset=UTF-8'); 
     225               echo   
     226               '<?xml version="1.0" encoding="utf-8"?>'."\n". 
     227               '<response><rsp>'."\n". 
     228               $msg."\n". 
     229               '</rsp></response>'; 
     230               exit(1); 
     231          } 
     232          # Server js 
     233          elseif ($args == '/zcfsupd.js' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) 
     234          { 
     235               $core->tpl->setPath($core->tpl->getPath(),dirname(__FILE__).'/default-templates'); 
     236               self::serveDocument('zcfsupd.js','text/javascript',false,false); 
     237               return; 
     238          } 
     239          # Server feeds description page 
     240          elseif (in_array($args,array('','/')) && $s->zoneclearFeedServer_pub_active) 
     241          { 
     242               $core->tpl->setPath($core->tpl->getPath(),dirname(__FILE__).'/default-templates'); 
     243               self::serveDocument('zcfeeds.html'); 
     244               return; 
     245          } 
     246          # Unknow 
     247          else 
     248          { 
     249               self::p404(); 
     250               return; 
     251          } 
     252          return; 
     253     } 
     254} 
     255 
     256class zoneclearFeedServerTpl 
     257{ 
     258     public static function Feeds($a,$c) 
     259     { 
     260          $lastn = -1; 
     261          if (isset($a['lastn'])) { 
     262               $lastn = abs((integer) $a['lastn'])+0; 
     263 
     264               $p .= "\$zcfs_params['limit'] = ".$lastn.";\n"; 
     265          } 
     266 
     267          if (isset($a['cat_id'])) { 
     268               $p .= "@\$zcfs_params['sql'] .= 'AND Z.cat_id = ".addslashes($a['cat_id'])." ';\n"; 
     269          } 
     270 
     271          if (isset($a['no_category'])) { 
     272               $p .= "@\$zcfs_params['sql'] .= 'AND Z.cat_id IS NULL ';\n"; 
     273          } 
     274 
     275          if (!empty($a['site_url'])) { 
     276               $p .= "\$zcfs_params['feed_url'] = '".addslashes($a['site_url'])."';\n"; 
     277          } 
     278 
     279          if (isset($a['feed_status'])) { 
     280               $p .= "\$zcfs_params['feed_status'] = ".((integer) $a['feed_status']).";\n"; 
     281          } 
     282          else { 
     283               $p .= "\$zcfs_params['feed_status'] = 1;\n"; 
     284          } 
     285 
     286          if (!empty($a['feed_url'])) { 
     287               $p .= "\$zcfs_params['feed_feed'] = '".addslashes($a['feed_url'])."';\n"; 
     288          } 
     289 
     290          if (isset($a['feed_owner'])) { 
     291               $p .= "@\$zcfs_params['sql'] .= \"AND Z.feed_owner = '".addslashes($a['author'])."' \";\n"; 
     292          } 
     293 
     294          $sortby = 'feed_creadt'; 
     295          $order = 'desc'; 
     296          if (isset($a['sortby'])) { 
     297               switch ($a['sortby']) { 
     298                    case 'name': $sortby = 'lowername'; break; 
     299                    case 'owner' : $sortby = 'feed_owner'; break; 
     300                    case 'date' : $sortby = 'feed_dt'; break; 
     301                    case 'update' : $sortby = 'feed_upddt'; break; 
     302                    case 'id' : $sortby = 'feed_id'; break; 
     303               } 
     304          } 
     305          if (isset($a['order']) && preg_match('/^(desc|asc)$/i',$a['order'])) { 
     306               $order = $a['order']; 
     307          } 
     308          $p .= "\$zcfs_params['order'] = '".$sortby." ".$order."';\n"; 
     309 
     310          return   
     311          '<?php '.$p. 
     312          '$_ctx->feeds_params = $zcfs_params;'."\n". 
     313          '$zcfs = new zoneclearFeedServer($core);'."\n". 
     314          '$_ctx->feeds = $zcfs->getFeeds($zcfs_params); unset($zcfs_params,$zcfs);'."\n". 
     315          "?>\n". 
     316 
     317          '<?php while ($_ctx->feeds->fetch()) : ?>'.$c.'<?php endwhile; '. 
     318          '$_ctx->feeds = null; $_ctx->feeds_params = null; ?>'; 
     319     } 
     320 
     321     public static function FeedIf($a,$c) 
     322     { 
     323          $if = array(); 
     324           
     325          $operator = isset($a['operator']) ? self::getOperator($a['operator']) : '&&'; 
     326 
     327          if (isset($a['type'])) { 
     328               $type = trim($a['type']); 
     329               $type = !empty($type) ? $type : 'feed'; 
     330               $if[] = '$_ctx->feeds->feed_type == "'.addslashes($type).'"'; 
     331          } 
     332           
     333          if (isset($a['site_url'])) { 
     334               $url = trim($a['feed_url']); 
     335               if (substr($url,0,1) == '!') { 
     336                    $url = substr($url,1); 
     337                    $if[] = '$_ctx->feeds->feed_url != "'.addslashes($url).'"'; 
     338               } else { 
     339                    $if[] = '$_ctx->feeds->feed_url == "'.addslashes($url).'"'; 
     340               } 
     341          } 
     342           
     343          if (isset($a['feed_url'])) { 
     344               $url = trim($a['feed_feed']); 
     345               if (substr($url,0,1) == '!') { 
     346                    $url = substr($url,1); 
     347                    $if[] = '$_ctx->feeds->feed_feed != "'.addslashes($url).'"'; 
     348               } else { 
     349                    $if[] = '$_ctx->feeds->feed_feed == "'.addslashes($url).'"'; 
     350               } 
     351          } 
     352           
     353          if (isset($a['category'])) { 
     354               $category = addslashes(trim($a['category'])); 
     355               if (substr($category,0,1) == '!') { 
     356                    $category = substr($category,1); 
     357                    $if[] = '($_ctx->feeds->cat_url != "'.$category.'")'; 
     358               } else { 
     359                    $if[] = '($_ctx->feeds->cat_url == "'.$category.'")'; 
     360               } 
     361          } 
     362           
     363          if (isset($a['first'])) { 
     364               $sign = (boolean) $a['first'] ? '=' : '!'; 
     365               $if[] = '$_ctx->feeds->index() '.$sign.'= 0'; 
     366          } 
     367           
     368          if (isset($a['odd'])) { 
     369               $sign = (boolean) $a['odd'] ? '=' : '!'; 
     370               $if[] = '($_ctx->feeds->index()+1)%2 '.$sign.'= 1'; 
     371          } 
     372           
     373          if (isset($a['has_category'])) { 
     374               $sign = (boolean) $a['has_category'] ? '' : '!'; 
     375               $if[] = $sign.'$_ctx->feeds->cat_id'; 
     376          } 
     377           
     378          if (isset($a['has_description'])) { 
     379               $sign = (boolean) $a['has_description'] ? '' : '!'; 
     380               $if[] = $sign.'$_ctx->feeds->feed_desc'; 
     381          } 
     382 
     383          if (!empty($if)) { 
     384               return '<?php if('.implode(' '.$operator.' ',$if).') : ?>'.$c.'<?php endif; ?>'; 
     385          } else { 
     386               return $c; 
     387          } 
     388     } 
     389 
     390     public static function FeedIfFirst($a) 
     391     { 
     392          $ret = isset($a['return']) ? $a['return'] : 'first'; 
     393          $ret = html::escapeHTML($ret); 
     394           
     395          return 
     396          '<?php if ($_ctx->feeds->index() == 0) { '. 
     397          "echo '".addslashes($ret)."'; } ?>"; 
     398     } 
     399 
     400     public static function FeedIfOdd($a) 
     401     { 
     402          $ret = isset($a['return']) ? $a['return'] : 'odd'; 
     403          $ret = html::escapeHTML($ret); 
     404           
     405          return 
     406          '<?php if (($_ctx->feeds->index()+1)%2 == 1) { '. 
     407          "echo '".addslashes($ret)."'; } ?>"; 
     408     } 
     409 
     410     public static function FeedDesc($a) 
     411     { 
     412          return self::getValue($a,'$_ctx->feeds->feed_desc'); 
     413     } 
     414 
     415     public static function FeedOwner($a) 
     416     { 
     417          return self::getValue($a,'$_ctx->feeds->feed_owner'); 
     418     } 
     419 
     420     public static function FeedCategory($a) 
     421     { 
     422          return self::getValue($a,'$_ctx->feeds->cat_title'); 
     423     } 
     424 
     425     public static function FeedCategoryID($a) 
     426     { 
     427          return self::getValue($a,'$_ctx->feeds->cat_id'); 
     428     } 
     429 
     430     public static function FeedCategoryURL($a) 
     431     { 
     432          return self::getValue($a,'$core->blog->url.$core->url->getBase(\'category\').\'/\'.html::sanitizeURL($_ctx->feeds->cat_url)'); 
     433     } 
     434 
     435     public static function FeedCategoryShortURL($a) 
     436     { 
     437          return self::getValue($a,'$_ctx->feeds->cat_url'); 
     438     } 
     439 
     440     public static function FeedID($a) 
     441     { 
     442          return self::getValue($a,'$_ctx->feeds->feed_id'); 
     443     } 
     444      
     445     public static function FeedLang($a) 
     446     { 
     447          $f = $GLOBALS['core']->tpl->getFilters($a); 
     448          if (!empty($a['full'])) { 
     449               return '<?php $langs = l10n::getISOcodes(); if (isset($langs[$_ctx->feeds->feed_lang])) { echo '.sprintf($f,'$langs[$_ctx->feeds->feed_lang]').'; } else { echo '.sprintf($f,'$_ctx->feeds->feed_lang').'; } unset($langs); ?>'; 
     450          } 
     451          else { 
     452               return '<?php echo '.sprintf($f,'$_ctx->feeds->feed_lang').'; ?>'; 
     453          } 
     454     } 
     455 
     456     public static function FeedName($a) 
     457     { 
     458          return self::getValue($a,'$_ctx->feeds->feed_name'); 
     459     } 
     460      
     461     public static function FeedSiteURL($a) 
     462     { 
     463          return self::getValue($a,'$_ctx->feeds->feed_url'); 
     464     } 
     465      
     466     public static function FeedFeedURL($a) 
     467     { 
     468          return self::getValue($a,'$_ctx->feeds->feed_feed'); 
     469     } 
     470 
     471     public static function FeedsHeader($a,$c) 
     472     { 
     473          return "<?php if (\$_ctx->feeds->isStart()) : ?>".$c."<?php endif; ?>"; 
     474     } 
     475 
     476     public static function FeedsFooter($a,$c) 
     477     { 
     478          return "<?php if (\$_ctx->feeds->isEnd()) : ?>".$c."<?php endif; ?>"; 
     479     } 
     480 
     481     public static function FeedsCount($a) 
     482     { 
     483          $none = 'no feed'; 
     484          $one = 'one feed'; 
     485          $more = '%d feeds'; 
     486 
     487          if (isset($a['none'])) { 
     488               $none = addslashes($a['none']); 
     489          } 
     490          if (isset($a['one'])) { 
     491               $one = addslashes($a['one']); 
     492          } 
     493          if (isset($a['more'])) { 
     494               $more = addslashes($a['more']); 
     495          } 
     496 
     497          return 
     498          "<?php \$fcount = \$_ctx->feeds->count(); \n". 
     499          "if (\$fcount == 0) {\n". 
     500          "  printf(__('".$none."'),\$fcount);\n". 
     501          "} elseif (\$fcount == 1) {\n". 
     502          "  printf(__('".$one."'),\$fcount);\n". 
     503          "} else {\n". 
     504          "  printf(__('".$more."'),\$fcount);\n". 
     505          "} unset(\$fcount); ?>"; 
     506     } 
     507 
     508     public static function FeedsEntriesCount($a) 
     509     { 
     510          $none = 'no feed'; 
     511          $one = 'one feed'; 
     512          $more = '%d feeds'; 
     513 
     514          if (isset($a['none'])) { 
     515               $none = addslashes($a['none']); 
     516          } 
     517          if (isset($a['one'])) { 
     518               $one = addslashes($a['one']); 
     519          } 
     520          if (isset($a['more'])) { 
     521               $more = addslashes($a['more']); 
     522          } 
     523 
     524          return 
     525          "<?php \$fcount = 0; \$allfeeds = \$_ctx->feeds->zc->getFeeds(); \n". 
     526          "if (!\$allfeeds->isEmpty()) { \n". 
     527          " while (\$allfeeds->fetch()) { ". 
     528          "  \$fcount += (integer) \$_ctx->feeds->zc->getPostsByFeed(array('feed_id'=>\$allfeeds->feed_id),true)->f(0); ". 
     529          " } \n". 
     530          "} \n". 
     531          "if (\$fcount == 0) {\n". 
     532          "  printf(__('".$none."'),\$fcount);\n". 
     533          "} elseif (\$fcount == 1) {\n". 
     534          "  printf(__('".$one."'),\$fcount);\n". 
     535          "} else {\n". 
     536          "  printf(__('".$more."'),\$fcount);\n". 
     537          "} unset(\$allfeeds,\$fcount); ?>"; 
     538     } 
     539 
     540     public static function FeedEntriesCount($a) 
     541     { 
     542          $none = 'no entry'; 
     543          $one = 'one entry'; 
     544          $more = '%d entries'; 
     545 
     546          if (isset($a['none'])) { 
     547               $none = addslashes($a['none']); 
     548          } 
     549          if (isset($a['one'])) { 
     550               $one = addslashes($a['one']); 
     551          } 
     552          if (isset($a['more'])) { 
     553               $more = addslashes($a['more']); 
     554          } 
     555 
     556          return 
     557          "<?php \$fcount = \$_ctx->feeds->zc->getPostsByFeed(array('feed_id'=>\$_ctx->feeds->feed_id),true)->f(0); \n". 
     558          "if (\$fcount == 0) {\n". 
     559          "  printf(__('".$none."'),\$fcount);\n". 
     560          "} elseif (\$fcount == 1) {\n". 
     561          "  printf(__('".$one."'),\$fcount);\n". 
     562          "} else {\n". 
     563          "  printf(__('".$more."'),\$fcount);\n". 
     564          "} unset(\$fcount); ?>"; 
     565     } 
     566 
     567     protected static function getValue($a,$v) 
     568     { 
     569          return '<?php echo '.sprintf($GLOBALS['core']->tpl->getFilters($a),$v).'; ?>'; 
     570     } 
     571 
     572     protected static function getOperator($op) 
     573     { 
     574          switch (strtolower($op)) 
     575          { 
     576               case 'or': 
     577               case '||': 
     578                    return '||'; 
     579               case 'and': 
     580               case '&&': 
     581               default: 
     582                    return '&&'; 
     583          } 
     584     } 
     585} 
    130586?> 
  • plugins/zoneclearFeedServer/_widgets.php

    r2178 r2204  
    2323 
    2424          $w->create('zcfssource', 
    25                __('Zoneclear feed server sources'), 
     25               __('Feeds server : sources'), 
    2626               array('zoneclearFeedServerWidget','publicSource') 
    2727          ); 
    2828          $w->zcfssource->setting('title', 
    29                __('Title:'),__('Feed sources'),'text' 
     29               __('Title:'),__('Feeds sources'),'text' 
    3030          ); 
    3131          $w->zcfssource->setting('sortby', 
     
    4444               __('Limit:'),10,'text' 
    4545          ); 
     46          $w->zcfssource->setting('pagelink', 
     47               __('Add link to feeds page'),1,'check' 
     48          ); 
    4649          $w->zcfssource->setting('homeonly', 
    4750               __('Home page only'),1,'check' 
    4851          ); 
    4952     } 
     53 
    5054     public static function adminNumber($w) 
    5155     { 
    52           $w->create('zcfsnumber',__('Zoneclear feed server numbers'),array('zoneclearFeedServerWidget','publicNumber')); 
    53           $w->zcfsnumber->setting('title',__('Title:'),__('Feed numbers'),'text'); 
     56          $w->create('zcfsnumber',__('Feeds server : numbers'),array('zoneclearFeedServerWidget','publicNumber')); 
     57          $w->zcfsnumber->setting('title',__('Title:'),__('Feeds numbers'),'text'); 
    5458 
    5559          # Feed 
     
    98102          } 
    99103 
     104          if ($w->pagelink) { 
     105               $res .= '<li><a href="'.$core->blog->url.$core->url->getBase('zoneclearFeedsPage').'">'.__('All sources').'</a></li>'; 
     106          } 
     107 
    100108          return 
    101109          '<div class="zoneclear-sources">'. 
     
    133141               else { 
    134142                    $text = sprintf(__('%s sources'),$count); 
     143               } 
     144               if ($s->zoneclearFeedServer_pub_active) { 
     145                    $text = '<a href="'.$core->blog->url.$core->url->getBase('zoneclearFeedsPage').'">'.$text.'</a>'; 
    135146               } 
    136147 
  • plugins/zoneclearFeedServer/inc/class.zoneclear.feed.server.php

    r2178 r2204  
    1515class zoneclearFeedServer 
    1616{ 
     17     public static $nethttp_timeout = 2; 
     18     public static $nethttp_agent = 'zoneclearFeedServer - http://zoneclear.org'; 
     19     public static $nethttp_maxredirect = 2; 
     20 
    1721     public $core; 
    1822     public $con; 
    19      public $timer = 30; 
    2023     private $blog; 
    2124     private $table; 
     25     private $lock = null; 
    2226 
    2327     public function __construct($core) 
     
    105109 
    106110     # Quick enable / disable feed 
    107      public function enableFeed($id,$enable=true) 
     111     public function enableFeed($id,$enable=true,$time=null) 
    108112     { 
    109113          try 
     
    118122 
    119123               $cur->feed_upddt = date('Y-m-d H:i:s'); 
     124                
    120125               $cur->feed_status = (integer) $enable; 
     126               if (null !== $time) { 
     127                    $cur->feed_upd_last = (integer) $time; 
     128               } 
    121129 
    122130               $cur->update("WHERE feed_id = ".$id." AND blog_id = '".$this->blog."' "); 
     
    131139 
    132140          # --BEHAVIOR-- zoneclearFeedServerAfterEnableFeed 
    133           $this->core->callBehavior('zoneclearFeedServerAfterEnableFeed',$id,$enable); 
     141          $this->core->callBehavior('zoneclearFeedServerAfterEnableFeed',$id,$enable,$time); 
    134142 
    135143     } 
     
    259267     } 
    260268 
     269     # Get next table id 
     270     private function getNextId() 
     271     { 
     272          return $this->con->select('SELECT MAX(feed_id) FROM '.$this->table)->f(0) + 1; 
     273     } 
     274 
     275     # Lock a file to see if an update is ongoing 
     276     public function lockUpdate() 
     277     { 
     278          # Cache writable ? 
     279          if (!is_writable(DC_TPL_CACHE)) { 
     280               return false; 
     281          } 
     282          # Set file path 
     283          $f_md5 = md5($this->blog); 
     284          $cached_file = sprintf('%s/%s/%s/%s/%s.txt', 
     285               DC_TPL_CACHE, 
     286               'zcfs', 
     287               substr($f_md5,0,2), 
     288               substr($f_md5,2,2), 
     289               $f_md5 
     290          ); 
     291          # Make dir 
     292          if (!is_dir(dirname($cached_file))) { 
     293               try { 
     294                    files::makeDir(dirname($cached_file),true); 
     295               } catch (Exception $e) { 
     296                    return false; 
     297               } 
     298          } 
     299          # Make file 
     300          if (!file_exists($cached_file)) { 
     301               if (!@file_put_contents($cached_file,'')) { 
     302                    return false; 
     303               } 
     304          } 
     305          # Open file 
     306          if (!($fp = @fopen($cached_file, 'wb'))) { 
     307               return false; 
     308          } 
     309          # Lock file 
     310          if (flock($fp,LOCK_EX)) { 
     311               $this->lock = $fp; 
     312               return true; 
     313          } 
     314          return false; 
     315     } 
     316 
     317     public function unlockUpdate() 
     318     { 
     319          @fclose($this->lock); 
     320          $this->lock = null; 
     321     } 
     322 
    261323     # Check and add/update post related to record if needed 
    262324     public function checkFeedsUpdate($id=null) 
    263325     { 
     326          # Limit to one update at a time 
     327          if (!$this->lockUpdate()) { 
     328               return false; 
     329          } 
     330 
    264331          $s = self::settings($this->core,'system'); 
    265332          dt::setTZ($s->blog_timezone); 
    266333          $time = time(); 
    267  
    268           # All feeds 
    269           if ($id === null) 
    270           { 
    271                # Limit update to every "timer" second 
    272                if (!$this->checkTimer(true)) return null; 
    273  
    274                $f = $this->getFeeds(); 
    275           } 
    276           # One feed (from admin) 
    277           else { 
    278                $f = $this->getFeeds(array('feed_id'=>$id)); 
    279           } 
     334          $s = self::settings($this->core); 
     335 
     336          # All feeds or only one (from admin) 
     337          $f = !$id ? 
     338               $this->getFeeds(array('feed_status'=>1)) :  
     339               $this->getFeeds(array('feed_id'=>$id)); 
    280340 
    281341          # No feed 
    282           if ($f->isEmpty()) { 
    283                return null; 
    284           } 
    285  
    286           $this->enableUser(); 
     342          if ($f->isEmpty()) return false; 
     343 
     344          # Set feeds user 
     345          $this->enableUser($s->zoneclearFeedServer_user); 
    287346 
    288347          $meta = new dcMeta($this->core); 
     
    290349          $loop_mem = array(); 
    291350 
    292           $s = self::settings($this->core); 
    293351          $limit = abs((integer) $s->zoneclearFeedServer_update_limit); 
    294           if ($limit < 2) $limit = 10; 
    295           $i = 1; 
     352          if ($limit < 1) $limit = 10; 
     353          $i = 0; 
     354 
     355          $cur_post = $this->con->openCursor($this->core->prefix.'post'); 
     356          $cur_meta = $this->con->openCursor($this->core->prefix.'meta'); 
    296357 
    297358          while($f->fetch()) 
     
    300361               if ($id || $i < $limit && $f->feed_status == 1  
    301362                && $time > $f->feed_upd_last + $f->feed_upd_int) 
    302                { 
     363               {          
    303364                    $i++; 
    304  
    305                     # Claim first that update is done 
    306                     $upd = $this->openCursor(); 
    307                     $upd->feed_upd_last = $time; 
    308                     $this->updFeed($f->feed_id,$upd); 
    309  
    310                     $feed = feedReader::quickParse($f->feed_feed,null);//,DC_TPL_CACHE); 
    311  
     365                    $feed = self::readFeed($f->feed_feed); 
     366 
     367                    # Nothing to parse 
    312368                    if (!$feed) { 
     369                         # Disable feed 
    313370                         $this->enableFeed($f->feed_id,false); 
     371                         $i++; 
     372                    } 
     373                    # Not updated since last visit 
     374                    elseif (!$id && '' != $feed->pubdate && strtotime($feed->pubdate) < $f->feed_upd_last) { 
     375                         # Set update time of this feed 
     376                         $this->enableFeed($f->feed_id,true,$time); 
    314377                         $i++; 
    315378                    } 
    316379                    else 
    317380                    { 
    318                          $cur = $this->con->openCursor($this->core->prefix.'post'); 
     381                         # Set update time of this feed 
     382                         $this->enableFeed($f->feed_id,$f->feed_status,$time); 
    319383 
    320384                         $this->con->begin(); 
     
    322386                         foreach ($feed->items as $item) 
    323387                         { 
    324                               # Fix loop bug 
    325                               if (in_array($item->link.$item->TS,$loop_mem)) continue; 
    326                               $loop_mem[] = $item->link.$item->TS; 
     388                              $item_TS = $item->TS ? $item->TS : $time; 
     389                              $item_link = $this->con->escape($item->link); 
     390 
     391                              # Not updated since last visit 
     392                              if (!$id && $item_TS < $f->feed_upd_last) continue; 
     393 
     394                              # Fix loop twin 
     395                              if (in_array($item_link,$loop_mem)) continue; 
     396                              $loop_mem[] = $item_link; 
    327397 
    328398                              # Check if entry exists 
    329                               $rs = $this->con->select( 
     399                              $old_post = $this->con->select( 
    330400                                   'SELECT P.post_id '. 
    331401                                   'FROM '.$this->core->prefix.'post P '. 
     
    334404                                   "WHERE blog_id='".$this->blog."' ". 
    335405                                   "AND meta_type = 'zoneclearfeed_url' ". 
    336                                    "AND meta_id = '".$item->link."' " 
     406                                   "AND meta_id = '".$item_link."' " 
    337407                              ); 
    338                               if (!$rs->isEmpty()) continue; 
    339  
    340                               # Insert entry 
    341                               $cur->clean(); 
    342                               $cur->user_id = $this->core->auth->userID(); 
    343                               if ($f->cat_id) { 
    344                                    $cur->cat_id = $f->cat_id; 
    345                               } 
    346                               $cur->post_title = $item->title ? $item->title : text::cutString(html::clean($cur->post_content),60); 
    347                               $cur->post_format = 'xhtml'; 
    348                               $cur->post_dt = date('Y-m-d H:i:s',$item->TS); 
    349                               $cur->post_status = (integer) $s->zoneclearFeedServer_post_status_new; 
    350                               $cur->post_open_comment = 0; 
    351                               $cur->post_open_tb = 0; 
    352  
     408 
     409                              # Prepare entry cursor 
     410                              $cur_post->clean(); 
     411                              $cur_post->post_dt = date('Y-m-d H:i:s',$item_TS); 
     412                              if ($f->cat_id) $cur_post->cat_id = $f->cat_id; 
    353413                              $post_content = $item->content ? $item->content : $item->description; 
    354                               $cur->post_content = html::absoluteURLs($post_content,$feed->link); 
    355  
     414                              $cur_post->post_content = html::absoluteURLs($post_content,$feed->link); 
     415                              $cur_post->post_title = $item->title ? $item->title : text::cutString(html::clean($cur_post->post_content),60); 
    356416                              $creator = $item->creator ? $item->creator : $f->feed_owner; 
    357417 
    358418                              try 
    359419                              { 
    360                                    $post_id = $this->core->auth->sudo(array($this->core->blog,'addPost'),$cur); 
    361  
    362                                    $meta->setPostMeta($post_id,'zoneclearfeed_url',$item->link); 
    363                                    $meta->setPostMeta($post_id,'zoneclearfeed_author',$creator); 
    364                                    $meta->setPostMeta($post_id,'zoneclearfeed_site',$f->feed_url); 
    365                                    $meta->setPostMeta($post_id,'zoneclearfeed_sitename',$f->feed_name); 
    366                                    $meta->setPostMeta($post_id,'zoneclearfeed_id',$f->feed_id); 
    367  
     420                                   # Create entry 
     421                                   if ($old_post->isEmpty()) 
     422                                   { 
     423                                        # Post 
     424                                        $cur_post->user_id = $this->core->auth->userID(); 
     425                                        $cur_post->post_format = 'xhtml'; 
     426                                        $cur_post->post_status = (integer) $s->zoneclearFeedServer_post_status_new; 
     427                                        $cur_post->post_open_comment = 0; 
     428                                        $cur_post->post_open_tb = 0; 
     429 
     430                                        $post_id = $this->core->auth->sudo(array($this->core->blog,'addPost'),$cur_post); 
     431                                   } 
     432                                   # Update entry 
     433                                   else 
     434                                   { 
     435                                        $post_id = $old_post->post_id; 
     436                                        $this->core->auth->sudo(array($this->core->blog,'updPost'),$post_id,$cur_post); 
     437 
     438                                        # Quick delete old meta 
     439                                        $this->con->execute( 
     440                                             'DELETE FROM '.$this->core->prefix.'meta '. 
     441                                             'WHERE post_id = '.$post_id.' '. 
     442                                             "AND meta_type LIKE 'zoneclearfeed_%' " 
     443                                        ); 
     444                                        # Delete old tags 
     445                                        $this->core->auth->sudo(array($meta,'delPostMeta'),$post_id,'tag'); 
     446                                   } 
     447 
     448                                   # Quick add new meta 
     449                                   $cur_meta->clean(); 
     450                                   $cur_meta->post_id = $post_id; 
     451                                   $cur_meta->meta_type = 'zoneclearfeed_url'; 
     452                                   $cur_meta->meta_id = $item->link; 
     453                                   $cur_meta->insert(); 
     454 
     455                                   $cur_meta->clean(); 
     456                                   $cur_meta->post_id = $post_id; 
     457                                   $cur_meta->meta_type = 'zoneclearfeed_author'; 
     458                                   $cur_meta->meta_id = $creator; 
     459                                   $cur_meta->insert(); 
     460 
     461                                   $cur_meta->clean(); 
     462                                   $cur_meta->post_id = $post_id; 
     463                                   $cur_meta->meta_type = 'zoneclearfeed_site'; 
     464                                   $cur_meta->meta_id = $f->feed_url; 
     465                                   $cur_meta->insert(); 
     466 
     467                                   $cur_meta->clean(); 
     468                                   $cur_meta->post_id = $post_id; 
     469                                   $cur_meta->meta_type = 'zoneclearfeed_sitename'; 
     470                                   $cur_meta->meta_id = $f->feed_name; 
     471                                   $cur_meta->insert(); 
     472 
     473                                   $cur_meta->clean(); 
     474                                   $cur_meta->post_id = $post_id; 
     475                                   $cur_meta->meta_type = 'zoneclearfeed_id'; 
     476                                   $cur_meta->meta_id = $f->feed_id; 
     477                                   $cur_meta->insert(); 
     478 
     479                                   # Add new tags 
    368480                                   $tags = $meta->splitMetaValues($f->feed_tags); 
    369481                                   $tags = array_merge($tags,$item->subject); 
    370482                                   $tags = array_unique($tags); 
    371  
    372483                                   foreach ($tags as $tag) 
    373484                                   { 
    374                                         $meta->setPostMeta($post_id,'tag',dcMeta::sanitizeMetaID($tag)); 
     485                                        $this->core->auth->sudo(array($meta,'setPostMeta'),$post_id,'tag',dcMeta::sanitizeMetaID($tag)); 
    375486                                   } 
    376487                              } 
     
    379490                                   $this->con->rollback(); 
    380491                                   $this->enableUser(false); 
     492                                   $this->unlockUpdate(); 
    381493                                   throw $e; 
    382494                              } 
     
    388500          } 
    389501          $this->enableUser(false); 
     502          $this->unlockUpdate(); 
    390503          return true; 
    391504     } 
    392505 
    393      # Get next table id 
    394      private function getNextId() 
    395      { 
    396           return $this->con->select('SELECT MAX(feed_id) FROM '.$this->table)->f(0) + 1; 
    397      } 
    398       
    399      # Set a timer between two updates 
    400      private function checkTimer($update=false) 
    401      { 
    402           $s = self::settings($this->core); 
    403           $now = time(); 
    404           $last = (integer) $s->zoneclearFeedServer_timer; 
    405           $enable = ($last + $this->timer < $now); 
    406  
    407           if ($update && $enable) { 
    408                $s->set('zoneclearFeedServer_timer',$now); 
    409           } 
    410           return $enable; 
    411      } 
    412  
    413506     # Set permission to update post table 
    414      public function enableUser($enable=true) 
     507     public function enableUser($enable=false) 
    415508     { 
    416509          # Enable 
    417510          if ($enable) { 
    418                $s = self::settings($this->core); 
    419                if (!$this->core->auth->checkUser($s->zoneclearFeedServer_user)) { 
     511               if (!$this->core->auth->checkUser($enable)) { 
    420512                    throw new Exception('Unable to set user'); 
    421513               } 
     
    425517               $this->core->auth = new dcAuth($this->core); 
    426518          } 
     519     } 
     520 
     521     # Read and parse external feeds 
     522     public static function readFeed($f) 
     523     { 
     524          try { 
     525               $feed_reader = new feedReader; 
     526               $feed_reader->setCacheDir(DC_TPL_CACHE); 
     527               $feed_reader->setTimeout(self::$nethttp_timeout); 
     528               $feed_reader->setMaxRedirects(self::$nethttp_maxredirect); 
     529               $feed_reader->setUserAgent(self::$nethttp_agent); 
     530               return $feed_reader->parse($f); 
     531          } 
     532          catch (Exception $e) {} 
     533 
     534          return null; 
    427535     } 
    428536 
     
    447555          return true; 
    448556     } 
    449       
     557 
    450558     public static function absoluteURL($root,$url) 
    451559     { 
  • plugins/zoneclearFeedServer/inc/index.feed.php

    r2178 r2204  
    226226          $feed_tags = $_POST['feed_tags']; 
    227227          $feed_cat_id = $_POST['feed_cat_id']; 
    228           $feed_status = (integer) $_POST['feed_status']; 
     228          if (isset($_POST['feed_status'])) { 
     229               $feed_status = (integer) $_POST['feed_status']; 
     230          } 
    229231          $feed_upd_int = $_POST['feed_upd_int']; 
    230232 
     
    550552 
    551553echo '<html> 
    552 <head><title>'.__('Zoneclear feed server').'</title>'.$header. 
     554<head><title>'.__('Feeds server').'</title>'.$header. 
    553555dcPage::jsPageTabs($default_tab). 
    554556$next_headlink."\n".$prev_headlink. 
     
    601603     '<div id="entry-content"><fieldset class="constrained">'. 
    602604     '<h2>'.__('Feed information').'</h2>'. 
    603      '<p><label>'.__('Name:'). 
     605     '<p><label class="required">'.__('Name:'). 
    604606     form::field('feed_name',60,255,$feed_name,'maximal',2). 
     607     '</label></p>'. 
     608     '<p><label class="required">'.__('Owner:'). 
     609     form::field(array('feed_owner'),60,255,$feed_owner,'maximal',2). 
     610     '</label></p>'. 
     611     '<p><label class="required">'.__('Site URL:'). 
     612     form::field(array('feed_url'),60,255,$feed_url,'maximal',2). 
     613     '</label></p>'. 
     614     '<p><label class="required">'.__('Feed URL:'). 
     615     form::field(array('feed_feed'),60,255,$feed_feed,'maximal',2). 
    605616     '</label></p>'. 
    606617     '<p><label>'.__('Description:'). 
    607618     form::field(array('feed_desc'),60,255,$feed_desc,'maximal',2). 
    608      '</label></p>'. 
    609      '<p><label>'.__('Owner:'). 
    610      form::field(array('feed_owner'),60,255,$feed_owner,'maximal',2). 
    611      '</label></p>'. 
    612      '<p><label>'.__('Site URL:'). 
    613      form::field(array('feed_url'),60,255,$feed_url,'maximal',2). 
    614      '</label></p>'. 
    615      '<p><label>'.__('Feed URL:'). 
    616      form::field(array('feed_feed'),60,255,$feed_feed,'maximal',2). 
    617619     '</label></p>'. 
    618620     '<p><label>'.__('Tags:'). 
  • plugins/zoneclearFeedServer/inc/index.feeds.php

    r2178 r2204  
    180180          foreach($_POST['feeds'] as $feed_id) 
    181181          { 
    182                $zc->enableFeed($feed_id,false); 
     182               $zc->enableFeed($feed_id,true); 
    183183          } 
    184184          http::redirect($p_url.'&part=feeds&msg='.$action); 
     
    195195          foreach($_POST['feeds'] as $feed_id) 
    196196          { 
    197                $zc->enableFeed($feed_id,true); 
     197               $zc->enableFeed($feed_id,false); 
    198198          } 
    199199          http::redirect($p_url.'&part=feeds&msg='.$action); 
     
    321321# Prepared lists 
    322322$show_filters = false; 
    323 $sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : 'upddt'; 
     323$sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : 'feed_upddt'; 
    324324$order = !empty($_GET['order']) ? $_GET['order'] : 'desc'; 
    325325$page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; 
     
    367367echo ' 
    368368<html> 
    369 <head><title>'.__('Zoneclear feed server').'</title>'.$header. 
     369<head><title>'.__('Feeds server').'</title>'.$header. 
    370370dcPage::jsLoad('index.php?pf=zoneclearFeedServer/js/feeds.js'). 
    371371'</head> 
     
    464464     </fieldset> 
    465465     </form> 
    466      <form action="'.$p_url.'" method="post" id="form-actions">'; 
     466     <form action="'.$p_url.'&amp;part=feeds" method="post" id="form-actions">'; 
    467467 
    468468     $feeds_list->feedsDisplay($page,$nb_per_page,$pager_base_url); 
  • plugins/zoneclearFeedServer/inc/index.setting.php

    r2180 r2204  
    1414 
    1515$active = (boolean) $s->zoneclearFeedServer_active; 
     16$pub_active = (boolean) $s->zoneclearFeedServer_pub_active; 
    1617$post_status_new = (boolean) $s->zoneclearFeedServer_post_status_new; 
    17 $dis_pub_upd = (boolean) $s->zoneclearFeedServer_dis_pub_upd; 
     18$bhv_pub_upd = (integer) $s->zoneclearFeedServer_bhv_pub_upd; 
    1819$update_limit = (integer) $s->zoneclearFeedServer_update_limit; 
    19 if ($update_limit < 2) $update_limit = 10; 
     20if ($update_limit < 1) $update_limit = 10; 
    2021$post_full_tpl = @unserialize($s->zoneclearFeedServer_post_full_tpl); 
    2122if (!is_array($post_full_tpl)) $post_full_tpl = array(); 
     
    3031     try { 
    3132          $limit = abs((integer) $_POST['update_limit']); 
    32           if ($limit < 2) $limit = 10; 
     33          if ($limit < 1) $limit = 10; 
    3334          $s->put('zoneclearFeedServer_active',!empty($_POST['active'])); 
     35          $s->put('zoneclearFeedServer_pub_active',!empty($_POST['pub_active'])); 
    3436          $s->put('zoneclearFeedServer_post_status_new',!empty($_POST['post_status_new'])); 
    35           $s->put('zoneclearFeedServer_dis_pub_upd',!empty($_POST['dis_pub_upd'])); 
     37          $s->put('zoneclearFeedServer_bhv_pub_upd',(integer) $_POST['bhv_pub_upd']); 
    3638          $s->put('zoneclearFeedServer_update_limit',$limit); 
    3739          $s->put('zoneclearFeedServer_post_full_tpl',serialize($_POST['post_full_tpl'])); 
    3840          $s->put('zoneclearFeedServer_post_title_redir',serialize($_POST['post_title_redir'])); 
     41          $s->put('zoneclearFeedServer_user',(string) $_POST['feeduser']); 
    3942 
    4043          $core->blog->triggerBlog(); 
     
    4851 
    4952$combo_admins = $zc->getAllBlogAdmins(); 
     53$combo_pubupd = array( 
     54     __('disable') => 0, 
     55     __('before display') => 1, 
     56     __('after display') => 2, 
     57     __('through Ajax') => 3 
     58); 
     59$combo_status = array( 
     60     __('unpublished') => 0, 
     61     __('published') => 1 
     62); 
     63 
     64$pub_page_url = $core->blog->url.$core->url->getBase('zoneclearFeedsPage'); 
    5065 
    5166echo ' 
    5267<html> 
    53 <head><title>'.__('Zoneclear feed server').'</title>'.$header. 
     68<head><title>'.__('Feeds server').'</title>'.$header. 
    5469dcPage::jsColorPicker(). 
    5570dcPage::jsLoad('index.php?pf=zoneclearFeedServer/js/setting.js'). 
     
    7388 
    7489<fieldset id="setting-option"><legend>'. __('General rules').'</legend> 
     90<div class="two-cols"><div class="col"> 
    7591<p class="field"><label>'. 
    76 form::checkbox('post_status_new',1,$post_status_new). 
    77 __('Publish new feed posts').'</label></p> 
    78 <p class="field"><label>'. 
    79 __('Number of feeds to update at one time:').'<br />'. 
    80 form::field('update_limit',6,4,$update_limit).'</label></p> 
    81 <p class="form-note">'.sprintf(__('There is a limit of %s seconds between two series of updates.'),$zc->timer).'</p> 
     92__('Status of new posts:').'<br />'. 
     93form::combo(array('post_status_new'),$combo_status,$post_status_new).'</label></p> 
    8294<p class="field"><label>'. 
    8395__('Owner of entries created by zoneclearFeedServer:').'<br />'. 
    8496form::combo(array('feeduser'),$combo_admins,$feeduser).'</label></p> 
    8597<p class="field"><label>'. 
    86 form::checkbox('dis_pub_upd',1,$dis_pub_upd). 
    87 __('Disable public update').'</label></p> 
    88 <p class="form-note">'.__('If you use cron script, you can disable public update.').'</p> 
     98__('Update feeds on public side:').'<br />'. 
     99form::combo(array('bhv_pub_upd'),$combo_pubupd,$bhv_pub_upd).'</label></p> 
     100<p class="field"><label>'. 
     101__('Number of feeds to update at one time:').'<br />'. 
     102form::field('update_limit',6,4,$update_limit).'</label></p> 
     103<p class="field"><label>'. 
     104form::checkbox(array('pub_active'),'1',$pub_active). 
     105__('Enable public page').'</label></p> 
     106</div><div class="col"> 
     107<h3>'.__('Information').'</h3> 
     108<ul> 
     109<li>'.__('A writable cache folder is required to use this extension.').'</li> 
     110<li>'.__('If you set a large number of feeds to update at one time, this may cause a timeout error. We recommand to keep it to one.').'</li> 
     111<li>'.__('If you use cron script, you can disable public update.').'</li> 
     112<li>'.sprintf(__('If active, a public list of feeds are available at "%s".'),'<a href="'.$pub_page_url.'">'.$pub_page_url.'</a>').'</li> 
     113<li>'.__('In order to do update through Ajax, your theme must have behavior publicHeadContent.').'</li> 
     114</ul> 
     115</div></div> 
    89116</fieldset> 
    90117 
  • plugins/zoneclearFeedServer/inc/lib.zoneclear.feed.server.activityreport.php

    r2161 r2204  
    122122          $core->activityReport->addLog('zoneclearFeedServer','delete',$logs); 
    123123     } 
    124      public static function enableFeed($id,$enable) 
     124     public static function enableFeed($id,$enable,$time) 
    125125     { 
    126126          global $core; 
  • plugins/zoneclearFeedServer/index.php

    r2178 r2204  
    3333<a class="button" href="'.$p_url.'&amp;part=setting">'.__('Settings').'</a> -  
    3434zoneclearFeedServer - '.$core->plugins->moduleInfo('zoneclearFeedServer','version').'&nbsp; 
    35 <img alt="'.__('Zoneclear feed server').'" src="index.php?pf=zoneclearFeedServer/icon.png" /> 
     35<img alt="'.__('Feeds server').'" src="index.php?pf=zoneclearFeedServer/icon.png" /> 
    3636</p>'; 
    3737 
  • plugins/zoneclearFeedServer/locales/fr/main.lang.php

    r2178 r2204  
    11<?php 
    22// Language: français  
    3 // Module: zoneclearFeedServer - 0.6 
    4 // Date: 2010-04-11 13:35:14  
     3// Module: zoneclearFeedServer - 0.7 
     4// Date: 2010-04-22 19:08:39  
    55// Translated with dcTranslater - 1.3  
    66 
    77#_admin.php:20 
    8 #inc/index.feed.php:552 
     8#inc/index.feed.php:554 
    99#inc/index.feeds.php:369 
    10 #inc/index.setting.php:52 
     10#inc/index.setting.php:68 
    1111#index.php:35 
    12 $GLOBALS['__l10n']['Zoneclear feed server'] = 'Serveur de flux Zoneclear'; 
    13  
    14 #_admin.php:51 
     12$GLOBALS['__l10n']['Feeds server'] = 'Serveur de flux'; 
     13 
     14#_admin.php:45 
     15$GLOBALS['__l10n']['%s disabled feeds'] = '%s flux désactivés'; 
     16 
     17#_admin.php:45 
     18$GLOBALS['__l10n']['one disable feed'] = 'Un flux désactivé'; 
     19 
     20#_admin.php:72 
    1521$GLOBALS['__l10n']['Feed source'] = 'Source du flux'; 
    1622 
    17 #_admin.php:53 
     23#_admin.php:74 
    1824$GLOBALS['__l10n']['feed URL'] = 'URL du fil'; 
    1925 
    20 #_admin.php:54 
     26#_admin.php:75 
    2127$GLOBALS['__l10n']['site URL'] = 'URL du site'; 
    2228 
    23 #_public.php:110 
     29#_public.php:172 
    2430$GLOBALS['__l10n']['Original post on <a href="%s">%s</a>'] = 'Billet original sur <a href="%s">%s</a>'; 
    2531 
    26 #_public.php:121 
     32#_public.php:183 
    2733$GLOBALS['__l10n']['Read more details about this feed'] = 'Lire plus de détails à propos de ce flux'; 
    2834 
    2935#_widgets.php:25 
    30 $GLOBALS['__l10n']['Zoneclear feed server sources'] = 'Sources du serveur de flux Zoneclear'; 
     36$GLOBALS['__l10n']['Feeds server : sources'] = 'Serveur de flux : les sources'; 
    3137 
    3238#_widgets.php:29 
    33 $GLOBALS['__l10n']['Feed sources'] = 'Sources du flux'; 
     39$GLOBALS['__l10n']['Feeds sources'] = 'Sources des flux'; 
    3440 
    3541#_widgets.php:33 
     
    4248$GLOBALS['__l10n']['Limit:'] = 'Limite :'; 
    4349 
    44 #_widgets.php:52 
    45 $GLOBALS['__l10n']['Zoneclear feed server numbers'] = 'Nombre de flux du serveur de flux Zoneclear'; 
    46  
    47 #_widgets.php:53 
    48 $GLOBALS['__l10n']['Feed numbers'] = 'Le flux en chiffres'; 
     50#_widgets.php:47 
     51$GLOBALS['__l10n']['Add link to feeds page'] = 'Ajouter un lien vers la page des flux'; 
    4952 
    5053#_widgets.php:56 
     54$GLOBALS['__l10n']['Feeds server : numbers'] = 'Serveur de flux : les chiffres'; 
     55 
     56#_widgets.php:57 
     57$GLOBALS['__l10n']['Feeds numbers'] = 'Le flux en chiffres'; 
     58 
     59#_widgets.php:60 
    5160$GLOBALS['__l10n']['Show feeds count'] = 'Afficher le nombre de flux'; 
    5261 
    53 #_widgets.php:57 
     62#_widgets.php:61 
    5463$GLOBALS['__l10n']['Title for feeds count:'] = 'Titre pour le nombre de flux :'; 
    5564 
    56 #_widgets.php:57 
     65#_widgets.php:61 
    5766$GLOBALS['__l10n']['Feeds:'] = 'Flux :'; 
    5867 
    59 #_widgets.php:60 
     68#_widgets.php:64 
    6069$GLOBALS['__l10n']['Show entries count'] = 'Afficher le nombre de billets'; 
    6170 
    62 #_widgets.php:61 
     71#_widgets.php:65 
    6372$GLOBALS['__l10n']['Title for entries count:'] = 'Titre pour le nombre de billets :'; 
    6473 
    65 #_widgets.php:61 
     74#_widgets.php:65 
    6675$GLOBALS['__l10n']['Entries:'] = 'Billets :'; 
    6776 
    68 #_widgets.php:128 
    69 #_widgets.php:156 
     77#_widgets.php:105 
     78$GLOBALS['__l10n']['All sources'] = 'Toutes les sources'; 
     79 
     80#_widgets.php:136 
     81#_widgets.php:167 
    7082#inc/index.feeds.php:77 
    7183$GLOBALS['__l10n']['none'] = 'aucun'; 
    7284 
    73 #_widgets.php:131 
     85#_widgets.php:139 
    7486$GLOBALS['__l10n']['one source'] = 'une source'; 
    7587 
    76 #_widgets.php:134 
     88#_widgets.php:142 
    7789$GLOBALS['__l10n']['%s sources'] = '%s sources'; 
    7890 
    79 #_widgets.php:159 
     91#_widgets.php:170 
    8092$GLOBALS['__l10n']['one entry'] = 'un billet'; 
    8193 
    82 #_widgets.php:162 
     94#_widgets.php:173 
    8395$GLOBALS['__l10n']['%s entries'] = '%s billets'; 
    8496 
    85 #inc/class.zoneclear.feed.server.php:473 
     97#default-templates/zcfeeds.html:50 
     98$GLOBALS['__l10n']['List of feeds'] = 'Liste des flux'; 
     99 
     100#inc/class.zoneclear.feed.server.php:581 
    86101$GLOBALS['__l10n']['disabled'] = 'désactivé'; 
    87102 
    88 #inc/class.zoneclear.feed.server.php:474 
     103#inc/class.zoneclear.feed.server.php:582 
    89104$GLOBALS['__l10n']['enabled'] = 'activé'; 
    90105 
    91 #inc/class.zoneclear.feed.server.php:481 
     106#inc/class.zoneclear.feed.server.php:589 
    92107$GLOBALS['__l10n']['every hour'] = 'toutes les heures'; 
    93108 
    94 #inc/class.zoneclear.feed.server.php:482 
     109#inc/class.zoneclear.feed.server.php:590 
    95110$GLOBALS['__l10n']['every two hours'] = 'toutes les deux heures'; 
    96111 
    97 #inc/class.zoneclear.feed.server.php:483 
     112#inc/class.zoneclear.feed.server.php:591 
    98113$GLOBALS['__l10n']['two times per day'] = 'deux fois par jour'; 
    99114 
    100 #inc/class.zoneclear.feed.server.php:484 
     115#inc/class.zoneclear.feed.server.php:592 
    101116$GLOBALS['__l10n']['every day'] = 'tous les jours'; 
    102117 
    103 #inc/class.zoneclear.feed.server.php:485 
     118#inc/class.zoneclear.feed.server.php:593 
    104119$GLOBALS['__l10n']['every two days'] = 'tous les deux jours'; 
    105120 
    106 #inc/class.zoneclear.feed.server.php:486 
     121#inc/class.zoneclear.feed.server.php:594 
    107122$GLOBALS['__l10n']['every week'] = 'toutes les semaines'; 
    108123 
    109 #inc/class.zoneclear.feed.server.php:541 
     124#inc/class.zoneclear.feed.server.php:649 
    110125$GLOBALS['__l10n']['home page'] = 'la page d\'accueil'; 
    111126 
    112 #inc/class.zoneclear.feed.server.php:542 
     127#inc/class.zoneclear.feed.server.php:650 
    113128$GLOBALS['__l10n']['post pages'] = 'la page d\'un billet'; 
    114129 
    115 #inc/class.zoneclear.feed.server.php:543 
     130#inc/class.zoneclear.feed.server.php:651 
    116131$GLOBALS['__l10n']['tags pages'] = 'les pages des tags'; 
    117132 
    118 #inc/class.zoneclear.feed.server.php:544 
     133#inc/class.zoneclear.feed.server.php:652 
    119134$GLOBALS['__l10n']['archives pages'] = 'les pages des archives'; 
    120135 
    121 #inc/class.zoneclear.feed.server.php:545 
     136#inc/class.zoneclear.feed.server.php:653 
    122137$GLOBALS['__l10n']['category pages'] = 'les pages de catégorie'; 
    123138 
    124 #inc/class.zoneclear.feed.server.php:546 
     139#inc/class.zoneclear.feed.server.php:654 
    125140$GLOBALS['__l10n']['entries feed'] = 'le flux des billets'; 
    126141 
     
    134149$GLOBALS['__l10n']['previous feed'] = 'flux précédent'; 
    135150 
    136 #inc/index.feed.php:237 
     151#inc/index.feed.php:239 
    137152$GLOBALS['__l10n']['Record with same feed URL already exists.'] = 'Un enregistrement avec la même URL de flux existe déjà.'; 
    138153 
    139 #inc/index.feed.php:241 
     154#inc/index.feed.php:243 
    140155$GLOBALS['__l10n']['You must provide a name.'] = 'Vous devez indiquer un nom.'; 
    141156 
    142 #inc/index.feed.php:245 
     157#inc/index.feed.php:247 
    143158$GLOBALS['__l10n']['You must provide an owner.'] = 'Vous devez indiquer un propriétaire.'; 
    144159 
    145 #inc/index.feed.php:249 
     160#inc/index.feed.php:251 
    146161$GLOBALS['__l10n']['You must provide valid site URL.'] = 'Vous devez donner une URL de site valide.'; 
    147162 
    148 #inc/index.feed.php:253 
     163#inc/index.feed.php:255 
    149164$GLOBALS['__l10n']['You must provide valid feed URL.'] = 'Vous devez donner une URL de flux valide.'; 
    150165 
    151 #inc/index.feed.php:258 
     166#inc/index.feed.php:260 
    152167$GLOBALS['__l10n']['You must provide valid category.'] = 'Vous devez donner une catégorie valide.'; 
    153168 
    154 #inc/index.feed.php:561 
     169#inc/index.feed.php:560 
     170#inc/index.feeds.php:374 
     171#inc/index.setting.php:77 
     172$GLOBALS['__l10n']['Feeds'] = 'Fils de syndication'; 
     173 
     174#inc/index.feed.php:563 
    155175$GLOBALS['__l10n']['Edit feed'] = 'Edition de flux'; 
    156176 
    157 #inc/index.feed.php:562 
    158 #inc/index.feed.php:565 
     177#inc/index.feed.php:564 
     178#inc/index.feed.php:567 
    159179#inc/index.feeds.php:375 
    160 #inc/index.setting.php:63 
     180#inc/index.setting.php:79 
    161181$GLOBALS['__l10n']['New feed'] = 'Nouveau flux'; 
    162182 
    163 #inc/index.feed.php:584 
     183#inc/index.feed.php:586 
    164184#inc/index.feeds.php:34 
    165185$GLOBALS['__l10n']['Feed'] = 'Flux'; 
    166186 
    167 #inc/index.feed.php:587 
     187#inc/index.feed.php:589 
    168188$GLOBALS['__l10n']['Local settings'] = 'Paramètres locaux'; 
    169189 
    170 #inc/index.feed.php:594 
     190#inc/index.feed.php:596 
    171191$GLOBALS['__l10n']['Update:'] = 'Mise à jour :'; 
    172192 
    173 #inc/index.feed.php:602 
     193#inc/index.feed.php:604 
    174194$GLOBALS['__l10n']['Feed information'] = 'Information sur le flux'; 
    175195 
    176 #inc/index.feed.php:609 
     196#inc/index.feed.php:608 
    177197$GLOBALS['__l10n']['Owner:'] = 'Propriétaire :'; 
    178198 
    179 #inc/index.feed.php:612 
     199#inc/index.feed.php:611 
    180200$GLOBALS['__l10n']['Site URL:'] = 'URL du site :'; 
    181201 
     
    209229 
    210230#inc/index.feeds.php:302 
    211 $GLOBALS['__l10n']['change update interval'] = 'changer l\'intervale de mise à jour'; 
     231$GLOBALS['__l10n']['change update interval'] = 'changer l\'intervalle de mise à jour'; 
    212232 
    213233#inc/index.feeds.php:303 
     
    230250 
    231251#inc/index.feeds.php:383 
    232 $GLOBALS['__l10n']['This changes category for all selected feeds.'] = 'Ceci change la catégorie pour tous les flux selectionnés.'; 
     252$GLOBALS['__l10n']['This changes category for all selected feeds.'] = 'Ceci change la catégorie pour tous les flux sélectionnés.'; 
    233253 
    234254#inc/index.feeds.php:395 
     
    236256 
    237257#inc/index.feeds.php:411 
    238 $GLOBALS['__l10n']['This changes interval of updates for all selected feeds.'] = 'Ceci change l\'intervale de mise à jour des flux selectionnés.'; 
     258$GLOBALS['__l10n']['This changes interval of updates for all selected feeds.'] = 'Ceci change l\'intervalle de mise à jour des flux sélectionnés.'; 
    239259 
    240260#inc/index.feeds.php:423 
     
    244264$GLOBALS['__l10n']['Selected feeds action:'] = 'Action sur les flux sélectionnés :'; 
    245265 
    246 #inc/index.setting.php:62 
     266#inc/index.setting.php:54 
     267$GLOBALS['__l10n']['disable'] = 'désactiver'; 
     268 
     269#inc/index.setting.php:55 
     270$GLOBALS['__l10n']['before display'] = 'avant l\'affichage'; 
     271 
     272#inc/index.setting.php:56 
     273$GLOBALS['__l10n']['after display'] = 'après l\'affichage'; 
     274 
     275#inc/index.setting.php:57 
     276$GLOBALS['__l10n']['through Ajax'] = 'A travers Ajax'; 
     277 
     278#inc/index.setting.php:78 
    247279#index.php:33 
    248280$GLOBALS['__l10n']['Settings'] = 'Paramètres'; 
    249281 
    250 #inc/index.setting.php:67 
     282#inc/index.setting.php:83 
    251283$GLOBALS['__l10n']['Plugin activation'] = 'Activation de l\'extension'; 
    252284 
    253 #inc/index.setting.php:70 
     285#inc/index.setting.php:86 
    254286$GLOBALS['__l10n']['Enable plugin'] = 'Activer l\'extension'; 
    255287 
    256 #inc/index.setting.php:73 
     288#inc/index.setting.php:89 
    257289$GLOBALS['__l10n']['General rules'] = 'Réglages'; 
    258290 
    259 #inc/index.setting.php:86 
    260 $GLOBALS['__l10n']['Disable public update'] = 'Désactiver la mise à jour publique'; 
    261  
    262 #inc/index.setting.php:87 
    263 $GLOBALS['__l10n']['If you use cron script, you can disable public update.'] = 'Si vous utilisez un script cron, bous pouvez désactiver la mise à jour publique.'; 
    264  
    265 #inc/index.setting.php:76 
    266 $GLOBALS['__l10n']['Publish new feed posts'] = 'Publier les nouveaux billets de flux'; 
    267  
    268 #inc/index.setting.php:78 
     291#inc/index.setting.php:92 
     292$GLOBALS['__l10n']['Status of new posts:'] = 'Status des nouveaux billets :'; 
     293 
     294#inc/index.setting.php:95 
     295$GLOBALS['__l10n']['Owner of entries created by zoneclearFeedServer:'] = 'Propriétaire des billets créés par zoneclearFeedServer :'; 
     296 
     297#inc/index.setting.php:98 
     298$GLOBALS['__l10n']['Update feeds on public side:'] = 'Mettre à jour les flux depuis la partie publique :'; 
     299 
     300#inc/index.setting.php:101 
    269301$GLOBALS['__l10n']['Number of feeds to update at one time:'] = 'Nombre de flux à mettre à jour à la fois :'; 
    270302 
    271 #inc/index.setting.php:80 
    272 $GLOBALS['__l10n']['There is a limit of %s seconds between two series of updates.'] = 'Il y a une limite de %s secondes entre deux séries de mises à jour.'; 
    273  
    274 #inc/index.setting.php:82 
    275 $GLOBALS['__l10n']['Owner of entries created by zoneclearFeedServer:'] = 'Propriétaire des billets créés par ZoneclearFeedServer :'; 
    276  
    277 #inc/index.setting.php:90 
     303#inc/index.setting.php:105 
     304$GLOBALS['__l10n']['Enable public page'] = 'Activer la page publique'; 
     305 
     306#inc/index.setting.php:109 
     307$GLOBALS['__l10n']['A writable cache folder is required to use this extension.'] = 'Un dossier de cache accessible en écriture est nécessaire pour utiliser cette extension.'; 
     308 
     309#inc/index.setting.php:110 
     310$GLOBALS['__l10n']['If you set a large number of feeds to update at one time, this may cause a timeout error. We recommand to keep it to one.'] = 'Si vous paramètrez un grand nombre de flux à mettre à jour, ceci peut causer une erreur de timeout. Il est recommandé de laisser cette valeur à 1.'; 
     311 
     312#inc/index.setting.php:111 
     313$GLOBALS['__l10n']['If you use cron script, you can disable public update.'] = 'Si vous utilisez un script cron, vous pouvez désactiver la mise à jour publique.'; 
     314 
     315#inc/index.setting.php:112 
     316$GLOBALS['__l10n']['If active, a public list of feeds are available at "%s".'] = 'Si activé, une page publique de la liste des flux est disponible à l\'adresse %s .'; 
     317 
     318#inc/index.setting.php:113 
     319$GLOBALS['__l10n']['In order to do update through Ajax, your theme must have behavior publicHeadContent.'] = 'Pour utiliser la mise à jour depuis Ajax, votre thème doit avoir le behavior publicheadContent.'; 
     320 
     321#inc/index.setting.php:118 
    278322$GLOBALS['__l10n']['Display'] = 'Affichage'; 
    279323 
    280 #inc/index.setting.php:93 
     324#inc/index.setting.php:121 
    281325$GLOBALS['__l10n']['Show full content on:'] = 'Afficher le contenu complet sur :'; 
    282326 
    283 #inc/index.setting.php:104 
     327#inc/index.setting.php:132 
    284328$GLOBALS['__l10n']['Entries title'] = 'Titre des billets'; 
    285329 
    286 #inc/index.setting.php:105 
     330#inc/index.setting.php:133 
    287331$GLOBALS['__l10n']['Redirect to original post on:'] = 'Rediriger vers le billet original sur :'; 
    288332 
     
    303347 
    304348#inc/lib.zoneclear.feed.server.activityreport.php:40 
    305 $GLOBALS['__l10n']['updating feed records'] = 'mise à jour des enregistrement du flux (automatique)'; 
     349$GLOBALS['__l10n']['updating feed records'] = 'mise à jour des enregistrements du flux (automatique)'; 
    306350 
    307351#inc/lib.zoneclear.feed.server.activityreport.php:41 
     
    339383 
    340384#index.php:46 
    341 $GLOBALS['__l10n']['Feeds successfully updated'] = 'Flux mises à jour avec succès'; 
     385$GLOBALS['__l10n']['Feeds successfully updated'] = 'Flux mis à jour avec succès'; 
    342386 
    343387#index.php:47 
     
    357401 
    358402#index.php:52 
    359 $GLOBALS['__l10n']['Actions on posts successfully completed'] = 'Actions sur les billets complèté avec usccès'; 
     403$GLOBALS['__l10n']['Actions on posts successfully completed'] = 'Actions sur les billets complétées avec succès'; 
    360404 
    361405?> 
  • plugins/zoneclearFeedServer/locales/fr/main.po

    r2178 r2204  
    11# Language: français 
    2 # Module: zoneclearFeedServer - 0.6 
    3 # Date: 2010-04-11 13:35:14 
     2# Module: zoneclearFeedServer - 0.7 
     3# Date: 2010-04-22 19:08:39 
    44# Translated with translater 1.3 
    55 
     
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: zoneclearFeedServer 0.6\n" 
     9"Project-Id-Version: zoneclearFeedServer 0.7\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2010-04-11T13:35:14+00:00\n" 
     11"PO-Revision-Date: 2010-04-22T19:08:39+00:00\n" 
    1212"Last-Translator: JC Denis\n" 
    1313"Language-Team: \n" 
     
    1616 
    1717#: _admin.php:20 
    18 #: inc/index.feed.php:552 
     18#: inc/index.feed.php:554 
    1919#: inc/index.feeds.php:369 
    20 #: inc/index.setting.php:52 
     20#: inc/index.setting.php:68 
    2121#: index.php:35 
    22 msgid "Zoneclear feed server" 
    23 msgstr "Serveur de flux Zoneclear" 
    24  
    25 #: _admin.php:51 
     22msgid "Feeds server" 
     23msgstr "Serveur de flux" 
     24 
     25#: _admin.php:45 
     26msgid "%s disabled feeds" 
     27msgstr "%s flux désactivés" 
     28 
     29#: _admin.php:45 
     30msgid "one disable feed" 
     31msgstr "Un flux désactivé" 
     32 
     33#: _admin.php:72 
    2634msgid "Feed source" 
    2735msgstr "Source du flux" 
    2836 
    29 #: _admin.php:53 
     37#: _admin.php:74 
    3038msgid "feed URL" 
    3139msgstr "URL du fil" 
    3240 
    33 #: _admin.php:54 
     41#: _admin.php:75 
    3442msgid "site URL" 
    3543msgstr "URL du site" 
    3644 
    37 #: _public.php:110 
     45#: _public.php:172 
    3846msgid "Original post on <a href=\"%s\">%s</a>" 
    3947msgstr "Billet original sur <a href=\"%s\">%s</a>" 
    4048 
    41 #: _public.php:121 
     49#: _public.php:183 
    4250msgid "Read more details about this feed" 
    4351msgstr "Lire plus de détails à propos de ce flux" 
    4452 
    4553#: _widgets.php:25 
    46 msgid "Zoneclear feed server sources" 
    47 msgstr "Sources du serveur de flux Zoneclear" 
     54msgid "Feeds server : sources" 
     55msgstr "Serveur de flux : les sources" 
    4856 
    4957#: _widgets.php:29 
    50 msgid "Feed sources" 
    51 msgstr "Sources du flux" 
     58msgid "Feeds sources" 
     59msgstr "Sources des flux" 
    5260 
    5361#: _widgets.php:33 
     
    6371msgstr "Limite :" 
    6472 
    65 #: _widgets.php:52 
    66 msgid "Zoneclear feed server numbers" 
    67 msgstr "Nombre de flux du serveur de flux Zoneclear" 
    68  
    69 #: _widgets.php:53 
    70 msgid "Feed numbers" 
     73#: _widgets.php:47 
     74msgid "Add link to feeds page" 
     75msgstr "Ajouter un lien vers la page des flux" 
     76 
     77#: _widgets.php:56 
     78msgid "Feeds server : numbers" 
     79msgstr "Serveur de flux : les chiffres" 
     80 
     81#: _widgets.php:57 
     82msgid "Feeds numbers" 
    7183msgstr "Le flux en chiffres" 
    7284 
    73 #: _widgets.php:56 
     85#: _widgets.php:60 
    7486msgid "Show feeds count" 
    7587msgstr "Afficher le nombre de flux" 
    7688 
    77 #: _widgets.php:57 
     89#: _widgets.php:61 
    7890msgid "Title for feeds count:" 
    7991msgstr "Titre pour le nombre de flux :" 
    8092 
    81 #: _widgets.php:57 
     93#: _widgets.php:61 
    8294msgid "Feeds:" 
    8395msgstr "Flux :" 
    8496 
    85 #: _widgets.php:60 
     97#: _widgets.php:64 
    8698msgid "Show entries count" 
    8799msgstr "Afficher le nombre de billets" 
    88100 
    89 #: _widgets.php:61 
     101#: _widgets.php:65 
    90102msgid "Title for entries count:" 
    91103msgstr "Titre pour le nombre de billets :" 
    92104 
    93 #: _widgets.php:61 
     105#: _widgets.php:65 
    94106msgid "Entries:" 
    95107msgstr "Billets :" 
    96108 
    97 #: _widgets.php:128 
    98 #: _widgets.php:156 
     109#: _widgets.php:105 
     110msgid "All sources" 
     111msgstr "Toutes les sources" 
     112 
     113#: _widgets.php:136 
     114#: _widgets.php:167 
    99115#: inc/index.feeds.php:77 
    100116msgid "none" 
    101117msgstr "aucun" 
    102118 
    103 #: _widgets.php:131 
     119#: _widgets.php:139 
    104120msgid "one source" 
    105121msgstr "une source" 
    106122 
    107 #: _widgets.php:134 
     123#: _widgets.php:142 
    108124msgid "%s sources" 
    109125msgstr "%s sources" 
    110126 
    111 #: _widgets.php:159 
     127#: _widgets.php:170 
    112128msgid "one entry" 
    113129msgstr "un billet" 
    114130 
    115 #: _widgets.php:162 
     131#: _widgets.php:173 
    116132msgid "%s entries" 
    117133msgstr "%s billets" 
    118134 
    119 #: inc/class.zoneclear.feed.server.php:473 
     135#: default-templates/zcfeeds.html:50 
     136msgid "List of feeds" 
     137msgstr "Liste des flux" 
     138 
     139#: inc/class.zoneclear.feed.server.php:581 
    120140msgid "disabled" 
    121141msgstr "désactivé" 
    122142 
    123 #: inc/class.zoneclear.feed.server.php:474 
     143#: inc/class.zoneclear.feed.server.php:582 
    124144msgid "enabled" 
    125145msgstr "activé" 
    126146 
    127 #: inc/class.zoneclear.feed.server.php:481 
     147#: inc/class.zoneclear.feed.server.php:589 
    128148msgid "every hour" 
    129149msgstr "toutes les heures" 
    130150 
    131 #: inc/class.zoneclear.feed.server.php:482 
     151#: inc/class.zoneclear.feed.server.php:590 
    132152msgid "every two hours" 
    133153msgstr "toutes les deux heures" 
    134154 
    135 #: inc/class.zoneclear.feed.server.php:483 
     155#: inc/class.zoneclear.feed.server.php:591 
    136156msgid "two times per day" 
    137157msgstr "deux fois par jour" 
    138158 
    139 #: inc/class.zoneclear.feed.server.php:484 
     159#: inc/class.zoneclear.feed.server.php:592 
    140160msgid "every day" 
    141161msgstr "tous les jours" 
    142162 
    143 #: inc/class.zoneclear.feed.server.php:485 
     163#: inc/class.zoneclear.feed.server.php:593 
    144164msgid "every two days" 
    145165msgstr "tous les deux jours" 
    146166 
    147 #: inc/class.zoneclear.feed.server.php:486 
     167#: inc/class.zoneclear.feed.server.php:594 
    148168msgid "every week" 
    149169msgstr "toutes les semaines" 
    150170 
    151 #: inc/class.zoneclear.feed.server.php:541 
     171#: inc/class.zoneclear.feed.server.php:649 
    152172msgid "home page" 
    153173msgstr "la page d'accueil" 
    154174 
    155 #: inc/class.zoneclear.feed.server.php:542 
     175#: inc/class.zoneclear.feed.server.php:650 
    156176msgid "post pages" 
    157177msgstr "la page d'un billet" 
    158178 
    159 #: inc/class.zoneclear.feed.server.php:543 
     179#: inc/class.zoneclear.feed.server.php:651 
    160180msgid "tags pages" 
    161181msgstr "les pages des tags" 
    162182 
    163 #: inc/class.zoneclear.feed.server.php:544 
     183#: inc/class.zoneclear.feed.server.php:652 
    164184msgid "archives pages" 
    165185msgstr "les pages des archives" 
    166186 
    167 #: inc/class.zoneclear.feed.server.php:545 
     187#: inc/class.zoneclear.feed.server.php:653 
    168188msgid "category pages" 
    169189msgstr "les pages de catégorie" 
    170190 
    171 #: inc/class.zoneclear.feed.server.php:546 
     191#: inc/class.zoneclear.feed.server.php:654 
    172192msgid "entries feed" 
    173193msgstr "le flux des billets" 
     
    185205msgstr "flux précédent" 
    186206 
    187 #: inc/index.feed.php:237 
     207#: inc/index.feed.php:239 
    188208msgid "Record with same feed URL already exists." 
    189209msgstr "Un enregistrement avec la même URL de flux existe déjà." 
    190210 
    191 #: inc/index.feed.php:241 
     211#: inc/index.feed.php:243 
    192212msgid "You must provide a name." 
    193213msgstr "Vous devez indiquer un nom." 
    194214 
    195 #: inc/index.feed.php:245 
     215#: inc/index.feed.php:247 
    196216msgid "You must provide an owner." 
    197217msgstr "Vous devez indiquer un propriétaire." 
    198218 
    199 #: inc/index.feed.php:249 
     219#: inc/index.feed.php:251 
    200220msgid "You must provide valid site URL." 
    201221msgstr "Vous devez donner une URL de site valide." 
    202222 
    203 #: inc/index.feed.php:253 
     223#: inc/index.feed.php:255 
    204224msgid "You must provide valid feed URL." 
    205225msgstr "Vous devez donner une URL de flux valide." 
    206226 
    207 #: inc/index.feed.php:258 
     227#: inc/index.feed.php:260 
    208228msgid "You must provide valid category." 
    209229msgstr "Vous devez donner une catégorie valide." 
    210230 
    211 #: inc/index.feed.php:561 
     231#: inc/index.feed.php:560 
     232#: inc/index.feeds.php:374 
     233#: inc/index.setting.php:77 
     234msgid "Feeds" 
     235msgstr "Fils de syndication" 
     236 
     237#: inc/index.feed.php:563 
    212238msgid "Edit feed" 
    213239msgstr "Edition de flux" 
    214240 
    215 #: inc/index.feed.php:562 
    216 #: inc/index.feed.php:565 
     241#: inc/index.feed.php:564 
     242#: inc/index.feed.php:567 
    217243#: inc/index.feeds.php:375 
    218 #: inc/index.setting.php:63 
     244#: inc/index.setting.php:79 
    219245msgid "New feed" 
    220246msgstr "Nouveau flux" 
    221247 
    222 #: inc/index.feed.php:584 
     248#: inc/index.feed.php:586 
    223249#: inc/index.feeds.php:34 
    224250msgid "Feed" 
    225251msgstr "Flux" 
    226252 
    227 #: inc/index.feed.php:587 
     253#: inc/index.feed.php:589 
    228254msgid "Local settings" 
    229255msgstr "Paramètres locaux" 
    230256 
    231 #: inc/index.feed.php:594 
     257#: inc/index.feed.php:596 
    232258msgid "Update:" 
    233259msgstr "Mise à jour :" 
    234260 
    235 #: inc/index.feed.php:602 
     261#: inc/index.feed.php:604 
    236262msgid "Feed information" 
    237263msgstr "Information sur le flux" 
    238264 
    239 #: inc/index.feed.php:609 
     265#: inc/index.feed.php:608 
    240266msgid "Owner:" 
    241267msgstr "Propriétaire :" 
    242268 
    243 #: inc/index.feed.php:612 
     269#: inc/index.feed.php:611 
    244270msgid "Site URL:" 
    245271msgstr "URL du site :" 
     
    284310#: inc/index.feeds.php:302 
    285311msgid "change update interval" 
    286 msgstr "changer l'intervale de mise à jour" 
     312msgstr "changer l'intervalle de mise à jour" 
    287313 
    288314#: inc/index.feeds.php:303 
     
    312338#: inc/index.feeds.php:383 
    313339msgid "This changes category for all selected feeds." 
    314 msgstr "Ceci change la catégorie pour tous les flux selectionnés." 
     340msgstr "Ceci change la catégorie pour tous les flux sélectionnés." 
    315341 
    316342#: inc/index.feeds.php:395 
     
    320346#: inc/index.feeds.php:411 
    321347msgid "This changes interval of updates for all selected feeds." 
    322 msgstr "Ceci change l'intervale de mise à jour des flux selectionnés." 
     348msgstr "Ceci change l'intervalle de mise à jour des flux sélectionnés." 
    323349 
    324350#: inc/index.feeds.php:423 
     
    330356msgstr "Action sur les flux sélectionnés :" 
    331357 
    332 #: inc/index.setting.php:62 
     358#: inc/index.setting.php:54 
     359msgid "disable" 
     360msgstr "désactiver" 
     361 
     362#: inc/index.setting.php:55 
     363msgid "before display" 
     364msgstr "avant l'affichage" 
     365 
     366#: inc/index.setting.php:56 
     367msgid "after display" 
     368msgstr "après l'affichage" 
     369 
     370#: inc/index.setting.php:57 
     371msgid "through Ajax" 
     372msgstr "A travers Ajax" 
     373 
     374#: inc/index.setting.php:78 
    333375#: index.php:33 
    334376msgid "Settings" 
    335377msgstr "Paramètres" 
    336378 
    337 #: inc/index.setting.php:67 
     379#: inc/index.setting.php:83 
    338380msgid "Plugin activation" 
    339381msgstr "Activation de l'extension" 
    340382 
    341 #: inc/index.setting.php:70 
     383#: inc/index.setting.php:86 
    342384msgid "Enable plugin" 
    343385msgstr "Activer l'extension" 
    344386 
    345 #: inc/index.setting.php:73 
     387#: inc/index.setting.php:89 
    346388msgid "General rules" 
    347389msgstr "Réglages" 
    348390 
    349 #: inc/index.setting.php:86 
    350 msgid "Disable public update" 
    351 msgstr "Désactiver la mise à jour publique" 
    352  
    353 #: inc/index.setting.php:87 
    354 msgid "If you use cron script, you can disable public update." 
    355 msgstr "Si vous utilisez un script cron, bous pouvez désactiver la mise à jour publique." 
    356  
    357 #: inc/index.setting.php:76 
    358 msgid "Publish new feed posts" 
    359 msgstr "Publier les nouveaux billets de flux" 
    360  
    361 #: inc/index.setting.php:78 
     391#: inc/index.setting.php:92 
     392msgid "Status of new posts:" 
     393msgstr "Status des nouveaux billets :" 
     394 
     395#: inc/index.setting.php:95 
     396msgid "Owner of entries created by zoneclearFeedServer:" 
     397msgstr "Propriétaire des billets créés par zoneclearFeedServer :" 
     398 
     399#: inc/index.setting.php:98 
     400msgid "Update feeds on public side:" 
     401msgstr "Mettre à jour les flux depuis la partie publique :" 
     402 
     403#: inc/index.setting.php:101 
    362404msgid "Number of feeds to update at one time:" 
    363405msgstr "Nombre de flux à mettre à jour à la fois :" 
    364406 
    365 #: inc/index.setting.php:80 
    366 msgid "There is a limit of %s seconds between two series of updates." 
    367 msgstr "Il y a une limite de %s secondes entre deux séries de mises à jour." 
    368  
    369 #: inc/index.setting.php:82 
    370 msgid "Owner of entries created by zoneclearFeedServer:" 
    371 msgstr "Propriétaire des billets créés par ZoneclearFeedServer :" 
    372  
    373 #: inc/index.setting.php:90 
     407#: inc/index.setting.php:105 
     408msgid "Enable public page" 
     409msgstr "Activer la page publique" 
     410 
     411#: inc/index.setting.php:109 
     412msgid "A writable cache folder is required to use this extension." 
     413msgstr "Un dossier de cache accessible en écriture est nécessaire pour utiliser cette extension." 
     414 
     415#: inc/index.setting.php:110 
     416msgid "If you set a large number of feeds to update at one time, this may cause a timeout error. We recommand to keep it to one." 
     417msgstr "Si vous paramètrez un grand nombre de flux à mettre à jour, ceci peut causer une erreur de timeout. Il est recommandé de laisser cette valeur à 1." 
     418 
     419#: inc/index.setting.php:111 
     420msgid "If you use cron script, you can disable public update." 
     421msgstr "Si vous utilisez un script cron, vous pouvez désactiver la mise à jour publique." 
     422 
     423#: inc/index.setting.php:112 
     424msgid "If active, a public list of feeds are available at \"%s\"." 
     425msgstr "Si activé, une page publique de la liste des flux est disponible à l'adresse %s ." 
     426 
     427#: inc/index.setting.php:113 
     428msgid "In order to do update through Ajax, your theme must have behavior publicHeadContent." 
     429msgstr "Pour utiliser la mise à jour depuis Ajax, votre thème doit avoir le behavior publicheadContent." 
     430 
     431#: inc/index.setting.php:118 
    374432msgid "Display" 
    375433msgstr "Affichage" 
    376434 
    377 #: inc/index.setting.php:93 
     435#: inc/index.setting.php:121 
    378436msgid "Show full content on:" 
    379437msgstr "Afficher le contenu complet sur :" 
    380438 
    381 #: inc/index.setting.php:104 
     439#: inc/index.setting.php:132 
    382440msgid "Entries title" 
    383441msgstr "Titre des billets" 
    384442 
    385 #: inc/index.setting.php:105 
     443#: inc/index.setting.php:133 
    386444msgid "Redirect to original post on:" 
    387445msgstr "Rediriger vers le billet original sur :" 
     
    409467#: inc/lib.zoneclear.feed.server.activityreport.php:40 
    410468msgid "updating feed records" 
    411 msgstr "mise à jour des enregistrement du flux (automatique)" 
     469msgstr "mise à jour des enregistrements du flux (automatique)" 
    412470 
    413471#: inc/lib.zoneclear.feed.server.activityreport.php:41 
     
    457515#: index.php:46 
    458516msgid "Feeds successfully updated" 
    459 msgstr "Flux mises à jour avec succès" 
     517msgstr "Flux mis à jour avec succès" 
    460518 
    461519#: index.php:47 
     
    481539#: index.php:52 
    482540msgid "Actions on posts successfully completed" 
    483 msgstr "Actions sur les billets complèté avec usccès" 
    484  
     541msgstr "Actions sur les billets complétées avec succès" 
     542 
  • plugins/zoneclearFeedServer/release.txt

    r2178 r2204  
    11x.x xxxxxxxx 
    2  * Not added ability to update of previous post (see item->TS and compare) 
    3  * Not added public page of feed description 
    4  * Not fixed duplicate entries 
     2 * Not fixed disallow self blog feeds 
     3 
     40.7 20100422 
     5 * Added icon on dashboard if some feeds are disabled 
     6 * Added public page of feed description (first step) 
     7 * Added update of existing entries 
     8 * Added settings to add "aftercontent" and ajax options 
     9 * Added uninstall features 
     10 * Fixed duplicate entry (I hope so) using php flock 
     11 * Fixed feeds actions on admin 
     12 * Fixed typo (closes #441) 
     13 * Fixed user settings (closes #442) 
    514 
    6150.6 20100411 
     
    918 * Fixed multiple bugs 
    1019 * Changed admin interface 
    11  
    1220 
    13210.5.2 20100405 
Note: See TracChangeset for help on using the changeset viewer.

Sites map