Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Pipke on February 04, 2023, 01:07:56 PM

Title: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 04, 2023, 01:07:56 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4356)

Recent Forum Topics on Board Index

For SMF 2.1.x
Tested only with the SMF default theme!

This mod will add Recent Forum Topics on the Boardindex, it has some options:

License
* This SMF modification is subject to the BSD 2-Clause License

User options
- Options are available through icons (some are only available when you are logged in!)

Languages
- English

Version 1.2 - Mar 15, 2023
- Fixed the constructpages

Version 1.1 - Feb 11, 2023
- Fixed undefined array key due php > 8.0
- Added language Spanish/Latin by Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)

Version 1.0 - Jan 17, 2023
- Initial Release
Title: Re: Recent Forum Topics on Board Index
Post by: TwitchisMental on February 04, 2023, 05:09:13 PM
Nice work !
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: -Rock Lee- on February 05, 2023, 04:06:06 PM
Good job and I'll leave you the translation by the way :D


Regards!
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Matias- on February 06, 2023, 11:41:08 AM
Hello, thanks for the mod. One question, if I only want to use the recent topic, how can I do it?

(https://i.imgur.com/K0UL92k.png)

It happens that I would like to use only that part, but when I urge it, it modifies my entire menu of categories and others... Thanks!
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 06, 2023, 11:48:00 AM
@Matias- The mod is not intended to function that it only shows the recent topics on the boardindex, that's why its called recent topics on the boardindex ;), however it should be possible, ill take a look when i have time how it can be easy achieved.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Matias- on February 06, 2023, 11:51:00 AM
Quote from: Pipke on February 06, 2023, 11:48:00 AM@Matias- The mod is not intended to function that it only shows the recent topics on the boardindex, that's why its called recent topics on the boardindex ;), however it should be possible, ill take a look when i have time how it can be easy achieved.

It would be nice since there is no day of date a "recent topics" that can be put in the boardindex.

I add: It would also be very useful to have compatibility with the prefix mod: https://custom.simplemachines.org/index.php?mod=4038

Thank you!
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on February 07, 2023, 05:00:06 AM
Looks nice! Any idea why I'm getting "file not found" in the two "extract tree" steps for ./Themes and ./Sources? Naturally, these paths are there, above the Packages dir.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 07, 2023, 10:09:43 AM
Quote from: Gryzor on February 07, 2023, 05:00:06 AMLooks nice! Any idea why I'm getting "file not found" in the two "extract tree" steps for ./Themes and ./Sources? Naturally, these paths are there, above the Packages dir.

I dont know what you mean, can you explain better?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 07, 2023, 02:27:57 PM
@Matias- I'm not going to implement the option to hide the board structure/categories so that it shows only the recent topics in the mod, if I did... the way to use the filter options will lose its function and that is not the purpose for which I built the mod.

I'll just explain how you can achieve this with these edits, but it's not recommended to do so... it's entirely up to you. First you should set the user options like you want it, you'and other users can't change it later anymore trough the menu after the edits, because it gets removed!

in Sources/RecentTopicsBoardIndex.php
Code (find) Select
// Fire it up ;)
loadTemplate('RecentTopicsBoardIndex', 'RecentTopicsBoardIndex'); #template, css
Code ("add after") Select
$rtbi['options']['align'] = 'top';
$rtbi['quickbuttons'] = array(); 
unset($context['rtbi_buttons']['applyfilter']);

in {your_theme}/RecentTopicsBoardIndex.template.php
Code (find) Select
// Disable smf default mark read button
$context['mark_read_button'] = array();
Code ("add after") Select
$context['categories'] = array();

Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on February 07, 2023, 02:31:17 PM
Quote from: Pipke on February 07, 2023, 10:09:43 AM
Quote from: Gryzor on February 07, 2023, 05:00:06 AMLooks nice! Any idea why I'm getting "file not found" in the two "extract tree" steps for ./Themes and ./Sources? Naturally, these paths are there, above the Packages dir.

I dont know what you mean, can you explain better?
Not much to explain unfortunately, these errors just come up and reported by smf when trying to install the mod. Installation stops with those 2 errors... 😐
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 07, 2023, 02:35:16 PM
Quote from: Gryzor on February 07, 2023, 02:31:17 PM
Quote from: Pipke on February 07, 2023, 10:09:43 AM
Quote from: Gryzor on February 07, 2023, 05:00:06 AMLooks nice! Any idea why I'm getting "file not found" in the two "extract tree" steps for ./Themes and ./Sources? Naturally, these paths are there, above the Packages dir.

I dont know what you mean, can you explain better?
Not much to explain unfortunately, these errors just come up and reported by smf when trying to install the mod. Installation stops with those 2 errors... 😐

Can you install other mods without errors, if so it looks like the file you downloaded as the mod is fault, try to download a new one, and see how that goes.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Matias- on February 07, 2023, 09:50:29 PM
Quote from: Pipke on February 07, 2023, 02:27:57 PM@Matias- I'm not going to implement the option to hide the board structure/categories so that it shows only the recent topics in the mod, if I did... the way to use the filter options will lose its function and that is not the purpose for which I built the mod.

I'll just explain how you can achieve this with these edits, but it's not recommended to do so... it's entirely up to you. First you should set the user options like you want it, you'and other users can't change it later anymore trough the menu after the edits, because it gets removed!

in Sources/RecentTopicsBoardIndex.php
Code (find) Select
// Fire it up ;)
loadTemplate('RecentTopicsBoardIndex', 'RecentTopicsBoardIndex'); #template, css
Code ("add after") Select
$rtbi['options']['align'] = 'top';
$rtbi['quickbuttons'] = array(); 
unset($context['rtbi_buttons']['applyfilter']);

in {your_theme}/RecentTopicsBoardIndex.template.php
Code (find) Select
// Disable smf default mark read button
$context['mark_read_button'] = array();
Code ("add after") Select
$context['categories'] = array();



Thanks for your answer, I was able to do it but now my categories are not visible... What could it be?

(https://i.imgur.com/KPhqQ1S.png)
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 08, 2023, 04:44:43 AM
Quote from: Matias- on February 07, 2023, 09:50:29 PMThanks for your answer, I was able to do it but now my categories are not visible... What could it be?

Quote from: Matias- on February 06, 2023, 11:41:08 AMHello, thanks for the mod. One question, if I only want to use the recent topic, how can I do it?
that is why?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Matias- on February 08, 2023, 05:43:56 AM
Quote from: Pipke on February 08, 2023, 04:44:43 AM
Quote from: Matias- on February 07, 2023, 09:50:29 PMThanks for your answer, I was able to do it but now my categories are not visible... What could it be?

Quote from: Matias- on February 06, 2023, 11:41:08 AMHello, thanks for the mod. One question, if I only want to use the recent topic, how can I do it?
that is why?

Maybe because of my bad English it was misunderstood.

What I want is to use the "recent topics" part and for everything else to be seen by default.

For example:

-Box Shoutbox
-Box Recent Topics
- Categories
- Etc...

All by default.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 08, 2023, 12:26:10 PM
@Matias- I'll put it in ideas for the next update to add that option.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Matias- on February 09, 2023, 01:10:55 PM
Quote from: Pipke on February 08, 2023, 12:26:10 PM@Matias- I'll put it in ideas for the next update to add that option.

Excellent, a mod to see recent topics would be nice.

I would add the option to view the prefixes of the mod that already exists.

https://custom.simplemachines.org/index.php?mod=4038

Example:

https://prnt.sc/LFYrSxnB3Opk
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 11, 2023, 03:50:51 PM
Quote from: Pipke on February 08, 2023, 12:26:10 PM@Matias- I'll put it in ideas for the next update to add that option.

I thought about it for a while, you can keep the boards hidden by clicking on the arrow up/down behind the category name, this way the boards are also hidden ;) much easier.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 11, 2023, 04:04:14 PM
updated mod to v1.1

- Fixed undefined array key due php > 8.0
- Added language Spanish_Latin by Rock Lee
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: EthanR on February 26, 2023, 10:50:04 PM
Can you make it like the 2.0 version with the round poster avatars next to the topic?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 27, 2023, 03:04:04 AM
Quote from: EthanR on February 26, 2023, 10:50:04 PMCan you make it like the 2.0 version with the round poster avatars next to the topic?

What do you mean exaclty, as it is now the mod does that... or do i don't understand you correctly?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: EthanR on February 27, 2023, 03:13:19 PM
Sorry I should really start reading properly, I forgot to install your Avatar mod.. :-[

Just to confirm, the only settings available for the recent topics are the ones on the 9 dot button?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on February 27, 2023, 03:38:50 PM
Quote from: EthanR on February 27, 2023, 03:13:19 PMJust to confirm, the only settings available for the recent topics are the ones on the 9 dot button?

Yep, and the button to switch between boards and categories filter
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: EthanR on February 28, 2023, 03:43:22 PM
 Thanks :)

Would you mind enabling the avatars on mobile view as well? (On mobile the thread icon is displayed, I think avatars would be nicer).
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: gevv on March 09, 2023, 01:12:05 PM
@Pipke   Nice mod.  Thanks a lot.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Bugo on March 10, 2023, 12:27:39 PM
Great work!
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on March 15, 2023, 05:54:53 AM
+1 for adding the avatar on mobile view if possible? 
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on March 15, 2023, 11:19:58 AM
A user of mine complained that the avatars are smaller now (and indeed they are). I'm not sure if it's this mod (or the Avatar integration one) causing this?

[EDIT] ah found it, it's in the AvatarsDisplayIntegration.css .
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 15, 2023, 05:42:13 PM
updated mod, because it had a huge issue/bug, cant believe no one reported that yet ;)
Version 1.2 - Mar 15, 2023
- Fixed the constructpages

