Messages - MatthewSchenker [ switch to compact view ]

Pages: prev1 2 3 4 [5]
21
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']))

22
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.

23
Thanks for the reply.  I am kind of adventuresome, and have dabbled into the code at times.
What do I have to lose?
Thanks!

24
Hello,
I really like the work you're doing with SMF modifications.

I run a woodworking forum (www.festoolownersgroup.com).  Your inline attachment modification would be great for us.  Recently, I tried to install this, but received the following error:
1.     Execute Modification     ./Themes/default/Display.template.php     Test failed

How do I fix this to install the modification?

By the way, I'm testing the modification below, first with my avatar:
[attachthumb=#1][/attachthumb]

Next, with a tool picture:
[attachthumb=#2][/attachthumb]

Works well!

Thanks!

Pages: prev1 2 3 4 [5]
Go to full version