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: 644
  • 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]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Message Icons in Recent Post/Topics Block  (Read 7588 times)

0 Members and 1 Guest are viewing this topic.

Offline ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Message Icons in Recent Post/Topics Block
« on: May 12, 2010, 01:38:18 PM »
Hello.

I would like to add the message icon to each post/topic listed by the Recent Post/Topics Block.  The current setup shows another icon that I'd like to replace.

The code in question is in the portalblocks.php file around line 1050.

Can some one help me?
« Last Edit: May 13, 2010, 04:30:12 PM by ehsizzup »

Offline ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #1 on: May 13, 2010, 12:03:43 PM »
gentle bump.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Message Icons in Recent Post/Topics Block
« Reply #2 on: May 15, 2010, 10:43:22 PM »
The code below will make it work for topics, if you want it to work for messages/posts then more edits will be needed to the SSI.php file.

Code: ("Find (Sources/PortalBlocks.php)") [Select]
', sp_embed_image(empty($parameters['type']) ? 'post' : 'topic'), '
Code: ("Replace") [Select]
', !empty($item['icon']) ? $item['icon'] : sp_embed_image(empty($parameters['type']) ? 'post' : 'topic'), '
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 ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #3 on: May 17, 2010, 09:49:14 AM »
Now I'm a bit confused....this code seems to have had no effect on the block.

What is the difference between a topic, a message, and a post?

For example, this post/topic/message? has a custom message icon in this view.  It is this icon that I would like to show up in the block.








Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #4 on: May 17, 2010, 12:57:59 PM »
In the Recent POSTS/TOPICS block, did you choose POST or TOPIC?
If you are using POST, please test using TOPIC, and report if that works for you.
 
Here's the short explanation of the difference:
In SMF, any item on the forum is a message. It is also a POST
A TOPIC message is the very first message in a thread, or topic.
The remaining posts, the replies to the topic posts, are not topics. They are just POSTS.
 
Here's why the difference matters in the SimplePortal RECENT block:
In the Recent Posts/Topics block, if you choose "POSTS" then, if the most recent post is a new TOPIC, it will show up in the block. But, if the most recent post is a reply to a much older topic, the new post, the reply to the older topic, will show up in the block.
 
If you are using this block to show boards where there are no replies to the topic posts, then you'll get exactly the same messages showing up regardless of whether you choose "POSTS" or "TOPICS".  Strangely, though, the two functions SMF supplies in SSI.php (ssi_recentPosts and ssi_recentTopics) return a very slightly different list of stuff.  ssi_recentTopics returns, among other things, 'icon', whereas ssi_recentPosts does not.
 
SimplePortal uses these SSI functions because they are guaranteed to work in any official SMF release, no matter what changes SMF might undergo. This makes it much easier to keep SimplePortal running right.  Of course, you could customize SSI.php, just as you have customized PortalBlocks.php. But I find that fewer manual customizations makes it easier to maintain a website through SMF and mod upgrades.
« Last Edit: May 17, 2010, 01:18:24 PM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #5 on: May 17, 2010, 03:32:00 PM »
That did the trick.

and thanks for the education.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #6 on: May 17, 2010, 03:42:01 PM »
Glad to help.
 
I've often been accused of being too wordy.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #7 on: May 27, 2010, 04:44:46 PM »
I'm going to try to modify the ssi_recentPosts to return the icon.

Pray for me.



Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #8 on: May 27, 2010, 08:46:48 PM »
This will be a good introduction. It will be confusing, but not too hard.
Though it may take some time.
 
Make only one very small change at a time, because you are certain to get errors.
Even making a change that should not effect the output is a good step.
And remember -- you can always get the original SSI.php from the SMF distribution.
 
Good Luck.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline ehsizzup

  • Jr. Member
  • **
  • Posts: 84
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #9 on: October 25, 2010, 11:02:19 AM »
It took a while to get started on this, but I nailed it the first time without any errors!

Thanks for all your help.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Message Icons in Recent Post/Topics Block
« Reply #10 on: October 25, 2010, 11:48:28 AM »
Congratulation! You are on your way...
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?