How center an image in post??

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
registrado
Registered User
Posts: 10
Joined: Sat Nov 29, 2014 12:11 am

How center an image in post??

Post by registrado »

How to center an image in a post
divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: How center image in post??

Post by divingbrit »

The way I do it, and there are proberly other ways , there is an extension to place the image 'inline' called
"Inline images in attachment"
And then use another extension 'Advance BBcode box to center image.

Sounds long winded, but its just a number of clicks
Shy but working at it
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22833
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: How center image in post??

Post by Mick »

A simpler way is to use the custom BBCode Centre Align Text which, when it surrounds IMG tags, will centre an image in a post.

Example: [centre][img]http://mysite.com/images/smilies/icon_question.gif[/img][/centre]
"The more connected we get the more alone we become" - Kyle Broflovski©
registrado
Registered User
Posts: 10
Joined: Sat Nov 29, 2014 12:11 am

Re: How center image in post??

Post by registrado »

Before update 3.2 attachments-Images could now be placed in the center of any part of a post by using the [attachment=][/attachment] BBCode. Now version 3.2 all attachements-images in my forum are placed always at bottom of the post not as image, only as attached.

How can I place attachements-images centered in any part of the post: example:

Captura de pantalla 2017-01-11 a las 15.45.05.png
Last edited by registrado on Wed Jan 11, 2017 3:32 pm, edited 1 time in total.
divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: How center image in post??

Post by divingbrit »

Thats why I used the ext "Inline images in attachment", which is a quick method of making the image available, putting the code at the point of the curser, then using the BBcode to center the image.

If the code is wrongly put on the bottom of the page, just cut and paste where it is needed
Shy but working at it
registrado
Registered User
Posts: 10
Joined: Sat Nov 29, 2014 12:11 am

Re: How center image in post??

Post by registrado »

Since I upgraded to 3.2 I have hundreds of posts that now do not work with attached centered images.
I just need to center the attached images in the post. I need BBCODE works at attachaments.
I need bbcode that works with attachments, I think in version 3.2 it can not
divingbrit
Registered User
Posts: 86
Joined: Fri Mar 21, 2003 3:18 pm

Re: How center image in post??

Post by divingbrit »

Sorry to hear that, but,I have just rechecked, and using 3.2 and ext 'inline images in attachment' with ext 'Advanced BBcode box" works fine for me

Hopefully someone else can suggest whats gone wrong.
Shy but working at it
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22833
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: How center image in post??

Post by Mick »

OK, let's step back a second here, @OP: your original post asked:
registrado wrote:
Tue Jan 10, 2017 9:49 pm
How to center an image in a post
Which was answered, but then:
registrado wrote:
Wed Jan 11, 2017 3:53 pm
Since I upgraded to 3.2 I have hundreds of posts that now do not work with attached centered images.
I just need to center the attached images in the post. I need BBCODE works at attachaments.
I need bbcode that works with attachments, I think in version 3.2 it can not
Which is a completely different issue.

Before 3.2 how did you center attachment images?

Can you list the extensions you're presently using?
"The more connected we get the more alone we become" - Kyle Broflovski©
registrado
Registered User
Posts: 10
Joined: Sat Nov 29, 2014 12:11 am

Re: How center image in post??

Post by registrado »

This is the problem: I can´t center attachment with BBCODE:

Code: Select all

[center]attachment[/center]
BBCODE for center image only works for center TEXT, not IMAGE. This only happens in phpbb version 3.2.
Version 3.1.10 works fine.

This is the problem:
Captura de pantalla 2017-01-11 a las 19.24.13.jpg
Extensions:
Captura de pantalla 2017-01-11 a las 19.50.32.png
paopevil
Registered User
Posts: 1
Joined: Sat Jan 21, 2017 9:50 am

Re: How center image in post??

Post by paopevil »

Find file "bbcode.html" in folder "template". Insert tag <center></center>.
343.jpg
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5263
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: How center image in post??

Post by MattF »

Actually this is an issue in phpBB 3.2.

You can not nest an inline attachment inside many BBCodes.

Put it in the CODE or LIST BBCodes and it breaks. Or any of the built in text formatting or custom BBCodes such as alignment codes.

