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

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Tabbed Content - Blocks in Block  (Read 19015 times)

0 Members and 1 Guest are viewing this topic.

Offline FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Tabbed Content - Blocks in Block
« on: February 07, 2014, 04:45:39 AM »
So~

What I would like to be able to do, if possible, is have a display block, which calls up various blocks (block in block system) but each of the blocks it calls up are tabbed so as that only one shows at a time. You click the little tab and the next block will be viewable.

This is the block in block code I'm currently using:

Code: [Select]
$block_ids = array(34, 15, 20, 26, 106, 92, 102, 79, 83, 85);

$block_data = array();
foreach ($block_ids as $block)
{
   $data = current(getBlockInfo(false, $block, false, false, true));
   if (empty($data))
      continue;
   $block_data[$block] = $data;
   $block_data[$block]['style'] = sportal_parse_style('explode', $block_data[$block]['style'], true);
}

foreach ($block_data as $data)
echo '<div>', template_block($data), '</div>';

Thank you!

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #1 on: February 09, 2014, 04:02:53 PM »
This can absolutely be done.  One way to do it is with a little javascript.
Please see
http://simpleportal.net/index.php?topic=5332.msg32204;topicseen#msg32204
and
http://simpleportal.net/index.php?topic=5332.msg37841#msg37841

for how to do this.
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #2 on: February 10, 2014, 10:56:11 PM »
Thanks, that's awesome!

Unfortunately I cannot find any information on how to use custom php blocks inside the tabbed content, only pre-made blocks. How would I edit the code to include custom php blocks?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #3 on: February 11, 2014, 09:06:05 AM »
1) First create a custom php block to use inside the tabbed content
2) Find the block id of the blocks you just created.  You will see this in the list of all of your blocks.
3) Use these block ids in your "blocks in blocks" tabbed code.
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #4 on: February 11, 2014, 09:53:29 AM »
Okay. I already have a functioning BiB; I know how to do that. That's not what I want help with.

The TABBED block-in-block code is not nearly so easy to manipulate from my end of the screen. All the examples use pre-made SP blocks (recent_posts, for example) and there are no instruction on how to use the tabbed code with custom PHP blocks in it.

That said;

How do I edit THIS code, to read custom PHP blocks, instead of premades, preferably including individual block permissions??

Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #5 on: February 11, 2014, 01:59:47 PM »
A custom php block really does use a "premade block".  It uses the sp_php block.  One of the parameters of that block is the 'content', which is a bunch of php code.  I would not even think about trying to create a custom php block containing php code to pass to another php block.  That way lies madness.

Instead, create a custom php block.  Use function getBlockInfo  to retrieve the parameter info you need from the database.
pass that to sp_php (just as the example passes parameters to sp_recent, etc.)

It's exactly the same thing, only with the additional step of getting the $parameters off the database instead of hard-coding them in your php block with all the tabs.

Does that make sense?
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #6 on: February 11, 2014, 09:18:30 PM »
Not in the slightest ><

I have no idea how to get the block info to obtain the parameters. The Search function on the site isn't giving me any usable information that I can see.

