Advertisement:

Author Topic: Attachment problem  (Read 2677 times)

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Attachment problem
« on: September 05, 2008, 11:44:00 AM »
I have a problem with attachments which are not an images.

I have installed integrated Lightbox and I've changed settings for the attached images in Display.template.php in my Babylon theme.

I've attached how it looks like right now and I've attached part of Display.template.php which controls attachments.

I would like to put attachments, which are not an images in one row and to show some picture above attached file ( like zip, rar or something else ).



Code: [Select]
      // Now for the attachments, signature, ip logged, etc...
      echo '
               <tr id="msg_', $message['id'], '_footer">
                  <td valign="bottom" class="smalltext" width="85%">
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">';

         echo '<table>';

         $newRow = 1;

         foreach ($message['attachment'] as $attachment)
         {
            if ($attachment['is_image'])
            {
               if ($attachment['thumbnail']['has_thumb'])
                  {

                  if ($newRow == 1)
                  {
                     echo '
                        <tr>';
                  }

                  echo '<td class="smalltext" width="50%" style="padding: 5px;">
                           <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" rel="lightbox[smf]"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><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'] . '.)</td>';
                  }
                 
               else
               {
                  echo '<td>
                           <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 /></td>';                 
               }              
           
               $newRow++;

               if ($newRow == 3)
               {
                  echo '</tr>';
                  $newRow = 1;
               }

            }
            if(!$attachment['is_image'])
            {
            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 '</tr></table>
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
« Last Edit: October 07, 2008, 10:17:08 PM by Rumbaar »

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Attachment problem
« Reply #1 on: September 05, 2008, 11:51:41 AM »
Here's another problem.

There are attached one rar, one zip and one jpg file.
And here's what happened.

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Attachment problem
« Reply #2 on: September 13, 2008, 05:18:25 AM »
Can anyone help me with this?

PLEASE!

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Attachment problem
« Reply #3 on: September 13, 2008, 01:18:44 PM »
For the 100th time

BUMP

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Attachment problem
« Reply #4 on: September 19, 2008, 09:23:58 AM »
Bump, bump, bump!

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Attachment problem
« Reply #5 on: October 07, 2008, 10:19:15 PM »
Are you sure the most is fully compatible with SMF 2.x?

Now what you are after would be a [Mod] request at least or a piece of custom code to handle the different criteria you want.  It's beyond general support you can get from this section.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]