DLE主题:自适应新闻模板DLE ANN4,基于bootstrap4 UI框架
新的bootstrap4上的模板是如此清晰、简单和容易,我决定为你发布它!
新的 bootstrap4,许多功能,功能,新网格,用于用户列表和主页面统计的模块,切换短消息的类型。使用 animate.css 平滑动画。标题中的浮动菜单等等。
该模板很容易适应几乎任何主题,无论是视频内容还是普通博客。
添加 用户列表 迷你统计 Ajax 短新闻视图 三个模块
- 项目名称 ANN4
- DataLife 引擎版本 11.x 及以上
- 新闻/博客模板的主题
- 应用编码UTF-8 / Win-1251
- 框架,bootstrap4基础
用户列表。
将 users.php文件放在engine/modules/ 目录 下
打开 /engine/engine.php文件,找到一行:
case "pm" :
include ENGINE_DIR . '/modules/pm.php';
break;
粘贴在下面:
case "users" :
include ENGINE_DIR . '/modules/users.php';
break;
寻找线:
elseif ($do == 'pm') $nam_e = $lang['title_pm'];
在下面插入:
elseif ($do == 'users') $nam_e = "Список пользователей";
准备好!该列表位于 :http://yoursite.ru/index.php?do=users主页统计:
将 zpstats .php文件放在engine/modules/目录 中
完成!
Ajax 切换短消息的外观:
将 ajax_temp.php文件放在engine/ajax/ 目录 下
打开 engine/engine.php 文件并找到以下行:
$cache_prefix .= "_tempate_" . $config['skin'];
粘贴在下面:
$user_short_tpl = array(
'default' => 'shortstory.tpl',
'list' => 'shortstory_list.tpl',
'tablet' => 'shortstory_tablet.tpl'
);
$user_tpl =(isset($_COOKIE['short_template']) && isset($user_short_tpl[$_COOKIE['short_template']])) ? $_COOKIE['short_template'] : "default";
$cache_prefix .= "_".$user_tpl;
打开文件 /engine/modules/show.short.php 找到这一行:
if( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' );
else $tpl->load_template( 'shortstory.tpl' );
取而代之:
$user_short_tpl = array(
'default' => 'shortstory.tpl',
'list' => 'shortstory_list.tpl',
'tablet' => 'shortstory_tablet.tpl'
);
if($template_ajax)
$user_tpl = $user_short_tpl[$template_ajax];
else
$user_tpl =(isset($_COOKIE['short_template']) && isset($user_short_tpl[$_COOKIE['short_template']])) ? $user_short_tpl[$_COOKIE['short_template']] : $user_short_tpl["default"];
if( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' );
else{ $tpl->load_template($user_tpl);}
打开文件 /engine/modules/main.php 找到这一行:
$tpl->set ( '{speedbar}', $tpl->result['speedbar'] );
粘贴在下面:
$tpl->set ( '{id_cat}', $category_id );
$tpl->set ( '{cstart}', intval($_REQUEST["cstart"]) );
if(isset($_COOKIE['short_template']))
{
if($_COOKIE['short_template'] == "default")
{
$tpl->set_block( "'\\[default\\](.*?)\\[/default\\]'si", "\\1" );
$tpl->set_block( "'\\[list\\](.*?)\\[/list\\]'si", "" );
$tpl->set_block( "'\\[table\\](.*?)\\[/table\\]'si", "" );
}
elseif($_COOKIE['short_template'] == "list")
{
$tpl->set_block( "'\\[default\\](.*?)\\[/default\\]'si", "" );
$tpl->set_block( "'\\[list\\](.*?)\\[/list\\]'si", "\\1" );
$tpl->set_block( "'\\[table\\](.*?)\\[/table\\]'si", "" );
}
else
{
$tpl->set_block( "'\\[default\\](.*?)\\[/default\\]'si", "" );
$tpl->set_block( "'\\[list\\](.*?)\\[/list\\]'si", "" );
$tpl->set_block( "'\\[table\\](.*?)\\[/table\\]'si", "\\1" );
}
}
else
{
$tpl->set_block( "'\\[default\\](.*?)\\[/default\\]'si", "\\1" );
$tpl->set_block( "'\\[list\\](.*?)\\[/list\\]'si", "" );
$tpl->set_block( "'\\[table\\](.*?)\\[/table\\]'si", "" );
}
准备好!
外貌
打开文件 engine/modules/show.custom.php ;show.full.php ; show.short.php找到这一行:
<a href=\"" . $config['http_home_url'] . "tags/" . urlencode( $value ) . "/\">" . $value . "</a>
在三个文件中,将这一行替换为:
<a class=\"badge badge-light\" href=\"" . $config['http_home_url'] . "tags/" . urlencode( $value ) . "/\">" . $value . "</a>
在所有 3 个文件中查找:
$tpl->set( '{login}', $row['autor'] );
粘贴在下面:
$sql = $db->super_query("SELECT foto FROM ".PREFIX."_users WHERE name='{$row['autor']}'");
if (count(explode("@", $sql['foto'])) == 2) {
$tpl->set('{foto}', '//www.gravatar.com/avatar/' . md5(trim($sql['foto'])) . '?s=' . intval($user_group[$sql['user_group']]['max_foto']));
} else {
if ($sql['foto']) {
if (strpos($sql['foto'], "//") === 0)
$avatar = "http:" . $sql['foto'];
else
$avatar = $sql['foto'];
$avatar = @parse_url($avatar);
if ($avatar['host']) {
$tpl->set('{foto}', $sql['foto']);
} else
$tpl->set('{foto}', $config['http_home_url'] . "uploads/fotos/" . $sql['foto']);
} else
$tpl->set('{foto}', "{THEME}/dleimages/noavatar.png");
}
打开文件 engine/modules/main.php找到这一行:
echo $tpl->result['main'];
在上面插入:
$tpl->result['main'] = str_replace("Гость", $is_logged?$member_id['name']:'Гость', $tpl->result['main']);
查找行:
$tpl->set ( '{speedbar}', $tpl->result['speedbar'] );
粘贴在下面:
if($member_id["foto"])
{
if ( count(explode("@", $member_id["foto"])) == 2 ) {
$tpl->set( '{foto}', '//www.gravatar.com/avatar/' . md5(trim($member_id["foto"])) . '?s=' . intval($user_group[$member_id['user_group']]['max_foto']) );
} else {
if( $member_id["foto"] ) {
if (strpos($member_id["foto"], "//") === 0) $avatar = "http:".$member_id['foto']; else $avatar = $member_id['foto'];
$avatar = @parse_url ( $avatar );
if( $avatar['host'] ) {
$tpl->set( '{foto}', $member_id["foto"] );
} else $tpl->set( '{foto}', $config['http_home_url'] . "uploads/fotos/" . $member_id['foto'] );
} else $tpl->set( '{foto}', "{THEME}/dleimages/noavatar.png" );
}
}
else $tpl->set( '{foto}', "{THEME}/dleimages/noavatar.png" );
查找行:
$tpl->set ( '{content}', "<div id='dle-content'>" . $tpl->result['content'] . "</div>" );
将其替换为:
$tpl->set ( '{content}', "<div id='dle-content' class='row row-flex row-flex-wrap my'>" . $tpl->result['content'] . "</div>" );
打开文件 engine/modules/show.full.php找到这一行:
$tpl->load_template( 'addcomments.tpl' );
粘贴在下面:
if($member_id["foto"])
{
if ( count(explode("@", $member_id["foto"])) == 2 ) {
$tpl->set( '{foto}', '//www.gravatar.com/avatar/' . md5(trim($member_id["foto"])) . '?s=' . intval($user_group[$member_id['user_group']]['max_foto']) );
} else {
if( $member_id["foto"] ) {
if (strpos($member_id["foto"], "//") === 0) $avatar = "http:".$member_id['foto']; else $avatar = $member_id['foto'];
$avatar = @parse_url ( $avatar );
if( $avatar['host'] ) {
$tpl->set( '{foto}', $member_id["foto"] );
} else $tpl->set( '{foto}', $config['http_home_url'] . "uploads/fotos/" . $member_id['foto'] );
} else $tpl->set( '{foto}', "{THEME}/dleimages/noavatar.png" );
}
}
else $tpl->set( '{foto}', "{THEME}/dleimages/noavatar.png" );
打开文件 engine/modules/functions.php找到这一行:
<a href=\"#\" onclick=\"dle_change_sort('{$value['value']}','{$value['direction']}'); return false;\">" . $value['name'] . "</a>
取而代之:
<a href=\"#\" class=\"dropdown-item\" onclick=\"dle_change_sort('{$value['value']}','{$value['direction']}'); return false;\">" . $value['name'] . "</a>
下载地址