basename; $count = ''; $params = array(); $link = 'media_item.php?id='.$f->media_id; $link_edit = $p_url.'&edit='.$fname; $icon = 'index.php?pf=templator/img/template.png'; $class = 'media-item media-col-'.($i%2); $details = $special = ''; $widget_icon = ''; $copy_url = '&copy='; if (preg_match('/^category-(.+)$/',$f->basename)) { // That is ugly. $cat_id = str_replace('category-', '', $f->basename); $cat_id = str_replace('.html', '', $cat_id); $cat_parents = $core->blog->getCategoryParents($cat_id); $full_name = ''; while ($cat_parents->fetch()) {$full_name = $cat_parents->cat_title.' › ';}; $fname = ''.__('Category').' : '.$full_name.$core->blog->getCategory($cat_id)->cat_title; $params['cat_id'] = $cat_id; $params['post_type'] = ''; $icon = 'index.php?pf=templator/img/template-alt.png'; $copy_url = '&copycat='; try { $counter = $core->blog->getPosts($params,true); } catch (Exception $e) { $core->error->add($e->getMessage()); } if ($counter->f(0) == 0) { $count = __('No entry'); } elseif ($counter->f(0) == 1) { $count = ''.$counter->f(0).' '.__('entry').''; } else { $count = ''.$counter->f(0).' '.__('entries').''; } } elseif (preg_match('/^widget-(.+)$/',$f->basename)) { $count = ' '; $icon = 'index.php?pf=templator/img/template-widget.png'; $special = $widget_icon; } else { $params['meta_id'] = $f->basename; $params['meta_type'] = 'template'; $params['post_type'] = ''; try { $counter = $core->meta->getPostsByMeta($params,true); } catch (Exception $e) { $core->error->add($e->getMessage()); } if ($counter->f(0) == 0) { $count = ' '; } elseif ($counter->f(0) == 1) { $count = ''.$counter->f(0).' '.__('entry').''; } else { $count = ''.$counter->f(0).' '.__('entries').''; } } $res = '
'. ''. '
'; return $res; } } ?>