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.
User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: How center an image in post??

Post by JoshyPHP » Mon Apr 17, 2017 4:28 pm

Replace your [centre] BBCode to use a proper DIV and you'll be able to center other block elements:

Code: Select all

<div style="text-align:center">{TEXT}</div>
You'll still have to reparse old posts though.
I wrote the thing that does BBCodes in 3.2.

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

Re: How center an image in post??

Post by Lumpy Burgertushie » Mon Apr 17, 2017 4:32 pm

also remember that you can spell the word centre in the bbcode tag but not in the actual html, it must be center for the html.

luck,
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
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 9:50 pm

JoshyPHP wrote:
Mon Apr 17, 2017 4:28 pm
Replace your [centre] BBCode to use a proper DIV and you'll be able to center other block elements:

Code: Select all

<div style="text-align:center">{TEXT}</div>
You'll still have to reparse old posts though.
Still doesn't work. Please read my replies above. :)
Image

User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: How center an image in post??

Post by JoshyPHP » Mon Apr 17, 2017 10:19 pm

It works for me. If if doesn't for you, describe how to reproduce it on a new board, including the custom BBCode you use.

Edit: your previous posts are all over the place, you should probably open a new topic for it. Also, I think this bug report is invalid and doesn't mention your custom BBCode either.
I wrote the thing that does BBCodes in 3.2.

User avatar
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 10:43 pm

Sorry for the confusion. :lol:

I do provide this info here: viewtopic.php?p=14715956#p14715956

But here it is in case you are still confused: :roll:

BBCode usage

Code: Select all

[center]{TEXT}[/center]
HTML replacement

Code: Select all

<div align="center">{TEXT}</div>
Help line

Code: Select all

[center]your text here[/center]
Here is an online demo forum that you can test this issue at: http://forum.mattfriedman.me/viewtopic.php?f=8&t=1663 -- I just created an example post. It auto-prunes itself daily, so if it you get a "doesn't exist message" simply create a new post here: http://forum.mattfriedman.me/viewforum.php?f=8

I am very curious as to why it works for you on your phpBB 3.2 for inline attachments. That gives me hope, but the question is what are you placing there between the center bbcode? I am only referring to inline attachments that has this issue/bug. Normal text or URLs of images using the [img] bbcode worke fine.

Please also read VSE's report above my posts.

My 3.2x site is offline at the moment. So I can't help you there. Do you have your 3.2x site live? Maybe I can test your site with my issue? link?

FYI, VSE and I started to discuss this bug in this other topic: https://www.phpbb.com/customise/db/exte ... 86#p554586

I don't think I need to create a new topic. I already presented my issue to the phpBB dev team. And I used this topic to post screenshots and examples of the bug, but I can always revise my bug report and present more evidence if necessary. Still waiting for a reply by them.
Image

User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: How center an image in post??

Post by JoshyPHP » Mon Apr 17, 2017 11:04 pm

M.O.B. wrote:
Mon Apr 17, 2017 10:43 pm
Here is an online demo forum that you can test this issue at: http://forum.mattfriedman.me/viewtopic.php?f=8&t=1663
That thread uses a <span> element, that's why it doesn't work. If you use a template with a <div> it should work as expected. It works on my local 3.2.0 install. I don't have a public forum.

I don't know if browsers still support the deprecated align attribute. Use CSS instead:

Code: Select all

<div style="text-align:center">{TEXT}</div>
I wrote the thing that does BBCodes in 3.2.

User avatar
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 11:11 pm

JoshyPHP wrote:
Mon Apr 17, 2017 11:04 pm
That thread uses a <span> element, that's why it doesn't work. If you use a template with a <div> it should work as expected. It works on my local 3.2.0 install. I don't have a public forum.

I don't know if browsers still support the deprecated align attribute. Use CSS instead:

Code: Select all

<div style="text-align:center">{TEXT}</div>
Now I'm confused. :roll:

I tried replacing your HTML code above for the center bbcode, and started a new topic in my offline board, and it doesn't work with INLINE attachments.

Are you sure you are testing inline attachments?

Please provide a screenshot and also a URL code on how it looks on your offline site. -- Remember if you press PREVIEW it will show correctly, but when you SUBMIT the post that's when it doesn't show correctly.

P.S. my HTML BBCode is using a <div> and not a <span> see code below:

Code: Select all

<div align="center">[attachment=0]Clipboard02.png[/attachment]</div>
Last edited by M.O.B. on Mon Apr 17, 2017 11:15 pm, edited 1 time in total.
Image

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17050
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: How center an image in post??

Post by DavidIQ » Mon Apr 17, 2017 11:14 pm

It's a toss up on support since HTML5 does not support it but browsers might still recognize it, for now.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: How center an image in post??

