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 login or register.

* Who's Online

  • Dot Guests: 418
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Block ( Recent Image Attachments ) link to post  (Read 36457 times)

0 Members and 1 Guest are viewing this topic.

Offline earthview.nl

  • Semi Newbie
  • *
  • Posts: 5
    • Google earth forum
  • SMF Version: 1.1.11
  • SP Version: None
Block ( Recent Image Attachments ) link to post
« 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
« Last Edit: January 13, 2011, 12:33:18 PM by AngelinaBelle »

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Block ( Recent Image Attachments ) link to post
« Reply #1 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?
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline earthview.nl

  • Semi Newbie
  • *
  • Posts: 5
    • Google earth forum
  • SMF Version: 1.1.11
  • SP Version: None
Re: Block ( Recent Image Attachments ) link to post
« Reply #2 on: December 19, 2009, 03:26:00 AM »
Hi Nathaniel,

i use 1.1.11 and i have SimplePortal 2.2.2

Maik ;)

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Block ( Recent Image Attachments ) link to post
« Reply #3 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.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Block ( Recent Image Attachments ) link to post
« Reply #4 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...

Offline Zavoolon

  • Just Registered
  • Posts: 1
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #5 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

Offline SimonH

  • Just Registered
  • Posts: 1
  • SMF Version: None
  • SP Version: None
Re: Block ( Recent Image Attachments ) link to post
« Reply #6 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.

Offline jesustarre

  • Semi Newbie
  • *
  • Posts: 8
  • Gender: Male
    • Mundo Mustang
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #7 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

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #8 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'] . '">
« Last Edit: January 13, 2011, 12:30:37 PM by AngelinaBelle »
And slowly, you come to realize... It's all as it should be...

Offline jesustarre

  • Semi Newbie
  • *
  • Posts: 8
  • Gender: Male
    • Mundo Mustang
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #9 on: January 29, 2010, 02:58:41 PM »
Thanks [SiNaN]

Excellent.  That's all i need.


Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Block ( Recent Image Attachments ) link to post
« Reply #10 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" ???
« Last Edit: January 29, 2010, 06:23:00 PM by Divecall »

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #11 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>';

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #12 on: February 27, 2010, 05:51:32 AM »
samozin, what are those codes for exactly?
And slowly, you come to realize... It's all as it should be...

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #13 on: February 27, 2010, 06:04:12 AM »
they display the recent image attached linked to the topic
demo
www.salamoz.com

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #14 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.
And slowly, you come to realize... It's all as it should be...

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #15 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
« Last Edit: February 27, 2010, 06:30:24 AM by samozin »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #16 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.
And slowly, you come to realize... It's all as it should be...

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #17 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  :(
« Last Edit: February 27, 2010, 06:41:05 AM by samozin »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #18 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.
And slowly, you come to realize... It's all as it should be...

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #19 on: February 27, 2010, 08:21:21 AM »
ok  thanx  but  that wont make me stop loving the simpleportal :)

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Block ( Recent Image Attachments ) link to post
« Reply #20 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)


Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #21 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 ...?

Offline escorta.biz

  • Semi Newbie
  • *
  • Posts: 11
    • Escorte
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #22 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!

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #23 on: March 12, 2010, 07:56:49 AM »
Can you attach your edited file here?
And slowly, you come to realize... It's all as it should be...

Offline escorta.biz

  • Semi Newbie
  • *
  • Posts: 11
    • Escorte
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #24 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!

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #25 on: March 12, 2010, 08:13:18 AM »
Are you using Recent Image Attachments block or Recent Attachments block?
And slowly, you come to realize... It's all as it should be...

Offline escorta.biz

  • Semi Newbie
  • *
  • Posts: 11
    • Escorte
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #26 on: March 12, 2010, 08:14:29 AM »
Recent image attachments

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #27 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>
« Last Edit: January 13, 2011, 12:32:12 PM by AngelinaBelle »
And slowly, you come to realize... It's all as it should be...

Offline escorta.biz

  • Semi Newbie
  • *
  • Posts: 11
    • Escorte
  • SMF Version: 2 RC3
  • SP Version: 2.3.1
Re: Block ( Recent Image Attachments ) link to post
« Reply #28 on: March 12, 2010, 08:33:21 AM »
Excelent! It's working now. Many thanks! :)

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #29 on: March 12, 2010, 08:33:40 AM »
You're welcome. ;)
And slowly, you come to realize... It's all as it should be...

Offline earthview.nl

  • Semi Newbie
  • *
  • Posts: 5
    • Google earth forum
  • SMF Version: 1.1.11
  • SP Version: None
Re: Block ( Recent Image Attachments ) link to post
« Reply #30 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

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Block ( Recent Image Attachments ) link to post
« Reply #31 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>
« Last Edit: January 13, 2011, 12:33:01 PM by AngelinaBelle »
And slowly, you come to realize... It's all as it should be...

Offline earthview.nl

  • Semi Newbie
  • *
  • Posts: 5
    • Google earth forum
  • SMF Version: 1.1.11
  • SP Version: None
Re: Block ( Recent Image Attachments ) link to post
« Reply #32 on: March 23, 2010, 05:11:42 AM »
Yes :D Thanks

Offline swoodie

  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
Re: Block ( Recent Image Attachments ) link to post
« Reply #33 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
« Last Edit: April 20, 2010, 03:36:40 AM by swoodie »

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Block ( Recent Image Attachments ) link to post
« Reply #34 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.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline swoodie

  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
Re: Block ( Recent Image Attachments ) link to post
« Reply #35 on: April 20, 2010, 04:50:42 AM »
ok thanks will give it a try

Offline swoodie

  • Jr. Member
  • **
  • Posts: 63
  • Gender: Male
Re: Block ( Recent Image Attachments ) link to post
« Reply #36 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

Offline samozin

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #37 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 ?
« Last Edit: May 03, 2010, 06:49:44 PM by samozin »

Offline Ciler

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 1.1.12
  • SP Version: 2.3.3
Re: Block ( Recent Image Attachments ) link to post
« Reply #38 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!!

Offline RvG

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Block ( Recent Image Attachments ) link to post
« Reply #39 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:

Offline madman71

  • Semi Newbie
  • *
  • Posts: 20
  • SMF Version: 1.1.1
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #40 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


Offline madman71

  • Semi Newbie
  • *
  • Posts: 20
  • SMF Version: 1.1.1
  • SP Version: 2.3.2
Re: Block ( Recent Image Attachments ) link to post
« Reply #41 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

Offline newthing

  • Newbie
  • Posts: 3
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Block ( Recent Image Attachments ) link to post
« Reply #42 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 ....

Offline RandomRidoy

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #43 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....
« Last Edit: September 03, 2015, 02:49:58 AM by RandomRidoy »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #44 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
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline RandomRidoy

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #45 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...



how can i do this....???

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #46 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.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline RandomRidoy

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #47 on: September 04, 2015, 01:37:49 AM »
i am using.. Bottom Block... Custom PHP

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #48 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...
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline RandomRidoy

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #49 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....
« Last Edit: September 10, 2015, 12:40:22 AM by RandomRidoy »

Offline RandomRidoy

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #50 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

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Block ( Recent Image Attachments ) link to post
« Reply #51 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
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis