fopen attachment

Started by John, April 29, 2006, 11:21:49 AM

Previous topic - Next topic

John

I want to post more info about the attachment. So i looked in the Themes/default/Display.php file.
Would  someone be so nice to help me out so i can make the code below to work? Ive been working on this for ages and i cant get it done.

----original Themes/default/Display.php code------

if (!empty($message['attachment']))  
       {  
           echo '<hr width="100%" size="1" class="hrcolor" />\n';
           echo '\t<div style="overflow: auto; width: 100%;">\n';  

           foreach ($message['attachment'] as $attachment)  
           {  
               if (isset($attachment['image'])) {
                   echo '
                                       ', $attachment['image'], '<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['width'] . 'x' . $attachment['height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';  
               }
                }  
       }

----- what i want to add -----
if (file_exists("<path>". $attachment['name'])) {
                   fopen("<path>". $attachment['name'],"r");
                   $line = fgets($file,1000); // gets 1000
                   echo $line;  
                   fclose($file);  
               }


P.s i have version1.07

John

PLZ, anyone can help me?

John


Advertisement: