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: 480
  • 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: Creating a Panels Tab in a Custom PHP Block Completed  (Read 106971 times)

0 Members and 2 Guests are viewing this topic.

Offline nob4uask

  • Semi Newbie
  • *
  • Posts: 35
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Creating a Panels Tab in a Custom PHP Block Completed
« on: July 02, 2011, 04:19:50 AM »
Even All,

I have completed creating a panels tab in a custom php block if anyone would like to use it.  It really does clean up the site and allow information to be more organized.  I am currently using it for rss feeds but plan on expanding it for other purposes on my site.

Please keep in mind that I don’t know php so I had to do this in html then use an online converter to convert it to php.  I have cleaned it up some, but think that it can probably be written better.  If anyone has any pointers  I’m all ears.

Here are the instructions for creating a custom php panel tab block.

1st - Create a folder called SpryAssets then download the attached js & css files into the folder.  This folder will need to be upload to your root directory.  You can put the folder anywhere you would like but make sure you change the src & href in the below code.


2nd - Create a custom php block and paste the following code into it.

echo "
    <script src='SpryAssets/SpryTabbedPanels.js' type='text/javascript'></script>\n
    <link href='SpryAssets/SpryTabbedPanels.css' rel='stylesheet' type='text/css' />\n";
 
echo "<div id='TabbedPanels1' class='TabbedPanels'>\n";
echo "  <ul class='TabbedPanelsTabGroup'>\n";
echo "    <li class='TabbedPanelsTab' tabindex='0'>Tab 1</li>\n";
echo "    <li class='TabbedPanelsTab' tabindex='0'>Tab 2</li>\n";

echo "  </ul>\n";
echo "  <div class='TabbedPanelsContentGroup'>\n";
echo "    <div class='TabbedPanelsContent'>Content 1</div>\n";
echo "    <div class='TabbedPanelsContent'>Content 2</div>\n";

echo "  </div>\n";
echo "</div>\n";
 
echo "<script type='text/javascript'>\n";
echo "<!--\n";
echo "var TabbedPanels1 = new Spry.Widget.TabbedPanels('TabbedPanels1');\n";
echo "//-->\n";
echo "</script>\n";


3rd – Replace the Tab 1, Tab 2 in the 1st bolded code above with whatever description you want to show on the tab.  If you would like more tabs then copy & paste the entire line.  Remember that if you create more tabs, you must create more Content Lines (2nd Bolded Area).

4th – Replace the Content 1, Content 2, etc. in the second bolded area with whatever text you would like.

Preview the panel and confirm that it is working, simple as that.

If you would like to change the font and colors, it can be accomplished through the style.css located in the SpryAssets folder you uploaded.

If you would like to add RSS feeds then you will need to do the following.  At this time I would like to thank SiNaN for letting me bag his code from the block n block thread ( http://simpleportal.net/index.php?topic=5332.0 ).

1st - Create an RSS Feed block with the feed you want displayed and un-mark the “Active” box.  Since you already have the description/title of the feed in the panel tab, check the “No Title” box so that it doesn’t show up.

2nd - Find out the block_id of the block you just created by going into “Modify” of the specific bloack and looking at the link in the address bar of your browser.

3rd - Copy the following code:

$block = current(getBlockInfo(false, 23, false, false));
$block['style'] = sportal_parse_style('explode', $block['style'], true); 
template_block($block);

4th - Paste the above code in between the content panel <div> </div> of the tab for which it belongs (ie. If you have 3 tabs, you will have 3 Content Panels). It should look like this:

echo "     <div class='TabbedPanelsContent'>\n";

              $block = current(getBlockInfo(false, 23, false, false));
              $block['style'] = sportal_parse_style('explode', $block['style'], true); 
              template_block($block);

echo "      </div>\n";

5th – In the bolded line of the above code, change the “23” to the number of the block_id that you retrieved earlier.  Continue to do this for each of the tabs that you have created.

Hit the “preview” to make sure that all is ok, that simple.

If you would like to populate the tabs with recent topics & posts from different boards you can view the code that SiNaN wrote, in the above link, and work it into the appropriate areas.  If you would like to display top posters with their latest posts you could create an array then assign the Tab Name to the posters and insert their posts into the Content area. 

IMHO there are a lot of uses for this and I hope that it helps someone out.


One more thing, I am still having a problem with the following feed if anyone can help me.  I have checked on the error and understand that the RSS feed block is kind of flakey at times.

XML error: Invalid character at line 8
The RSS Feed link used was http://www.nfl.com/rss/rsslanding?searchString=home

Be Safe All.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #1 on: July 03, 2011, 10:18:53 AM »
Hey nice of you to share that with the rest of the class. One thing I would recommend for you is to edit the above post and add all lines of code in between code tags to make it easier for members here.
Seriously though, thanks for sharing this. It's definitely gonna come in handy on my site. :)

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #2 on: July 04, 2011, 07:39:38 AM »
Would someone please be kind enough to tell me how I can have display recent topics in the style of the screenshot shown below with the use of SpryAssets tabs:



I would be really grateful to whoever is able to help me out. It would mean a lot to me so please be generous to help me out.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #3 on: July 04, 2011, 08:17:06 AM »
Hi agente47,

For that you will need various blocks. One for all topics. And the others WHERE board = ID. I can do that for you but you have to tell me the ID of the Boards and the title that you want to put on the tabs.

Is that the layout that you want? TOPIC ------ POSTER ----- TIME?
« Last Edit: July 04, 2011, 08:21:56 AM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #4 on: July 04, 2011, 11:27:43 AM »
Actually bro, I have a working layout of how I want to display these recent topics. Below is the code, I just don't know how to implement them within the tabs

Code: [Select]
global $scripturl, $settings, $context, $txt;
   
$what = ssi_recentTopics('25',NULL,'array');

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';

foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];

// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';

echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';

if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}

echo '
</td>
</tr>
</table>
</div>';

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #5 on: July 04, 2011, 11:45:32 AM »
Something like this?
Code: [Select]
<?php 
global $txt;

$txt['all_boards'] = 'All Boards';
$txt['board_1'] = 'Board 1';

$buttons = array(
   
'all_boards' => array(
      
'text' => 'all_boards',
      
'image' => '',
      
'lang' => true,
      
'url' => '#all_boards" id="b_ab" onclick="change_display(\'b1\'); return false;',
      
'active' => true,
   ),
   
'board_1' => array(
      
'text' => 'board_1',
      
'image' => '',
      
'lang' => true,
      
'url' => '#board_1" id="b_b1" onclick="change_display(\'ab\'); return false;',
   ),
);

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

global 
$scripturl$settings$context$txt;
   
$what ssi_recentTopics('25',NULL,'array');

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>'
;

foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">'
$topic['link'];

// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="'
$scripturl'?topic='$topic['topic'], '.from'$topic['time'], '#new"><img src="'$settings['images_url'], '/'$context['user']['language'], '/new.gif" alt="new" border="0" /></a>';

echo '
</td>
<td class="windowbg2" valign="middle">'
$topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</td>
<td class="windowbg2" valign="middle">'
;

if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="'
$topic['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}

echo 
'
</td>
</tr>
</table>'
;

echo 
'</div>

<div id="board_1" style="display: none;">


Second Code in Here


</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'ab\' ? 1 : 0;

      document.getElementById(\'all_boards\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'board_1\').style.display = current ? \'\' : \'none\';
      document.getElementById(\'b_ab\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
      document.getElementById(\'b_b1\').className = current ? \'button_strip_recent_posts active\' : \'button_strip_recent_posts\';
   }
// ]]></script>'
;

I used [SiNaN]'s code so credits to him:
http://simpleportal.net/index.php?topic=5332.0
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #6 on: July 04, 2011, 11:53:29 AM »
Give me a moment bro as my site crashed a while ago.... So does the above code append them inside of tabs because I see nothing regarding TabsPanelsContent in there? :/
« Last Edit: July 04, 2011, 11:56:30 AM by agent47 »

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #7 on: July 04, 2011, 12:12:38 PM »
Yes, it does.

With the code I gave you you should see like the image attached.
« Last Edit: July 04, 2011, 01:00:40 PM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #8 on: July 04, 2011, 03:05:13 PM »
Hey bud as awesome as that looks the reason I wanted to use the tabbed panels was because it had an external CSS file which would allow me to fully customize it... I'm taking my site really seriously and I'm making it as professional could be so I guess you understand why an external CSS is important in order to make the homepage sleek & professional.... Isn't it possible to use my code recent topics code with nob4uask's tabbed panels, mate?

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #9 on: July 04, 2011, 04:27:59 PM »
BTW a good pal of mine cleaned up nob4uask's code on the first post... I suppose this will make things easier.....

Code: [Select]
<?php

echo '
<script src="http://www.superheroalliance.net/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> 
<link href="http://www.superheroalliance.net/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
 
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup"> 
<li class="TabbedPanelsTab" tabindex="0">Tab 1</li> 
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">Content 1</div> 
<div class="TabbedPanelsContent">Content 2</div> 
</div> 
</div>
 
<script type="text/javascript"> 
<!-- 
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); 
//--> 
</script>
'
;


?>
« Last Edit: July 04, 2011, 04:35:39 PM by agent47 »

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #10 on: July 04, 2011, 05:12:00 PM »
nice block :)
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline nob4uask

  • Semi Newbie
  • *
  • Posts: 35
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #11 on: July 04, 2011, 06:12:02 PM »
BTW a good pal of mine cleaned up nob4uask's code on the first post... I suppose this will make things easier.....

Code: [Select]
<?php

echo '
<script src="http://www.superheroalliance.net/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> 
<link href="http://www.superheroalliance.net/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
 
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup"> 
<li class="TabbedPanelsTab" tabindex="0">Tab 1</li> 
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">Content 1</div> 
<div class="TabbedPanelsContent">Content 2</div> 
</div> 
</div>
 
<script type="text/javascript"> 
<!-- 
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); 
//--> 
</script>
'
;


?>

Morn Agent,

Thanx for the cleanup, it has been kind of hectic around here lately.  How do you put the code in frame like you did ? 

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #12 on: July 04, 2011, 06:15:42 PM »
I haven't bud. That's what I need help with.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #13 on: July 04, 2011, 07:27:10 PM »
Nevermind I worked out something better... I'll share it with you guys once I'm completely done ;)

Offline nob4uask

  • Semi Newbie
  • *
  • Posts: 35
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #14 on: July 04, 2011, 07:53:37 PM »
I haven't bud. That's what I need help with.

Morn Agent,

I meant when you posted the cleaned up code it was in a frame or something in the post.  I haven't figured out how to do that even though it is probably pretty simple.

In regards to your issue with adding the boards to the panel.  It is day over here and I will play with it for awhile a little later on.
« Last Edit: July 04, 2011, 08:06:55 PM by nob4uask »

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #15 on: July 04, 2011, 08:13:17 PM »
Isn't it possible to use my code recent topics code with nob4uask's tabbed panels, mate?

Yes it is possible :) Screenshot attached ;) Here is the code:

Code: [Select]
<?php

/* [SETUP OF THE EXCLUDE BOARDS] */
$excluded_boards = array(1);         // For the second tab -> If you want to hide some boards just add the IDs like $excluded_boards = array(1,2,3); 

// CODE FROM NOW ON
echo '
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> 
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
 
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup"> 
<li class="TabbedPanelsTab">ALL BOARDS</li> 
<li class="TabbedPanelsTab">BOARD NAME</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

// START OF FIRST TAB
global $scripturl$settings$context$txt;
   
$what ssi_recentTopics('25',NULL,'array');

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>'
;

foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">'
$topic['link'];

// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="'
$scripturl'?topic='$topic['topic'], '.from'$topic['time'], '#new"><img src="'$settings['images_url'], '/'$context['user']['language'], '/new.gif" alt="new" border="0" /></a>';

echo '
</td>
<td class="windowbg2" valign="middle">'
$topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</td>
<td class="windowbg2" valign="middle">'
;

if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="'
$topic['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
echo '</td></tr>';
}

echo 
'
</table>
</div>'
;
// END OF FIRST TAB

echo'</div> 
<div class="TabbedPanelsContent">'
;

// START OF SECOND TAB
global $scripturl$settings$context$txt;
   
$what ssi_recentTopics('25',$excluded_boards,'array');

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>'
;

foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">'
$topic['link'];

// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="'
$scripturl'?topic='$topic['topic'], '.from'$topic['time'], '#new"><img src="'$settings['images_url'], '/'$context['user']['language'], '/new.gif" alt="new" border="0" /></a>';

echo '
</td>
<td class="windowbg2" valign="middle">'
$topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</td>
<td class="windowbg2" valign="middle">'
;

if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="'
$topic['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';

echo '</td></tr>';
}

echo 
'
</table>
</div>'
;
// END OF SECOND TAB

echo'</div> 
</div> 
</div>
 
<script type="text/javascript"> 
<!-- 
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); 
//--> 
</script>
'
;


?>
« Last Edit: July 05, 2011, 04:03:15 PM by Blue »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline nob4uask

  • Semi Newbie
  • *
  • Posts: 35
  • SMF Version: 1.1.13
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #16 on: July 04, 2011, 09:56:47 PM »
Morn All,

Just a little update. 

I was adding another Panels Tab Custom PHP block to my front page and things went a little flacky.  After doing some testing I figured out what was wrong.  If you are going to have more than one block  you need to make sure you make changes to the following lines of code.

<div id='TabbedPanels1' class='TabbedPanels'>

var TabbedPanels1 = new Spry.Widget.TabbedPanels('TabbedPanels1')

You can see that the id of the first panel is 'TabbedPanels1".  You will need to change the "1" to a "2", "3" or how many ever blocks you have.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #17 on: July 05, 2011, 03:45:25 PM »
Awesome Blue you are.. Just one prob though, I can't seem to exclude boards. I tried $exclude_boards but that doesn't do the trick.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #18 on: July 05, 2011, 03:55:35 PM »
Sorry, I explained wrong.

Imagine that you want to exclude board ID = 1 and board ID = 2. Thus, the IDs should appear in an array(). Example of the above:
Code: [Select]
/* [SETUP OF THE EXCLUDE BOARDS] */
$excluded_boards = array(1,2);         // For the second tab -> If you want to hide some boards just add the IDs like $excluded_boards = array(1,2,3);
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Creating a Panels Tab in a Custom PHP Block Completed
« Reply #19 on: July 05, 2011, 04:04:58 PM »
Here's how I did it, still doesn't work though :(

Code: [Select]
$what = ssi_recentTopics('25',NULL,'array');
        $excluded_boards = array(8,37);