News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Attachment problem

Started by AlenNS, September 05, 2008, 11:44:00 AM

Previous topic - Next topic

AlenNS

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




      // 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'], '">';

AlenNS

Here's another problem.

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

AlenNS

Can anyone help me with this?

PLEASE!

AlenNS


AlenNS


Rumbaar

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 ]

Advertisement: