Code Monkey home page Code Monkey logo

recentthreads's Introduction

Recent Threads On Index

Adds a section to your index page for recent threads.

Installation

  1. Upload the entire zip file to your forums directory. All files should extract to the proper location. Note that the directory Recent Threads in the inc/plugins folder needs to be uploaded as well.

  2. Install from the Admin CP.

  3. Verify that the variable {$recentthread_headerinclude} is in the head section of your index template. Verify that the variable {$recentthreadtable} is below {$forums}, unless you want it elsewhere on the page.

  4. Configure the settings for recent threads.

Compatibility: 1.8.1 or higher. This is due to functions that 1.8 uses in order to format avatars.

Upgrading If you are using a version that is 16 or lower, you will need to uninstall then reinstall the plugin in order to get all the necessary changes due to major file structure changes. If you are using version 17 or higher, you can upgrade by either clicking 'Run Upgrade Script' or 'Run Maintenance Script'. Future builds will likely not include changes in either the upgrade script or maintenance script beginning with version 20 due to making them be automated instead of being manually written for each upgrade. The only changes would be if a database change occurs since that is not logged anywhere.

Customization

The following two variables are not currently used, but will work in case you want them:
{$lastpostdate} - This uses the default date format on the last post.
{$lastposttime} - This uses the default time format on the last post.

These variables exist if you have the setting to show thread creation date on:
{$create_date} - Shows the date a thread was created.
{$create_time} - Shows the time a thread was created.
{$create_string} - Created on {$create_date} at {$create_time}. This variable is defined in inc/languages/english/recentthreads.lang.php.

Additional Variables:
{$folder} - What class the thread should be.
{$folder_label} - The title of the folder to be used on a title tag.
{$icon} - The icon the thread has.
{$recenttprefix} - THe formatted prefix of the thread.
{$recentthread_breadcrumbs} - Either the breadcrumbs of the forums that the thread resides in or just the forum it resides in depending on your settings.
{$lastavatar} - The last posters avatar formatted. Uses template recentthread_avatar.
{$posteravatar} - The thread author's avatar formatted. Uses template recentthread_last_avatar.
{$thread['author']} - The thread creators profile link. Formatted according to usergroup if option is set.

By default the page will update the recent threads every 30 seconds and stop refreshing after 15 minutes of no activity. This can be altered under templates -> your theme -> recentthread_headerinclude. On the line that begins with var refresher = Change 30000 to the number of milliseconds you want it to refresh at. 60000 = 1 minute. The next line controls how many milliseconds before it will stop refreshing at. 5 minutes = 300000; 10 minutes = 600000. Note that you do not use commas.

Please note that if you want to apply changes to templates across all themes, you should edit inc/plugins/recentthreads/templates.json. You should only edit the attribute "template"; the other attributes must stay the same or stuff will break. If you need to use double quotes in the template, you need to escape it with the '' character or errors will occur. These are the templates that are loaded when you install. Starting in version 20, there will also be a way to update all your recent thread templates to whatever is in the .json file.

If you wish to move the thread list to the top, go to templates -> your theme -> index templates -> index and move {$recentthreadtable} to where you want it.

There are currently 16 settings that you can configure to make your experience how you want it. This includes an option to work with XThreads.

Showing On Other Pages

Due to popular request, the plugin has now been updated to show the recent threads on any page. This example will show you how to display it on forumdisplay.php. Follow similar steps for other pages.

  1. Go to Recent Thread Settings.
  2. Change the value of Show On These Pages to be
    index.php
    forumdisplay.php
  3. Go to Templates -> Templates -> Your Theme -> Forum Display Templates -> forumdisplay.
  4. Below {$headerinclude} add {$recentthread_headerinclude}.
  5. The place you want to show the threads put <div id="recentthreads">{$recentthreadtable}</div>

Support For support with the plugin, please post in this thread. This way the Github repository is kept clean. Please note that if your forum does not meet eligibility requirements, you may not receive support. Prior to posting in the thread, try running the maintenance script because that is able to fix a lot of issues.

Bugs Please report bugs in this thread first. This way I can see if it is a new issue. Please make sure to post your forum url and that guests are able to view Recent Threads. If it is confirmed to be an actual bug, myself or Eldenroot will create an issue for it.

Enhancements If you have an idea for an enhancement, please create an issue. Be as specific as possible and try and search closed issues because certain things I am not willing to do.

Donations
This plugin will continue to remain free. If you would like to make a donation to help, you can do so here

recentthreads's People

Contributors

dragonexpert avatar eldenroot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

recentthreads's Issues

Moved threads are displayed as unread all the times

