SimplePortal

Customization => Custom Coding => Topic started by: earthview.nl on December 18, 2009, 04:05:01 AM

Title: Block ( Recent Image Attachments ) link to post
Post by: earthview.nl on December 18, 2009, 04:05:01 AM
Hi,

do you now if it is possible if someone click on a picture that the link navigation send him to the topic.

Many Thanks,
Michael
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Nathaniel on December 18, 2009, 08:03:10 PM
Moved to the Custom Coding board, this request is more of a minor alteration, rather than an entire new block request.

What version of SMF are you using?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: earthview.nl on December 19, 2009, 03:26:00 AM
Hi Nathaniel,

i use 1.1.11 and i have SimplePortal 2.2.2

Maik ;)
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Nathaniel on December 19, 2009, 08:24:28 PM
Wow, SP 2.2.2, I would strongly recommend that you upgrade to the latest version of SimplePortal.

The Recent Attachments block in SP 2.2.2 doesn't show any pictures of attachments, so I am not sure what you are referring to.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Divecall on January 08, 2010, 06:08:58 PM
I have almost the same problem. The "last picture"block show the pic, but it never gives a link to the topic. (SMF 2 RC2, SP 2.3.1)... It must be nice, when under the number of downloads and the author-name stand "link", and when somebody klick on it, he comes to the forum-post for this attachment.

And 1 question more: I use the "Highslide Image Viewer"-Mod (Java Lightbox) is there anyway to make this mod working with the SP 2.3.1 ?

thank you...
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Zavoolon on January 17, 2010, 03:47:37 PM
Same demand, does anyone now how to add a link to the topic the image has come from?
SMF 1.1.11 |
SimplePortal 2.3.1
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: SimonH on January 25, 2010, 05:17:55 PM
I've searched for an answer for the past few days.  Still cannot find how to link an attachment which is in the recent attachment block to the post it was attached to.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: jesustarre on January 28, 2010, 07:35:12 PM
Hello !

I've the same request...

In my case i have a block showing the last pictures attached (Recent Image Attachments) but when i click over the picture,  SP link to:

http://www.mundomustang.com/forum/index.php?action=dlattach;topic=7828.0;attach=1075;image (original Size Image)

But I need link to:

http://www.mundomustang.com/forum/index.php?topic=7828.0 (Forum Post)


I'm using SMF 1.1.11 and SimplePortal 2.3.1

thanks in advance
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on January 29, 2010, 11:53:11 AM
For both SMF versions:

Sources/PortalBlocks.php

Code: (Find) [Select]
<a href="' . $item['file']['href'] . '">
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: jesustarre on January 29, 2010, 02:58:41 PM
Thanks [SiNaN]

Excellent.  That's all i need.

Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Divecall on January 29, 2010, 03:05:15 PM
Thank you a lot !

Its working now.

@[SiNaN]: You have a solution, that i can use the funtion of the "Highslide Image Viewer"-Mod in the Simple Portal ? I mean: when i click on the picture (Recent Image Block), its open with this "javafunction Lightbox" ???
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on February 27, 2010, 05:46:57 AM
for smf SMF 2.0 RC2
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: 230px; height: 230px; 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 class="windowbg2" 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="1">Downloads: </font>', $item['file']['downloads'], '<br />
    </td>
    <td width="50%">
    ', '<font size="1">By:</font> ', $item['member']['link'], '
    </td>
  </tr>
</table><br>

      </li>';

   echo '
      </ul>
    </td>
  </tr>
</table>';


 for smf 1.1.

Code: [Select]
global $db_prefix, $modSettings, $scripturl, $txt, $settings;

$boards = boardsAllowedTo('view_attachments');

if (empty($boards))
return array();
elseif ($boards[0] == 0)
$boards = '';
else
$boards = ' AND m.ID_BOARD IN (' . implode(',', $boards) . ')';

$limit = empty($parameters[0]) ? 12 : (int) $parameters[0];

