newbb有個評分功能,但幾乎沒人使用,連官方論壇都關掉沒在用,根本雞肋

但我研究了一下,其實是有用的功能,沒人用多半是UI的問題

如果改成facebook的按讚UI,相信會更容易讓人有想按的感覺

所以才有了這個hack,同時包含了quickreply及social share也有類似問題就一起改了

 

修改成果

 

環境

xoops : 2.5.9
module : newbb 4.34 Final
template : newbb_viewtopic.tpl
css framework: Bootstrap3
icon : Font Awesome 4.7.0

 

code

<!-- only for login user //-->
<{if $viewer_level gt 0}>

<!-- modal for rate //-->
<div class="modal fade bs-example-modal-sm container" id="replyrate" tabindex="-1" role="dialog" aria-labelledby="replyrate">
<div class="modal-dialog btn-bottom" role="document">
<div class="modal-content btn-group" role="group">
<button type="button" class="btn btn-default" onclick="location.href='/modules/<{$xoops_dirname}>/ratethread.php?topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;rate=5';"><i class="fa fa-thumbs-o-up fa-2x" aria-hidden="true"></i><br><{$smarty.const._MD_RATE5}></button>
<button type="button" class="btn btn-default" onclick="location.href='/modules/<{$xoops_dirname}>/ratethread.php?topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;rate=4';"><i class="fa fa-smile-o fa-2x" aria-hidden="true"></i><br><{$smarty.const._MD_RATE4}></button>
<button type="button" class="btn btn-default" onclick="location.href='/modules/<{$xoops_dirname}>/ratethread.php?topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;rate=3';"><i class="fa fa-meh-o fa-2x" aria-hidden="true"></i><br><{$smarty.const._MD_RATE3}></button>
<button type="button" class="btn btn-default" onclick="location.href='/modules/<{$xoops_dirname}>/ratethread.php?topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;rate=2';"><i class="fa fa-frown-o fa-2x" aria-hidden="true"></i><br><{$smarty.const._MD_RATE2}></button>
<button type="button" class="btn btn-default" onclick="location.href='/modules/<{$xoops_dirname}>/ratethread.php?topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;rate=1';"><i class="fa fa-thumbs-o-down fa-2x" aria-hidden="true"></i><br><{$smarty.const._MD_RATE1}></button>
</div>
</div>
</div>

<!-- modal for quickreply //-->
<div class="modal fade bs-example-modal-sm container" id="replyquick" tabindex="-1" role="dialog" aria-labelledby="replyquick">
<div class="modal-dialog btn-bottom" role="document">
<div class="modal-content modal-body"><button type="button btn-default" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<{$quickreply.form}>
</div>
</div>
</div>

<!-- fix bottom navbar //-->
<div class="navbar-fixed-bottom container" id="postnav" style="bottom:12px;">

<!-- rate button //-->
<{if $rating_enable}>
<a class="btn btn-default btn-lg" style="box-shadow: 0 0 15px 0 grey" data-toggle="modal" data-target="#replyrate"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i><{$smarty.const.THEME_LIKE}></a>&nbsp;
<{/if}>

<!-- reply button //-->
<{if $quickreply.show}>
<a class="btn btn-default btn-lg" style="box-shadow: 0 0 15px 0 grey" data-toggle="modal" data-target="#replyquick"><i class="fa fa-comment-o" aria-hidden="true"></i><{$smarty.const.THEME_FORUM_REPLY}></a>&nbsp;
<{/if}>

<!-- modal-dialog move to bottom //-->
<style>.btn-bottom {position: absolute;bottom:48px;z-index:9999;} </style>

<!-- scroll hide bottom navbar //-->
<script>
$(window).scroll(function(){
var scrollBottom = $("body").height()-$(window).height()-60;
if (scrollBottom > 120 )
{
if ($(this).scrollTop() > 60 && $(this).scrollTop() < scrollBottom)
{ $('#postnav').fadeIn(); }
else {  $('#postnav').fadeOut(); }
}
else
{
$('#postnav').fadeIn();
}
});
</script>
</div>
<{/if}>

 


發表自: 九五二七九五二七
愛漫畫愛遊戲愛上網愛星爺,小時摸到阿羅士與AppleII後註定宅一輩子,從紅白機玩到PS4,從386打到Xeon,沒日沒夜的打電動;待過所有宅產業,從光華混到NOVA,從遊戲滾到動漫,從攝影器材爬到網路電信,喜愛學習多於睡覺,無時無刻散發一股宅味,但號稱長的像梁朝偉XD

覺得讚想推薦或分享嗎?