* User

Welcome, Guest. Please login or register.
Did you miss your activation email?

08 Sep 10, 14:46:55

Login with username, password and session length

Select language:

* Recent Topics



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

* Stats

  • *Total Members: 2448
  • *Latest: ElNikez

  • *Total Posts: 10789
  • *Total Topics: 1629
  • *Online Today: 20
  • *Most Online: 157
(27 Aug 09, 03:54:53)
  • *Users: 0
  • *Guests: 15
  • *Total: 15

Author Topic: where is that code in portamx ? gonna make ablock fom it  (Read 486 times)

0 Members and 1 Guest are viewing this topic.

Offline samozin

  • Newbie
  • *
  • Posts: 18
  • Gender: Male
    • الحب الحقيقى
hello every one 
while i was playing with my forum portamx options i found that
there is areally  nice block called Board News with the option show or hide the attached image
 and number of Number of words before tease

thats all really good
 and already made ablock showing reacent attached images linked to the topic

and couldnt  make it show images  from certian  board  (needs an array or something)

my new idea came up  by making  the block from (Board News) portamx code   
with some modifications
so where is that code in portamx?

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 3367
  • Gender: Female
You can code your own idees in php blocks ...

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline samozin

  • Newbie
  • *
  • Posts: 18
  • Gender: Male
    • الحب الحقيقى
i already made this one http://portamx.com/topic_1561.msg9122.html#msg9122
but still missing the options present in the poertamx (Board News) with thumbnail preview

u know  i want to make somthing like (latest music albums )
images  from the music board shown nicely and linked to thier topic

i made it but  grabs images from all over the forum
 i think  now u got what iam thinking of

 this one iam think of will  be usefull for someone wants to sell products or themes ......etc

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 3367
  • Gender: Female
The link to a thumbnail (and mutch more) is exist in the result array, so you can use that ..
Simple look at the SSI.php what is returned or use echo print_r($resultarray, true); to see te informations.

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline shrky123

  • Newbie
  • *
  • Posts: 1
  • Gender: Male
Quote
u know  i want to make somthing like (latest music albums )
images  from the music board shown nicely and linked to thier topic
i tried this but its not working  :(
Code: [Select]
global $settings, $txt;

// Boardnumbers you see
$my_board = array(2,8);
// Number of attachments (use odd number)
$num_attachments = 10;
// call the ssi function
$result = ssi_recentAttachments($num_attachments, null, $my_board, '');


echo '
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>';

foreach ($attachments as $attach)
{
   echo '
           <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"  width="100%">
  <tr>
    <td class="windowbg2" width="100%" colspan="2">

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

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

   echo '
     </tbody>
   </table>';

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 3367
  • Gender: Female
First .. your SSI call id bad .. you can't request a specific board.
Correct call: (where null can be a array with attachment extensions)
Code: [Select]
$result = ssi_recentAttachments($num_attachments, null, '');
This return a lot of arrays as follow example for ONE attachment:
Code: [Select]
1464 => array(
    member => array(
         'id' => 31,
         'name' => 'cat',
         'link' => '<a href="http://xxxxx/profile/user_31/">User</a>',
    ),
    file => array(
         'filename' => 'logo3.png',
         'filesize' => '8.23kB',
         'downloads' => 3,
         'href' => 'http://xxxxx/dlattach/attach,1464/topic_1518.0.html',
         'link' => '<img src="http://xxxxx/Themes/default/images/icons/clip.gif" alt="" /> <a href="http://xxxxx/index.php?action=dlattach;topic=1518.0;attach=1464">logo3.png</a>',
         'is_image' => true,
         image => array(
                'id' => 1465,
                'width' => 250,
                'height' => 60,
                'img' => '<img src="http://xxxxx/dlattach/attach,1464/image/topic_1518.0.html" alt="logo3.png" />',
                'thumb' => '<img src="http://xxxxx/dlattach/attach,1465/image/topic_1518.0.html" alt="logo3.png" />',
                'href' => 'http://xxxxx/index.php?action=dlattach;topic=1518.0;attach=1465;image',
                'link' => '<a href="http://xxxxx/dlattach/attach,1464/image/topic_1518.0.html"><img src="http://kb0049/portamx.com/dlattach/attach,1465/image/topic_1518.0.html" alt="logo3.png" /></a>',
         ),
    ),
    topic => array(
         'id' => 1518,
         'subject' => 'new new',
         'href' => 'http://xxxxx/topic_1518.msg8531.html#msg8531',
         'link' => '<a href="http://xxxxx/topic_1518.msg8531.html#msg8531">new new</a>',
         'time' => '25 Aug 10, 03:28:01',
    ),
),

Fel
Many are stubborn in relation to the path, a few in relation to the target.