Post by JoshyPHP » Mon Apr 17, 2017 11:18 pm

M.O.B. wrote:
Mon Apr 17, 2017 11:11 pm
P.S. my HTML BBCode is using a <div> and not a <span> see code below:

Code: Select all

<div align="center">Clipboard02.png</div>
Dude, you need to stop and reassess. This is not the HTML I told you to use, I don't know how else to say it. I posted it twice and you keep using the same thing that doesn't work.
I wrote the thing that does BBCodes in 3.2.

User avatar
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 11:29 pm

JoshyPHP wrote:
Mon Apr 17, 2017 11:18 pm
M.O.B. wrote:
Mon Apr 17, 2017 11:11 pm
P.S. my HTML BBCode is using a <div> and not a <span> see code below:

Code: Select all

<div align="center">Clipboard02.png</div>
Dude, you need to stop and reassess. This is not the HTML I told you to use, I don't know how else to say it. I posted it twice and you keep using the same thing that doesn't work.
Dude?

I already told you that I also tested yours: (please read my replies earlier in this topic: viewtopic.php?p=14716636#p14716636 and viewtopic.php?p=14716671#p14716671 ).

Code: Select all

<div style="text-align:center">{TEXT}</div>
Comprende? Capisci? Understand? :lol:

I'm not trying to be difficult or a dick, I'm hoping we find a solution to this--I win if it gets solved. Please provide a screenshot and also a screenshot of your source file. Since I can't use your offline site to a make a test.
Last edited by M.O.B. on Tue Apr 18, 2017 12:28 am, edited 2 times in total.
Image

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17050
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: How center an image in post??

Post by DavidIQ » Mon Apr 17, 2017 11:32 pm

I can verify the above suggestion works just fine.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 11:44 pm

DavidIQ wrote:
Mon Apr 17, 2017 11:32 pm
I can verify the above suggestion works just fine.
Your site seems to be using something else also -- by inspecting the source file: ReIMG-ZoomIn?

Code: Select all

<div style="text-align: center"><div class="inline-attachment">
			
		
				<dl class="file">
			<dt class="attach-image"><a href="http://phpbb.davidiq.com/download/file.php?id=158" data-reimgwidth="451" data-reimgheight="57" title="Zoom in (real dimensions: 451 x 57)" class="ReIMG-Anchor"><span class="ReIMG-ZoomIn"></span><img src="./download/file.php?id=158" class="postimage" alt="annoy_web_dev.png" onclick="viewableArea(this);"></a></dt>
						<dd>annoy_web_dev.png (7.38 KiB) Viewed 7 times</dd>
		</dl>
		
		
		
			</div>
I created an account over there: MOB -- can you give me permissions to be able to upload an attachment and also use bbcode. I want to test something out??
Image

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17050
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: How center an image in post??

Post by DavidIQ » Mon Apr 17, 2017 11:53 pm

M.O.B. wrote:
Mon Apr 17, 2017 11:44 pm
Your site seems to be using something else also -- by inspecting the source file: ReIMG-ZoomIn?
Yeah ReIMG is my own extension and isn't doing anything to make the center BBCode work. It's just adding more elements for the image zooming. You should be able to attach an image now. I've disabled ReIMG for your testing pleasure.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
M.O.B.
Registered User
Posts: 927
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. » Mon Apr 17, 2017 11:59 pm

DavidIQ wrote:
Mon Apr 17, 2017 11:53 pm
M.O.B. wrote:
Mon Apr 17, 2017 11:44 pm
Your site seems to be using something else also -- by inspecting the source file: ReIMG-ZoomIn?
Yeah ReIMG is my own extension and isn't doing anything to make the center BBCode work. It's just adding more elements for the image zooming. You should be able to attach an image now. I've disabled ReIMG for your testing pleasure.
I still don't have attachment or bbcode permissions. :(

I'm glad to see it works on your site. I am thrilled. I want this fix so bad! :)

Hopefully VSE can make sense as to why it works on your site.
Image

User avatar
JoshyPHP
Code Contributor
Posts: 1012
Joined: Mon Jul 11, 2011 12:28 am

Re: How center an image in post??

Post by JoshyPHP » Tue Apr 18, 2017 12:15 am

Try a clean install on your own server. There is something wrong on your side and nobody can help you with that. Maybe you have an extension that overwrites the good [center] BBCode or [centre] BBCode or whatever BBCode you use to center things, maybe you think you're doing something but you're actually doing something else, maybe there is a rare condition in a cache somewhere that makes your board use the wrong HTML. Either way, this is something that is specific to your setup.
I wrote the thing that does BBCodes in 3.2.

Post Reply

Return to “[3.2.x] Support Forum”