BBCode with style

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

Previous topic - Next topic

davidhs

Quote from: roshaoar on April 29, 2015, 06:09:04 PM
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?
I do not known documentation about this. You can see files:
- Sources/Display.php, line 1449, function loadAttachmentContext()
- Themes/default/Display.template.php, line 497

Quote from: roshaoar on April 30, 2015, 04:27:19 AM
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:...
:o I have this mod installed in a test forum and an operation forum and attach files and images works... I do not known cause of your problem. Sorry :(

roshaoar

Thanks for taking the time to respond davidhs, much appreciated. I'm now suspecting another mod has caused this - but rolling back has sadly massively failed :). So I'll just do a complete reinstall I guess!

Thanks for pointing me to those files

roshaoar

fyi - was user error (partially). I reinstalled and it did the same on a fresh no mods install!!! Turns out the image I was trying to post had something bad about it maybe size or something (no error message though, just a white default 500)... With a different image it went fine.

Thanks again

-Johan

davidhs

I updated this mod.

Quote from: davidhs on March 23, 2015, 06:16:15 AM
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.
If rotate or flip of image fail, the original image is shown.




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!
I can not activate this on source code, must be activated in php.ini or .htaccess file. I add a note in readme.txt file.




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
Sorry, I have not done any of this.

1) I think this is not very useful and requires changes beyond the scope of this mod (BBC code).

2) I will not add buttons for insert img BBC various rotates because are not very useful. Other reason, you can use style/class attribute in hr/img/li/list/table/tr/td tag and I do not add button for these, only for div/span.
You can to do these:
- Write a warning on forum with new bbc tags/attributes. For example: "Use [img rotateangle=n]http://...[/img] for rotate an image n degrees".
or
- Add yourself buttons for insert these BBC. This would be another mod :) Steps (using SMF 2.0.x):
1. Create buttons of image rotate 90º, 180º and 270º (named img90.gif, img180.gif, img270.gif), similar to , and move to /Themes/default/images/bbc/
2. Create a file named Subs-MyBbcButtons.php with this content:

<?php

if (!defined('SMF'))
die('Hacking attempt...');

function 
my_bbc_buttons(&$bbc_tags)
{
// This insert a gap
$bbc_tags[1][] = array();

// This insert a button with bbc [img rotateangle=90]...[/img]
$bbc_tags[1][] = array(
'image' => 'img90'// File name without ".gif".
'code' => 'img',
'before' => '[img rotateangle=90]',
'after' => '[/img]',
'description' => 'Rotate 90º',
);
// This insert a button with bbc [img rotateangle=180]...[/img]
$bbc_tags[1][] = array(
'image' => 'img180',
'code' => 'img',
'before' => '[img rotateangle=180]',
'after' => '[/img]',
'description' => 'Rotate 180º',
);
// This insert a button with bbc [img rotateangle=270]...[/img]
$bbc_tags[1][] = array(
'image' => 'img270',
'code' => 'img',
'before' => '[img rotateangle=270]',
'after' => '[/img]',
'description' => 'Rotate 270º',
);
}

?>


and move to /Source/
If you do not create buttons, description will displayed instead of button.
3. In Source/Load.php, search "// Any files to pre include?" (near line 317) and insert these before:

add_integration_function('integrate_pre_include', '$boarddir/Sources/Subs-MyBbcButtons.php', false);
add_integration_function('integrate_bbc_buttons', 'my_bbc_buttons', false);

line 317 --> // Any files to pre include?

davidhs

New version:
1.5     2015-05-23
------------------
@ PHP configuration option "allow_url_fopen" must be activated in php.ini or .htaccess file.
* If rotate or flip of image fail, the original image is shown.
+ SMF compatibility: 1.1.21 and 2.0.10.

TourFL

Hello,

I keep getting some errors in my logs with one of the module's file:

http://<mysite>/index.php?action=printpage;topic=6078.0
8: Undefined offset: 1
File: <root_dir>/web/Sources/Subs-BBCodeWithStyle.php(66) : runtime-created function
Line: 4

Then the same with offset 2, 3

I run version 1.4.9 of the module, with SMF 2.0.10

Any idea how to solve this?

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

davidhs

Quote from: TourFL on August 25, 2015, 04:57:09 AM
Hello,

I keep getting some errors in my logs with one of the module's file:

http://<mysite>/index.php?action=printpage;topic=6078.0
8: Undefined offset: 1
File: <root_dir>/web/Sources/Subs-BBCodeWithStyle.php(66) : runtime-created function
Line: 4

Then the same with offset 2, 3

I run version 1.4.9 of the module, with SMF 2.0.10

Any idea how to solve this?

Thanks!
Sorry, I do not see the cause of this error message. :(

Usually, these messages are not important, you do not worry.

This error is created when you visit http://<mysite>/index.php?action=printpage;topic=6078.0
Is it created when you visit http://<mysite>/index.php?topic=6078.0 ?

You can to do this:
- Update my mod to last version.
- Tell me content of your topic http://<mysite>/index.php?topic=6078.0

TourFL

Thanks for your help!

The specificity of the topics generating errors, is that it uses [img rotateangle=<degree>] for some images. Errors only appear in those topics.
Adress is: http://www.500-126.com/index.php?topic=6078.0

The error is not generated when viewing the topic normally, only when a user tries to print it.

If I try to print a topic with photos, but not using the rotation, it doesn't generate errors.

I installed version 1.5 of your module, the error is still here  :(
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

davidhs

Quote from: TourFL on August 25, 2015, 07:53:35 AM
Thanks for your help!

The specificity of the topics generating errors, is that it uses [img rotateangle=<degree>] for some images. Errors only appear in those topics.
Adress is: http://www.500-126.com/index.php?topic=6078.0

The error is not generated when viewing the topic normally, only when a user tries to print it.

If I try to print a topic with photos, but not using the rotation, it doesn't generate errors.

I installed version 1.5 of your module, the error is still here  :(
Ok, I will test print with rotate.

Thank you for warning,

davidhs

Quote from: TourFL on August 25, 2015, 04:57:09 AM
Hello,

I keep getting some errors in my logs with one of the module's file:

http://<mysite>/index.php?action=printpage;topic=6078.0
8: Undefined offset: 1
File: <root_dir>/web/Sources/Subs-BBCodeWithStyle.php(66) : runtime-created function
Line: 4

Then the same with offset 2, 3

I run version 1.4.9 of the module, with SMF 2.0.10

Any idea how to solve this?

Thanks!
I had an error on source code. I fixed this.




1.5.1   2015-08-26
------------------
! When img tag is disabled only URL is displayed.

TourFL

Thanks a lot!
I'll install it now  ;D

Edit: It works! :D
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

davidhs

Compatible with SMF 2.0.11.

Grammy

#112
I was wondering if this mod will allow class style within url tags?  For instance, if I don't want a hyperlink to have an underline and wanted to use a class like text-decoration: none;  Is that a possibility?  (I'm asking before I install.)   :)




EDIT:  Hang on.....   I sat here and read all 6 pages, so how did I miss this?

http://www.simplemachines.org/community/index.php?topic=379283.msg3456364#msg3456364

Well, there ya go, then........ 

davidhs

Quote from: Grammy on July 23, 2016, 06:49:48 PM
I was wondering if this mod will allow class style within url tags?  For instance, if I don't want a hyperlink to have an underline and wanted to use a class like text-decoration: none;  Is that a possibility?  (I'm asking before I install.)   :)




EDIT:  Hang on.....   I sat here and read all 6 pages, so how did I miss this?

http://www.simplemachines.org/community/index.php?topic=379283.msg3456364#msg3456364

Well, there ya go, then........ 
Sorry, you can not use this mod for this. :(

Grammy

Quote from: davidhs on July 24, 2016, 07:27:45 AM
Sorry, you can not use this mod for this. :(


No, but your advice on that link was just what I needed.  Plus, I can see a lot of other neat things I can use the mod for.   :)

Thanks!

davidhs

Compatible with SMF 2.0.12.

Steve

Did you make any changes? I've been using this through an number of patches including 2.0.12 without any problems.


Love this mod, btw. :)
Please do not PM me for support. 

davidhs

Quote from: Steve on October 15, 2016, 10:32:08 AM
Did you make any changes? I've been using this through an number of patches including 2.0.12 without any problems.


Love this mod, btw. :)
I do not make changes. This works in SMF 2.0.12 and previous.

Warning: In you update to SMF 2.0.12, it (SMF) has an important bug :(
http://www.simplemachines.org/community/index.php?topic=549122.0

Steve

Please do not PM me for support. 

davidhs

Compatible with SMF 2.0.13.

Advertisement: