topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 11:20 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: new forum feature coded - ability to inline link attachments!  (Read 174465 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #50 on: June 12, 2007, 11:15 AM »
It's probably just that the installer is not upgraded to the most recent version of the file its trying to update, either because you've made other changes to it, or because ive not updated it to latest smf version.
however, if you are feeling adventuresome, you can see the instructions in the mod for making the changes to the files manually.

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #51 on: June 12, 2007, 12:55 PM »
Thanks for the reply.  I am kind of adventuresome, and have dabbled into the code at times.
What do I have to lose?
Thanks!

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #52 on: June 12, 2007, 04:31 PM »
I just looked at the files, and it's a bit too confusing.  I have a couple of other modifications inserted in the same areas where I need to replace code for the inline attachment modification.  I tried to make the changes carefully, but it broke my forum, so I had to switch back to the old Display.template.php file. 

Perhaps I'll play with it again later, but right now my head hurts trying to figure it out!  Too bad, I really do want to use this modification.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #53 on: June 12, 2007, 04:37 PM »
can you tell me which other mods modified that area, then maybe i can make the inline attachments mod work around them?

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #54 on: June 12, 2007, 05:16 PM »
Mouser,
Thanks for the generous offer.  I see that an "Ignore User" modification is in there, and possibly another one, but I'm not sure.  Perhaps it would be easier if I posted the relevant code here and let you highlight the sections to leave alone?  I'm thinking this might also be helpful to other people as well.

Below is the section of code we're discussing:

      // Show the post itself, finally!
      echo '
                        </td>
                     </tr></table>
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
                     <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
                  </td>
               </tr>';

      // Now for the attachments, signature, ip logged, etc...
      //-Ignore MOD- Start
      if ($message['is_ignored'] && $message['can_be_ignored'])
      echo '
               <tr>
                  <td valign="bottom" class="smalltext" width="85%" style="display: none;" id="ignfooter', $message['counter']+1 , '" >
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">';
      else
      //-Ignore MOD- End

      echo '
               <tr>
                  <td valign="bottom" class="smalltext" width="85%">
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">';

      // Assuming there are attachments...
      if (!empty($message['attachment']))
      {
         echo '
                           <hr width="100%" size="1" class="hrcolor" />
                           <div style="overflow: auto; width: 100%;">';
         foreach ($message['attachment'] as $attachment)
         {
            if ($attachment['is_image'])
            {
               if ($attachment['thumbnail']['has_thumb'])
                  echo '
                           <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
               else
                  echo '
                           <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
            }
            echo '
                              <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
         }

         echo '
                           </div>';
      }

      echo '
                        </td>
                     </tr><tr>
                        <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

      // Show "« Last Edit: Time by Person »" if this post was edited.
      if ($settings['show_modify'] && !empty($message['modified']['name']))

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #55 on: June 12, 2007, 05:41 PM »
it's "ignore user" im almost positive, this has come up before.
gri who is hard to understand posted a fix for this on his forum.  you could probably use that installer.

try it: http://gri.sunshineh...ndex.php?topic=267.0
direct download: http://gri.sunshineh...pic=267.0;attach=113

note that i like gri but he is a very strange bird.

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #56 on: June 12, 2007, 05:47 PM »
Mouser,
Thanks for the help.  So, looking at the code, does it seem that the Ignore User modification is the only issue here?
By the way, I like strange people.  The world would be a terribly boring place without them (or should I say "us").
Thanks again!

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #57 on: June 13, 2007, 06:33 AM »
Last night, I downloaded and installed the modified version and it runs great on my forum!

This is a terrific modification.

But when I use the "inline noimage attachment" option, I get this error:
"[ ERROR: SPECIFIED ATTACHMENT MISSING ]."
When I attach the same URL using the "Insert Image" button, it works fine.

I have a couple of responses that I think would help make this modification closer to perfect!  This just my opinion, but some of the pulldown menu options have confusing wording.  May I make some suggestions?
        > "inline display attachment" - fine the way it is
        > "inline fullsize attachment" - fine the way it is
        > "inline thumb attachment" - fine the way it is
        > "inline noimage attachment" - should instead be "inline attachment from URL"
        > "inline noimage attachment (no details)" - should instead be "inline link to attached file"

The problem is, the two "noimage" options actually serve quite different functions, but their names imply they are similar.

I'd love to get rid of the "Insert Image" button and use the "inline attachment" modification for all image attachments.  I think this would be possible, if the "inline noimage attachment" option worked well.

Again, this is a terrific modification!

Looking forward to your response.

Thanks!

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #58 on: June 14, 2007, 09:43 AM »
Hello,
I made some changes to the menu items.  Here's a screen shot of what the menu now looks like in my test forum:


I think this is a terrific modification.

I would really like to replace the "Insert Image" button with a line in the Inline Attachment Modification pull-down menu. In other words, I'd like the inline attachment modification to serve as the place for managing all image attachments.

Can someone explain how to get a command in the Inline Attachment pull-down menu for [i m g] [/i m g] tags?

Thanks!

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #59 on: June 14, 2007, 10:41 AM »
Hello,
OK, I'm kind of answering my own question here, but it might be helpful for others to see what I've done.

I've added the "Insert Image" functionality into the "Inline Image Attachments" modification.

So now the menu looks like this in my forum:


Now that I have the "Insert Image" functionality, can someone tell me how to drop the standard "Insert Image" button?

Thanks?

Timo Trallala

  • Participant
  • Joined in 2007
  • *
  • Posts: 4
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #60 on: June 21, 2007, 04:49 AM »
Hi Mouser,

once again: Is there a way to set a max width for fullsizeInlineImages so they will not crash my layout.

The following function should solve my problem, but I really don't know how to edit my files


   function resizeImage($width, $height, $maxWidth, $maxHeight)
        {
        $srcRatio=$width / $height;  // width/height ratio
        $destRatio=$maxWidth / $maxHeight;

        if ($destRatio > $srcRatio)
            {
            $destSize[1]=$maxHeight;
            $destSize[0]=ceil($maxHeight * $srcRatio);
            }
        else
            {
            $destSize[0]=$maxWidth;
            $destSize[1]=ceil($maxWidth / $srcRatio);
            }

        return $destSize;
        }

Thanks for some instructions
Greetz from Germany
Timo
« Last Edit: June 21, 2007, 10:27 AM by Timo Trallala »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #61 on: June 21, 2007, 06:47 AM »
Hi Timo,

This is a nice idea actually.. Let me add it to the code and test, and then paste instructions on where to do it.

-mouser

digit2

  • Participant
  • Joined in 2007
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #62 on: July 16, 2007, 04:32 AM »
Is there any chance we can get this mod to work with Recent.template.php?

In my recent results I see
[attach=x][/attach]

Thanks!
« Last Edit: July 16, 2007, 06:38 AM by digit2 »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #63 on: November 21, 2007, 01:55 PM »
Hi, I can't get Insert Flash to work  :(
I have attached a .swf flash animation, inserted the flash tags: [ flash=607,431][ /flash], then tried in various ways to insert a link to the attached file but it doesn't work. Any suggestions on how to do this? Or is the flash option only meant for externally hosted flash animations?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #64 on: November 21, 2007, 04:09 PM »
yeah there is no way currently to inline link flash images in a post.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #65 on: November 21, 2007, 04:11 PM »
wow i didn't notice digit2's request till now -- sorry :(
i didn't even think about adding it to recent.template.php..
but it would probably mean duplicating the post template code which i'm not to keen to do.. maybe there is a better way to do it.

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #66 on: December 17, 2007, 08:42 AM »
Hello,
I just updated my forum, and was very upset to see that the Inline Attachment Modification is no longer on the SMF site.  I understand your problems with SMF, but I just think this is a terrific modification.  Actually, my forum absolutely needs this modification, and my members rely on it!!

Is the modification gone now?  If it's still available, where can I get it?

Thanks!
« Last Edit: December 17, 2007, 08:45 AM by MatthewSchenker »

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #67 on: December 17, 2007, 08:53 AM »
Hello,
I just updated my forum, and was very upset to see that the Inline Attachment Modification is no longer on the SMF site.  I understand your problems with SMF, but I just think this is a terrific modification.  Actually, my forum absolutely needs this modification, and my members rely on it!!

Is the modification gone now?  If it's still available, where can I get it?

Thanks!
-MatthewSchenker (December 17, 2007, 08:42 AM)

i have now uploaded a new beta version of the inline attachment mod, with package installer here:
https://www.donation...ationCoderDotCom.zip

please UNINSTALL the previous verison before installing this one.

        //---------------------------------------------------------------------------
        // "Inline Attachments" Mod for the Simple Machines Forum (SMF)
        //  by mouser, from https://www.donationcoder.com - funded by user donations
        //  version 1.04.02, 10/18/06
        //---------------------------------------------------------------------------
        //
        //---------------------------------------------------------------------------
        // Updated 07/08/06 - better use builtin thumbnails
        // Updated 10/18/06 - smarter text for unavailable attachments
        // Updated 10/18/06 -  [i]([url=https://www.donationcoder.com/forum/index.php?topic=1996.msg41100#msg41100]see attachment in previous post[/url])[/i] now uses forum default format
        // Updated 10/18/06 - you can now skip the =# part and it will increment through attachments
        // Updated 10/18/06 - you can now use  [i]([url=https://www.donationcoder.com/forum/index.php?topic=1996.msg41100#msg41100]see attachment in previous post[/url])[/i] to show url w/o download count and size
        // Updated 10/19/06 - Added mod of Post.template.php to include attachment inline dropdown menu
        //---------------------------------------------------------------------------




Will that help?

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #68 on: December 17, 2007, 11:01 AM »
scancode,
Thanks for the link!  I don't know why I couldn't find this before.
This is a great modification -- one of the essential ones in my opinion.
Matt

ACE844

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #69 on: January 22, 2008, 01:57 PM »
Hello Everyone,

  I am new to both this community and to coding in general. I just started to admin and learn about this stuff recently. I saw this mod, and it was exactly what we were looking for in our forum. I downloaded the app, and uploaded the .zip to my server via the SMF 1.1.4 admin panel, that went fine, but when I clikced on the automated install option I got the following error
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.


Thanks,
ACE844
« Last Edit: January 22, 2008, 04:15 PM by ACE844 »

ACE844

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #70 on: January 22, 2008, 04:16 PM »
So I decided to try the manual install of the code and it is in and working fine. I just have one additional issue. Below every post it says:

« Last Edit: December 31, 1969, 05:00:00 PM by  »

Does anyone know what I did wrong or what I could do to fix this and stop it from happening??

Thanks,
 ace844

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #71 on: January 22, 2008, 05:36 PM »
that's strange.. it looks like you must have done something slightly wrong when adding the code manually.
if you want to send me your modified files and originals i can try to pinpoint what went wrong ([email protected]).

ACE844

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #72 on: January 22, 2008, 05:53 PM »
E-mail sent, thank you sir for your help.

MatthewSchenker

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 24
    • View Profile
    • Festool Owners Group
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #73 on: May 04, 2008, 08:18 AM »
Hi Everyone,
This modification has become essential in my forum!  Now, I'm upgrading to 2.0.
Does it work in 2.0 beta 3.1?
Thanks,
Matthew

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: new forum feature coded - ability to inline link attachments!
« Reply #74 on: May 04, 2008, 08:24 AM »
Mathew,

A very nice person named slinouille has modified it to work with smf version 2.
See this thread: https://www.donation...ex.php?topic=13011.0

Let us know how it goes.