SimplePortal

Customization => Custom Coding => Topic started by: b1gbely on August 07, 2013, 09:18:26 AM

Title: Block w/ Recent Topic & 1st Attached image
Post by: b1gbely on August 07, 2013, 09:18:26 AM
Hi there SP!  Noob here w/ little programming experience.  Wasn't sure if I should bump an old thread or create a new one, so here goes:

I am attempting to create a block that basically just shows the 1st attached image, and just the recent topic.

I played around with SP's Recent Image Attachment block, but didn't know how to incorporate the recent topic title.

So now I took a samozin's code from this thread:  http://simpleportal.net/index.php?topic=4118.0 (http://simpleportal.net/index.php?topic=4118.0) (Thanks samozin) and was wondering if someone could help me get rid of those bullets, remove the vertical grey lines & display more recent topics/images & the page #s.

Not sure if I should continue down this path, or play with the  Recent Image Attachment block

Code: [Select]
$attachments = ssi_recentAttachments(10, array('jpg', 'png', 'gif', 'bmp'), 'array');

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

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

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

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

    </td>
  </tr>
 
    <td class="windowbg2" width="100%" colspan="2" height="40">
 <b>
 <font size="2" face="Arabic Transparent">', $item['topic']['link'], '</font></b><br /> 

    </td>
  </tr>
  <tr>
    <td width="50%">
    </td>
  </tr>
</table><br>

      </li>';

   echo '
      </ul>
    </td>
  </tr>
</table>';
Title: Re: Block w/ Recent Topic & 1st Attached image
Post by: b1gbely on August 13, 2013, 12:13:06 AM
Mods, please mark this resolved.  Thanks.
Title: Re: Block w/ Recent Topic & 1st Attached image
Post by: [SiNaN] on August 14, 2013, 01:50:59 PM
Topic solved feature is not actually enabled in customization boards, so if you've solved your problem, it's okay. Maybe you can also share your final code in case others would find it useful as well.
SimplePortal 2.3.8 © 2008-2024, SimplePortal