$request = db_query("
SELECT
att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
att.width, att.height" . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? "" : ", IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height") . "
FROM {$db_prefix}attachments AS att
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = att.ID_MSG)
INNER JOIN {$db_prefix}topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? "" : "
LEFT JOIN {$db_prefix}attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)") . "
WHERE att.attachmentType = 0
AND att.width != 0
$boards
ORDER BY att.ID_ATTACH DESC
LIMIT $limit", __FILE__, __LINE__);
$items = array();
while ($row = mysql_fetch_assoc($request))
{
$filename = preg_replace('~&#(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '&#\\1;', htmlspecialchars($row['filename']));

$items[$row['ID_ATTACH']] = array(
'member' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>',
),
'file' => array(
'filename' => $filename,
'filesize' => round($row['filesize'] /1024, 2) . $txt['smf211'],
'downloads' => $row['downloads'],
'href' => $scripturl . '?action=dlattach;topic=' . $row['ID_TOPIC'] . '.0;attach=' . $row['ID_ATTACH'],
'link' => ' <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '">' . $row['subject'] . '</a>',
'is_image' => !empty($row['width']) && !empty($row['height']) && !empty($modSettings['attachmentShowImages']),
),
'topic' => array(
'id' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'],
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '">' . $row['subject'] . '</a>',
'time' => timeformat($row['posterTime']),
),
);

if ($items[$row['ID_ATTACH']]['file']['is_image'])
{
$id_thumb = empty($row['ID_THUMB']) ? $row['ID_ATTACH'] : $row['ID_THUMB'];
$items[$row['ID_ATTACH']]['file']['image'] = array(
'id' => $id_thumb,
'width' => $row['width'],
'height' => $row['height'],
'img' => '<img src="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;attach=' . $row['ID_ATTACH'] . ';image" alt="' . $row['subject'] . '" />',
'thumb' => '<img src="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;attach=' . $id_thumb . ';image" alt="' . $row['subject'] . '" />',
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] ,
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0"><img src="' . $scripturl . '?action=dlattach;topic=' . $row['ID_TOPIC'] . '.0;attach=' . $id_thumb . ';image" alt="' . $row['subject'] . '"' . (empty($row['ID_THUMB']) ? ' width="210" height="240"' : '') . ' /></a>',
);
}
}
mysql_free_result($request);

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

foreach ($items as $item)
  echo '
      <li class="windowbg2"  style="text-align: center; width: 230px; 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 class="windowbg2" 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['file']['link'], '</font></b><br />   
    </td>
  </tr>
  <tr>
    <td class="windowbg2" width="50%">
      ','<font size="1">مرات التحميل: </font>', $item['file']['downloads'], '<br />
    </td>
    <td width="50%">
    ', '<font size="1">بواسطة:</font> ', $item['member']['link'], '
    </td>
  </tr>
</table><br>

      </li>';

echo '
      </ul>
    </td>
  </tr>
</table>';
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on February 27, 2010, 05:51:32 AM
samozin, what are those codes for exactly?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on February 27, 2010, 06:04:12 AM
they display the recent image attached linked to the topic
demo
www.salamoz.com
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on February 27, 2010, 06:10:22 AM
There is already a block in SimplePortal that displays recent attachment images and with that little edit above I provided, you can make it link to topics instead of images.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on February 27, 2010, 06:27:47 AM
There is already a block in SimplePortal that displays recent attachment images and with that little edit above I provided, you can make it link to topics instead of images.

ummm on smf 2.x i couldnt make the images linked to the topic .
i just added its topic title linked to the topic
i think i need to ssi.php  and see what going there  can  give alit help in that issue
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on February 27, 2010, 06:29:38 AM
Can you elaborate on what you mean? I'm not sure how we can help you since you seem to be using a different portal mod.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on February 27, 2010, 06:38:09 AM
 u  know  iam big fan of simple portal  but iam already stuck with felblog
my users have their blogs on my site  .that felblog not supported any more   but supported only with portamx portal so i had to use it  :(
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on February 27, 2010, 06:51:40 AM
I see. Of course, it is completely up to you which mod to you. It's just that you would probably get a better support at their support forum though.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on February 27, 2010, 08:21:21 AM
ok  thanx  but  that wont make me stop loving the simpleportal :)
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Divecall on March 05, 2010, 01:46:08 PM
@samozin:

Hey, great, you have a Java-Lightbox-Function on your Portal.... !

How you was doing this ? I was trying to add the "Highslide"-Mod to the Portal, but it is not working for me (maybe i am too blond)

Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on March 10, 2010, 11:17:20 AM
@samozin:

Hey, great, you have a Java-Lightbox-Function on your Portal.... !

How you was doing this ? I was trying to add the "Highslide"-Mod to the Portal, but it is not working for me (maybe i am too blond)
actully i did not do any thing its already included with the portal iam using isnt it great  i hope simpleportal include it  so soon  ha ...?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: escorta.biz on March 12, 2010, 06:54:04 AM
For both SMF versions:

Sources/PortalBlocks.php

Code: (Find) [Select]
<a href="' . $item['file']['href'] . '">
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">
I replaced 'file' with 'topic' as mentioned above but no change was made. Same as i changed 'file' with 'post', still nothing happens... when i click the image, is opening as attachment.

