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: 507
  • 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 36452 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 :)