How to center external images in viewtopic

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
Locked
forforce
Registered User
Posts: 323
Joined: Fri Oct 04, 2013 7:57 am
Contact:

How to center external images in viewtopic

Post by forforce » Sun Sep 14, 2014 10:26 am

Hi, as you can see in this topic: http://www.cumseface.eu/viewtopic.php?t=246 , 1st image is from an external link , added with "img" default bbcode and is aligned to left. Other images are internal(attachments) and I made them to be aligned to center.

Can somebody make a mod that can make external images added with default bbcode to be aligned to center?
Thank you.
https://www.cumseface.eu , We have tutorials for everything / Te ajutam se te descurci singur .

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

Re: How to center external images in viewtopic

Post by Lumpy Burgertushie » Sun Sep 14, 2014 2:57 pm

easiest way is to create a new bbcode:

bbcode:

Code: Select all

[image]{URL}[/image]
html replacement:

Code: Select all

<div style="text-align: center;"><img src="{URL}"></div>
just post the url of the image in the bbcode.

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?

forforce
Registered User
Posts: 323
Joined: Fri Oct 04, 2013 7:57 am
Contact:

Re: How to center external images in viewtopic

Post by forforce » Sun Sep 14, 2014 9:37 pm

Ok, thank you for reply, I will do that but I don`t want to have 2 bbcodes for external images. Can I delete the default bbcode (that doesn`t center the image) so it won`t appear there? Thank you.

Edit:
In: template/bbcode.html
I found and changed the code to:

Code: Select all

<!-- BEGIN img --><tr><td align="center"><img src="{URL}" alt="{L_IMAGE}" /></td></tr><!-- END img -->
but is not working :( (I tried to edit the default code)

Edit 2 (Solved):
In: includes/bbcode.php
I found and changed the code from:

Code: Select all

<img src="$1" alt="' . $user->lang['IMAGE'] . '" />
to:

Code: Select all

<div style="text-align: center;"><img src="$1" alt="' . $user->lang['IMAGE'] . '" /></div>
Thank you anyway for guiding me and for reply.
https://www.cumseface.eu , We have tutorials for everything / Te ajutam se te descurci singur .

Locked

Return to “[3.0.x] MOD Requests”