There is something else i should change? i'm using SMF 2 RC3 and Simple Portal 2.3.1.

Thanks!
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on March 12, 2010, 07:56:49 AM
Can you attach your edited file here?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: escorta.biz on March 12, 2010, 08:09:23 AM
Sure thing, please see the attachment.

Meanwhile i noticed that the url look like domainname/forum/dlattach/attach,51/image/path_to_topic.html. I guess there is a problem related to Simple SEF mod i'm using.
There is a solution for this or should i ask for support in the mod's topic?

Thanks!
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on March 12, 2010, 08:13:18 AM
Are you using Recent Image Attachments block or Recent Attachments block?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: escorta.biz on March 12, 2010, 08:14:29 AM
Recent image attachments
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on March 12, 2010, 08:26:34 AM
Ah, you mean you want the image itself to link to the topic.

Code: (Find) [Select]
', $item['file']['image']['link'], '
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">', $item['file']['image']['thumb'], '</a>
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: escorta.biz on March 12, 2010, 08:33:21 AM
Excelent! It's working now. Many thanks! :)
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on March 12, 2010, 08:33:40 AM
You're welcome. ;)
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: earthview.nl on March 19, 2010, 06:50:54 AM
Ah, you mean you want the image itself to link to the topic.

Code: (Find) [Select]
', $item['file']['image']['link'], '
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">', $item['file']['image']['thumb'], '</a>

Hi Sinan,

thanks a lot, if i use this code, they will show the images in orginal size , the resizes doens't work.

Gr,
Maik
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: [SiNaN] on March 20, 2010, 10:57:34 AM
You can try this then:

Code: (Find) [Select]
', $item['file']['image']['link'], '
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">', str_replace('<img', '<img width="100"', $item['file']['image']['thumb']), '</a>
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: earthview.nl on March 23, 2010, 05:11:42 AM
Yes :D Thanks
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: swoodie on April 20, 2010, 03:11:47 AM
For both SMF versions:

Sources/PortalBlocks.php

Code: (Find) [Select]
<a href="' . $item['file']['href'] . '">
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">

Hi will this work on RC3 & SP2.3.2
do i edit index.php in forum root
thanks in advance
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Nathaniel on April 20, 2010, 04:15:06 AM
It should work. As stated in the post, you need to edit the 'Sources/PortalBlocks.php' file.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: swoodie on April 20, 2010, 04:50:42 AM
ok thanks will give it a try
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: swoodie on April 20, 2010, 04:58:16 AM
thanks worked a treat i needed to use Reply #27
like it very much i only stumbled across this post SP rocks
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: samozin on May 03, 2010, 06:45:33 PM
just look at my site www.salamoz.com
i have edited both ssi.php and the portalblock.php one
 i have

Code: [Select]
// Images.
if ($attachments[$row['id_attach']]['file']['is_image'])
{
$id_thumb = empty($row['id_thumb']) ? $row['id_attach'] : $row['id_thumb'];
$attachments[$row['id_attach']]['file']['image'] = array(
'id' => $id_thumb,
'width' => $row['width'],
'height' => $row['height'],
'img' => '<img src="' . $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $row['id_attach'] . ';image" alt="' . $filename . '" />',
'thumb' => '<img src="' . $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $id_thumb . ';image" alt="' . $filename . '" />',
'href' => $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $id_thumb . ';image',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0"><img src="' . $scripturl . '?action=dlattach;topic=' . $row['id_topic'] . '.0;attach=' . $id_thumb . ';image" alt="' . $row['subject'] . '"' . (empty($row['ID_THUMB']) ? ' width="210" height="240"' : '') . ' /></a>',
);
}
}
$smcFunc['db_free_result']($request);
that  is in the ssi.php

and i have this

Code: [Select]
<a href="' . $item['topic']['href'] . '">' . $item['topic']['link'] . '</a><br />' : ''), 'in portalblck.php line 3193

i think  thats the best thing for  adding the latest topics with the attached images the images linked to topic and the title of the topic above it

any one can help  i need to add  auto scrolling for that ?
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: Ciler on January 09, 2011, 06:45:20 AM
O.k. I have it working now but the images are still actually i want the images scrolling (moving) please can you give me the code in the script to make the images moving?

Thanks in advance!!
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RvG on May 24, 2011, 11:32:57 PM
You can try this then:

Code: (Find) [Select]
', $item['file']['image']['link'], '
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">', str_replace('<img', '<img width="100"', $item['file']['image']['thumb']), '</a>

thanks... it works.  :nervous-happy:
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: madman71 on March 26, 2012, 12:49:30 AM
For both SMF versions:

Sources/PortalBlocks.php

Code: (Find) [Select]
<a href="' . $item['file']['href'] . '">
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">


I have upgraded to SimplePortal 2.3.4 and im having some issues  with the above code.  It's not making the thumbs link to the actual post. 
Should the above code still work for linking the thumbs to the post in 2.3.4?

thanks

Title: Re: Block ( Recent Image Attachments ) link to post
Post by: madman71 on March 26, 2012, 12:52:26 AM
You can try this then:

Code: (Find) [Select]
', $item['file']['image']['link'], '
Code: (Replace) [Select]
<a href="' . $item['topic']['href'] . '">', str_replace('<img', '<img width="100"', $item['file']['image']['thumb']), '</a>

thanks... it works.  :nervous-happy:


oppps, NM, that's the wrong code.  It would have helped if i read the whole thread. LOL

thanks
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: newthing on July 21, 2013, 03:37:11 PM
hello ... sorry for bumping old topic... but i need help.. is there a way to make recent image attachment block in form of table???? like CSS??? i have no idea regarding coding.. and just modified this block to show topic too..Please help ....
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RandomRidoy on September 03, 2015, 02:45:00 AM
hi.. it is working good... but i want to customize it to show only 10 posts in simple portal how can i do it... and another problem is when the topic name gose biger it looks disgusting can you help me with it too.... plz help....
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: ♦ Ninja ZX-10RR ♦ on September 03, 2015, 03:17:09 AM
RandomRidoy,

Well both blocks come with SimplePortal by default now (at least as of 2.3.6, don't know exactly when they were introduced), so you should have a look in the relative settings, it should be possible to customize the number of things easily in the block settings ;)
And also provide a link to your site, so that I could check that topic title issue as well. In the meantime you could try to add
Code: [Select]
word-wrap: break-word; into the "Custom CSS styles" text field for the "Body" of your block, it should work, but could look ugly anyway, that's why I need a link :)

Regards
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RandomRidoy on September 04, 2015, 01:33:03 AM
hi there... when i post 2 topic... but it show 1 - 2.. but i want to show the last topic in first... like this...

(http://i.imgur.com/fYyFkqn.png)

how can i do this....???
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: ♦ Ninja ZX-10RR ♦ on September 04, 2015, 01:35:57 AM
Which block are you using? There are recent attachments and recent images blocks built-in into SimplePortal already.
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RandomRidoy on September 04, 2015, 01:37:49 AM
i am using.. Bottom Block... Custom PHP
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: ♦ Ninja ZX-10RR ♦ on September 04, 2015, 01:41:50 AM
There are recent attachments and recent images blocks built-in into SimplePortal already.
I don't know how to say it differently, I already said this 3 times...
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RandomRidoy on September 10, 2015, 12:29:31 AM
for smf SMF 2.0 RC2
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: 230px; height: 230px; 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 class="windowbg2" 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="1">Downloads: </font>', $item['file']['downloads'], '<br />
    </td>
    <td width="50%">
    ', '<font size="1">By:</font> ', $item['member']['link'], '
    </td>
  </tr>
</table><br>

      </li>';

   echo '
      </ul>
    </td>
  </tr>
</table>';


can i replace attachments with bbc code...??? if i can... can you help me with it....
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: RandomRidoy on September 14, 2015, 12:17:12 AM
for smf SMF 2.0 RC2
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: 230px; height: 230px; 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 class="windowbg2" 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="1">Downloads: </font>', $item['file']['downloads'], '<br />
    </td>
    <td width="50%">
    ', '<font size="1">By:</font> ', $item['member']['link'], '
    </td>
  </tr>
</table><br>

      </li>';

   echo '
      </ul>
    </td>
  </tr>
</table>';



hi, i am using this php code in my simple portal.... http://i.imgur.com/whWdx91.png

but there is a problem... when any Guest visit my site its show nothing... i allow everyone to view this..  but stil it showing nothing....

http://i.imgur.com/p8WkAaZ.png
Title: Re: Block ( Recent Image Attachments ) link to post
Post by: ♦ Ninja ZX-10RR ♦ on September 14, 2015, 12:23:12 AM
Most likely because guests are not allowed to view recent topics :P I believe it's info center permission, but I could be wrong. didn't use it for a long time. Give it a try!

Regards
SimplePortal 2.3.8 © 2008-2024, SimplePortal