@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.mtassets.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_mtassets($args, $content, &$ctx, &$repeat) { $localvars = array('_assets', 'asset', 'asset_first_in_row', 'asset_last_in_row'); $counter = 0; if (isset($args['sort_by']) && $args['sort_by'] == 'score' && !isset($args['namespace'])) { return $ctx->error($ctx->mt->translate('sort_by="score" must be used in combination with namespace.')); } if (!isset($content)) { $ctx->localize($localvars); $blog_id = $ctx->stash('blog_id'); $args['blog_id'] = $ctx->stash('blog_id'); $tag = $ctx->this_tag(); if (($tag == 'mtentryassets') || ($tag == 'mtpageassets')) { $entry = $ctx->stash('entry'); if ($entry) $args['entry_id'] = $entry['entry_id']; } $args['exclude_thumb'] = 1; $assets = $ctx->mt->db->fetch_assets($args); $ctx->stash('_assets', $assets); } else { $assets = $ctx->stash('_assets'); $counter = $ctx->stash('_assets_counter'); } if ($counter < count($assets)) { $per_row = 1; if (isset($args['assets_per_row'])) $per_row = $args['assets_per_row']; $asset = $assets[$counter]; $ctx->stash('asset', $asset); $ctx->stash('_assets_counter', $counter + 1); $ctx->stash('asset_first_in_row', ($counter % $per_row) == 0); $ctx->stash('asset_last_in_row', (($counter + 1) % $per_row) == 0); if (($counter + 1) >= count($assets)) $ctx->stash('asset_last_in_row', true); $repeat = true; } else { $ctx->restore($localvars); $repeat = false; } return $content; } ?>