@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb011 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
php
/
lib
/
Path :
Upload File :
New :
File
Dir
//homepage/v-mt/php/lib/block.mtfor.php
<?php # Movable Type (r) (C) 2001-2008 Six Apart, Ltd. All Rights Reserved. # This code cannot be redistributed without permission from www.sixapart.com. # For more information, consult your Movable Type license. # # $Id$ function smarty_block_mtfor($args, $content, &$ctx, &$repeat) { $localvars = array('__for_end', '__for_var'); if (!isset($content)) { $ctx->localize($localvars); // first invocation; setup loop $start = array_key_exists('start', $args) ? $args['start'] : (array_key_exists('from', $args) ? $args['from'] : 0); $end = array_key_exists('end', $args) ? $args['end'] : (array_key_exists('to', $args) ? $args['to'] : null); $var = $args['var']; if ($end === null) { $content = ''; $repeat = false; } $index = $start; $counter = 1; $ctx->stash('__for_end', $end); $ctx->stash('__for_var', $var); } else { $index = $ctx->__stash['vars']['__index__'] + 1; $counter = $ctx->__stash['vars']['__counter__'] + 1; $end = $ctx->stash('__for_end'); $var = $ctx->stash('__for_var'); } if ($index <= $end) { $ctx->__stash['vars']['__index__'] = $index; $ctx->__stash['vars']['__counter__'] = $counter; $ctx->__stash['vars']['__odd__'] = ($counter % 2) == 1; $ctx->__stash['vars']['__even__'] = ($counter % 2) == 0; $ctx->__stash['vars']['__first__'] = $counter == 1; $ctx->__stash['vars']['__last__'] = $index == $end; if ($var) $ctx->__stash['vars'][$var] = $index; if (array_key_exists('glue', $args)) { if ($index < $end) $content = $content . $args['glue']; } $repeat = true; } else { $ctx->restore($localvars); $repeat = false; } return $content; } ?>