Jump to content
Sign in to follow this  

'Вывод Информации Из Доп.полей Dle В Шаблоне Main.tpl'

Recommended Posts

В index.php

$tpl->load_template ( 'main.tpl' );


if( strpos( $tpl->copy_template, "[xfvalue_" ) !== false AND !empty($xfieldsdata) AND !empty($xfields)) {    foreach ( $xfields as $value ) {        $preg_safe_name = preg_quote( $value[0], "'" );        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 = str_replace( "[xfvalue_{$preg_safe_name}]", 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 );

Теперь в main.tpl работает полная поддержка всех доп.полей.
И прошу, не лезьте в файл xfields.txt, создавайте поля ТОЛЬКО через админку!!!

  • Like 1

Правила форума       Правила оформления контента       Приватный форум и чат



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Language
  • стиль

2020 © cmsmafia.ru

  • Create New...

Important Information

Privacy Policy