Post by Brian on Jan 25, 2016 15:11:43 GMT -8
www.proboards.com/library/plugins/item/1203
This plugin was created for anyone who wishes to have the Hot Topics functionality returned to their forum. It's pretty straightforward. All you have to do is specify your preferred image URLs and the plugin does the rest automatically.
For users with multiple themes that use different thread icons on each theme follow the instructions below on any theme you wish to use different images on.
Non-Plugin Version
Goes in Structure > Headers & Footers > Global Header. Change the count in green to your preferred post count for a hot topic.
This plugin was created for anyone who wishes to have the Hot Topics functionality returned to their forum. It's pretty straightforward. All you have to do is specify your preferred image URLs and the plugin does the rest automatically.
For users with multiple themes that use different thread icons on each theme follow the instructions below on any theme you wish to use different images on.
- Go to Themes > Theme Manager and click on your theme's name to enter its settings. On the following page click on the Images tab. Add all 6 of your images to the Custom Theme Images section and click on each of their pencil icons to give them the following names, pressing Enter to save after each one:
Hot Topic
thread_hot
Locked
thread_locked
Sticky
thread_sticky
Announcement
thread_announce
Locked + Sticky
thread_locked_sticky
Locked + Announcement
thread_locked_announce - Go to Themes > Layout Templates > Forum Wrapper and add a new line before the closing </head> tag. Place this on the new line:<script type="text/javascript">
if(!pbp)
var pbp = {};
pbp.hot_topics_s = {};
pbp.hot_topics_s.image = {
hot: "$[theme.image.thread_hot.src]",
locked: "$[theme.image.thread_locked.src]",
sticky: "$[theme.image.thread_sticky.src]",
announce: "$[theme.image.thread_announce.src]",
locked_sticky: "$[theme.image.thread_locked_sticky.src]",
locked_announce: "$[theme.image.thread_locked_announce.src]"
};
</script>
Non-Plugin Version
Goes in Structure > Headers & Footers > Global Header. Change the count in green to your preferred post count for a hot topic.
<script type="text/javascript">
// Hot Topics Standalone
if(pbp == undefined)
var pbp = new Object();
if(pbp != null && typeof(pbp) == "object") {
pbp.hot_topics = {
count: 50,
image: {
hot: "//images.proboards.com/v5/icons/thread-hot.png",
locked: "//images.proboards.com/v5/icons/thread-locked-hot.png",
sticky: "//images.proboards.com/v5/icons/thread-sticky-hot.png",
announce: "//images.proboards.com/v5/icons/thread-announcement-hot.png",
locked_sticky: "//images.proboards.com/v5/icons/thread-locked-sticky-hot.png",
locked_announce: "//images.proboards.com/v5/icons/thread-locked-announcement-hot.png"
},
init: function(){
if($('.item.thread').length){
$('.item.thread').each(function(){
if($(this).find('.thread-participants').length){
if(parseInt($(this).find('.thread-participants').html().replace(/,/g,'')) >= pbp['hot_topics'].count){
var c = { a: $(this).hasClass('announcement'), l: $(this).hasClass('locked'), s: $(this).hasClass('sticky') };
if(!c.a && !c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.hot);
else if(!c.a && c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked);
else if(!c.a && !c.l && c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.sticky);
else if(c.a && !c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.announce);
else if(!c.a && c.l && c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked_sticky);
else if(c.a && c.l)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked_announce);
}
}
});
}
}
};
if(pbp.hot_topics_s)
pbp.hot_topics.image = pbp.hot_topics_s.image;
}
$(document).ready(function(){ pbp['hot_topics'].init(); });
proboards.on('afterSearch',function(){ pbp['hot_topics'].init(); });
$(document).ajaxComplete(function(event,xhr,settings){
if(settings.url.indexOf('/threads/mark/') != -1)
pbp['hot_topics'].init();
});
</script>
// Hot Topics Standalone
if(pbp == undefined)
var pbp = new Object();
if(pbp != null && typeof(pbp) == "object") {
pbp.hot_topics = {
count: 50,
image: {
hot: "//images.proboards.com/v5/icons/thread-hot.png",
locked: "//images.proboards.com/v5/icons/thread-locked-hot.png",
sticky: "//images.proboards.com/v5/icons/thread-sticky-hot.png",
announce: "//images.proboards.com/v5/icons/thread-announcement-hot.png",
locked_sticky: "//images.proboards.com/v5/icons/thread-locked-sticky-hot.png",
locked_announce: "//images.proboards.com/v5/icons/thread-locked-announcement-hot.png"
},
init: function(){
if($('.item.thread').length){
$('.item.thread').each(function(){
if($(this).find('.thread-participants').length){
if(parseInt($(this).find('.thread-participants').html().replace(/,/g,'')) >= pbp['hot_topics'].count){
var c = { a: $(this).hasClass('announcement'), l: $(this).hasClass('locked'), s: $(this).hasClass('sticky') };
if(!c.a && !c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.hot);
else if(!c.a && c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked);
else if(!c.a && !c.l && c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.sticky);
else if(c.a && !c.l && !c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.announce);
else if(!c.a && c.l && c.s)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked_sticky);
else if(c.a && c.l)
$(this).find('.icon').find('img').attr('src',pbp['hot_topics'].image.locked_announce);
}
}
});
}
}
};
if(pbp.hot_topics_s)
pbp.hot_topics.image = pbp.hot_topics_s.image;
}
$(document).ready(function(){ pbp['hot_topics'].init(); });
proboards.on('afterSearch',function(){ pbp['hot_topics'].init(); });
$(document).ajaxComplete(function(event,xhr,settings){
if(settings.url.indexOf('/threads/mark/') != -1)
pbp['hot_topics'].init();
});
</script>