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

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Staff block where name links to pages  (Read 19363 times)

0 Members and 1 Guest are viewing this topic.

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Staff block where name links to pages
« on: June 15, 2015, 04:57:43 PM »
I'm making pages for each staff member.
I'd like to have a new staff block, that looks the same as the default, but allows me to change the links to the pages for each staff member.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #1 on: June 15, 2015, 05:08:46 PM »
Easy to edit, I just need to know what the new page URLs look like

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #2 on: June 15, 2015, 05:26:47 PM »
They are SP pages.
So would be: index.php?page=staffmembername

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #3 on: June 15, 2015, 05:45:42 PM »
I'll need to know a bit more about the pages, for example if the staff member's name is my name, would it be SayakaMaizono without any spaces?

What about if I had my name as Sayaka-Maizono, would you omit the dash?

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #4 on: June 15, 2015, 07:27:31 PM »
I try not to use dashes in page ID's.
Like, my page would be burkeknight
I also tend to stay away from caps in page names. :)

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #5 on: June 15, 2015, 07:35:03 PM »
Open ./Sources/PortalBlocks.php

Find:
Code: [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',

Replace with:
Code: [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
//'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'link' => '<a href="' . $scripturl . '?page="' . preg_replace('/\s*/', '', $smcFunc['strtolower']($row['real_name'])) . '">' . $row['real_name'] . '</a>',

This will automatically convert the names to lowercase and remove all the spaces. It might break when you get crafty with usernames however as this is a staff list, I don't think it will cause any problems.

Ideally you should use their IDs for the pages, like ?page=member1 and ?page=member54, but it doesn't look as nice.

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #6 on: June 15, 2015, 07:58:55 PM »
That breaks the block, it seems.
Also, like stated, I'm changing the names on them, a bit...

Quote
Ideally you should use their IDs for the pages, like ?page=member1 and ?page=member54, but it doesn't look as nice.
However, I wonder if can use their user name, instead?

Do note, I'm not using SMF, but using ElkArte.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #7 on: June 15, 2015, 08:37:34 PM »
Open ./Sources/PortalBlocks.php

Find:
Code: [Select]
$staff_list = array();
$colorids = array();

Replace with:
Code: [Select]
$staff_list = array();
$colorids = array();

$custom_staff = array(
array(
'id' => 1,
'name' => 'Sayaka Maizono',
'link' => $scripturl . '?page=maizono'
),
array(
'id' => 7,
'name' => 'Makoto Naegi',
'link' => $scripturl . '?page=naegi'
),
);

Find:
Code: [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'group' => $row['group_name'],
'type' => $row['type'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Replace with:
Code: [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'group' => $row['group_name'],
'type' => $row['type'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

foreach ($custom_staff as $key => $member)
{
if ($member['id'] == $row['id_member'])
{
$staff_list[$row['type'] . '-' . $row['id_member']['link'] = '<a href="' . $member['link'] . '">' . $member['name'] . '</a>';
continue;
}
}

I made two entries in the array as an example so you can build it yourself, you just need to make a new array entry and then add 'id' (the user id of the member), their name, and then the link you want to make it.

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #8 on: June 15, 2015, 08:49:58 PM »
I kind of did something a little simpler, that would not edit a file, in case of SP update, since using it on ElkArte.
I used custom HTML block, and made own to resemble as much as can, but links to where I want.

However, it also is more hard coded, so any staff changes, I'll have to manually change it, as well. ;)

Thank you, though, for the help. :)

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #9 on: June 15, 2015, 08:56:57 PM »
If you already did something simpler, why ask for a solution?

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #10 on: June 15, 2015, 09:21:34 PM »
Well, like said, I kind of did something a little simpler, meaning, after I had done Reply #6.
If you think I'd do something, and then ask for help just to not use it, you are very mistaken.
However, it was due to editing the portal blocks page, instead of using a custom block to resemble, that I did it the way I did.

Like I stated, I'm running this on ElkArte, and we are still doing lots of work on the SimplePortal mod for it. That being said, file edits are not the best idea, as they are bound to get removed when doing updates.

Hence, the reason that people that post for custom blocks, have for them to be done as custom HTML or PHP blocks, and not file edits.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #11 on: June 17, 2015, 01:32:52 AM »
You want a block that will do this without any hard edits, so it works like a default block, but.. you want it for different forum software?

I'm not really following that, but I can add the fields in the database and adjust the staff block to "add" the features innate.

I'm not even sure if there is licensing problems with porting SP to other software...

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Staff block where name links to pages
« Reply #12 on: June 17, 2015, 06:44:25 AM »
You want a block that will do this without any hard edits, so it works like a default block, but.. you want it for different forum software?
I'm not even sure if there is licensing problems with porting SP to other software...

I wanted it in a custom block, to look like the regular staff block. That way, updates would not make it so would have to redo it.

I'm not really following that, but I can add the fields in the database and adjust the staff block to "add" the features innate.

There's no need, as I got it done, as custom HTML... Ok, I have to manually edit if any staff changes, but I rather doubt that would be hard to do.

I'm not even sure if there is licensing problems with porting SP to other software...

Before you start on lines like that, why don't you LOOK at what the license IS for SimplePortal.
Also, why not LOOK at the topic for SimplePortal at the ElkArte site: http://www.elkarte.net/community/index.php?topic=1399.0

Especially, look at Reply #3, and WHO posted that reply.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Staff block where name links to pages
« Reply #13 on: June 17, 2015, 06:49:23 PM »
Oh, I know what that is now.

I wasn't aware of what ElkArte even was, I thought it was another forum software like IPB.

Offline LittleFang

  • Semi Newbie
  • *
  • Posts: 8
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Staff block where name links to pages
« Reply #14 on: September 10, 2018, 12:51:54 PM »
This is a lovely mod! 

May I ask for a way to have the mod link to a user's custom forum section with their name?