Add to folder menu template in the right place to insert in the template file main.tpl:
{include file="/menu/menu.tpl"}
Download
{include file="/menu/menu.tpl"}
Download
ALTER TABLE `dle_category` ADD `main_tpl` VARCHAR( 40 ) NOT NULL AFTER `full_tpl`;
If you have another prefix, change dle on his own.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' );
if( strpos( $tpl->copy_template, "[xfvalue_" ) !== false OR strpos( $tpl->copy_template, "[xfgiven_" ) !== false ) { $xfound = true; $xfields = xfieldsload();}
else $xfound = false;
if( count( $banners ) AND $config['allow_banner'] AND !$smartphone_detected) {
$news_c = 1;
if( isset( $ban_short ) ) {
for($indx = 0, $max = sizeof( $ban_short['top'] ), $banners_topz = ''; $indx < $max; $indx ++)
if( $ban_short['top'][$indx]['zakr'] ) {
$banners_topz .= $ban_short['top'][$indx]['text'];
unset( $ban_short['top'][$indx] );
}
for($indx = 0, $max = sizeof( $ban_short['cen'] ), $banners_cenz = ''; $indx < $max; $indx ++)
if( $ban_short['cen'][$indx]['zakr'] ) {
$banners_cenz .= $ban_short['cen'][$indx]['text'];
unset( $ban_short['cen'][$indx] );
}
for($indx = 0, $max = sizeof( $ban_short['down'] ), $banners_downz = ''; $indx < $max; $indx ++)
if( $ban_short['down'][$indx]['zakr'] ) {
$banners_downz .= $ban_short['down'][$indx]['text'];
unset( $ban_short['down'][$indx] );
}
$middle = floor( $config['news_number'] / 2 );
$middle_s = floor( ($middle - 1) / 2 );
$middle_e = floor( $middle + (($config['news_number'] - $middle) / 2) + 1 );
}
}
3) OPEN File engine/modules/show.short.php AND SEARCH : while ( $row = $db->get_row( $sql_result ) ) {
INSERT THE FOLLOWING : $cat_tpl = explode( ',', $row['category'] );
if($category_id and $cat_info[$category_id]['short_tpl'] != '' ) {
$tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' );
} elseif( !$category_id and $cat_info[$cat_tpl[0]]['main_tpl'] != '') {
$tpl->load_template( $cat_info[$cat_tpl[0]]['main_tpl'] . '.tpl' );
} else {
$tpl->load_template( 'shortstory.tpl' );
}
if( strpos( $tpl->copy_template, "[xfvalue_" ) !== false OR strpos( $tpl->copy_template, "[xfgiven_" ) !== false ) { $xfound = true; $xfields = xfieldsload();}
else $xfound = false;
if( count( $banners ) AND $config['allow_banner'] AND !$smartphone_detected) {
$news_c = 1;
if( isset( $ban_short ) ) {
for($indx = 0, $max = sizeof( $ban_short['top'] ), $banners_topz = ''; $indx < $max; $indx ++)
if( $ban_short['top'][$indx]['zakr'] ) {
$banners_topz .= $ban_short['top'][$indx]['text'];
unset( $ban_short['top'][$indx] );
}
for($indx = 0, $max = sizeof( $ban_short['cen'] ), $banners_cenz = ''; $indx < $max; $indx ++)
if( $ban_short['cen'][$indx]['zakr'] ) {
$banners_cenz .= $ban_short['cen'][$indx]['text'];
unset( $ban_short['cen'][$indx] );
}
for($indx = 0, $max = sizeof( $ban_short['down'] ), $banners_downz = ''; $indx < $max; $indx ++)
if( $ban_short['down'][$indx]['zakr'] ) {
$banners_downz .= $ban_short['down'][$indx]['text'];
unset( $ban_short['down'][$indx] );
}
$middle = floor( $config['news_number'] / 2 );
$middle_s = floor( ($middle - 1) / 2 );
$middle_e = floor( $middle + (($config['news_number'] - $middle) / 2) + 1 );
}
}
4) OPEN file engine/inc/categories.php AND SEARCH (2 times) : if ( $_POST['short_tpl'] ) {
$url = @parse_url ( $_POST['short_tpl'] );
$file_path = dirname (clear_url_dir($url['path']));
$tpl_name = pathinfo($url['path']);
$tpl_name = totranslit($tpl_name['basename']);
if ($file_path AND $file_path != ".") $tpl_name = $file_path."/".$tpl_name;
$short_tpl = $tpl_name;
} else $short_tpl = "";
INSERT BELOW (2 times) : if ( $_POST['main_tpl'] ) {
$url = @parse_url ( $_POST['main_tpl'] );
$file_path = dirname (clear_url_dir($url['path']));
$tpl_name = pathinfo($url['path']);
$tpl_name = totranslit($tpl_name['basename']);
if ($file_path AND $file_path != ".") $tpl_name = $file_path."/".$tpl_name;
$main_tpl = $tpl_name;
} else $main_tpl = "";
5) OPEN file engine/inc/categories.php AND SEARCH full_tpl='$full_tpl'
Replace with : full_tpl='$full_tpl', main_tpl='$main_tpl'
6) OPEN file engine/inc/categories.php AND SEARCH : <div class="form-group">
<label class="control-label col-lg-2">{$lang['cat_f_tpl']}</label>
<div class="col-lg-10">
<input style="width:100%;max-width:200px;" type="text" name="full_tpl">.tpl <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="right" data-content="{$lang['cat_f_tpl_hit']}" >?</span>
</div>
</div>
INSERT THE FOLLOWING : <div class="form-group">
<label class="control-label col-lg-2">{$lang['cat_m_tpl']}</label>
<div class="col-lg-10">
<input style="width:100%;max-width:200px;" type="text" name="main_tpl">.tpl <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="right" data-content="{$lang[cat_m_tpl_hit]}" >?</span>
</div>
</div>
7) OPEN file engine/inc/categories.php AND SEARCH : short_tpl, full_tpl
Replace with : short_tpl, full_tpl, main_tpl
8) OPEN file engine/inc/categories.php AND SEARCH : '$short_tpl', '$full_tpl'
Replace with : '$short_tpl', '$full_tpl', '$main_tpl'
9) OPEN file engine/inc/categories.php AND SEARCH : <div class="form-group">
<label class="control-label col-lg-2">{$lang['cat_f_tpl']}</label>
<div class="col-lg-10">
<input style="width:100%;max-width:200px;" type="text" name="full_tpl" value="{$row['full_tpl']}">.tpl <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="right" data-content="{$lang['cat_f_tpl_hit']}" >?</span>
</div>
</div>
INSERT THE FOLLOWING : <div class="form-group">
<label class="control-label col-lg-2">{$lang['cat_m_tpl']}</label>
<div class="col-lg-10">
<input style="width:100%;max-width:200px;" type="text" name="main_tpl" value="{$row['main_tpl']}">.tpl <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="right" data-content="{$lang[cat_m_tpl_hit]}" >?</span>
</div>
</div>
10) OPEN file language/English/adminpanel.lng AND SEARCH : 'cat_f_tpl' => "Full news template",
INSERT ABOVE : 'cat_m_tpl' => "Pattern Short News",
'cat_m_tpl_hit' => "In addition to the appointment of a separate template for this category, you can specify only a single template file for display on the main news summary. You can leave this field blank, then it will load the standard template file <b>shortstory.tpl</b>",
<?PHP
@error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
@ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
@ini_set ( 'display_errors', true );
@ini_set ( 'html_errors', false );
define ( 'ROOT_DIR', dirname ( __FILE__ ) );
if(!$_GET['href']) die('Undefinded href');
$href = md5($_GET['href']);
$stat = unserialize(file_get_contents(ROOT_DIR."/stats.txt"));
if(!$stat[$href]) $stat[$href] = 0;
if($_GET['type']=='set'){
$stat[$href]++;
file_put_contents(ROOT_DIR. "/stats.txt", serialize($stat), LOCK_EX);
}
echo $stat[$href];
?>
<a href="[xfields_download]">Download</a>
<a href="[xfields_download]" class="click_count">Download</a>
$(function(){
function get_counter(a,b){
$.get(dle_root+'click_counter/index.php',{type:b,href:a.attr('href')},function(d){
a.find('.click_counter').html(d);
});
}
var click_trigger = ".click_count";
$(click_trigger).each(function(){
$(this).append(" <span class='click_counter' title='Click'><img src='/click_counter/loading.gif' alt=''/></span>");
get_counter($(this),'');
});
$('body').on("click",click_trigger,function(){
get_counter($(this),'set');
});
})
<a href="[xfields_download]" class="click_count">Download<span class='click_counter' title='Click'>0</span></a>
[shortrss]<item>
<title>{title}</title>
<guid isPermaLink="true">{rsslink}</guid>
<link>{rsslink}</link>
<description>{short-story}</description>
<category>{category}</category>
<dc:creator>{rssauthor}</dc:creator>
<pubDate>{rssdate}</pubDate>
</item>[/shortrss]
[fullrss]<item>
<title>{title}</title>
<guid isPermaLink="true">{rsslink}</guid>
<link>{rsslink}</link>
<description><![CDATA[{short-story}]]></description>
<category><![CDATA[{category}]]></category>
<dc:creator>{rssauthor}</dc:creator>
<pubDate>{rssdate}</pubDate>
</item>[/fullrss]
[yandexrss]<item>
<title>{title}</title>
<link>{rsslink}</link>
<description>{short-story}</description>
<category>{category}</category>{images}
<pubDate>{rssdate}</pubDate>
<yandex:full-text>{full-story}</yandex:full-text>
</item>[/yandexrss]
.ratingzero {
color: #6c838e;
}
.ratingtypeplusminus {
padding: 0px 5px;
}
.ratingtypeplus {
color: #6c838e;
padding: 0px 0px 0px 5px;
}
.ratingplus {
color: green;
}
.ratingminus {
color: red;
}
.ratebox2 {
float: right;
}
.ratebox3 {
float: right;
}
.ratebox ul, .ratebox ul li {
float: left;
}
.ratebox2 ul, .ratebox2 ul li {
float: left;
}
.ratebox3 ul, .ratebox3 ul li {
float: left;
}
[rating]
[rating-type-1]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating-type-1]
[rating-type-2]<div class="ratebox2">
<ul class="reset">
<li>[rating-plus]<img src="{THEME}/images/like.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
<li>{rating}</li>
</ul></div>[/rating-type-2]
[rating-type-3]<div class="ratebox3">
<ul class="reset">
<li>[rating-minus]<img src="{THEME}/images/ratingminus.png" title="Dislike" alt="Dislike" style="width:14px;" />[/rating-minus]</li>
<li>{rating}</li>
<li>[rating-plus]<img src="{THEME}/images/ratingplus.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
</ul>
</div>[/rating-type-3]
[/rating]
[rating]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating]
[rating]
[rating-type-1]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating-type-1]
[rating-type-2]<div class="ratebox2">
<ul class="reset">
<li>[rating-plus]<img src="{THEME}/images/like.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
<li>{rating}</li>
</ul></div>[/rating-type-2]
[rating-type-3]<div class="ratebox3">
<ul class="reset">
<li>[rating-minus]<img src="{THEME}/images/ratingminus.png" title="Dislike" alt="Dislike" style="width:14px;" />[/rating-minus]</li>
<li>{rating}</li>
<li>[rating-plus]<img src="{THEME}/images/ratingplus.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
</ul>
</div>[/rating-type-3]
[/rating]
[rating]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating]
[rating]
[rating]
[rating-type-1]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating-type-1]
[rating-type-2]<div class="ratebox2">
<ul class="reset">
<li>[rating-plus]<img src="{THEME}/images/like.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
<li>{rating}</li>
</ul></div>[/rating-type-2]
[rating-type-3]<div class="ratebox3">
<ul class="reset">
<li>[rating-minus]<img src="{THEME}/images/ratingminus.png" title="Dislike" alt="Dislike" style="width:14px;" />[/rating-minus]</li>
<li>{rating}</li>
<li>[rating-plus]<img src="{THEME}/images/ratingplus.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
</ul>
</div>[/rating-type-3]
[/rating]
[rating]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating]
[rating]
[rating-type-1]<div class="ratebox"><div class="rate">{rating}</div></div>[/rating-type-1]
[rating-type-2]<div class="ratebox2">
<ul class="reset">
<li>[rating-plus]<img src="{THEME}/images/like.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
<li>{rating}</li>
</ul></div>[/rating-type-2]
[rating-type-3]<div class="ratebox3">
<ul class="reset">
<li>[rating-minus]<img src="{THEME}/images/ratingminus.png" title="Dislike" alt="Dislike" style="width:14px;" />[/rating-minus]</li>
<li>{rating}</li>
<li>[rating-plus]<img src="{THEME}/images/ratingplus.png" title="Like" alt="Like" style="width:14px;" />[/rating-plus]</li>
</ul>
</div>[/rating-type-3]
[/rating]
<div class="ratebox"><div class="rate">{rate}</div><span>Rating:</span></div>
[rating-type-1]<div class="ratebox"><div class="rate">{rate}</div><span>Rating:</span></div>[/rating-type-1]
[rating-type-2]<div class="ratebox2"><span>Rating:</span> {rate}</div>[/rating-type-2]
[rating-type-3]<div class="ratebox2"><span>Rating:</span> {rate}<span></div>[/rating-type-3]
Download Datalife Engine 10.4 Final English_utf8
Download Datalife Engine 10.4 Final English_windows-1251
<form name="news_set_sort" id="news_set_sort" method="post" action="" >" . $lang['sort_main'] . " " . implode( " | ", $sort );
$sort .= <<<HTML
<input type="hidden" name="dlenewssortby" id="dlenewssortby" value="{$config['news_sort']}" />
<input type="hidden" name="dledirection" id="dledirection" value="{$config['news_msort']}" />
<input type="hidden" name="set_new_sort" id="set_new_sort" value="{$find_sort}" />
<input type="hidden" name="set_direction_sort" id="set_direction_sort" value="{$direction_sort}" />
<script type="text/javascript">
<!-- begin
function dle_change_sort(sort, direction){
var frm = document.getElementById('news_set_sort');
frm.dlenewssortby.value=sort;
frm.dledirection.value=direction;
frm.submit();
return false;
};
// end -->
</script></form>
Replace it with:
<form class="pull-left" name="news_set_sort" id="news_set_sort" method="post" action="" ><button type="button" class="btn btn-default dropdown-toggle btn-sort" data-toggle="dropdown"><span class="glyphicon glyphicon-sort"></span> <span class="caret"></span></button> <ul class="dropdown-menu">" . implode( " ", $sort );
$sort .= <<<HTML
<input type="hidden" name="dlenewssortby" id="dlenewssortby" value="{$config['news_sort']}" />
<input type="hidden" name="dledirection" id="dledirection" value="{$config['news_msort']}" />
<input type="hidden" name="set_new_sort" id="set_new_sort" value="{$find_sort}" />
<input type="hidden" name="set_direction_sort" id="set_direction_sort" value="{$direction_sort}" />
<script type="text/javascript">
<!-- begin
function dle_change_sort(sort, direction){
var frm = document.getElementById('news_set_sort');
frm.dlenewssortby.value=sort;
frm.dledirection.value=direction;
frm.submit();
return false;
};
// end -->
</script></ul></form>
Find the code:
$sort[] = $value['image'] . "<a href="#" onclick="dle_change_sort('{$value['value']}','{$value['direction']}'); return false;">" . $value['name'] . "</a>";
Replace it with:
$sort[] = $value['image'] . "<li><a href="#" onclick="dle_change_sort('{$value['value']}','{$value['direction']}'); return false;">" . $value['name'] . "</a></li>";
Find the code and deleting it:
if( strtolower( $direction ) == "asc" ) {
$soft_by_array[$soft_by]['image'] = "<img src="{THEME}/dleimages/asc.gif" alt="" />";
$soft_by_array[$soft_by]['direction'] = "desc";
} else {
$soft_by_array[$soft_by]['image'] = "<img src="{THEME}/dleimages/desc.gif" alt="" />";
$soft_by_array[$soft_by]['direction'] = "asc";
}
4. The picture of the author in the full news. Installation.
$news_find = array
Add the above:
$ava = $db->get_row($db->query("SELECT foto FROM ".PREFIX."_users WHERE name='".$row['autor']."'")); if($ava['foto']) $tpl->set('{poster_avatar}', "<a href="".$config['http_home_url']."uploads/fotos/".$ava['foto']."" onclick="return hs.expand(this)" ><img src="".$config['http_home_url']."uploads/fotos/".$ava['foto']."" width="60px"></a>"); else $tpl->set('{poster_avatar}', "<img src="/templates/Blogss/dleimages/noavatar.png">");
The configuration is complete.