When you move a thread (I moved a thred from subcategory into subsubcategory) -> recent thread plugin display the thread title bolded all the time (unread posts) even I read it. Can you reproduce this issue please?

Manually Loaded Template

Due to the code change for allowing Font Awesome requiring an additional template to be loaded, the global_start needs to be updated.

Make misc.php_action=recent_threads More Known

I'm thinking of having a hover function on the ~ Recent Threads ~ part to make it more obvious that it exists. Additionally, the templates for that page should be renamed to start with recentthreads so it becomes easier to automate maintenance and upgrade scripts.

Makes Templates and Settings JSON

By making the individual templates and settings in JSON, it is easy to reuse them for upgrades, maintenance, installation, and uninstall. For settings, the keys would be the name of the setting that is unique and no spaces. For templates it will be the title with no spaces allowed.

Pagination Bug

Pagination shows shows additional copies of links under certain conditions.

Avatars Always Shown if enabled

Currently the code does not check if a user has chosen to not see avatars in posts. It only checks the plugin setting. This will be an easy fix in my next pull request I do.

Add Hooks

There should be some hooks just like on forumdisplay.php. Note that this has been resolved with the latest pull request so I am going to immediately close it, but this way it gets documented.

Simplify template Creation / Updates

Currently the code leaves a lot to be desired because it gets very long having all the templates in the file. Using Curl would be much more efficient.

Vulnerability XSS

as reported on MyBB extend site, can you please fix it? This plugin is really useful and is used by a lot of users, should get a security update ASAP.

@dragonexpert

Add simple fallback for broken avatars

When the user avatar is broken (remote url not responding, it looks really ugly). It could be solved by adding fallback for broken avatars:

onerror="this.src='/images/default_avatar.png';"

Maintenance Script

There should be a maintenance script to fix any missing settings and database structure changes. This should also check if the template group exists and if not, run the template_install function.

Parse error: syntax error, unexpected

Version 17 im having this error
Parse error: syntax error, unexpected '';"/>'' (T_CONSTANT_ENCAPSED_STRING) in /home/mydomain/public_html/inc/plugins/recentthreads/templates.php on line 54

Does not show the template "recentthread_last_avatar" if you are a guest

Hello happy new year, there is a problem with your plugin. When you are invited it does not show "recentthread_last_avatar" it is empty, I do not know why it happens.

But if you are registered in the forum if it shows the template "recentthread_last_avatar"

When you are a registered user.
image

When you are a guest
image

I made modifications to the templates to improve their appearance. So use the default templates to test if it was that and no, it's the same!
Thanks for your help friend!

Language

Create a language pack to avoid hard coded language.

Plugin not working

I tried to install plugin but not working also I've aleady installed it correctly
image

Rendering of threads with unread posts

It would be great if the threads where there are some unread posts could be rendered in the same way it is in regular thread list, i.e. highlighted.

Maybe in general the recent thread list should be more stock-alike (in the way the HTML is organized).

Add "Show more" button

One used on my board had this request (idea). Add a button "Show more" to the bottom of the recenthread box. It would load (show on a new page) more latest post than the amount set in ACP.

Possibility to show Forum and Subforum?

I would like to ask you if is possible to show something like "Forum 1 -> Subforum". Now it displays only forum where the thread is posted. Something like "breadcrumb".

It is sometimes not really useful if you have 2 or more forums with same name, so the thread have same forum displayed even when they are in two different places.

Sorry for my English, really difficult to describe this feature request.

Template Updating & Other Improvements

There should be a way to update all the templates across all themes to using what is in inc/plugins/recentthreads/templates.json. This would make it a lot less work for the forum administrator if they only have to edit once and not for each theme.

Can I force the thread title to show in a single line?

I don't know is this related to my theme's CSS, but this is what I got

     -> [Prefix] Thread's Title
     -> [Prefix] Thread's Title
     ->
     [Longer Prefix]
     Longer Thread's Title
     -> [Prefix] Thread's Title

I want it to be:
     -> [Prefix] Thread's Title
     -> [Prefix] Thread's Title
     -> [Longer Prefix] Longer Thread's Title
     -> [Prefix] Thread's Title

Just to clarify - even if I truncate the thread's title, problem is still there :(

ACP improvements

  • Add PayPal image instead of link to the right side
  • add a link to plugin configuration into plugin page
  • hide "run update script" if there is no need to run it

All threads are displayed as unread (bold text)

Hi, I use your latest GitHub version... unfortunately all threads in recent box are displayed as unread even there is no unread message. It has all the time "unread" css. Is possible to check the code if it is not bugged? Thank you very much

@dragonexpert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.