컨텐츠 확장 위젯 사용하여 조회수로 추출했습니다.
아래 빨간원처럼 순번(조회많은 순)을 표시하고 싶은데 어떻게 해결할 수 있을 지 문의드립니다.
PHP | PHP 7.2 |
---|---|
CMS | Rhymix |
컨텐츠 확장 위젯 사용하여 조회수로 추출했습니다.
아래 빨간원처럼 순번(조회많은 순)을 표시하고 싶은데 어떻게 해결할 수 있을 지 문의드립니다.
소스는 /skins/default/normal.html에서 아래 빨간색 부분을 추가했습니다. 그 후 어떤식으로 변경해야 될 지 도움 부탁 드립니다.
<!--// 목록형 출력 -->
<[email protected]($widget_info->markup_type=="list")-->
<ul class="widgetA">
{@$_idx=0}
<[email protected]($widget_info->content_items as $key => $item)-->
<li<[email protected]($widget_info->show_always_new == 'N' && $_idx >= $widget_info->list_count)--> style="display:none"<[email protected]>>
<span class="rank num1">
<?
$i=1;
echo $i;
?>
</span>
<[email protected]($widget_info->option_view_arr as $k => $v)-->
<[email protected]($v=='title')-->
<[email protected]($widget_info->show_browser_title=='Y' && $item->getBrowserTitle())-->
<a href="<[email protected]($item->contents_link)-->{$item->contents_link}<[email protected]>{getSiteUrl($item->domain, '', 'mid', $item->get('mid'))}<[email protected]>" class="board"><strong>{$item->getBrowserTitle()}</strong></a>
<[email protected]>
<[email protected]($widget_info->show_content_title=='Y' && $item->getDocumentTitle())-->
<a href="{$item->getDocumentURL()}"><strong>{$item->getDocumentTitle()}</strong></a>
<[email protected]>
<[email protected]($widget_info->show_category=='Y' && $item->get('category_srl') )-->
<a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'category',$item->get('category_srl'))}"><strong class="category">{$item->getCategory()}</strong></a>
<[email protected]>
<a href="{$item->getLink()}" class="title">{$item->getTitle($widget_info->subject_cut_size)}
</a>
<[email protected]($widget_info->show_comment_count=='Y' && $item->getCommentCount())-->
<sup class="replyNum" title="Replies"><a href="{$item->getLink()}#comment">{$item->getCommentCount()}</a></sup>
<[email protected]>
<[email protected]($widget_info->show_trackback_count=='Y' && $item->getTrackbackCount())-->
<sup class="trackbackNum" title="Trackbacks"><a href="{$item->getLink()}#trackback">{$item->getTrackbackCount()}</a></sup>
<[email protected]>
<[email protected]($widget_info->show_icon=='Y')-->
<span class="icon">{$item->printExtraImages()}</span>
<[email protected]>
<[email protected] if($v=='voted_count')-->
<[email protected]($item->getVotedCount())-->+{$item->getVotedCount()}<[email protected]>
<[email protected] if($v=='readed_count')-->
<[email protected]($item->getReadedCount())-->{$item->getReadedCount()}<[email protected]>0<[email protected]>
<[email protected] if($v=='nickname')-->
<a <[email protected]($item->getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"<[email protected]($item->getAuthorSite())-->href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"<[email protected]>href="#" onclick="return false;" class="author member"<[email protected]> >{$item->getNickName()}</a>
<[email protected] if($v=='regdate')-->
<span class="date">{$item->getRegdate("Y-m-d")}</span> <span class="hour">{$item->getRegdate("H:i")}</span>
<[email protected] if($v=='extravar')-->
{$item->getExtraVar()}
<[email protected] if($v=='extravar2')-->
{$item->getExtraVar2()}
<[email protected] if($v=='extravar3')-->
{$item->getExtraVar3()}
<[email protected] if($v=='extravar4')-->
{$item->getExtraVar4()}
<[email protected] if($v=='extravar5')-->
{$item->getExtraVar5()}
<[email protected]>
<[email protected]>
</li>
{@$_idx++}
<[email protected]>
</ul>
<[email protected]($widget_info->page_count > 1 && $widget_info->list_count<$_idx)-->
<ul class="widgetNavigator">
<li><button type="button" class="prev" title="{$lang->cmd_prev}" onclick="content_widget_prev(jQuery(this).parents('ul.widgetNavigator').prev('ul.widgetA'),{$widget_info->list_count})"><span>{$lang->cmd_prev}</span></button></li>
<li><button type="button" class="next" title="{$lang->cmd_next}" onclick="content_widget_next(jQuery(this).parents('ul.widgetNavigator').prev('ul.widgetA'),{$widget_info->list_count})"><span>{$lang->cmd_next}</span></button></li>
</ul>
<[email protected]>
도움 감사드립니다. 수정하니 아래 그림처럼 두번째 글부터 1이 되는데 왜 그런지 문의 드립니다.
소스는 아래 빨간색으로 수정하였습니다.
<!--// 목록형 출력 -->
<[email protected]($widget_info->markup_type=="list")-->
<ul class="widgetA">
{@$_idx=0}
{@$i=1}
<[email protected]($widget_info->content_items as $key => $item)-->
<li<[email protected]($widget_info->show_always_new == 'N' && $_idx >= $widget_info->list_count)--> style="display:none"<[email protected]>>
<!-- 아래한줄 추가함. 완성안됨 -->
<span class="rank num1"><? echo $i++; ?></span>
<[email protected]($widget_info->option_view_arr as $k => $v)-->
<[email protected]($v=='title')-->
<[email protected]($widget_info->show_browser_title=='Y' && $item->getBrowserTitle())-->
<a href="<[email protected]($item->contents_link)-->{$item->contents_link}<[email protected]>{getSiteUrl($item->domain, '', 'mid', $item->get('mid'))}<[email protected]>" class="board"><strong>{$item->getBrowserTitle()}</strong></a>
<[email protected]>
<[email protected]($widget_info->show_content_title=='Y' && $item->getDocumentTitle())-->
<a href="{$item->getDocumentURL()}"><strong>{$item->getDocumentTitle()}</strong></a>
<[email protected]>
<[email protected]($widget_info->show_category=='Y' && $item->get('category_srl') )-->
<a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'category',$item->get('category_srl'))}"><strong class="category">{$item->getCategory()}</strong></a>
<[email protected]>
<a href="{$item->getLink()}" class="title">{$item->getTitle($widget_info->subject_cut_size)}
</a>
<[email protected]($widget_info->show_comment_count=='Y' && $item->getCommentCount())-->
<sup class="replyNum" title="Replies"><a href="{$item->getLink()}#comment">{$item->getCommentCount()}</a></sup>
<[email protected]>
<[email protected]($widget_info->show_trackback_count=='Y' && $item->getTrackbackCount())-->
<sup class="trackbackNum" title="Trackbacks"><a href="{$item->getLink()}#trackback">{$item->getTrackbackCount()}</a></sup>
<[email protected]>
<[email protected]($widget_info->show_icon=='Y')-->
<span class="icon">{$item->printExtraImages()}</span>
<[email protected]>
<[email protected] if($v=='voted_count')-->
<[email protected]($item->getVotedCount())-->+{$item->getVotedCount()}<[email protected]>
<[email protected] if($v=='readed_count')-->
<[email protected]($item->getReadedCount())-->{$item->getReadedCount()}<[email protected]>0<[email protected]>
<[email protected] if($v=='nickname')-->
<a <[email protected]($item->getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"<[email protected]($item->getAuthorSite())-->href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"<[email protected]>href="#" onclick="return false;" class="author member"<[email protected]> >{$item->getNickName()}</a>
<[email protected] if($v=='regdate')-->
<span class="date">{$item->getRegdate("Y-m-d")}</span> <span class="hour">{$item->getRegdate("H:i")}</span>
<[email protected] if($v=='extravar')-->
{$item->getExtraVar()}
<[email protected] if($v=='extravar2')-->
{$item->getExtraVar2()}
<[email protected] if($v=='extravar3')-->
{$item->getExtraVar3()}
<[email protected] if($v=='extravar4')-->
{$item->getExtraVar4()}
<[email protected] if($v=='extravar5')-->
{$item->getExtraVar5()}
<[email protected]>
<[email protected]>
</li>
{@$_idx++}
<[email protected]>
</ul>
<[email protected]($widget_info->page_count > 1 && $widget_info->list_count<$_idx)-->
<ul class="widgetNavigator">
<li><button type="button" class="prev" title="{$lang->cmd_prev}" onclick="content_widget_prev(jQuery(this).parents('ul.widgetNavigator').prev('ul.widgetA'),{$widget_info->list_count})"><span>{$lang->cmd_prev}</span></button></li>
<li><button type="button" class="next" title="{$lang->cmd_next}" onclick="content_widget_next(jQuery(this).parents('ul.widgetNavigator').prev('ul.widgetA'),{$widget_info->list_count})"><span>{$lang->cmd_next}</span></button></li>
</ul>
<[email protected]>
DoubleU님 너무 고맙고 죄송합니다. 예전 좀 배우긴 했는데 손놓은 지 오래되어 조언주신데로 기초부터 다시 익히고 지속적으로 적용해봐야 겠어요.
근데 조언주신데로 수정했는데도(이리저리 해봐도) 동일한 현상입니다.(두번째 글부터 순번 표시됨)
왜 그럴까요? 질문이 계속되어 송구스럽습니다.