@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb007 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.mtifcategory.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_mtifcategory($args, $content, &$ctx, &$repeat) { if (!isset($content)) { $e = $ctx->stash('entry'); $tag = $ctx->this_tag(); if ($tag == 'mtentryifcategory') { $entry_context = 1; if (!$e) $ok = 0; } if ($entry_context && $e) $cat = $ctx->mt->db->fetch_category($e['placement_category_id']); if (!$entry_context) { $cat or $cat = $ctx->stash('category'); $cat or $cat = $ctx->stash('archive_category'); if (!$cat && $e) { $cat = $ctx->mt->db->fetch_category($e['placement_category_id']); } } $primary = $args['type'] == 'primary'; $secondary = $args['type'] == 'secondary'; $name = $args['name']; $name or $name = $args['label']; if (!isset($name) || !isset($cat)) $ok = 0; if (!isset($ok)) { $cats = array(); if ($primary || !$e) { $cats[] = $cat; } elseif ($e) { $cats = $ctx->mt->db->fetch_categories(array('entry_id' => $e['entry_id'])); if (!is_array($cats)) $cats = array(); } if ($secondary && $cat) { $sec_cats = array(); $primary_cat = $cat; foreach ($cats as $cat) { if ($cat['category_id'] != $primary_cat['category_id']) $sec_cats[] = $cat; } $cats = $sec_cats; } $ok = 0; if (isset($name)) { foreach ($cats as $cat) { if ($cat['category_label'] == $name) { $ok = 1; break; } } } } return $ctx->_hdlr_if($args, $content, $ctx, $repeat, $ok); } else { return $ctx->_hdlr_if($args, $content, $ctx, $repeat); } } ?>