News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

In Line Attachments -- ILA

Started by Spuds, April 17, 2010, 06:45:49 AM

Previous topic - Next topic

Raffoz

i don't know...  i just know that usually it works...
and now, disabling the mod, it works normally...

how can i check if it is what u said?
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Arantor

It depends on your browser as to how to detect Javascript errors; I don't know off hand on most of them, though because all the browsers I have, they're all extended with tools to help me debug sites...

Raffoz

Quote from: Arantor on May 07, 2010, 04:40:44 AM
It depends on your browser as to how to detect Javascript errors; I don't know off hand on most of them, though because all the browsers I have, they're all extended with tools to help me debug sites...

it means i'm the only one with this error?
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Arantor

Possibly there's a bug in the Javascript and/or it doesn't work in the browser you have.

Raffoz

Quote from: Arantor on May 07, 2010, 05:00:04 AM
Possibly there's a bug in the Javascript and/or it doesn't work in the browser you have.

ok, then my question is: the normal button "add attachment" is not in javascript? instead the "add attachment" that comes out with ILA Mod is in javascript?
because i thought they were the same, i don't see difference between them (and the code too, it appears - to me- the same)... but i'm not a code good boy... :)
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Arantor

No, the normal button is Javascript too. This mod changes the code though.

Spuds

Quote from: Raffaele1977 on May 07, 2010, 05:02:51 AM
Quote from: Arantor on May 07, 2010, 05:00:04 AM
Possibly there's a bug in the Javascript and/or it doesn't work in the browser you have.

ok, then my question is: the normal button "add attachment" is not in javascript? instead the "add attachment" that comes out with ILA Mod is in javascript?
because i thought they were the same, i don't see difference between them (and the code too, it appears - to me- the same)... but i'm not a code good boy... :)

They are different, ILA adds an additional function and has to keep track of the attachment number so things get assigned to the right spots.  Anyway what we have is some javascript problems, oh joy!

What browser and version are you using?  There must be a setting to display script errors or a addon that will do that.  Knowing where its javascript engine is tossing a cog will be a big help in tracking this down.

Looking back through that code, the only odd thing I immediately see is in  post.template.php ,

find:
var count_attachments = ', count($context['current_attachments']) ,' + 1;

replace with
var count_attachments = ', count($context['current_attachments']) + 1,';

See if that makes any difference at all ... and remember to put it back to the way it was or the MOD will not uninstall cleanly.  So save a copy of the post.template.php before you start doing edits so you can get back to where you were.


imno007

Thanks for the mod! Glad someone got this ball rolling again. Here's to hoping that some day the smf guys will realize that this should be a feature smf comes with "out of the box." 8)

Raffoz

Quote from: Spuds on May 07, 2010, 10:43:21 AM
Quote from: Raffaele1977 on May 07, 2010, 05:02:51 AM
Quote from: Arantor on May 07, 2010, 05:00:04 AM
Possibly there's a bug in the Javascript and/or it doesn't work in the browser you have.

ok, then my question is: the normal button "add attachment" is not in javascript? instead the "add attachment" that comes out with ILA Mod is in javascript?
because i thought they were the same, i don't see difference between them (and the code too, it appears - to me- the same)... but i'm not a code good boy... :)

They are different, ILA adds an additional function and has to keep track of the attachment number so things get assigned to the right spots.  Anyway what we have is some javascript problems, oh joy!

What browser and version are you using?  There must be a setting to display script errors or a addon that will do that.  Knowing where its javascript engine is tossing a cog will be a big help in tracking this down.

Looking back through that code, the only odd thing I immediately see is in  post.template.php ,

find:
var count_attachments = ', count($context['current_attachments']) ,' + 1;

replace with
var count_attachments = ', count($context['current_attachments']) + 1,';

See if that makes any difference at all ... and remember to put it back to the way it was or the MOD will not uninstall cleanly.  So save a copy of the post.template.php before you start doing edits so you can get back to where you were.



no, no difference... :(

thanks the same...
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

searchgr

Quote from: imno007 on May 15, 2010, 11:34:12 AM
Thanks for the mod! Glad someone got this ball rolling again. Here's to hoping that some day the smf guys will realize that this should be a feature smf comes with "out of the box." 8)

Agree ....

woolly bugger

fyi,

I installed the mod and it worked great for a while! Thanks for your efforts getting this done. Just letting you know that after installing a couple of other mods; Hide Images From Guest 1.3  and Rename *Child Board* | S-Ace  2.0 the inline mod stopped working, it now only displays the attachment below the post and won't show the image or thumb inline.

working on manually uninstalling ila mod now, will try to reinstall again...

woolly bugger

Quote from: woolly bugger on May 23, 2010, 07:00:39 PM
fyi,

I installed the mod and it worked great for a while! Thanks for your efforts getting this done. Just letting you know that after installing a couple of other mods; Hide Images From Guest 1.3  and Rename *Child Board* | S-Ace  2.0 the inline mod stopped working, it now only displays the attachment below the post and won't show the image or thumb inline.

working on manually uninstalling ila mod now, will try to reinstall again...

I looked at my subs.php and the ila edits were gone, so i manually inserted them and all  is good.

Spuds

Glad you were able to get it fixed.   Installing multiple mods can sometimes be a challenge as often they are trying to put hooks into the same areas of the code.  That coupled with the fact that Mods are only Base SMF aware, not Mod aware so they can easily step on top of each other requiring some manual intervention.  Anyway glad you were able to get it worked out.

AK_CCM

Thanks in advance for that mod!

One question: I'm using "Highslide 4 SMF" and if I choose "Inline expandable thumbnail" to attach an image inline no highslide effect will appear. Only if I choose the standard option "End-of-post expandable thumbnail" I could use the highslide zoom in feature. Is there any way at present to use highslide with inline thumbs?

r2d2-trader

Hy Spuds,

i've just started to use your great mod - but i've recognized a problem within using the PortaMx-Mod. When i insert a Block within PortaMx for the New Posts and there is an inline attachment in one of the newest posts i get the following error:

Fatal error: Cannot redeclare template_main() (previously declared in /var/www/XXX/html/XXXX/Themes/default/PortaMx/PortaMx.template.php:17) in /var/www/XXX/html/XXXX/Themes/default/Display.template.php  on line 1135

It still works fine when just add the attachment at the end of the post. Maybe you have an include statement in one of the modified files for the Display.template.php or u have a clue what causes this error?

would be great to get help from you.

cu Rob
"Aller Anfang ist leicht, und die letzten Stufen werden am schwersten und seltensten erstiegen."
Johann Wolfgang von Goethe

Spuds

Quote from: AK_CCM on June 03, 2010, 12:34:37 PM
Thanks in advance for that mod!

One question: I'm using "Highslide 4 SMF" and if I choose "Inline expandable thumbnail" to attach an image inline no highslide effect will appear. Only if I choose the standard option "End-of-post expandable thumbnail" I could use the highslide zoom in feature. Is there any way at present to use highslide with inline thumbs?

I'll have and update of ILA that supports HS4SMF, its actually done, I just need to finish packaging it.  Unfortunately I'm traveling and all that code is back at the mother ship.

Quote from: r2d2-trader on June 13, 2010, 12:33:23 PM
Fatal error: Cannot redeclare template_main() (previously declared in /var/www/XXX/html/XXXX/Themes/default/PortaMx/PortaMx.template.php:17) in /var/www/XXX/html/XXXX/Themes/default/Display.template.php  on line 1135

I took a quick look for what might be causing this, but have not come up with anything obvious.  I do an include_once on display.php but I don't call the function where the template would be initiate. 

Really ILA is a very fancy BBC code, it links into subs.php to replace those ILA tags with the appropriate image tag when the message is parsed.  Sorry I can't be of much help, perhaps ask on the PortalMx thread or site for some help.  I'll be glade to make changes to help with comparability but don't know where to start.

r2d2-trader

#36
Hi Spuds,

when i copy back the version of subs.php to the sources folder there is no error and the PortaMx is working fine. Maybe the PortaMx is having a problem with the declaration of these arrays?

it seems to happen when the ILA-subs is parsing. Maybe there is a possibility to disable parsing when PortaMx-Frontpage is shown. So maybe there shoulb be a modification in this part of the Subs.php?

// ILA in line attachment changes
if (empty($parse_tags) && empty($context['uninstalling']))
{
global $sourcedir;

if (stripos($message, '[attach') !== false)
{
if (!function_exists('ila_hide_bbc'))
require_once($sourcedir . '/ILA-Subs.php');
ila_hide_bbc($message);
}
}
// End ILA in line attachment changes


i hope this question is not stupid, i'm not a programmer, just a beginner.

i would appreciate your help and thanks in advance

Rob
"Aller Anfang ist leicht, und die letzten Stufen werden am schwersten und seltensten erstiegen."
Johann Wolfgang von Goethe

r2d2-trader

Problem solved

=> http://portamx.com/topic_1850.0.html

// Sift out the bbc for a performance improvement.
if(empty($context['pmx_forumReq']) && ($context['PortaMx']['settings']['frontpage'] != 'none' || !empty($_REQUEST['spage'])))
        {   
          // your code here
        }
        // ILA in line attachment changes

// ILA in line attachment changes
else if (empty($parse_tags) && empty($context['uninstalling']))
{
global $sourcedir;

if (stripos($message, '[attach') !== false)
{
if (!function_exists('ila_hide_bbc'))
require_once($sourcedir . '/ILA-Subs.php');
ila_hide_bbc($message);
}
}
// End ILA in line attachment changes


cu Rob
"Aller Anfang ist leicht, und die letzten Stufen werden am schwersten und seltensten erstiegen."
Johann Wolfgang von Goethe

Spuds

Glad you were able to find a solution! ... I'll add those changes into the next release unless I can find a solution.  With what you have it will prevent ILA from rendering [attach tags only when portalMX is installed, and is displaying its front page that contains a page. 

I guess both mods load display.php which causes the template error, but that's because both are trying to display/render a post.  I need to get at the attachments array so I can render them but that involves loading display.php.

Anyway glad you found a solution that meets your needs.

Nickhead

#39
edit, as i deleted the mod.

.Org, .Net, .Com

Advertisement: