SimplePortal

Customization => Custom Coding => Topic started by: Ares on March 01, 2011, 09:29:46 PM

Title: Recent attachments with 75 character of content block
Post by: Ares on March 01, 2011, 09:29:46 PM
Code: [Select]
$attachments = ssi_recentAttachments(6, array('jpg', 'png', 'gif', 'bmp'), 'array');


   echo '
<table style="border: 0;  width: 100%;">
  <tr>
    <td>
      <ul style="float: right; width: 100%;">';

foreach ($attachments as $item)
     echo '
      <li class="windowbg2"  style="text-align: center; width: 250px; height: 250px; line-height: 1.4em; border: 1px #ededed solid; padding: 0px; float: right;">

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"  width="100%">
  <tr>
    <td width="100%" colspan="2">

     ', $item['file']['image']['link'], '<br />

    </td>
  </tr>
  <tr>
    <td class="windowbg2" width="100%" colspan="2" height="40">
 <b>
 <font size="3" face="Arabic Transparent">', $item['topic']['link'], '</font></b><br />   
    </td>
  </tr>
  <tr>
    <td class="windowbg2" width="50%">
      ','<font size="2">Downloads: </font>', $item['file']['downloads'], '<br />
    </td>
    <td class="windowbg2" width="50%">
    ', '<font size="2">By:</font> ', $item['member']['link'], '
    </td>
  </tr>
</table><br>

      </li>';

   echo '
      </ul>
    </td>
  </tr>
</table>';
Would like this code to also show the content of the post not all just about 75 character but removing the dots showing on the left and anything else you can think of that makes this block look better
Title: Re: Recent attachments with 75 character of content block
Post by: Ares on March 03, 2011, 05:31:45 AM
ok i found a better way to do this wit the board news block but it does not show attached images how may i make this work
Title: Re: Recent attachments with 75 character of content block
Post by: AngelinaBelle on March 03, 2011, 07:04:01 AM
ONe way is to include the attached file in the post (before the [.cutoff.] tag)
like this:
[img height=300]http://simpleportal.net/index.php?action=dlattach;topic=8014.0;attach=4936;image[/img]
 
(http://simpleportal.net/index.php?action=dlattach;topic=8014.0;attach=4936;image)
 
Anything else would require custom changes to the block
Title: Re: Recent attachments with 75 character of content block
Post by: Ares on March 03, 2011, 06:41:35 PM
yes thats what i am doing now but is there a code I can add to the board news block code to show the attached image
Title: Re: Recent attachments with 75 character of content block
Post by: AngelinaBelle on March 03, 2011, 09:13:22 PM
I think it would actually be easier to start with your own
function sp_recent_images_with_body, which would call a modified version of ssi_recentAttachments -- one that would return the message body, which you would then deal with in exactly the same way sp_recent deals with it, cutoff tag and everything.
 
The reason I suggest this is that you would only have to add one field to the SQL statement in the ssi-type-function, and copy some code from sp_recent into your modified copy of sp_recentImages.
SimplePortal 2.3.8 © 2008-2024, SimplePortal