edit @Bugo, i've forgot to add your translation, i'll do it in next update.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Speed King on March 16, 2023, 12:46:21 AM
I'm using 1.2 version on my test forum. Hidden boards are visible for guests:

Click => (https://i.postimg.cc/vDZYqC8B/2023-03-16.png) (https://postimg.cc/vDZYqC8B)

When guest click on "Recycle Bin", a message that board is restricted is appeared, but guests shouldn't see such boards at all.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on March 16, 2023, 04:54:09 AM
Latest version works fine.

One question: after installing the mod, I installed a new theme. Seems like the mod tries to apply to that theme too, with disastrous results. Is it possible to disable it for a single theme? Again, I installed the theme *after* the mod, if it's got any significance...
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 16, 2023, 07:06:07 AM
Quote from: Speed King on March 16, 2023, 12:46:21 AMI'm using 1.2 version on my test forum. Hidden boards are visible for guests:

Click => (https://i.postimg.cc/vDZYqC8B/2023-03-16.png) (https://postimg.cc/vDZYqC8B)

When guest click on "Recycle Bin", a message that board is restricted is appeared, but guests shouldn't see such boards at all.

That is a smf default setting and has nothing todo with this mod, you should uncheck the checkbox for that board the guest access in the admin center: Administration Centerâ–º Boards and Categoriesâ–º Modify Boards, then settings Allowed Groups: Groups allowed to access this board.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 16, 2023, 07:08:20 AM
Quote from: Gryzor on March 16, 2023, 04:54:09 AMLatest version works fine.

One question: after installing the mod, I installed a new theme. Seems like the mod tries to apply to that theme too, with disastrous results. Is it possible to disable it for a single theme? Again, I installed the theme *after* the mod, if it's got any significance...

if you have the theme already installed try to uninstall mod then install it agian (after the new theme) and see if that helps.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Gryzor on March 16, 2023, 07:41:29 AM
Quote from: Pipke on March 16, 2023, 07:08:20 AM
Quote from: Gryzor on March 16, 2023, 04:54:09 AMLatest version works fine.

One question: after installing the mod, I installed a new theme. Seems like the mod tries to apply to that theme too, with disastrous results. Is it possible to disable it for a single theme? Again, I installed the theme *after* the mod, if it's got any significance...

if you have the theme already installed try to uninstall mod then install it agian (after the new theme) and see if that helps.
Hmm ok I'll try! So it isn't possible to not use the mod for a specific theme? 
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 16, 2023, 03:23:14 PM
Quote from: Gryzor on March 16, 2023, 07:41:29 AM
Quote from: Pipke on March 16, 2023, 07:08:20 AM
Quote from: Gryzor on March 16, 2023, 04:54:09 AMLatest version works fine.

One question: after installing the mod, I installed a new theme. Seems like the mod tries to apply to that theme too, with disastrous results. Is it possible to disable it for a single theme? Again, I installed the theme *after* the mod, if it's got any significance...

if you have the theme already installed try to uninstall mod then install it agian (after the new theme) and see if that helps.
Hmm ok I'll try! So it isn't possible to not use the mod for a specific theme?

This mod will work on other themes that are based of the smf default theme, so infact is the answer yes it does. However if themes have different setup on the default templates it can have strange behavior and it needs tweaks then.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: webtiryaki on March 17, 2023, 02:30:17 AM
Hi pipke, how can I remove the area codes I marked in the picture?

checkboxes

cehekbox.png
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: webtiryaki on March 17, 2023, 05:21:50 AM
Quote from: webtiryaki on March 17, 2023, 02:30:17 AMHi pipke, how can I remove the area codes I marked in the picture?

checkboxes

cehekbox.png

// Remove empty values
$ids = array_filter($ids);

return '<a href="' . $scripturl . '?'.$filter.'=' .(!empty($ids) ? implode(',', $ids) : 'clear'). ';'.$context['session_var'] . '=' . $context['session_id'] . '"><i class="rtbi-'.$icon.'" title="'.$txt['rtbi_forum_filter'].'"></i></a>';
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 19, 2023, 07:04:17 AM
@webtiryaki if you want to remove the checkboxes, the user can no longer filter the boards, are you sure you want that??
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: HelAu007 on May 11, 2023, 03:22:27 PM
Thanks a lot for your great mod !
Is there a special reason why you've limited it to 10 entries ?
I would like to have more :)
I will provide german language later.

Regards
Helmut
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on May 11, 2023, 03:47:13 PM
Quote from: HelAu007 on May 11, 2023, 03:22:27 PMThanks a lot for your great mod !
Is there a special reason why you've limited it to 10 entries ?
I would like to have more :)
I will provide german language later.

