phpBB : MOD (un)subscribed button on forum list

This is a modification of phpBB 3.1.10 code (edit : also tested for 3.3.10) which add subscription/unsubscription buttons (ON/OFF style) on the right of forum list such as users can see directly their subscriptions. And by clicking on button, the status of subscription if toggled. Simple and clear:Original presentation about this MOD, and related comments/improvements, are there: https://www.phpbb.com/customise/db/mod/watch_forum_link_on_forum_list/support/topic/94167

Procedure

Please, make a copy of original phpBB files before editing…

Open: includes/functions_display.php

Find:

Add before:

Comment: this is to get watching status of current user in s_watching_forum array. I don’t know exactly if I use the watch_topic_forum function properly, but it seems to be OK…

And Add after: (on a new blank line)

Save the file.

Open: styles/prosilver/template/forumlist_body.html

Find:

Add after:

Comments:
Translation in french for title elements above:
OFF: « Actuellement, vous n’êtes pas abonné(e) à ce forum. Cliquez ici pour vous ABONNER, ainsi vous recevrez un email lorsqu’un nouveau message sera posté dans ce forum. »
ON: « Vous êtes actuellement abonné(e) à ce forum. Cliquez ici pour vous DÉSABONNER et ne plus recevoir les emails de ce forum. »

Save the file.

File copy

Download icons.zip archive here:

icons

and copy png files in your styles/prosilver/theme/images/ directory.

I give you 3 sets of icons:

off.png, off-faded.png and on.png: red (OFF), faded red (OFF) and green (ON) buttons 126×54 px (big size, use it to make reductions as you like)

off-30.png, off-faded-30.png and on-30.png: same but 70×30 px (medium size)

off-20.png, off-faded-20.png and on-20.png: same but 47×20 px (small size, used in screen capture)

The faded red is only an alternative for esthetic reason, if you consider there is too much flashy red on you forum…

Final

Finally, clear cache via ACP, or by deleting all files in the /cache directory (except .htaccess and index.htm).