Kategori sayfaları için bilgileri manuel girmej yerine o kategori ile ilgili bilgileri veritabanından çekmek için tasarlanmıştır.
Düzenleme sonrasında main.tpl dosyanızda o an görüntülenen makelenin kategorisinin veya kategori sayfasının bilglerini çekebilirsiniz.
Kategory açıklamasını çeker :
{category echo="description"}$config['http_home_url'] = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) );// MWS Category Echo
if (stripos ( $tpl->copy_template, "{category" ) !== false) {
$tpl->copy_template = preg_replace_callback ( "#\\{category(.+?)\\}#i", "custom_cat_print", $tpl->copy_template );
}
// MWS Category Echofunction custom_print( $matches=array() ) {// MWS Category Echo
function custom_cat_print( $matches = array() ) {
global $db, $cat_info, $config, $user_group, $category_id, $_TIME, $lang, $category_id, $PHP_SELF;
if ( !count($matches) ) return "";
$param_str = trim( $matches[1] );
if( preg_match( "#echo=['\"](.+?)['\"]#i", $param_str, $match ) ) {
$echo = $db->safesql( trim( $match[1] ) );
if ( $echo == "name" ) { $key = "name"; }
else if ( $echo == "url" ) { $key = "alt_name"; }
else if ( $echo == "description" ) { $key = "descr"; }
else if ( $echo == "keywords" ) { $key = "keywords"; }
else if ( $echo == "title" ) { $key = "metatitle"; }
else if ( $echo == "id" ) { $key = "id"; }
else {
if ( in_array( $echo, array_keys( $cat_info[ $category_id ] ) ) ) {
$key = $echo;
}
}
//echo "Value :" . $echo . "<br />Index : " . $key;
return $cat_info[ $category_id ][ $key ];
} else return "";
}
// MWS Category Echo