The issue seems to be with the BBCodes that use a <span> element. If so, the inline attachment rendering seems to break (displaying: [attachment=0]Clipboard02.png[/attachment], and renders as plain text, and phpBB falls back to displaying the attachment in the non-inline way.

This is how [align=center][attachment=0]Clipboard02.png[/attachment][/align]is stored in the db:

Code: Select all

<r><ALIGN align="center"><s>[align=center]</s>[attachment=0]Clipboard02.png[/attachment]<e>[/align]</e></ALIGN></r>
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
3Di
Former Team Member
Posts: 16038
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: How center image in post??

Post by 3Di »

Actually, it doesn't center images also with css only, using URL&IMG tags. In 3.1 it does.
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
Looking for a specific feature or alternative option? We will rock you! 🚀
User avatar
M.O.B.
Registered User
Posts: 942
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: How center image in post??

Post by M.O.B. »

Man! I'm really hoping we can figure out a solution to this issue. Perhaps phpBB developers need to figure out how to fix this???

I tend to use a lot the PLACE INLINE attachment feature button to place attached images centered on a topic, this way it looks a bit like a news page blog.

Here an example on phpBB 3.1.x using the newspage extension: http://www.mixingonbeat.com/phpbb/app.php/news -- plus when you then go to the main topic, you still see the attached inline image centered.

Basically using the following bbcode syntax:

Code: Select all

[center][attachment=1]image.png[/attachment][/center]
But now with phpBB 3.2 this is broken. Now it shows up like this:
center_inline_attachment_test_-_MattFriedman.me_-_2017-04-14_21.33.36.png
Notice how it just shows the text on the post where the attached inline image should be, and instead just places the attachment at the bottom.

WORKAROUND:
I did find a workaround, but it's going to take me ages to update all my sites that use this type of pattern -- plus since phpBB doesn't have a bbcode parser, I think I will have to open each post and then submit so the new changes take affect.

The workaround is to place it within a quote box:

Code: Select all

[quote][center][attachment=1]image.png[/attachment][/center][/quote]
Using the above example, it will look like this:
[Tip]_Factors_To_Consider_Quinceañera_Plus_Size_Dresses_-_My15Birthday_-_Quinceañera_Forum_-_2017-04-15_18.45.22.png
This is how the workaround quote fix looks like in the database for phpBB 3.2:

Code: Select all

<QUOTE><s>[quote]</s><CENTER><s>[center]</s><ATTACHMENT filename="Clipboard02.png" index="0"><s>[attachment=0]</s>Clipboard02.png<e>[/attachment]</e></ATTACHMENT><e>[/center]</e></CENTER><e>[/quote]</e></QUOTE>
So, I was wondering if we could study the quote feature in phpBB and also make the center bbcode act the same way, regardless of the code we place within?

P.S. I haven't gone live with phpBB 3.2 on all my sites. But the clock is ticking and I know I gotta update them soon, but this issue is killing me. I need help from the bbcode / phpBB Gods! :lol:

I think what phpBB devs should do is give us a placement option when placing an inline attachment in a post -- meaning being able to select if we want it centered and etc. This way, we don't need to use bbcode for that. Just a thought. -- Of course this will still kill me, because right now I got thousands of threads that are broke because inline attachments can't be centered using bbcode in phpBB 3.2. So if they add such a feature, I will spend years fixing them all.
paopevil wrote:
Sat Jan 21, 2017 10:08 am
Find file "bbcode.html" in folder "template". Insert tag <center></center>.

Image
The issue with this workaround, is that not all inline attachments need to be centered, like zip files, docs, and etc. Or other images that we place in a guide/tutorial type of page/post.
Last edited by M.O.B. on Mon Apr 17, 2017 2:08 am, edited 1 time in total.
Image
User avatar
M.O.B.
Registered User
Posts: 942
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: How center an image in post??

Post by M.O.B. »

UPDATE:

I started a Bug Tracker about this issue: https://tracker.phpbb.com/browse/PHPBB3-15177

It seems back in 2007 there was a similar bug: https://tracker.phpbb.com/browse/PHPBB3-5959

I don't think it has been officially reported to them--I did a search and could not find a recent report. I'm hoping they figure this out. I have tons of posts broken because of this issue. :(

If anyone has some php code they can offer to fix this, please let me know? I'm willing to use that code on my offline 3.2 site.
Image
User avatar
M.O.B.
Registered User
Posts: 942
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: How center an image in post??

Post by M.O.B. »

UPDATE 2:

Here is something odd.

When we add an inline image attachment on the post like this: (just like before)

Code: Select all

[center][attachment=0]Clipboard02.png[/attachment][/center]
And we press the "PREVIEW" button, we can see the image inline attachment being displayed and centered correctly.

Here is the HTML code that displays when in PREVIEW mode:

Code: Select all

<div align="center">
	<div class="inline-attachment">
		<dl class="thumbnail">
			<dt><a href="./download/file.php?id=316&amp;mode=view"><img src="./download/file.php?id=316&amp;t=1" class="postimage" alt="Clipboard02.png" title="Clipboard02.png (663.73 KiB) Viewed 22 times"></a></dt>
		</dl>
	</div>
</div>
It seems the issue is only when we press the SUBMIT button, it's when it displays it wrong.

Here is the HTML code that displays in SUBMIT mode:

Code: Select all

<div align="center">[attachment=0]Clipboard02.png[/attachment]</div>
So I am thinking that it's suppose to work, but there might be a bug somewhere in the code??

BTW, this is how it looks like in the database:

for phpBB 3.2:

Code: Select all

<CENTER><s>[center]</s>[attachment=0]Clipboard02.png[/attachment]<e>[/center]</e></CENTER>
for phpBB 3.1.10:

Code: Select all

[center:22citped][attachment=0:22citped]<!-- ia0 -->Clipboard02.png<!-- ia0 -->[/attachment:22citped][/center:22citped]
So it seems to be different! Why? I wonder if the database update process from phpBB 3.1.10 to 3.2 changed that? Anyone?
Image
Post Reply

Return to “[3.2.x] Support Forum”