MyBB Community Forums

Full Version: Recent Threads On Index [Updated 02-09-21]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
This is how it looks now on my local testsite. I think it's a very flexible plugin. Maybe there's a better way to put the avatars, I'm still thinking about it. When you click on the avatar, a modal window with the profile will popup.
how come it doesnt update on page refresh?

I changed it to pull only 5 and i still see 15


ah sorry it a ACP setting LOL

OK, so how can i add a second panel with just the stickies? OR MULTIPLE panels

thanks for mod

btw, you got a permissions setting in there, could you add a forum selection setting too?
Is there any way how to make avatar images clickable? Click on avatar -> same like to click on username

EDIT: I get errors in JS during auto ajax updates in console
anyone else getting duplicates for the first 3 items?

and how do i turn on the avatars?
(2015-02-06, 02:04 AM)expat Wrote: [ -> ]how come it doesnt update on page refresh?

I changed it to pull only 5 and i still see 15


ah sorry it a ACP setting LOL

OK, so how can i add a second panel with just the stickies? OR MULTIPLE panels

thanks for mod

btw, you got a permissions setting in there, could you add a forum selection setting too?

There is a setting for which forums get ignored.

(2015-02-06, 10:54 AM)Eldenroot Wrote: [ -> ]Is there any way how to make avatar images clickable? Click on avatar -> same like to click on username

EDIT: I get errors in JS during auto ajax updates in console

Not sure how you are getting JS errors. What kind of errors is it saying? This is my current recentthreads_headerinclude
<script type="text/javascript">
  <!--
	var refresher = window.setInterval(function () {refresh_recent_threads()}, 30000);
    var stopper = window.setTimeout(function() { stop_recent_threads()}, 900000);
    function refresh_recent_threads()
    {
      	var xmlhttp;
		if(window.XMLHttpRequest)
  		{// code for IE7+, Firefox, Chrome, Opera, Safari
 			 xmlhttp=new XMLHttpRequest();
  		}
		else
 		 {// code for IE6, IE5
     		 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
      xmlhttp.onreadystatechange=function()
      {
        if(xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
   				 document.getElementById("recentthreads").innerHTML=xmlhttp.responseText;
    		}
      }
      	xmlhttp.open("GET","xmlhttp.php?action=recent_threads",true);
		xmlhttp.send();
    }
    function stop_recent_threads()
    {
      		clearInterval(refresher);
    }
  // -->
  </script>


(2015-02-06, 11:44 AM)expat Wrote: [ -> ]anyone else getting duplicates for the first 3 items?

and how do i turn on the avatars?

I don't get duplicates. Avatars for first post and last post are in the settings the plugin has.
I replace my code with yours one. I will test it.

I need to make my avatars image clickable in recent thread index (click on them -> link to the user post).

I tried to manage hide/show button but without success. I wanted to improve it to make it permanently, not until next refresh. Do you have any tips how to do that?
If you use the variable {$lastpostlink}, that gives you the url for the last poster's post. I didn't have that variable open and close an anchor tag so it would be easier to customize.

If you want the hide / show to be permanent, look into using cookies.
Yes, I use laspostlink but it shows formated username. I will have to look into your code
Updated the code on Github to hopefully fix the JS errors. You can update by one of two ways. Either deactivate then reactivate the plugin to get the updated templates. Modify the recentthread template to this:
<div class="scroll">
<div id="recentthreads">
<table border="0" cellspacing="1" cellpadding="6" class="tborder" style="clear: both;max-height:300px">
<thead>
    <tr>
    <td class="thead{$expthead}" colspan="4" style="text-align:left; font-size: 10pt;"><div class="expcolimage"><img src="{$theme['imgdir']}/collapse.png" id="cat_9999_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div>~ Recent Threads ~</div>
</td>
    </tr>
</thead>
<tbody style="{$expdisplay}" id="cat_9999_e">
    <tr>
    <td class="tcat" width="230" style="font-size: 9pt; text-align: center;"><strong>Thread / Author</strong></td>
    <td class="tcat" width="30" style="font-size: 9pt; text-align: center;"><strong>Forum</strong></td>
    <td class="tcat" width="30" style="font-size: 9pt; text-align: center;"><strong>Posts</strong></td>
    <td class="tcat" width="140" style="font-size: 9pt; text-align: center;"><strong>Last Post</strong></td>
    </tr>
    {$recentthreads}
</tbody>
    </table>
</div>
    </div>
@dragonexpert maybe you should consider adding language support for international users. I added it as not everybody is using the english language as their default.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42