Makaleler için kullandığımız ilave alanlar ile aynı mantık ile çalışan bu düzenleme ile fullstory.tpl veya shortstory.tpl dosyalarınızda bulunduğu kategoriye ait bilgileri çektirebilirsiniz.İlave alan tipleri olarak text, textarea, select bulunmakta.Select için değerleri belirlemekte özgürsünüz
MWS Category XField
Kurulum :
Dosyaları upload edin ve aşağıdaki düzenlemeleri yapın.
İlave alan ayarlamalarını engine/data/catxfields.txt dosyasından yapabilirsiniz.
phpMyAdmin'den aşağıdaki SQL'i sorgulayın.
ALTER TABLE dle_category ADD COLOUMN xfields text;if( strpos( $tpl->copy_template, "[catlist=" ) !== false ) { // MWS Category XField
if ( strpos( $tpl->copy_template, "{if cxfield=" ) ) {
require_once ENGINE_DIR . "/inc/include/functions.xfield.php";
$xfdata = $xf->load( $cat_info[ $category_id ]['xfields'] );
if ( preg_match_all( "#\{if cxfield=['\"](.+?)['\"]\}[\s\n\t]*(.+?)[\s\n\t]*\{\/if\}#im", $tpl->copy_template, $matches1 ) ) {
$length = count( $matches1[0] );
for ( $x = 0; $x <= $length; $x++ ) {
if ( in_array( $matches1[1][$x], array_keys( $xfdata ) ) ) {
$matches1[2][$x] = str_replace( "{cxfield_" . $matches1[1][$x] . "}", $xfdata[ $matches1[1][$x] ], $matches1[2][$x] );
$tpl->copy_template = str_replace( $matches1[0][$x], $matches1[2][$x], $tpl->copy_template );
} else {
$tpl->copy_template = str_replace( $matches1[0][$x], "", $tpl->copy_template );
}
}
}
unset( $xfdata, $matches1 );
}
// MWS Category XField
$db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, alt_name, // MWS Category XField
require_once ENGINE_DIR . "/inc/include/functions.xfield.php";
$xfields = $xf->parse( $_POST['catxf'], &$db );
// MWS Category XField$db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, alt_name, icon, skin, descr, keywords, news_sort, news_msort, news_number, short_tpl, full_tpl, metatitle) values ('$category', '$cat_name', '$alt_cat_name', '$cat_icon', '$skin_name', '$description', '$keywords', '$news_sort', '$news_msort', '$news_number', '$short_tpl', '$full_tpl', '$meta_title')" );$db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, alt_name, icon, skin, descr, keywords, news_sort, news_msort, news_number, short_tpl, full_tpl, metatitle, xfields) values ('$category', '$cat_name', '$alt_cat_name', '$cat_icon', '$skin_name', '$description', '$keywords', '$news_sort', '$news_msort', '$news_number', '$short_tpl', '$full_tpl', '$meta_title', '$xfields')" );$row['news_msort'] = makeDropDown( array ("" => $lang['sys_global'], "DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "news_msort", $row['news_msort'] ); // MWS Category XField
require_once ENGINE_DIR . "/inc/include/functions.xfield.php";
$xfielddata = $xf->load( $row['xfields'] );
$xfields = $xf->get( );
$mws_cat_xf = $xf->resulter( $xfields, $xfielddata );
// MWS Category XField <tr>
<td colspan="2"><div class="hr_line"></div></td>
</tr>
<tr>
<td style="padding:4px;"> </td>
<td><input type="submit" class="btn btn-success" value=" {$lang['vote_edit']} ">
<input type=hidden name=action value=doedit>
<input type="hidden" name="user_hash" value="$dle_login_hash" />
<input type=hidden name=catid value=$row[id]>
</tr> <tr>
<td colspan="2"><div class="hr_line"></div></td>
</tr>
<!-- MWS Category XField -->
{$mws_cat_xf}
<!-- MWS Category XField -->$db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', // MWS Category XField
require_once ENGINE_DIR . "/inc/include/functions.xfield.php";
$xfields = $xf->parse( $_POST['catxf'], &$db );
// MWS Category XField$db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', icon='$cat_icon', skin='$skin_name', descr='$description', keywords='$keywords', news_sort='$news_sort', news_msort='$news_msort', news_number='$news_number', short_tpl='$short_tpl', full_tpl='$full_tpl', metatitle='$meta_title' WHERE id='$catid'" );$db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', icon='$cat_icon', skin='$skin_name', descr='$description', keywords='$keywords', news_sort='$news_sort', news_msort='$news_msort', news_number='$news_number', short_tpl='$short_tpl', full_tpl='$full_tpl', metatitle='$meta_title', xfields='{$xfields}' WHERE id='$catid'" );$skinlist = SelectSkin( '' );// MWS Category XField
require_once ENGINE_DIR . "/inc/include/functions.xfield.php";
$xfields = $xf->get( );
$mws_cat_xf = $xf->resulter( $xfields );
// MWS Category XField <tr>
<td colspan="2"><div class="hr_line"></div></td>
</tr>
<tr>
<td style="padding:4px;"> </td>
<td><input type="submit" class="btn btn-success" value=" {$lang['vote_new']} ">
<input type=hidden name=mod value=categories>
<input type="hidden" name="user_hash" value="$dle_login_hash" />
<input type=hidden name=action value=add></td>
</tr> <tr>
<td colspan="2"><div class="hr_line"></div></td>
</tr>
<!-- MWS Category XField -->
{$mws_cat_xf}
<!-- MWS Category XField -->