Changeset 2427
- Timestamp:
- 07/03/10 05:38:33 (13 years ago)
- Location:
- plugins/rateIt
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/rateIt/_define.php
r2394 r2427 17 17 /* Description*/ "Rating system for your blogs", 18 18 /* Author */ "JC Denis", 19 /* Version */ '2.0-alpha 2',19 /* Version */ '2.0-alpha4', 20 20 /* Permissions */ 'admin' 21 21 ); 22 /* date */ #20100 62522 /* date */ #20100703 23 23 ?> -
plugins/rateIt/_public.php
r2394 r2427 301 301 global $core; 302 302 303 $style = isset($attr['style']) ? $attr['style'] : 'classic';304 $type = isset($attr['type']) ? $attr['type']: '';303 $style = isset($attr['style']) ? html::escapeHTML($attr['style']) : ''; 304 $type = isset($attr['type']) ? html::escapeHTML($attr['type']) : ''; 305 305 $res = ''; 306 306 … … 312 312 return 313 313 "<?php \n". 314 "if ('".$style."' == \$core->blog->settings->rateit->rateit_rating_style) { \n". 314 "\$rateit_style = \"".$style."\"; \n". 315 "if (empty(\$rateit_style)) { ". 316 " \$rateit_style = \$core->blog->settings->rateit->rateit_rating_style; ". 317 "} \n". 318 "if (empty(\$rateit_params)) { ". 319 "\$rateit_params = array('type'=>'','id'=>''); \n". 315 320 $res. 321 "} ". 316 322 "if (!empty(\$rateit_params['type'])) { \n". 317 323 " \$rateit_voted = \$core->rateIt->voted(\$rateit_params['type'],\$rateit_params['id']); \n". … … 324 330 "} \n". 325 331 "unset(\$rateit_params); \n". 326 " }\n".332 "unset(\$rateit_style); \n". 327 333 "?> \n"; 328 334 } … … 352 358 { 353 359 $if[] = '\''.$attr['type'].'\' == $_ctx->rateIt->type'; 360 } 361 } 362 if (!empty($attr['style'])) 363 { 364 if (substr($attr['style'],0,1) == '!') 365 { 366 $if[] = '\''.substr($attr['style'],1).'\' != $rateit_style'; 367 } 368 else 369 { 370 $if[] = '\''.$attr['style'].'\' == $rateit_style'; 354 371 } 355 372 } … … 388 405 global $core; 389 406 $f = $core->tpl->getFilters($attr); 390 return '<?php echo rateItContext::linker($rateit_voted,$_ctx->rateIt->type,$_ctx->rateIt->id,$_ctx->rateIt->note,$_ctx->rateIt->quotient ); ?>';407 return '<?php echo rateItContext::linker($rateit_voted,$_ctx->rateIt->type,$_ctx->rateIt->id,$_ctx->rateIt->note,$_ctx->rateIt->quotient,$rateit_style); ?>'; 391 408 } 392 409 -
plugins/rateIt/default-templates/tpl/rateit.html
r2358 r2427 1 1 <tpl:rateIt> 2 3 <tpl:rateItIf style="classic"> 2 4 <div class="rateit rateit-classic"> 3 5 <h3>{{tpl:rateItTitle}}</h3> … … 11 13 </ul> 12 14 </div> 13 </tpl:rateIt>15 </tpl:rateItIf> 14 16 15 <tpl:rateItstyle="twin">17 <tpl:rateItIf style="twin"> 16 18 <div class="rateit rateit-twin"> 17 19 <p>{{tpl:rateItMinCount}}</p> … … 19 21 <p>{{tpl:rateItMaxCount}}</p> 20 22 </div> 21 </tpl:rateIt>23 </tpl:rateItIf> 22 24 23 <tpl:rateItstyle="simple">25 <tpl:rateItIf style="simple"> 24 26 <div class="rateit retait-simple"> 25 27 {{tpl:rateItLinker}} 26 28 <p>{{tpl:rateItMaxCount}}</p> 27 29 </div> 30 </tpl:rateItIf> 31 28 32 </tpl:rateIt> -
plugins/rateIt/inc/lib.rateit.context.php
r2424 r2427 16 16 { 17 17 # Form 18 public static function linker($enable,$type,$id,$note,$quotient )18 public static function linker($enable,$type,$id,$note,$quotient,$style='') 19 19 { 20 20 global $core; 21 21 22 if (!in_array($style,array('classic','simple','twin'))) 23 { 24 $style = $core->blog->settings->rateit->rateit_rating_style; 25 } 22 26 $like = $core->blog->settings->rateit->rateit_msglike; 23 27 if (empty($like)) { $like = __('I like'); } … … 36 40 37 41 38 if ($ core->blog->settings->rateit->rateit_rating_style == 'simple')42 if ($style == 'simple') 39 43 { 40 44 $chk = $enable ? ' checked="checked"' : ''; 41 45 $res .= '<input title="'.$like.'" name="'.$uid.'" class="rateit-'.$type.'-'.$id.'" type="radio" value="'.$quotient.'" '.$chk.$dis.' />'; 42 46 } 43 elseif ($ core->blog->settings->rateit->rateit_rating_style == 'twin')47 elseif ($style == 'twin') 44 48 { 45 49 $chk = $enable ? ' checked="checked"' : ''; -
plugins/rateIt/inc/modules/lib.rateit.module.post.public.php
r2394 r2427 29 29 { 30 30 if ($type != '' && $type != 'post') return; 31 31 //utiliser $core->getPostType 32 32 return 33 33 "if (\$_ctx->exists('posts')". -
plugins/rateIt/release.txt
r2394 r2427 4 4 - Not added public API 5 5 - Not completed modules behaviors (delete/edit category, tag...) 6 7 2.0-alpha4 20100703 8 * Fixed attributes 'type' and 'style' to rateIt in templates 9 * Added condition for 'style' to rateItIf in templates 10 11 2.0-alpha3 20100701 12 * Fixed filename 6 13 7 14 2.0-alpha2 20100625
Note: See TracChangeset
for help on using the changeset viewer.