묻고답하기
최신글,댓글 위젯스킨에 아이콘을 넣고 싶습니다.
2017.01.10 08:06
지금 사용중인 위젯 스킨이 doorweb 최신글 ,댓글 위젯 스킨 ver. 1.1 을 사용 중입니다.
아주 좋은 위젯이라 사용을 하는데...약간의 추가사항은 새글이나 댓글이 등록되면 글 앞이나 뒤에 NEW 아이콘을 넣고 싶습니다.
소스를 보아도, 워낙 프로그램에 지식이 없어서...고수분들의 도움이 필요합니다.
감사합니다.
이렇게요...아래 소스 있습니다.
*만약 프로그램 원작자에게 저작원 영향이 있는 문의라면 삭제하겠습니다.
----------------------------------------------------------------------------------------------
<load target="smart_popular.css" />
{@
$tabc=count($widget_info->tab_view_arr);
$optc=count($widget_info->option_view_arr);
$li_width = $widget_info->widget_widths/$tabc;
$img_width = $widget_info->thumbnail_width-2;
$img_height = $widget_info->thumbnail_height-2;
}
<!--@if(!$global['popsid'])-->{@ $__Context->global['popsid'] = 1}<!--@endif-->{@ $__Context->global['popsid']++}
<div id="popular{$global['popsid']}" class="doorweb-popular newClear">
<!--// TAB Start -->
<div class="tabs_items newClear" >
<ul>
<block loop="$i=0; $i<$tabc; $i++">
<!--@if($widget_info->tab_view_arr[$i]=='popular')-->
<li><a id="pd_link_s{$global['popsid']}" class="tabs_active"|cond="$widget_info->tab_view_arr[0]=='popular'" href="#">{$lang->ip_popular_documents}</a></li>
<!--@elseif($widget_info->tab_view_arr[$i]=='newestd')-->
<li><a id="nd_link_s{$global['popsid']}" class="tabs_active"|cond="$widget_info->tab_view_arr[0]=='newestd'" href="#">{$lang->ip_newest_documents}</a></li>
<!--@elseif($widget_info->tab_view_arr[$i]=='newestc')-->
<li><a id="nc_link_s{$global['popsid']}" class="tabs_active"|cond="$widget_info->tab_view_arr[0]=='newestc'" href="#">{$lang->ip_newest_comments}</a></li>
<!--@end-->
</block>
</ul>
</div>
<!--// TAB End -->
<div class="tabs_inner newClear" >
<!--// Popular Documents Start -->
<div id="popular_documents_s{$global['popsid']}" class="tabs_content<!--@if($widget_info->tab_view_arr[0]=='popular')--> tabs_active<!--@endif-->">
<ul cond="$widget_info->popular_documents">
<li loop="$widget_info->popular_documents=>$key,$val" class="newClear">
<a href="{$val->getPermanentUrl()}">
<block loop="$i=0; $i<$optc; $i++">
<!--@if($widget_info->option_view_arr[$i]=='image')-->
<!--@elseif($widget_info->option_view_arr[$i]=='title')-->
<div class="text_title">{$val->getTitle($widget_info->subject_cut_size)} <span class="replyNum" title="Replies" cond="$val->getCommentCount() > 0">({$val->getCommentCount()})</span></div>
<!--@elseif($widget_info->option_view_arr[$i]=='content')-->
<!--@elseif($widget_info->option_view_arr[$i]=='regdate')-->
<!--@endif-->
</block>
</a>
</li>
</ul>
</div>
<!--// Popular Documents End -->
<!--// Newest Documents Start -->
<div id="newest_documents_s{$global['popsid']}" class="tabs_content<!--@if($widget_info->tab_view_arr[0]=='newestd')--> tabs_active<!--@endif-->">
<ul>
<li loop="$widget_info->newest_documents=>$key,$val" class="newClear">
<a href="{$val->getPermanentUrl()}">
<block loop="$i=0; $i<$optc; $i++">
<!--@if($widget_info->option_view_arr[$i]=='image')-->
<!--@elseif($widget_info->option_view_arr[$i]=='title')-->
<div class="text_title">{$val->getTitle($widget_info->subject_cut_size)} <span class="replyNum" title="Replies" cond="$val->getCommentCount() > 0"> ({$val->getCommentCount()})</span></div>
<!--@elseif($widget_info->option_view_arr[$i]=='content')-->
<!--@elseif($widget_info->option_view_arr[$i]=='regdate')-->
<!--@endif-->
</block>
</a>
</li>
</ul>
</div>
<!--// Newest Documents End -->
<!--// Newest Comments Start -->
<div id="newest_comments_s{$global['popsid']}" class="tabs_content<!--@if($widget_info->tab_view_arr[0]=='newestc')--> tabs_active<!--@endif-->">
<ul>
<li loop="$widget_info->newest_comments=>$key,$val" class="newClear">
<a href="{$val->getPermanentUrl()}">
<span class="tabs_content2">{$val->getSummary($widget_info->comment_cut_size)}</span>
</a>
</li>
</ul>
</div>
<!--// Newest Comments End -->
</div>
</div>
<script>
jQuery(function($){
var $popular = $("#popular{$global['popsid']}"),
$tabs_items = $popular.find(".tabs_items"),
$tabs_itema = $tabs_items.find("a"),
$tabs_inner = $popular.find(".tabs_inner");
var $pds = $("#popular_documents_s{$global['popsid']}"),
$nds = $("#newest_documents_s{$global['popsid']}"),
$ncs = $("#newest_comments_s{$global['popsid']}");
function actTab($tid){
$tabs_itema.removeClass("tabs_active");
$tid.addClass("tabs_active");
}
function actItem($sid){
$tabs_inner.find(".tabs_active").removeClass("tabs_active");
$sid.addClass("tabs_active");
}
$tabs_itema.on("mouseover click",function(e){
e.preventDefault();
var $tid = $(this);
actTab($tid);
});
$("#pd_link_s{$global['popsid']}").on("mouseover click",function(e){
e.preventDefault();
actItem($pds);
});
$("#nd_link_s{$global['popsid']}").on("mouseover click",function(e){
e.preventDefault();
actItem($nds);
});
$("#nc_link_s{$global['popsid']}").on("mouseover click",function(e){
e.preventDefault();
actItem($ncs);
});
});
</script>