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 plugin adds the most recent threads to your index page.

Compatibility: 1.8.1 or higher
Latest Version: 20.0
Languages: English, German ( Out of date )
Features:
- Uses the forum permission system
- Setting for ajax refresh rate.
- Ajax refreshes disabled after 15 minutes.
- Options for displaying avatars
- Options to exclude certain forums from having threads show
- Easily adjust how many threads you want to show
- Thread title links to the newest post you haven't read
- Username styles are maintained
- Reply count is clickable to bring up the list of who posted
- Variables for relative time, date, and standard time of last post
- Thread titles can be shortened along with an option of breaking at the word or character level.
- Option to select which groups can't use this.
- Option to show formatted thread prefixes.
- Setting to allow Thread Fields from XThreads
- Option to show formatted usernames
- Option to show thread creation date.
- Ability to use on additional pages.
- New file structure makes it easier to maintain for your programmers.
- Option to show breadcrumb forum as either no breadcrumb, partial, or full path.
- Maintenance Script that can be run to insert missing settings, database changes, and templates.
- The master templates are now a .json file so that can be edited and then all themes can be updated to it.
- Option to download the templates for a particular theme as a .json file which could then be uploaded if you want to apply that layout across all themes with 1 click.
- Maintenance script which can check for missing templates and settings and repair them.

Installation:
1) Upload the zip file to your forum root and extract it.  The file and folder directory is maintained.
2) Install and Activate in the Admin CP
3) Go to your index template and verify {$recentthread_headerinclude} and {$recentthreadtable} are on the template once each.
4) Customize settings to your liking.

Upgrading:
1) Upload all files in the zip file to the directories.
2) Click the link that says Run Upgrade Script in the plugin's description.
3) To upgrade to version 20, after running the upgrade script, go to Templates & Style and select Recent Threads and update templates. Failure to do this may result in some of the new features not working. If you do not wish to replace all templates, you'll need to look at the templates.json file for any changes.

XThreads Fields

You have two options if you choose to enable it.  You can either use the raw data from the database or formatted data.  You will place this code in the recentthread_thread template.

Raw: {$threadfields_raw[$tid]['fieldname']}
Formatted: {$threadfields_formatted[$tid]['fieldname']}

Download: http://community.mybb.com/mods.php?action=view&pid=191

Github

https://github.com/dragonexpert/recentthreads

For additional documentation, the read me file is your friend.
Unable to deactivate this plugin. Please help.

Quote:MyBB has experienced an internal SQL error and cannot continue.

How to remove this plugin manually? Are there any settings in the database?



Edit:

I deleted the templates but the plugin still showed up in the plugin list. So I tried to add the templates manually and it shows an error when I try to add the recentthread_thread template.


<tr>
    <td class="trow1"><a href="{$threadlink}">{$thread[\'subject\']}</a><br />{$thread[\'author\']}</td>
    <td class="trow1">{$thread[\'posts\']}</td>
    <td class="trow1">{$thread[\'views\']}</td>
    <td class="trow1">{$lastposttime}<br />
    <a href="{$lastpostlink}">Last Post:</a> {$lastposterlink}</td>
    </tr>


Quote:A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support.
^ remove backslashes (i.e. \) from that recentthread_thread template codes
Thanks.
What ?
/inc/plugins/recentthread.php 77 errorHandler->error
/inc/class_plugins.php 139 recentthread_list_threads
/index.php 387 pluginSystem->run_hooks
^ when did you get those errors ? on activation or on the index page after adding the variable in index template
if the error is still on your forum, can we have forum url to see complete errors
(2014-09-21, 06:45 AM)ThePanda Wrote: [ -> ]Unable to deactivate this plugin. Please help.

Quote:MyBB has experienced an internal SQL error and cannot continue.

How to remove this plugin manually? Are there any settings in the database?



Edit:

I deleted the templates but the plugin still showed up in the plugin list. So I tried to add the templates manually and it shows an error when I try to add the recentthread_thread template.


<tr>
    <td class="trow1"><a href="{$threadlink}">{$thread[\'subject\']}</a><br />{$thread[\'author\']}</td>
    <td class="trow1">{$thread[\'posts\']}</td>
    <td class="trow1">{$thread[\'views\']}</td>
    <td class="trow1">{$lastposttime}<br />
    <a href="{$lastpostlink}">Last Post:</a> {$lastposterlink}</td>
    </tr>


Quote:A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support.

It would've helped a lot more if you posted what the SQL query was so I could figure it out faster. To fix the error change this line:

    $db->delete_query("templates", "name IN('recentthread','recentthread_thread')");

to this:
    $db->delete_query("templates", "title IN('recentthread','recentthread_thread')");

The mod site will be updated momentarily.
3 problems:
- no date is shown
- no post count shown
- poster name should be smaller
The date is not shown because realistically a forum should be getting daily posts. Note that I did make a variable called {$lastpostdate} available if you want it.

I forget it doesn't use the key posts for postcount. I'm used to my custom software where I called it posts. {$thread['posts']} should be changed to {$thread['replies']} in the recentthreads_thread template.

If you want the poster name to be smaller wrap a span tag around and give it the class smalltext. That is a template edit.
(2014-09-21, 01:08 PM)dragonexpert Wrote: [ -> ]It would've helped a lot more if you posted what the SQL query was so I could figure it out faster.  To fix the error change this line:

Sorry, there was no sql query in the error box. If it had any sql query I would have posted it. Smile
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