Regards
Helmut

glad you like it, you can easily change the number of topics

find in file Sources/RecentTopicsBoardIndex.php

            $rtbi['options']['per_page'] = $rtbi['options']['per_page'] == 5 ? 10 : 5;

replace the 10 with another number, note that the higher you set it... the more cpu the server has to load to fetch the data, this also depends on how many topics you have on your site, I would recommend not higher than 20
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: HelAu007 on May 15, 2023, 09:24:39 AM
Here are the german translations.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: HelAu007 on July 03, 2023, 10:47:29 AM
Hello
Is there a chance to go to the last topic in a thread when pressing on the recent posts , on a mobile i dont see the last posts column
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: zl0y on July 09, 2023, 02:37:09 PM
Hello
It's possible to move these checkbox for setup display topic categories to separate page? Main page looks very overloaded.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: TwitchisMental on December 05, 2023, 06:15:04 PM
Hey just noticed that I get this error every so often.

      
/forum/Themes/default/RecentTopicsBoardIndex.template.php (Line 88)
Backtrace information
Type of error: General
Error message Select
2: foreach() argument must be of type array|object, null given

&
2: Undefined array key "categories"
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on December 07, 2023, 05:08:02 AM
Quote from: TwitchisMental on December 05, 2023, 06:15:04 PMHey just noticed that I get this error every so often.

       
/forum/Themes/default/RecentTopicsBoardIndex.template.php (Line 88)
Backtrace information
Type of error: General
Error message Select
2: foreach() argument must be of type array|object, null given

&
2: Undefined array key "categories"

I can't reproduce that error, but I made some changes and I hope this will fix your error. Download the file in the attachment and overwrite it in your theme folder. Can you please respond if it is resolved.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: TwitchisMental on December 07, 2023, 07:40:18 PM
So far so good Pipke, no more errors to report.
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Dark Wizard on January 14, 2024, 08:28:28 AM
How to set default style?
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on January 15, 2024, 02:57:24 PM
Quote from: Dark Wizard on January 14, 2024, 08:28:28 AMHow to set default style?

click the second button from left (ps. if you hover it... the title says "align top, board default")
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Dark Wizard on January 16, 2024, 01:57:36 PM
Quote from: Pipke on January 15, 2024, 02:57:24 PMclick the second button from left (ps. if you hover it... the title says "align top, board default")
I mean, for all new visitors I want to set specific style by default
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on January 17, 2024, 02:56:08 PM
Quote from: Dark Wizard on January 16, 2024, 01:57:36 PMI mean, for all new visitors I want to set specific style by default

in file RecentTopicsBoardIndex.php 
change this line:
            'align' => isset( $_COOKIE['rtbi_align'] ) ? $_COOKIE['rtbi_align'] : 'left',to this:
            'align' => isset( $_COOKIE['rtbi_align'] ) ? $_COOKIE['rtbi_align'] : 'top',
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Bugo on March 17, 2024, 02:58:24 AM
Quote from: Pipke on March 15, 2023, 05:42:13 PMupdated mod, because it had a huge issue/bug, cant believe no one reported that yet ;)
Version 1.2 - Mar 15, 2023
- Fixed the constructpages

edit @Bugo, i've forgot to add your translation, i'll do it in next update.
Wouldn't want to wait until next year :)
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Thomas057 on March 17, 2024, 11:44:18 AM
How can I set it to top authomacally for all user I mean it will be rtbi=top
Title: Re: Recent Forum Topics on Board Index For 2.1.x
Post by: Pipke on March 17, 2024, 05:59:21 PM
Quote from: Thomas057 on March 17, 2024, 11:44:18 AMHow can I set it to top authomacally for all user I mean it will be rtbi=top

you can do that in admin... but if the user itself changes their own user setting, your admin setting will be overwritten, so the user setting will overwrite your admin setting, that's how I built it and think it's fair enough and user friendly.