Could you please supply how to do that, and possibly given an example, because I have no F* idea and you are speaking Gibberish to me :(

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #7 on: February 11, 2014, 09:26:16 PM »
Sorry.  I'll back up a bit.

First step.  Create a custom php block, for the content you would like to have in your sub-block.
Now, when you are editing that block, notice the URL for that block.

Along with some other stuff, you are going to see something like
index.php?action=admin;area=portalblocks;sa=edit;block_id=64
That number, 64, is the id number for one of my custom php blocks on a site I manage.

That block_id is just the secret code you need to get your block information out of the database.
Fortunately, [SiNaN] has provided a function called getBlockInfo.
In the original blocks-in-blocks example, you will see an example of getBlockInfo being used to get the parameters and several other things back about a block.

Can you see how you would do that?
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #8 on: February 12, 2014, 09:43:15 AM »
I don't think we're on the same page. You're not telling me anything I don't already know; and I don't see how it relates to the tabbed BiB.

I know how to get hte block IDs - the original code I supplied in the opening post is a BIB with several individual custom PHP blocks in it. That's all well and good, looks fantastic, I love it.

However, I now want to put THOSE blocks into a BIB htat uses the tabs such as was given in the example here.

I am unable to see how to change the code to make it pull the blocks I want it to, because all the examples given for that particular code is for pre-made SP blocks, not custom made blocks.


This is the code for Tabbed BIB; What I want to know is how to change the elements to call up Custom PHP blocks that I want to be part of the tabbed system. That's all. How do I do that?:

Code: [Select]
global $txt;

$txt['recent_topics'] = 'Recent Topics';
$txt['recent_posts'] = 'Recent Posts';

$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_posts' => array(
      'text' => 'recent_posts',
      'image' => '',
      'lang' => true,
      'url' => '#recent_posts" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1), 0), '
</div>
<div id="recent_posts" style="display: none;">
   ', sp_recent(array('display' => 1), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'recent_posts\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>';
« Last Edit: February 12, 2014, 10:13:24 AM by FireDitto »

Offline Tarista

  • Semi Newbie
  • *
  • Posts: 37
  • SMF Version: 2.0.10
  • SP Version: 2.3.5
Re: Tabbed Content - Blocks in Block
« Reply #9 on: February 12, 2014, 11:00:31 AM »
I'm also trying to figure out the same (i think) that you're trying to achieve FireDitto.

I tried to change some parts around from the examples I found in the links by AngelinaBelle and codes by [SiNaN]. I can't get the ID of the php to load so I guess I messed something up there. And HTML is just for adding some lines of HTML which will not be enough. Still thought i could share the code I put together with snippets of codes. At least in this version it's possible to add more tabs, and not just two. :)

Hope I'm not intruding. Feel free to ignore me if so.

This is the part I think would be most relevant if we could figure out how to make it work :)

As of now it does not seem to work. My ID of the custom block is 58 :)

Code: [Select]
array(
'label' => 'My Block',
'type' => 'sp_php',
'parameters' => array('block_id' => 58),
),

And this is the whole code
(no credit to me, I just added it up from pieces I found)
Code: [Select]
$blocks = array(
array(
'label' => 'Recent Posts',
'type' => 'sp_recent',
'parameters' => array('display' => 1),
),
array(
'label' => 'My Block',
'type' => 'sp_php',
'parameters' => array('block_id' => 58),
),
array(
'label' => 'Some HTML',
'type' => 'sp_html',
'parameters' => array('content' => 'html code goes here'),
),
);

global $txt;

$button_list = array();
foreach ($blocks as $id => $block)
{
$txt['sp_bib_label_' . $id] = $block['label'];

$button_list[] = array(
'text' => 'sp_bib_label_' . $id,
'image' => '',
'lang' => true,
'url' => '#sp_bib_' . $id . '" id="sp_bib_button_' . $id . '" onclick="sp_bib_change(' . $id . '); return false;',
);
}

$button_list[0]['active'] = true;

echo '
<div style="overflow: auto;">
', template_button_strip($button_list), '
</div>';

foreach ($blocks as $id => $block)
{
echo '
<div id="sp_bib_', $id, '"', $id != 0 ? ' style="display: none;"' : '', '>';

$block['type']($block['parameters'], 0);

echo '
</div>';
}

echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function sp_bib_change(id)
{
for (var i = 0; i < ', count($blocks), '; i++)
{
document.getElementById(\'sp_bib_\' + i).style.display = i == id ? \'\' : \'none\';
document.getElementById(\'sp_bib_button_\' + i).className = \'button_strip_\' + i + (i == id ? \' active\' : \'\');
}
}
// ]]></script>';

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #10 on: February 12, 2014, 04:29:16 PM »
Fireditto,

Actually, I think we might be close to being on the same page.

Let us suppose that, instead of sp_recent, you want to call sp_php.  That is great.  But what do you pass into it?

First you need to get the parameters for the block.
You will want to do something like:
Code: [Select]
$block_info = getBlockInfo(,64);This will get the info for the block with id # 64.   If your php is stored in a block with a different id, then use that id number instead.

Next, you will want to get the paremeters out of there

Code: [Select]
$parameters = $block_info['parameters'];
Finally, when you get down to that line that not calls sp_recent, you will make the change to
Code: [Select]
sp_php($parameters,0)
Tarista, you are also on the right track, though you may be making your code so general-purpose that you might have a hard time debugging it.  It should work, in the end.
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #11 on: February 13, 2014, 01:11:09 AM »
Yes! That's what I want to do.

However, your explanation has left me befuddled still. I do not know how to implement it at all into the code. Everything I'm trying is rendering the php invisible :| I'm trying to follow your instructions, but I really cant figure it out ><

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #12 on: February 13, 2014, 05:30:56 PM »
First things first, then.

1) The php block that you want to show inside your other block.  Is that working just great?
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #13 on: February 13, 2014, 09:50:33 PM »
The ID of the block is 15, and yes, it works perfectly fine both standalone and in the other BIB code. Just can't get it to work in the tabbed code.

Offline FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #14 on: February 14, 2014, 10:11:45 AM »
Hey Angelina, thanks for your help by the way. I really do appreciate it.

I've looked over my blocks, and what I would like is a TABBED block that calls up:

Block ID 114 (custom PHP) as the opening block
Block ID 120 (custom PHP) as the second tab
Block ID 121 (custom PHP) as the final tab

I'm still playing with it, but I am very much failing to get it to work presently.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #15 on: February 14, 2014, 08:15:12 PM »
Assuming you started with working code above, you would make the changes I suggested somewhat as follows.
Remember, I have not tested this code, of course. I apologize if I have made any typing errors.

Code: [Select]
global $txt;

$blockInfo =
array (
array(
'blockName' => 'First Block',
'parameters' => getBlockInfo(,115)
),
array(
'blockName' => 'Second Block',
'parameters' => getBlockInfo(,120)
),
array(
'blockName' => 'Third Block',
'parameters' => getBlockInfo(,121)
)
);

$txt['button0'] = $blockInfo[0]['blockName'];
$txt['button1'] = $blockInfo[1]['blockName'];
$txt['button2'] = $blockInfo[2]['blockName'];



$buttons = array(
   'button0' => array(
      'text' => 'button0',
      'image' => '',
      'lang' => true,
      'url' => '#first_button" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'button1' => array(
      'text' => 'button1',
      'image' => '',
      'lang' => true,
      'url' => '#second_button" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
   'button2' => array(
      'text' => 'button2',
      'image' => '',
      'lang' => true,
      'url' => '#second_button" id="b_rp" onclick="change_display(\'rt\'); return false;',
   ),
);




echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="button0">
   ', sp_php($blockInfo[0]['parameters'],0), '
</div>
<div id="button1" style="display: none;">
   ', sp_php($blockInfo[1]['parameters'],0), '
</div>
<div id="button2" style="display: none;">
   ', sp_php($blockInfo[2]['parameters'],0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'button0\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'button1\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'button2\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_button0\' : \'button_strip_button0 active\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_button1\' : \'button_strip_button1 active\';
      document.getElementById(\'b_rp\').className = current ? \'button_strip_button2 active\' : \'button_button2\';
   }
// ]]></script>';
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 FireDitto

  • Jr. Member
  • **
  • Posts: 91
  • Gender: Female
    • Second Pass Weyr
  • SMF Version: 2.0.11
  • SP Version: 2.3.5
  • Elkarte Version: None
Re: Tabbed Content - Blocks in Block
« Reply #16 on: February 14, 2014, 08:29:12 PM »
It does not seem to work; I'm getting a tiny empty block that I think generally means a piece of code is wrong but not "broken"?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #17 on: February 18, 2014, 04:49:05 PM »
I am sorry I did not test this code.  I only made some modifications to the code from Tarista.
If this were for my forum, I would start from the basics.

I would start with just one block.

I would just try one little part, without all the fancy tabs and whatnot.

Code: [Select]
$parameters = getBlockInfo(,121);
sp_php($parameters'],0);

If that works ok, then try building the rest of it up, bit by bit.
 


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 Tarista

  • Semi Newbie
  • *
  • Posts: 37
  • SMF Version: 2.0.10
  • SP Version: 2.3.5
Re: Tabbed Content - Blocks in Block
« Reply #18 on: February 18, 2014, 04:57:31 PM »
Yeah, that code seemed not to work for me either. I ended up with a blank page too. Everything else loaded fine however. Just those php blocks giving me trouble.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Tabbed Content - Blocks in Block
« Reply #19 on: February 18, 2014, 05:00:28 PM »
Sorry.  Untested code.  It was just a sort of "something like this" idea, and I may have messed up in the arrays or
... who knows where.

I recommend starting with the simplest possible piece (use block info, then use that to eval a php block).
Then build up from there.  You will quickly find my awful errors that 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?