BBCode with style

Started by davidhs, May 02, 2010, 02:40:59 AM

Previous topic - Next topic

davidhs

Quote from: recursiveMAX on November 15, 2013, 04:20:35 PM
I have a couple of questions. I was designing a template on my site with an image hosted at imgur as the background of the div. On preview, it looked great, but every time I would actually post the template, the external url would automatically turn into bbcode and screw up my template.

I turned off "automatically turn links into bbcode links", but then that screwed with another one of my mods, and I would really like to turn the links into bbcode again...

Is there any way to use a background image in a div:
1. without the link automatically turning into a click-able link
2. without uploading the background-image to my server (my members also make templates that have background images that are external links and I don't want to have to force them to upload all their background images to my server).
I suppouse your code is
[div style="background-image('http://image');"]...[/div]
Sorry but SMF parse all links (http:// ) into lick-able link :(

You have two solutions:

1. Upload image to your server. But you can not to do this :(
2. Use html instead of my MOD
[html]<div style="background-image: url('http://media.simplemachinesweb.com/smf/default/images/spanish_es-utf8/new.gif');">[/html]xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[html]</div>[/html]

On my forum works but not here:
Quote<div style="background-image: url('http://media.simplemachinesweb.com/smf/default/images/spanish_es-utf8/new.gif');">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>

davidhs

New version:
1.4.8   2014-01-25
------------------
+ SMF compatibility: 2.0.7.

davidhs

New version:
1.4.9   2014-06-23
------------------
! Use HTML entities in ISO-8859-1 languages.
+ SMF compatibility: 2.0.8.

Steve

I don't need to update if I already have it installed and it's working fine with 2.0.8 right? :)

(the language fix doesn't really apply to me)
DO NOT pm me for support!

davidhs

Yes, you do not need update this MOD :)

Only users with ISO-8859-1 languages.need update this MOD, but not is important.  They can not update.

Steve

DO NOT pm me for support!

davidhs

New version:
1.4.10  2014-10-07
------------------
+ SMF compatibility: 1.1.20 and 2.0.9.

gnowak

Regarding: "Sorry but SMF parse all links (http:// ) into lick-able link :("

Would it be possible to turn off the clickable link feature only when it is between BBCode?

SMF won't parse http:// when the switch "Automatically link posted URLs" is turne off. But it would be lovely to have it working only when it is outside BBCode.

http://example.com [nofollow] should be clickable, but [mycoolbbc]http://example.com [nofollow][/mycoolbbc] should not.

Just my thoughts.

Thanks.
Curriculum Vitae [nofollow]

davidhs

Quote from: gnowak on October 16, 2014, 04:04:21 PM
Regarding: "Sorry but SMF parse all links (http:// ) into lick-able link :("

Would it be possible to turn off the clickable link feature only when it is between BBCode?

SMF won't parse http:// when the switch "Automatically link posted URLs" is turne off. But it would be lovely to have it working only when it is outside BBCode.

http://example.com should be clickable, but [mycoolbbc]http://example.com[/mycoolbbc] should not.

Just my thoughts.

Thanks.
I did not find any mod with your request. It can be an idea for other mod. ;)

gnowak

Thanks for the quick reply. Yes, I guess this is an idea for another mod. :-D

BBC Parsing http://example.com [nofollow] instead of <a href="http://example.com [nofollow]">http://example.com [nofollow]</a> would be fantastic!

Thanks again for your time.
Curriculum Vitae [nofollow]

TourFL

Hello,

Did anybody manage to make the image rotation work? With more and more photos taken with mobile phones, users end up posting photos automatically rotated on their computer, and not rotated on the forum  :(

I run SMF 2.0.9, version 1.4.9 of "BBCode with style" and PHP 5.2. Image always shows as broken link.
I tried with images hosted on forum or externaly, doesn't change anything. As soon as it goes through the "Subs-BBCodeWithStyle-Image.php", there is no output (even with rotateangle=0)

Thanks for any help!
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

davidhs

Quote from: TourFL on March 23, 2015, 05:39:27 AM
Hello,

Did anybody manage to make the image rotation work? With more and more photos taken with mobile phones, users end up posting photos automatically rotated on their computer, and not rotated on the forum  :(

I run SMF 2.0.9, version 1.4.9 of "BBCode with style" and PHP 5.2. Image always shows as broken link.
I tried with images hosted on forum or externaly, doesn't change anything. As soon as it goes through the "Subs-BBCodeWithStyle-Image.php", there is no output (even with rotateangle=0)

Thanks for any help!
Sorry, but rotateangle, rotatebgcolor and flip do not work in all servers. :(

TourFL

Ok, but can I know if it uses some special php module, or has special requirements,permissions etc to work? I can surely ask my server hosting to install something if required.
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

davidhs

Quote from: TourFL on March 23, 2015, 05:56:45 AM
Ok, but can I know if it uses some special php module, or has special requirements,permissions etc to work? I can surely ask my server hosting to install something if required.
Yes.

First, it need GD library. In next update I will try to do that the mod detected if GD is installed, and if GD is not installed then image will be shown without processed.

Second, in my local server (Windows 7 + Apache 1.3) when an image is processed by Subs-BBCodeWithStyle-Image.php, a temporal file is created in root of my disk. I do not know if this happen in linux systems and permission are required. Perhaps this only happen in my system because my config files...

TourFL

Thanks, I made it work!

So I added so print in your code, and got this message when printing "exif_imagetype($_GET['image']);"

Warning: exif_imagetype() [function.exif-imagetype]: URL file-access is disabled in the server configuration in ..../Sources/Subs-BBCodeWithStyle-Image.php on line 97


After some search, I learned it comes from php.ini parameter "allow_url_fopen" which should be activated (off by default on my server). So problem comes from not being able to open stream from url.

I don't have acess tphp.ini file on my service provider, but this can be achieved in the  .htaccess file by adding the line
php_flag "allow_url_fopen" "On"

Now it works fine! thanks for your help!
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

davidhs

Quote from: TourFL on March 23, 2015, 06:38:03 AM
After some search, I learned it comes from php.ini parameter "allow_url_fopen" which should be activated (off by default on my server). So problem comes from not being able to open stream from url.

I don't have acess tphp.ini file on my service provider, but this can be achieved in the  .htaccess file by adding the line
php_flag "allow_url_fopen" "On"

Now it works fine! thanks for your help!
Wow. I am glad that this works!

roshaoar

Nice mod, thank you very much. I have a couple of questions if that's ok!

1) Can you suggest a way to make this work on attachments, rotating the thumbnail?
2) My users will want to rotate a lot of images, both attached and images hosted elsewhere. Can you suggest a way to make it supereasy for them, ie maybe some icons they can use on the BBC UIX and tag their img BBC with various rotates. Any suggestions?

Thank you for your time,

-Johan

davidhs

Quote from: roshaoar on April 29, 2015, 01:55:44 PM
Nice mod, thank you very much. I have a couple of questions if that's ok!

1) Can you suggest a way to make this work on attachments, rotating the thumbnail?
2) My users will want to rotate a lot of images, both attached and images hosted elsewhere. Can you suggest a way to make it supereasy for them, ie maybe some icons they can use on the BBC UIX and tag their img BBC with various rotates. Any suggestions?

Thank you for your time,

-Johan
I do not know... I will see if I can to do something on next update.

roshaoar

Thank you, davidhs!

I think (hope) I can use this to make some obvious icons that'll let the author rotate their images with this (I think). Still need to look into it.

But #1 is eluding me. I don't know where the programming is that affects thumbnails or how to even find thumbnails from a post. Do you know of any documentation that explains this, even in a roundabout way?

Thank you

-Johan

roshaoar

Hmmm, sorry to bother again and be needy, but having thought this worked perfectly I've just discovered that adding this mod seems to have messed up my ability to post an attachment. I've removed and tried rolling back but same problem seems to be happening. When I try and post an attached image I get a 500 error with:


Quote
The website cannot display the page
http://extreme-macro.co.uk/forum/buy-sell/?action=post2;start=0

In my error logs I see:

Quote
mod_fcgid: stderr: PHP Warning:  imagedestroy(): 5 is not a valid Image resource in /home/plat-linnas01/e/extreme-macro.co.uk/user/htdocs/forum/Sources/Subs-BBCodeWithStyle-Image.php on line 113, referer: http://extreme-macro.co.uk/forum/light-diffusers/links-test/

What would you recommend? posting text works fine - it goes to post, not post2

Thank you for your time,

-Johan

Advertisement: