Дополнительные поля в модальных окнах

Используем дополнительные поля в модальных окнах.

Автор: AiosИспользуем дополнительные поля в модальных окнах.

Зайти в /engine/ajax/profile.php

Найти:

require_once ENGINE_DIR . ‘/classes/templates.class.php’;

Добавить ниже:

require_once ENGINE_DIR . ‘/classes/parse.class.php’;

Найти:

$tpl->set( ‘{rate}’, userrating( $row[‘name’] ) );

Добавить ниже:


$xfieldsaction = «list»;
$parse = new ParseFilter( Array (), Array (), 1, 1 );
$xfieldsadd = false;
$xfieldsid = $row[‘xfields’];
include (ENGINE_DIR . ‘/inc/userfields.php’);
$tpl->set( ‘
<script type=»text/javascript»>
<!—
  var item = null;
  if (document.getElementById) {
    item = document.getElementById(«category»);
  } else if (document.all) {
    item = document.all[«category»];
  } else if (document.layers) {
    item = document.layers[«category»];
  }
  if (item) {
    onCategoryChange(item.value);
  }
// —>
</script>’, $output );

// Обработка дополнительных полей
$xfieldsdata = xfieldsdataload( $row[‘xfields’] );

foreach ( $xfields as $value ) {
  $preg_safe_name = preg_quote( $value[0], «‘» );

  if( $value[5] != 1 or ($is_logged and $member_id[‘user_group’] == 1) or ($is_logged and $member_id[‘user_id’] == $row[‘user_id’]) ) {
   if( empty( $xfieldsdata[$value[0]] ) ) {
    $tpl->copy_template = preg_replace( «‘\[xfgiven_{$preg_safe_name}\](.*?)\[/xfgiven_{$preg_safe_name}\]’is», «», $tpl->copy_template );
   } else {
    $tpl->copy_template = preg_replace( «‘\[xfgiven_{$preg_safe_name}\](.*?)\[/xfgiven_{$preg_safe_name}\]’is», «\1», $tpl->copy_template );
   }
   $tpl->copy_template = preg_replace( «‘\[xfvalue_{$preg_safe_name}\]’i», stripslashes( $xfieldsdata[$value[0]] ), $tpl->copy_template );
  } else {
   $tpl->copy_template = preg_replace( «‘\[xfgiven_{$preg_safe_name}\](.*?)\[/xfgiven_{$preg_safe_name}\]’is», «», $tpl->copy_template );
   $tpl->copy_template = preg_replace( «‘\[xfvalue_{$preg_safe_name}\]’i», «», $tpl->copy_template );
  }
}
// Обработка дополнительных полей


Пользуемся

Вы можете оставить комментарий, или ссылку на Ваш сайт.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *