Recent Forum Topics on Board Index For 2.1.x

Started by Pipke, February 04, 2023, 01:07:56 PM

Previous topic - Next topic

Pipke

Link to the mod

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:
  • Change on wich side you want it to display
  • Filtering the forum topics by selecting categories or boards
  • Display posters avatars (Note: this only works if you have the Avatars Display Integration mod installed)
  • More...

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

Version 1.0 - Jan 17, 2023
- Initial Release
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

TwitchisMental


-Rock Lee-

Good job and I'll leave you the translation by the way :D


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Matias-

Hello, thanks for the mod. One question, if I only want to use the recent topic, how can I do it?



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!

Pipke

@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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Matias-

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!

Gryzor

#6
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.

Pipke

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?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

@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();

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Gryzor

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... 😐

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Matias-

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?


Pipke

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?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Matias-

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.

Pipke

@Matias- I'll put it in ideas for the next update to add that option.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Matias-

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

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

updated mod to v1.1

- Fixed undefined array key due php > 8.0
- Added language Spanish_Latin by Rock Lee
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

EthanR

Can you make it like the 2.0 version with the round poster avatars next to the topic?

Pipke

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?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

EthanR

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?

Pipke

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
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

EthanR

 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).

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Bugo


Gryzor

+1 for adding the avatar on mobile view if possible? 

Gryzor

#26
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 .

Pipke

#27
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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Speed King

I'm using 1.2 version on my test forum. Hidden boards are visible for guests:

Click =>

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

Gryzor

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...

Pipke

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 =>

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Gryzor

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? 

Pipke

#33
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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

webtiryaki

Hi pipke, how can I remove the area codes I marked in the picture?

checkboxes

You cannot view this attachment.

webtiryaki

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

You cannot view this attachment.

// 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>';

Pipke

@webtiryaki if you want to remove the checkboxes, the user can no longer filter the boards, are you sure you want that??
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

HelAu007

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

Pipke

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
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

HelAu007


HelAu007

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

zl0y

Hello
It's possible to move these checkbox for setup display topic categories to separate page? Main page looks very overloaded.

TwitchisMental

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"

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

TwitchisMental

So far so good Pipke, no more errors to report.


Pipke

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")
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Dark Wizard

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

Pipke

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',
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Bugo

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 :)

Thomas057

How can I set it to top authomacally for all user I mean it will be rtbi=top

Pipke

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.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

EthanR

Hi Pipke, I would really like to set default options for all users (recent topics on top and forum below).

How can I modify the mod to do this and remove the config buttons on the top right so it can't be changed?

EthanR

 @Pipke Is also possible to when you click on the recent topic heading to link to the latest post and not page 1 of the thread? :)

Pipke

Quote from: EthanR on October 18, 2024, 08:47:04 PMHi Pipke, I would really like to set default options for all users (recent topics on top and forum below).

How can I modify the mod to do this and remove the config buttons on the top right so it can't be changed?
Quote from: EthanR on October 19, 2024, 04:17:10 PM@Pipke Is also possible to when you click on the recent topic heading to link to the latest post and not page 1 of the thread? :)

Ive edited the mod file to your wishes...
Replace the attached file in your Sources folder, be sure to make backup of original file first.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

EthanR


Advertisement: