How to add a custom image to the ban message screen

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
Miu
Registered User
Posts: 2
Joined: Sat Apr 20, 2019 2:40 pm
Location: Ontario, Canada
Name: William Moreland
Contact:

How to add a custom image to the ban message screen

Post by Miu » Sat Apr 20, 2019 2:47 pm

Hi, I'm wondering if anyone could tell me how to add an image below the message that shows up when someone has been banned from my forum. Is there an easy way to do this?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50812
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to add a custom image to the ban message screen

Post by stevemaury » Sat Apr 20, 2019 2:56 pm

What message that shows up where?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Miu
Registered User
Posts: 2
Joined: Sat Apr 20, 2019 2:40 pm
Location: Ontario, Canada
Name: William Moreland
Contact:

Re: How to add a custom image to the ban message screen

Post by Miu » Sat Apr 20, 2019 3:04 pm

I've attached a screenshot with an arrow pointing to where I mean. I just want to have an image displayed, but I'm not sure which files I need to edit to do so.

Image

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50812
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to add a custom image to the ban message screen

Post by stevemaury » Sat Apr 20, 2019 8:59 pm

No way I can read that. Why don't you really attach it rather than embed it?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
3Di
Former Team Member
Posts: 14245
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: How to add a custom image to the ban message screen

Post by 3Di » Sat Apr 20, 2019 9:07 pm

https://i.imgur.com/8QdhBLe.png

that could be probably done via an extension, see:

Code: Select all


		/**
		* Event to set custom ban type
		*
		* @event core.session_set_custom_ban
		* @var	bool		return				If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution
		* @var	bool		banned				Check if user already banned
		* @var	array|false	ban_row				Ban data
		* @var	string		ban_triggered_by	Method that caused ban, can be your custom method
		* @since 3.1.3-RC1
		*/
Not quite sure though, perhaps another event should be made to append the $message var.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 6532
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: How to add a custom image to the ban message screen

Post by Raul [ThE KuKa] » Sun Apr 21, 2019 10:12 am

Nice style, but... :roll: HikiOta Style by William Moreland this is NOT true. :twisted:

This is the original style copyright: Flat Style by Ian Bradley
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate with Image
:flag_es: phpBB Spain - Online Since 2003 :heart:



User avatar
Lumpy Burgertushie
Registered User
Posts: 66741
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How to add a custom image to the ban message screen

Post by Lumpy Burgertushie » Sun Apr 21, 2019 3:38 pm

just some helpful suggestions:

replace that collection of background images with just one image. your background takes forever to load.
and, nobody can see all those images behind the board anyway
and, you can add your name to the credits along with the original designer. for example:
HikiOta Style by William Moreland based on Flat Style by Ian Bradley

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
EA117
Registered User
Posts: 954
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: How to add a custom image to the ban message screen

Post by EA117 » Sun Apr 21, 2019 5:00 pm

If you wanted to add an image which always shows on this "INFORMATION" message page, then the message_body.html template in the style is what can be modified. This would be if the additional image is "just for aesthetic purposes", and you want the additional image to display 100% of the time, regardless of whether the "INFORMATION" message being shown is in relation to banning or for some other reason.

If you did want the image to ONLY show when a banned user was being rejected, there isn't any template specific to that scenario, nor does there appear to be a template-testable condition defined that would help you detect this usage of message_body.html. Which is why 3Di recommended that an extension that tries to manipulate the ban reason such that it includes the additional HTML for your image may the the required solution.

If I was trying to implement that on my board, I would simply modify the /phpbb/session.php module to add the additional HTML to this "banned user" case directly, without using an extension. e.g. In phpBB 3.2.5, right after session.php line 1286, where you see other literal HTML being used to compose the banned user message:

Code: Select all

			$contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);
			$message = sprintf($this->lang[$message], $till_date, '<a href="' . $contact_link . '">', '</a>');
			$message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : '';
			$message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>';
			
			// My additional message line to display a custom image:
			$message .= '<br /><img src="/myboard/images/banned.png">';
That comes with all the expected caveats of "you will lose this change every time you update phpBB", since the session.php will be overwritten with the shipping version again. But for such a small change, and for such a benign "cosmetic issue", that might be an acceptable cost and appropriate level of investment, compared to trying to get an extension created just for this. For what it's worth.

Post Reply

Return to “[3.2.x] Styles Support & Discussion”