@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb012 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.mtcategorynext.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_mtcategorynext($args, $content, &$ctx, &$repeat) { $localvars = array('category', 'entries'); $tag = $ctx->this_tag(); if (($tag == 'mtcategoryprevious') || $tag == 'mtfolderprevious' || $tag == 'mtarchiveprevious') { $step = -1; } else { $step = 1; } if (!isset($content)) { $e = $ctx->stash('entry'); if ($e) $cat = $ctx->mt->db->fetch_category($e['placement_category_id']); $cat or $cat = $ctx->stash('category'); $cat or $cat = $ctx->stash('archive_category'); if (!$cat) return ''; $needs_entries = $args['entries']; $class = 'category'; if (isset($args['class'])) { $class = $args['class']; } $cats = _catx_load_categories($ctx, $cat, $class); if ($cats == null) { $repeat = false; return $content; } $idx = 0; foreach ($cats as $c) { if ($c['category_id'] == $cat['category_id']) { $pos = $idx; break; } $idx++; } $repeat = false; if (isset($pos)) { $pos += $step; while (($pos >= 0) && ($pos < count($cats))) { if ($cats[$pos]['category_count'] == 0) { if (isset($args['show_empty']) && $args['show_empty']) { } else { $pos += $step; continue; } } $ctx->localize($localvars); $ctx->stash('category', $cats[$pos]); if ($needs_entries) $ctx->stash('entries', null); $repeat = true; break; } } } else { $ctx->restore($localvars); } return $content; } function _catx_load_categories(&$ctx, $cat, $class) { $blog_id = $cat['category_blog_id']; $parent = $cat['category_parent']; $parent or $parent = 0; $cats = $ctx->stash('__cat_cache_'.$blog_id . '_' . $parent); if (!$cats) { $cats = $ctx->mt->db->fetch_categories(array('blog_id' => $blog_id, 'parent' => $parent, 'show_empty' => 1, 'class' => $class)); $ctx->stash('__cat_cache_'.$blog_id. '_' . $parent, $cats); } return $cats; } ?>