Данный материал предоставлен сайтом ProWebber.cc исключительно в ознакомительных целях. Администрация не несет ответственности за его содержимое.
Скачать бесплатно Multi-XFields.
Скачать бесплатно Multi-XFields.
И так приступим.
Скачивайте файл указанный ниже и вставьте с заменой в папку engine/inc.
Теперь в файле engine/skins/default.css в самом конце добавьте эти стили.
.xf_filt_sel {
width: 100%;
height: 40px;
float: left;
background: url(images/line_bg.gif) repeat-x bottom;
}
.xf_filt_sel span {line-height: 30px;margin-left: 10px;margin-right: 180px;font-weight: bold;color: #726F69;text-shadow: 0px 1px 0px rgba(255,255,255,0.1);}
ol.sortable {float: left;width: 100%;color: #444;marigin: 0;padding:0;}
ol.sortable li {display: block;float:left;width:100%;border-bottom: 1px dotted #aaa;}
ol.sortable li b {font-weight: normal;float:left;width: 200px;line-height: 25px;text-align: left;}
ol.sortable li b#x_name {margin-left: 10px;}
ol.sortable li b#x_cats {margin-left: 95px;}
ol.sortable li b#x_type {margin-left: 60px;}
ol.sortable li b#yes_no {margin-left: 55px;}
ol.sortable span {float: right;margin-right: 10px;margin-top: 5px;}
Потом в engine/modules/show.short.php замените код с 398 и до 439 строке на этот
// Обработка дополнительных полей
if( $xfound ) {
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$value[0]}]", "", $tpl->copy_template );
}
$xfieldsdata[$value[0]] = stripslashes( $xfieldsdata[$value[0]] );
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$count= intval($matches[1]);
$xfieldsdata[$value[0]] = str_replace( "</p><p>", " ", $xfieldsdata[$value[0]] );
$xfieldsdata[$value[0]] = strip_tags( $xfieldsdata[$value[0]], "<br>" );
$xfieldsdata[$value[0]] = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $xfieldsdata[$value[0]] ) ) ) ));
if( $count AND dle_strlen( $xfieldsdata[$value[0]], $config['charset'] ) > $count ) {
$xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $count, $config['charset'] );
if( ($temp_dmax = dle_strrpos( $xfieldsdata[$value[0]], ' ', $config['charset'] )) ) $xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $temp_dmax, $config['charset'] );
}
$tpl->set( $matches[0], $xfieldsdata[$value[0]] );
} else {
if ( dle_strrpos( $xfieldsdata[$value[0]], "~~", $config['charset'] ) ) {
$valcb = explode("\r\n", $value[4]);
$selcb = explode("~~", $xfieldsdata[$value[0]] );
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template( 'xfield_checkbox.tpl' );
foreach( $selcb as $seldata) {
$tpl2->set( '{name}', str_replace("'", "'", $valcb[$seldata]) );
$tpl2->compile( 'xfield_checkbox' );
}
$xfieldsdata[$value[0]] = $tpl2->result['xfield_checkbox'];
}
$tpl->copy_template = str_replace( "[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template );
}
}
}
// Обработка дополнительных полей
В engine/modules/show.full.php замените код с 813 и до 853 строке на этот
if( $xfound ) {
$xfieldsdata = xfieldsdataload( $related['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl2->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[xfnotgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[/xfnotgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
} else {
$tpl2->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[xfgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[/xfgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
}
$tpl2->copy_template = str_replace( "[xfvalue_{$preg_safe_name}]", stripslashes( $xfieldsdata[$value[0]] ), $tpl2->copy_template );
}
}
Потом в engine/modules/show.custom.php замените код с 324 и до 362 строке на этот
// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$value[0]}]", "", $tpl->copy_template );
}
$xfieldsdata[$value[0]] = stripslashes( $xfieldsdata[$value[0]] );
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$count= intval($matches[1]);
$xfieldsdata[$value[0]] = str_replace( "</p><p>", " ", $xfieldsdata[$value[0]] );
$xfieldsdata[$value[0]] = strip_tags( $xfieldsdata[$value[0]], "<br>" );
$xfieldsdata[$value[0]] = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $xfieldsdata[$value[0]] ) ) ) ));
if( $count AND dle_strlen( $xfieldsdata[$value[0]], $config['charset'] ) > $count ) {
$xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $count, $config['charset'] );
if( ($temp_dmax = dle_strrpos( $xfieldsdata[$value[0]], ' ', $config['charset'] )) ) $xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $temp_dmax, $config['charset'] );
}
$tpl->set( $matches[0], $xfieldsdata[$value[0]] );
} else {
if ( dle_strrpos( $xfieldsdata[$value[0]], "~~", $config['charset'] ) ) {
$valcb = explode("\r\n", $value[4]);
$selcb = explode("~~", $xfieldsdata[$value[0]] );
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template( 'xfield_checkbox.tpl' );
foreach( $selcb as $seldata) {
$tpl2->set( '{name}', str_replace("'", "'", $valcb[$seldata]) );
$tpl2->compile( 'xfield_checkbox' );
}
$xfieldsdata[$value[0]] = $tpl2->result['xfield_checkbox'];
}
$tpl->copy_template = str_replace( "[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template );
}
}
// Обработка дополнительных полей
Потом в engine/modules/search.php замените код с 1026 и до 1066 строке на этот
// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$preg_safe_name}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$preg_safe_name}]", "", $tpl->copy_template );
}
$xfields_val = stripslashes($xfieldsdata[$value[0]]);
$tpl->copy_template = preg_replace( "'\\[xfvalue_{$preg_safe_name}\\]'i", $xfields_val, $tpl->copy_template );
}
// Обработка дополнительных полей
Эти Допо.поля выводятся стандартным образом.
Скачивайте файл указанный ниже и вставьте с заменой в папку engine/inc.
Теперь в файле engine/skins/default.css в самом конце добавьте эти стили.
.xf_filt_sel {
width: 100%;
height: 40px;
float: left;
background: url(images/line_bg.gif) repeat-x bottom;
}
.xf_filt_sel span {line-height: 30px;margin-left: 10px;margin-right: 180px;font-weight: bold;color: #726F69;text-shadow: 0px 1px 0px rgba(255,255,255,0.1);}
ol.sortable {float: left;width: 100%;color: #444;marigin: 0;padding:0;}
ol.sortable li {display: block;float:left;width:100%;border-bottom: 1px dotted #aaa;}
ol.sortable li b {font-weight: normal;float:left;width: 200px;line-height: 25px;text-align: left;}
ol.sortable li b#x_name {margin-left: 10px;}
ol.sortable li b#x_cats {margin-left: 95px;}
ol.sortable li b#x_type {margin-left: 60px;}
ol.sortable li b#yes_no {margin-left: 55px;}
ol.sortable span {float: right;margin-right: 10px;margin-top: 5px;}
Потом в engine/modules/show.short.php замените код с 398 и до 439 строке на этот
// Обработка дополнительных полей
if( $xfound ) {
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$value[0]}]", "", $tpl->copy_template );
}
$xfieldsdata[$value[0]] = stripslashes( $xfieldsdata[$value[0]] );
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$count= intval($matches[1]);
$xfieldsdata[$value[0]] = str_replace( "</p><p>", " ", $xfieldsdata[$value[0]] );
$xfieldsdata[$value[0]] = strip_tags( $xfieldsdata[$value[0]], "<br>" );
$xfieldsdata[$value[0]] = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $xfieldsdata[$value[0]] ) ) ) ));
if( $count AND dle_strlen( $xfieldsdata[$value[0]], $config['charset'] ) > $count ) {
$xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $count, $config['charset'] );
if( ($temp_dmax = dle_strrpos( $xfieldsdata[$value[0]], ' ', $config['charset'] )) ) $xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $temp_dmax, $config['charset'] );
}
$tpl->set( $matches[0], $xfieldsdata[$value[0]] );
} else {
if ( dle_strrpos( $xfieldsdata[$value[0]], "~~", $config['charset'] ) ) {
$valcb = explode("\r\n", $value[4]);
$selcb = explode("~~", $xfieldsdata[$value[0]] );
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template( 'xfield_checkbox.tpl' );
foreach( $selcb as $seldata) {
$tpl2->set( '{name}', str_replace("'", "'", $valcb[$seldata]) );
$tpl2->compile( 'xfield_checkbox' );
}
$xfieldsdata[$value[0]] = $tpl2->result['xfield_checkbox'];
}
$tpl->copy_template = str_replace( "[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template );
}
}
}
// Обработка дополнительных полей
В engine/modules/show.full.php замените код с 813 и до 853 строке на этот
if( $xfound ) {
$xfieldsdata = xfieldsdataload( $related['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl2->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[xfnotgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[/xfnotgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
} else {
$tpl2->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[xfgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
$tpl2->copy_template = str_replace( "[/xfgiven_{$preg_safe_name}]", "", $tpl2->copy_template );
}
$tpl2->copy_template = str_replace( "[xfvalue_{$preg_safe_name}]", stripslashes( $xfieldsdata[$value[0]] ), $tpl2->copy_template );
}
}
Потом в engine/modules/show.custom.php замените код с 324 и до 362 строке на этот
// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$value[0]}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$value[0]}]", "", $tpl->copy_template );
}
$xfieldsdata[$value[0]] = stripslashes( $xfieldsdata[$value[0]] );
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$count= intval($matches[1]);
$xfieldsdata[$value[0]] = str_replace( "</p><p>", " ", $xfieldsdata[$value[0]] );
$xfieldsdata[$value[0]] = strip_tags( $xfieldsdata[$value[0]], "<br>" );
$xfieldsdata[$value[0]] = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $xfieldsdata[$value[0]] ) ) ) ));
if( $count AND dle_strlen( $xfieldsdata[$value[0]], $config['charset'] ) > $count ) {
$xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $count, $config['charset'] );
if( ($temp_dmax = dle_strrpos( $xfieldsdata[$value[0]], ' ', $config['charset'] )) ) $xfieldsdata[$value[0]] = dle_substr( $xfieldsdata[$value[0]], 0, $temp_dmax, $config['charset'] );
}
$tpl->set( $matches[0], $xfieldsdata[$value[0]] );
} else {
if ( dle_strrpos( $xfieldsdata[$value[0]], "~~", $config['charset'] ) ) {
$valcb = explode("\r\n", $value[4]);
$selcb = explode("~~", $xfieldsdata[$value[0]] );
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template( 'xfield_checkbox.tpl' );
foreach( $selcb as $seldata) {
$tpl2->set( '{name}', str_replace("'", "'", $valcb[$seldata]) );
$tpl2->compile( 'xfield_checkbox' );
}
$xfieldsdata[$value[0]] = $tpl2->result['xfield_checkbox'];
}
$tpl->copy_template = str_replace( "[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template );
}
}
// Обработка дополнительных полей
Потом в engine/modules/search.php замените код с 1026 и до 1066 строке на этот
// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload( $row['xfields'] );
foreach ( $xfields as $value ) {
$preg_safe_name = preg_quote( $value[0], "'" );
if ( $value[6] AND !empty( $xfieldsdata[$value[0]] ) ) {
$temp_array = explode( ",", $xfieldsdata[$value[0]] );
$value3 = array();
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] == "yes" ) $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if( empty( $xfieldsdata[$value[0]] ) ) {
$tpl->copy_template = preg_replace( "'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template );
} else {
$tpl->copy_template = preg_replace( "'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[xfgiven_{$preg_safe_name}]", "", $tpl->copy_template );
$tpl->copy_template = str_replace( "[/xfgiven_{$preg_safe_name}]", "", $tpl->copy_template );
}
$xfields_val = stripslashes($xfieldsdata[$value[0]]);
$tpl->copy_template = preg_replace( "'\\[xfvalue_{$preg_safe_name}\\]'i", $xfields_val, $tpl->copy_template );
}
// Обработка дополнительных полей
Эти Допо.поля выводятся стандартным образом.