Есть сайт с фильмами и некоторые вещи такие как качество, формат и др. выводятся через доп. поля.
Как в ДЛЕ 10.1 сделать чтобы эти доп. поля при добавлении новости из админки автоматически прописывались в теги?
include (ENGINE_DIR . '/inc/xfields.php');
$filecontents = array ();
if( $config['safe_xfield'] ) {
$parse->ParseFilter();
$parse->safe_mode = true;
} else {
$parse = new ParseFilter( Array (), Array (), 1, 1 );
}
if( ! empty( $postedxfields ) ) {
foreach ( $postedxfields as $xfielddataname => $xfielddatavalue ) {
if( $xfielddatavalue == "" ) {
continue;
}
$parse->allow_code = true;
$xfielddatavalue = $db->safesql( $parse->BB_Parse( $parse->process( $xfielddatavalue ), false ) );
$xfielddataname = $db->safesql( $xfielddataname );
$xfielddataname = str_replace( "|", "|", $xfielddataname );
$xfielddataname = str_replace( "\r\n", "__NEWL__", $xfielddataname );
$xfielddatavalue = str_replace( "|", "|", $xfielddatavalue );
$xfielddatavalue = str_replace( "\r\n", "__NEWL__", $xfielddatavalue );
$filecontents[] = "$xfielddataname|$xfielddatavalue";
}
$filecontents = implode( "||", $filecontents );
} else
$filecontents = '';
//xak tegov
$polya=$postedxfields;
$vpolya['year']=array();
$vpolya['year']=explode( ",", $polya['year']);
foreach ( $vpolya['year'] as $value ){
$_POST['tags'].=','.trim($value);
}
$vpolya['country']=array();
$vpolya['country']=explode( ",", $polya['country']);
foreach ( $vpolya['country'] as $value ){
$_POST['tags'].=','.trim($value);
}
$vpolya['director']=array();
$vpolya['director']=explode( ",", $polya['director']);
foreach ( $vpolya['director'] as $value ){
$_POST['tags'].=','.trim($value);
}
$vpolya['quality']=array();
$vpolya['quality']=explode( ",", $polya['quality']);
foreach ( $vpolya['quality'] as $value ){
$_POST['tags'].=','.trim($value);
}
$vpolya['format']=array();
$vpolya['format']=explode( ",", $polya['format']);
foreach ( $vpolya['format'] as $value ){
$_POST['tags'].=','.trim(strtoupper($value));
}
$vpolya['actors']=array();
$vpolya['actors']=explode( ",", $polya['actors']);
foreach ( $vpolya['actors'] as $value ){
$_POST['tags'].=','.trim($value);
}
$bukvic=strtoupper(substr($title, 0, 1));
$_POST['tags']= explode( ",", $_POST['tags'] );
$tags2='';
foreach ( $_POST['tags'] as $value ) {
$tags2.=trim($value).',';
}
$tags2 = rtrim($tags2,",");
$_POST['tags'] = $tags2;
// end автозаполнение
if( $alt_name == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false );
else $alt_name = totranslit( $alt_name, true, false );
но сейчас в ДЛЕ 10.1 там такой код:
include (ENGINE_DIR . '/inc/xfields.php');
if( $alt_name == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false );
else $alt_name = totranslit( $alt_name, true, false );