Advertisement:
2by2host

Author Topic: In Line Attachments -- ILA  (Read 55204 times)

Offline Raffaele1977

  • Jr. Member
  • **
  • Posts: 335
Re: In Line Attachments -- ILA
« Reply #20 on: May 07, 2010, 04:39:41 AM »
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 - 10.8
SMF 2.0.2
Safari 6.0 or Chrome 20.0.1132.57

Offline Arantor

  • SMF Legend
  • *
  • Posts: 51,062
    • wedgebook on Facebook
Re: In Line Attachments -- ILA
« Reply #21 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...

Offline Raffaele1977

  • Jr. Member
  • **
  • Posts: 335
Re: In Line Attachments -- ILA
« Reply #22 on: May 07, 2010, 04:50:53 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 - 10.8
SMF 2.0.2
Safari 6.0 or Chrome 20.0.1132.57

Offline Arantor

  • SMF Legend
  • *
  • Posts: 51,062
    • wedgebook on Facebook
Re: In Line Attachments -- ILA
« Reply #23 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.

Offline Raffaele1977

  • Jr. Member
  • **
  • Posts: 335
Re: In Line Attachments -- ILA
« Reply #24 on: May 07, 2010, 05:02:51 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 - 10.8
SMF 2.0.2
Safari 6.0 or Chrome 20.0.1132.57

Offline Arantor

  • SMF Legend
  • *
  • Posts: 51,062
    • wedgebook on Facebook
Re: In Line Attachments -- ILA
« Reply #25 on: May 07, 2010, 05:05:36 AM »
No, the normal button is Javascript too. This mod changes the code though.

Offline Spuds

  • SMF Hero
  • ******
  • Posts: 2,046
  • Gender: Male
Re: In Line Attachments -- ILA
« Reply #26 on: May 07, 2010, 10:43:21 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:
Code: [Select]
var count_attachments = ', count($context['current_attachments']) ,' + 1;
replace with
Code: [Select]
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.

"It is better to have tried and failed than to have failed to try, but the result's the same."
"Give me the liberty to know, to utter, and to argue freely according to conscience, above all liberties."

Offline imno007

  • Jr. Member
  • **
  • Posts: 170
Re: In Line Attachments -- ILA
« Reply #27 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)

Offline Raffaele1977

  • Jr. Member
  • **
  • Posts: 335
Re: In Line Attachments -- ILA
« Reply #28 on: May 16, 2010, 01:08:29 PM »
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:
Code: [Select]
var count_attachments = ', count($context['current_attachments']) ,' + 1;
replace with
Code: [Select]
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 - 10.8
SMF 2.0.2
Safari 6.0 or Chrome 20.0.1132.57

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,230
Re: In Line Attachments -- ILA
« Reply #29 on: May 19, 2010, 06:37:05 PM »
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 ....

Offline woolly bugger

  • Semi-Newbie
  • *
  • Posts: 72
    • Blue Ridge Fly Fisherman's Forum
Re: In Line Attachments -- ILA
« Reply #30 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...

Offline woolly bugger

  • Semi-Newbie
  • *
  • Posts: 72
    • Blue Ridge Fly Fisherman's Forum
Re: In Line Attachments -- ILA
« Reply #31 on: May 23, 2010, 07:57:45 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.

Offline Spuds

  • SMF Hero
  • ******
  • Posts: 2,046
  • Gender: Male
Re: In Line Attachments -- ILA
« Reply #32 on: May 23, 2010, 10:48:51 PM »
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.
"It is better to have tried and failed than to have failed to try, but the result's the same."
"Give me the liberty to know, to utter, and to argue freely according to conscience, above all liberties."

Offline AK_CCM

  • Semi-Newbie
  • *
  • Posts: 57
  • Gender: Male
    • Bavarian Mycological Society
Re: In Line Attachments -- ILA
« Reply #33 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?

Offline r2d2-trader

  • Semi-Newbie
  • *
  • Posts: 25
  • Gender: Male
  • Alles wird besser !
    • Forex Test Forum für Metatrader !
Re: In Line Attachments -- ILA
« Reply #34 on: June 13, 2010, 12:33:23 PM »
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

Offline Spuds

  • SMF Hero
  • ******
  • Posts: 2,046
  • Gender: Male
Re: In Line Attachments -- ILA
« Reply #35 on: June 13, 2010, 09:34:49 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.

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.
"It is better to have tried and failed than to have failed to try, but the result's the same."
"Give me the liberty to know, to utter, and to argue freely according to conscience, above all liberties."

Offline r2d2-trader

  • Semi-Newbie
  • *
  • Posts: 25
  • Gender: Male
  • Alles wird besser !
    • Forex Test Forum für Metatrader !
Re: In Line Attachments -- ILA
« Reply #36 on: June 24, 2010, 04:47:34 AM »
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?

Code: [Select]
// 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
« Last Edit: June 24, 2010, 04:56:59 AM by r2d2-trader »
"Aller Anfang ist leicht, und die letzten Stufen werden am schwersten und seltensten erstiegen."
Johann Wolfgang von Goethe

Offline r2d2-trader

  • Semi-Newbie
  • *
  • Posts: 25
  • Gender: Male
  • Alles wird besser !
    • Forex Test Forum für Metatrader !
Re: In Line Attachments -- ILA
« Reply #37 on: June 24, 2010, 05:02:01 PM »
Problem solved

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

Code: [Select]
// 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

Offline Spuds

  • SMF Hero
  • ******
  • Posts: 2,046
  • Gender: Male
Re: In Line Attachments -- ILA
« Reply #38 on: June 24, 2010, 05:31:59 PM »
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.
"It is better to have tried and failed than to have failed to try, but the result's the same."
"Give me the liberty to know, to utter, and to argue freely according to conscience, above all liberties."

Offline Nickhead

  • Jr. Member
  • **
  • Posts: 255
    • EITP Forum & Chat
Re: In Line Attachments -- ILA
« Reply #39 on: July 02, 2010, 03:48:09 AM »
edit, as i deleted the mod.
« Last Edit: July 02, 2010, 05:16:10 AM by Nickhead »

.Org, .Net, .Com