Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1275
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Recent attachments with 75 character of content block

Started by Ares, March 01, 2011, 09:29:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ares

$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

Ares

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

AngelinaBelle

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]



Anything else would require custom changes to the block
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Ares

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

AngelinaBelle

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.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?