SimplePortal

Customization => Custom Coding => Topic started by: nob4uask on July 02, 2011, 04:19:50 AM

Title: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask 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.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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. :)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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:

(http://dl.dropbox.com/u/915297/glk_recentposts_style.jpg)

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.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue 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?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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>';
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue 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 (http://simpleportal.net/index.php?topic=5332.0)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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? :/
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 04, 2011, 12:12:38 PM
Yes, it does.

With the code I gave you you should see like the image attached.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 04, 2011, 04:27:59 PM
BTW a good pal (http://www.visualpulse.net) 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>
'
;


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: rocknroller on July 04, 2011, 05:12:00 PM
nice block :)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask on July 04, 2011, 06:12:02 PM
BTW a good pal (http://www.visualpulse.net) 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 ? 
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 04, 2011, 06:15:42 PM
I haven't bud. That's what I need help with.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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 ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask 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.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue 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>
'
;


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask 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.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue 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);
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 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);
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 04:16:05 PM
Ok.. when I made the block I thought that this first tab would show all posts and the second tab would show only some boards so $excluded_boards only works in the second tab.

If you want to exclude boards from the first tab you have too find:
Code: [Select]
$what = ssi_recentTopics('25',NULL,'array');
And replace to:
Code: [Select]
$what = ssi_recentTopics('25',array(ID1,ID2),'array');
Where ID1 and ID2 are the IDs of the boards you want to exclude. Using that could it should be:
Code: [Select]
$what = ssi_recentTopics('25',array(8,37),'array');
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 05, 2011, 04:19:48 PM
This is gonna sound gay but I have to say it -- I love you man! It works like a charm... I honestly don't know how I'm ever gonna repay you bud.... You just are filled with awesome-ness  :thumbsup:
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 04:25:11 PM
I'm glad I helped ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 05, 2011, 04:37:44 PM
Minor glitch again bro.
You're right first tab is gonna display topics from all boards and second, third, fourth and so on........... are supposed to display topics from a particular board.... So here's what I did:

First tab is this line:
Code: [Select]
$what = ssi_recentTopics('25',NULL,'array');
And second tab is this line:
Code: [Select]
$what = ssi_recentTopics('25',array(2,30,4,3,5,24,39,40,42,43,45,41,6,46,47,48,49,34,50,51,33,35,52,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27),'array');
First tab displays all topics like it's supposed to but second tab displays only 2 topics from the particular board (which has it's ID excluded from the above line of code but it only displays 2 topics from that board whereas it's supposed to display 25 topics) ?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 05:14:56 PM
Hum.. In my test server works great. Are your posts approved in the board that you want to include? This is a stupid question but are there more than 2 posts in that board? :angel:
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 05, 2011, 05:17:12 PM
Yes and Yes.... Let me post my entire code how it looks in the block

Code: [Select]
<?php

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



// CODE FROM NOW ON
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">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Comics Discussion</li>
                <li class="TabbedPanelsTab" tabindex="0">TV, Movies & Music</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: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<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>'
;
// END OF FIRST TAB

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

// START OF SECOND TAB
global $scripturl$settings$context$txt;
   
 $what ssi_recentTopics('25',array(2,30,4,3,5,24,39,40,42,43,45,41,6,46,47,48,49,34,50,51,33,35,52,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27),'array');

echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<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>'
;
// END OF SECOND TAB

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 05:45:46 PM
Everything seems fine.

Try with a different board to see if it happens the same
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 05, 2011, 06:00:00 PM
Same issue :'(
Tried a different board and it's displaying only 4 topics from that board. Wonder what's causing this.....
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 06:09:22 PM
There seems to be a problem with ssi_recentTopics() hum.... try this:

Code: [Select]
<?php
// CODE FROM NOW ON
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">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Comics Discussion</li>
                <li class="TabbedPanelsTab" tabindex="0">TV, Movies & Music</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: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<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>'
;
// END OF FIRST TAB

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

// START OF SECOND TAB
global $scripturl$settings$context$txt;
   
 $what2 ssi_recentTopics('25',NULL,array(28),'array');

echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

foreach ($what2 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>'
;
// END OF SECOND TAB

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 05, 2011, 06:13:52 PM
Same issue...... :(
You're right though, there seems to be some issue with the code because I applied this with my other java tab and the result is the same as we are facing with this.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 05, 2011, 08:58:57 PM
Ok, I've tried to simulate this problem in my test server but everything is working fine.

Let's try something different. The RecentTopics block that comes in Simple Portal works the same way that this block. So, try to put only the ID of the board that you want to show and limit it to 25 just like in this block. If even then the issue persists in the built-in Simple Portal block then I will have to make the query myself since something is going on with your ssi file.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 06, 2011, 12:43:12 AM
Could you be a lil more specific about what you want me to do bud?
I checked my error log and here's what it says under critical errors:
Quote
http://www.superheroalliance.net/index.php?action=admin;area=portalblocks;sa=edit
Wrong value type sent to the database. Array of integers expected. (exclude_boards)
Function: ssi_recentTopicsFile: /home/superher/public_html/SSI.php
Line: 469

I even tried using exclude_boards instead of excluded_boards, doesn't seem to work either.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 09:41:04 AM
Now I corrected the critical erros (maybe that's the solution):

Let's see. If not I will have to do the query myself or beg for help to SP team :P

Code: [Select]
<?php
// CODE FROM NOW ON
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">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Comics Discussion</li>
                <li class="TabbedPanelsTab" tabindex="0">TV, Movies & Music</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

// START OF FIRST TAB
global $scripturl$settings$context$txt;

        
$what ssi_recentTopics(25nullnull'array');

echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<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>'
;
// END OF FIRST TAB

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

// START OF SECOND TAB
global $scripturl$settings$context$txt;
   
 $what2 ssi_recentTopics(25null, array(28), 'array');

echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

foreach ($what2 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>'
;
// END OF SECOND TAB

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 06, 2011, 10:42:12 AM
Same issue, sir :'(
How come there doesn't seem to be any errors while running this script on my test forum ? :/
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 11:02:37 AM
In your official forum the block does not work right but in your test forum it does?

If that's the case then your ssi file has some problem and in order to work I'll have to do the query myself.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 06, 2011, 11:59:29 AM
Actually, yes. It seems to be working perfectly fine on my test forum (http://test.superheroalliance.net/smf/index.php)
How would my SSI.php file have got messed in the first place?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 12:54:41 PM
Maybe some modification changed it. Can you show me the funtion ssi_recentTopics from the SSI.php file to see if something is different?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 06, 2011, 02:00:02 PM
Here you go bud:

Code: [Select]
// Recent topic list:   [board] Subject by Poster Date
function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));

// Only some boards?.
if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method = $include_boards;
$include_boards = array();
}

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
WHERE t.id_last_msg >= {int:min_message_id}
' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
' . (empty($include_boards) ? '' : '
AND b.id_board IN ({array_int:include_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND m.approved = {int:is_approved}' : '') . '
ORDER BY t.id_last_msg DESC
LIMIT ' . $num_recent,
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' : $include_boards,
'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards,
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'is_approved' => 1,
)
);
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
censorText($row['subject']);
censorText($row['body']);

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['board_name'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'replies' => $row['num_replies'],
'views' => $row['num_views'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" />',
);
}
$smcFunc['db_free_result']($request);

// Just return it.
if ($output_method != 'echo' || empty($posts))
return $posts;

echo '
<table border="0" class="ssi_table">';
foreach ($posts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
[', $post['board']['link'], ']
</td>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $txt['by'], ' ', $post['poster']['link'], '
', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" /></a>', '
</td>
<td align="right" nowrap="nowrap">
', $post['time'], '
</td>
</tr>';
echo '
</table>';
}
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 05:22:13 PM
Your file seems fine except for one line but I bet that's not the problem so I did the query for the second tab. It's not the final block, it's just a sketch to see if it works. If it does work then I make it output like you want ;)

Here is the code:
Code: [Select]
<?php
// CODE FROM NOW ON
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">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Comics Discussion</li>
                <li class="TabbedPanelsTab" tabindex="0">TV, Movies & Music</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

// START OF FIRST TAB
global $scripturl$settings$context$txt;

        
$what ssi_recentTopics(25nullnull'array');

echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<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>'
;
// END OF FIRST TAB

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

// START OF SECOND TAB
global $smcFunc$scripturl;
   
$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, t.id_last_msg, u.avatar, g.online_color
   FROM {db_prefix}topics AS t
   LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)
   WHERE m.approved=1 AND t.id_board=28
   ORDER BY t.id_last_msg DESC
   LIMIT 25'
);
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="' $text['board'] . '&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time'])
   );
}
$smcFunc['db_free_result']($posts_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

foreach ($topics as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">'
$topic['link'] ,'
</td>
<td class="windowbg2" valign="middle">'
$topic['poster'], '</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>'
;
// END OF SECOND TAB

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 06, 2011, 06:16:00 PM
Dude, are you like some PHP guru or something? Amazing dude.... Amazing!

Works perfectly but I just one thing, since your new code displays in a different style like usernames with colors I can't use the function ssi_recentTopics for the first tab to display topics from all boards as ssi_recentTopics function doesn't color usernames so I was wondering with your new code, how do I add multiple boards so that for the first tab I can add all boards IDs and then from second, third, fourth tab onwards I could use individual board IDs. I tried separating IDs like 2,6,43.......... but that didn't seem to work. Is there a way? if there isn't it's fine. This is so awesome.... I owe you BIG time buddy..... BIG-effing-TIME!
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 09:54:03 PM
Finally!

Here, I think the block is done ;) The Setup (number of topics and included boards) is inside each tab.

Code: [Select]
<?php
/*
The Setup is inside the tab!
Have Fun,
Blue @ Simple Portal.net

Credits to nob4uask for the Tabs tutorial: Thank You!
*/


// Basic Coding before TABS
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" tabindex="0">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Board IDs 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Board IDs 2</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards null; // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(1); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/


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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(2); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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


?>

Dude, are you like some PHP guru or something? Amazing dude.... Amazing!

I'm not a PHP guru. I'm just learning. I knew that it would work with a query but I wanted to try with recentTopics SMF function. Don't know why it did not work in your website although it worked in my and yours test forum. Oh well...

SiNaN is the PHP guru :applause:

I'm just learning ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 09:59:09 PM
This looks really handy you guyz are awsome, working out all this code
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:00:57 PM
blue you have been a great help to many  user on here, all you guys have so keep up the good work

 ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 10:09:01 PM
This looks really handy you guyz are awsome, working out all this code

Some of the code is from nob4uask, some is from agent47, some is from me and the other some belongs to ssi_recentTopics aka possibly SiNaN.

What a great community don't you think? ;)

blue you have been a great help to many  user on here, all you guys have so keep up the good work

I'm just glad that you guys appreciate my help :)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:11:18 PM
This looks really handy you guyz are awsome, working out all this code

Some of the code is from nob4uask, some is from agent47, some is from me and the other some belongs to ssi_recentTopics aka possibly SiNaN.

What a great community don't you think? ;)

blue you have been a great help to many  user on here, all you guys have so keep up the good work

I'm just glad that you guys appreciate my help :)

I agree this is a great community
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:13:41 PM
I don't get the tabs on ur last code Blue     :(
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:14:59 PM
the code you submitted before that one i get the tabs weird
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 10:17:25 PM
You have to upload the files attached to your main SMF folder in order to work with Tab effect ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:19:42 PM
My bad I didn't read back you already posted them soz Blue
thanks will do that right now  :D

ok i got it
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 10:35:33 PM
strange still no tabs image same as before
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 06, 2011, 10:40:10 PM
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.

After that, it will work :)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 11:00:04 PM
like this?
Code: [Select]
<script src="http://websitehere.com/test_forum/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="http://websitehere.com/test_forum/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 11:01:01 PM
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.

After that, it will work :)

have done the folder is on the server
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: S@ffz on July 06, 2011, 11:05:42 PM
its ok i found my mistake i spelt folder wrong :-[
It Worked
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 07, 2011, 06:05:17 AM
You my friend are a true genius.... We owe quite alot to you Blue. You're amazing!
Look how spectacular your made has my site look > http://www.superheroalliance.net
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask on July 07, 2011, 06:29:27 AM
You my friend are a true genius.... We owe quite alot to you Blue. You're amazing!
Look how spectacular your made has my site look > http://www.superheroalliance.net

Even Agent,

Looks good.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 07, 2011, 08:53:29 AM
Look how spectacular your made has my site look > http://www.superheroalliance.net

I've notice that you use Display name (Hitman) instead of username (admin). Here is the block showing display name:

Code: [Select]
<?php
/*
The Setup is inside the tab!
Have Fun,
Blue @ Simple Portal.net

Credits to nob4uask for the Tabs tutorial: Thank You!
*/


// Basic Coding before TABS
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" tabindex="0">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Board IDs 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Board IDs 2</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards null; // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.real_name, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['real_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(1); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.real_name, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['real_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/


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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(2); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.real_name, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['real_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 09:16:15 AM
I would like to make seven tabs.SpryAssets1, / SpryAssets2, / SpryAssets3 ... I saved the files in the format of the root. However, SpryTabbedPanels.js files affect eachother.What should I do? Thanks.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask on July 07, 2011, 10:10:20 AM
I would like to make seven tabs.SpryAssets1, / SpryAssets2, / SpryAssets3 ... I saved the files in the format of the root. However, SpryTabbedPanels.js files affect eachother.What should I do? Thanks.

Morn kim,

If I understand you correctly you want seven different panels tab blocks not just seven different tabs on one block.  If you are looking at making seven different panels tab blocks I addressed this earlier.


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.




I think that should take care of it, unless I mis-understood you.  If you take a look at the site in my sig you will see 2 different custom php blocks with a panels tab in each one.


Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 11:00:23 AM
If you look at my site.I also have 7 different tabs.But I would like to change the tabs.Because a little problematic.Exactly how did you two Tabs? Thanks for your information.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 11:10:16 AM
OK. Thank you. I got it.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: agent47 on July 07, 2011, 01:02:37 PM
Look how spectacular your made has my site look > http://www.superheroalliance.net

I've notice that you use Display name (Hitman) instead of username (admin). Here is the block showing display name:
Smart man! Thanks bud... Just one more question:
Is it possible to have it display the first subject title of a topic like Creating a Panels Tab in a Custom PHP Block Completed instead like this: Re: Creating a Panels Tab in a Custom PHP Block Completed
If possible please tell me what line needs to be altered/appended instead of posting the entire code.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 07, 2011, 01:22:05 PM
Yes, it's possible.

In each tab find:
Code: [Select]
<td class="windowbg" valign="middle">', $topic['link'];
Replace with:
Code: [Select]
<td class="windowbg" valign="middle">', str_replace('Re: ' , '' , $topic['link']);
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 03:01:39 PM
These tabs working right and bottom blocks but  not  working on the top block.The reason? Thanks.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 07, 2011, 04:34:05 PM
It should work the same way in right, left, bottom or top blocks :0
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 04:52:40 PM
the buttons on the top  block are lost.Why, do not understand
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on July 07, 2011, 05:02:49 PM
I was using below code.This was doing the code.not a problem now..Thanks.

Code: [Select]
<center><marquee onmouseover="this.scrollAmount=0" style="BORDER: #9e9e9e 1px solid; PADDING: 10px; FONT-SIZE: 10pt; FONT-FAMILY: Arial" onmouseout="this.scrollAmount=1" scrollamount="1" scrolldelay="40" direction="left" width="560" height="38" align="justify">
<font color=><br>
<strong><font color=Red>


</strong> <br>
<br></font>
</marquee></center>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: nob4uask on July 07, 2011, 08:58:29 PM
Morn All,

If you would like to identify which tab currently has focus a little better you can make the following modifications.

In the css file find the following line (should be around line 73)

font: bold 0.7em sans-serif;

Make a copy of this line then remove the "bold" part of it.

Next, go down to the following code. (about line 105)

.TabbedPanelsTabSelected {

   background-color: #EEE;
   border-bottom: 1px solid #EEE;
}

Insert the copied line just above the background-color line.

Now when the tab doesn't have focus it is just standard writing but when it does have focus it will be bold.

Hope this helps anyone who wants to do it.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Divecall on July 13, 2011, 12:59:28 PM
Really amazing Work !!!

One question, please:
I have SMF 2 RC5 with SP 2.3.3 (and some Mods installed).
One ot this mods is the "Ajax Recent Topics"-mod, what you can found here:
http://custom.simplemachines.org/mods/index.php?mod=1284

It is possible to add this auto-refresh-ajax-feature to this nice block?

Thank you in advance
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on July 13, 2011, 02:29:14 PM
Let me see I can add that feature ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Divecall on July 19, 2011, 06:54:31 PM
It is possible to use rotating tabs with jquery?

I found this interesting page:
http://urbanoalvarez.es/blog/2009/10/20/perfect-jquery-ui-rotating-tabs/

I follow the steps, but i stick in the code.
I create a custom theme (jquery UI) what looks like -almost- SMF default theme.

When i put the code in a HTML-Block all is working fine. But not in PHP.

I was changing the code to made it function in PHP, but i have a parse error:
Code: [Select]
echo "
<script src='test/jquery-1.5.1.min.js' type='text/javascript'></script>\n
<script src='test/jquery-ui-1.8.14.custom.min.js' type='text/javascript'></script>\n
    <link href='test/css/custom-theme/jquery-ui-1.8.14.custom.css' rel='stylesheet' type='text/css' />\n";
   
echo "<div id='tabs-rotate' class='RotatedTabs'>\n";
echo "  <ul class='RotatedTabsPanelsTabGroup'>\n";
echo "    <li class='RotatedTabsPanelsTab' tabindex='0'>Tab 1</li>\n";
echo "    <li class='RotatedTabsPanelsTab' tabindex='0'>Tab 2</li>\n";
echo "  </ul>\n";
echo "  <div class='RotatedTabsPanelsContentGroup'>\n";
echo "    <div class='RotatedTabsPanelsContent'>Content 1</div>\n";
echo "    <div class='RotatedTabsPanelsContent'>Content 2</div>\n";
echo "  </div>\n";
echo "</div>\n";

echo "<script type='text/javascript'>\n";
echo "<!--\n";
$(document).ready(function(){
$("#tabs-rotate").tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 3000);
$('#tabs-rotate').hover(function(){
$(this).tabs('rotate', 0, false);
},function(){
$(this).tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 3000);
}
);
});

$('#tabs').click(function(){
$(this).tabs('rotate', 0, false);
$(this).unbind('hover');
});
echo "//-->\n";
echo "</script>\n";

Put the attached files (decompressed) in a directory called "test" in your forum root.

Can somebody help ( :-[ Blue?  :angel:)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Divecall on July 30, 2011, 06:20:47 PM
How to add custom-html-code in this "block-code"?

http://simpleportal.net/index.php?topic=9143.msg48376#msg48376

Thank you in advance
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kimyaci on August 08, 2011, 12:05:31 PM
ie error message.How do I fix this.Thanks.


ie error message

Web sayfası hata ayrıntıları

Kullanıcı Aracısı: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.1; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Tarih damgası: Mon, 8 Aug 2011 15:50:59 UTC

Error: Object doesn't support this property or method
Line: 36
Char: 2
Code: 0
URI: http://www.igo8navigation.com/SpryAssets/SpryTabbedPanels.js
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Divecall on August 13, 2011, 05:31:21 PM
Please, what is the code for "recent Images"-block inside a tabbed content?

(Block 80)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: EvilGeneral on August 19, 2011, 12:52:08 PM

I've notice that you use Display name (Hitman) instead of username (admin). Here is the block showing display name:
[...]

This code ignores user permissions to see or not see a specific board. Right?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Inti31 on August 22, 2011, 02:07:08 AM
thank your for that - it works fine - just one thing

I tested w3c XHTML 1.0 Transitional structure and the result:
177 Errors found while checking this document as XHTML 1.0 Transitional!

check (http://validator.w3.org/check?uri=http%3A%2F%2Faida32-inventory.netboom.de%2Fsmf%2Findex.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.2)

any idea how to fix that?

thank you, Inti31
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on August 22, 2011, 04:40:47 AM
This looks really handy you guyz are awsome, working out all this code


Hi i am only new to this kind of thing can one of you help me out i have it working but don't know what code to change to match up with tabs

see screen shot e.g  with breaming reports tab is board 13 how do i change that show topics once clicked on.

sorry for the nobish  on this stuff.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on August 22, 2011, 03:50:19 PM
This code ignores user permissions to see or not see a specific board. Right?

I don't think so. Have you tried to see if it does?

177 Errors found while checking this document as XHTML 1.0 Transitional!
any idea how to fix that?

Most of the errors are related to the CSS file because It should be place before a <body> tag in HTML. Since that's a block the CSS in included inside the <body>. The best way is to style each tag instead of using a CSS file.

Hi i am only new to this kind of thing can one of you help me out i have it working but don't know what code to change to match up with tabs

see screen shot e.g  with breaming reports tab is board 13 how do i change that show topics once clicked on

I'm not following you. Do you want to know how to change the IDs of the forum or the titles?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on August 22, 2011, 05:09:26 PM
ID's Blue, also how can i make the tabs have colour in them please
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: EvilGeneral on August 24, 2011, 02:57:47 PM
Guys,

Think i found a error when testing the code.
Take a look at my site: http://mmo.brasucas.net/forum/index.php?page=bemvindo

1st tab ("Topicos Recentes")
As guest, you didn't have permission to see topics from board Comando, like "Guild Naming...". So i think something went wrong with permissions when you've had ported from SSI to new SELECT code.

Any ideas?

Sorry about my bad english. Im not very good when writing. =)

Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Blue on August 24, 2011, 04:35:40 PM
ID's Blue, also how can i make the tabs have colour in them please

Find this line in each tab and follow the instructions:
Code: [Select]
$include_boards = null; // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)
To make the tabs have colour you need to change the css file ;)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on August 24, 2011, 11:37:44 PM
thanks blue all good now  :thumbsup:
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on October 24, 2011, 11:11:24 PM
Hi all not sure if it's a error with my host but i went to edit the names of the tabs & i get Forbidden
 You don't have permission to access /index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


my host said they have disabled mod security

smf 2.0.1 Sp 2.3.3

any one else getting that error or know of another reason?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: AngelinaBelle on October 25, 2011, 12:43:12 AM
It sounds like you now have a permission problem.
Please check the permission on your files, such as index.php.

You may want to try
755 for directories
655 or even 645 for files.

See if that works better.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on October 25, 2011, 02:48:47 AM
what files & directories
?

Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: AngelinaBelle on October 25, 2011, 02:51:52 AM
All files and directories in your SMF forum.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on October 25, 2011, 04:14:12 AM
just a up date i checked all files folders they were all correct, i re hit up my host it was there error all resolved, waiting to see what they did to fix it
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: AngelinaBelle on October 25, 2011, 12:59:39 PM
I'm glad your host was able to find the error.  Sometimes it takes a lot of work on your part to convince tech support that the servers have caused a problem.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: kenng on October 31, 2011, 12:02:01 PM
Hi guys, How can I make this kind of layout? many thanks!
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: ZiFFeL on December 15, 2011, 04:16:01 PM
Hi, first of all thank you very much.

I have put your block without problems, but i would like to put only the new topics, no the answers for the posts, can be possible?

Regards an thank you before hand
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on February 23, 2012, 01:22:49 AM
Hi  Is there a way i can stop the scrolling once clicked on, i have a youtube video i would like it to stop scrolling once clicked on is this possible?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: thecoo1est on March 20, 2012, 08:43:28 PM
love this block, thanks to all who helped make it possible, is there anyway to get the content to fade in when a tab is clicked?
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Dylert on November 13, 2013, 06:41:45 PM
This block is really awesome! Thanks a lot!

One question: I would like to add forum-name and topic starter to the output table. (And maybe replies/views)
How can I do that?? :)
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Dylert on November 16, 2013, 05:18:34 AM
Does anybody know how I can get the name of the boards and thread starter into this block? I mean, now it only shows topic, poster and date, and I want to add thread starter and board name to the output table. Anyone?

Code: [Select]
<?php
/*
The Setup is inside the tab!
Have Fun,
Blue @ Simple Portal.net

Credits to nob4uask for the Tabs tutorial: Thank You!
*/


// Basic Coding before TABS
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" tabindex="0">All Boards</li> 
<li class="TabbedPanelsTab" tabindex="0">Board IDs 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Board IDs 2</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">'
;

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards null; // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(1); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/


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

/***************************************************************************
*************** START THE TAB **********************************************
***************************************************************************/


// [SETUP HERE] //
$num_recent 25; // HOW MANY RECENT TOPICS TO OUTPUT?
$include_boards = array(2); // IF ALL BOARDS null | IF SOME BOARDS array( ID1, ID2, ID3)



// code, code, code and some more code bahhh!
global $smcFunc$scripturl$context$settings$db_prefix$user_info;

if (is_array($include_boards) || (int) $include_boards === $include_boards)
{
$include_boards is_array($include_boards) ? $include_boards : array($include_boards);
}
elseif ($include_boards != null)
{
$output_method $include_boards;
$include_boards = array();
}

$topics_result $smcFunc['db_query']('''
   SELECT m.poster_name, m.poster_time, m.id_msg, t.id_member_updated, m.subject, m.body, m.id_topic, b.name, b.id_board, t.id_last_msg, u.avatar, g.online_color, ' 
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
   FROM {db_prefix}topics AS t
   INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
   INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
   LEFT JOIN {db_prefix}members AS u ON (t.id_member_updated = u.id_member)
   LEFT JOIN {db_prefix}membergroups AS g ON (g.id_group = CASE WHEN u.id_group = 0 THEN u.id_post_group ELSE u.id_group END)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '  
   WHERE m.approved=1' 
. (empty($include_boards) ? '' '
AND b.id_board IN ({array_int:include_boards})'
) . '
   ORDER BY t.id_last_msg DESC
   LIMIT ' 
$num_recent
array(
'current_member' => $user_info['id'],
'include_boards' => empty($include_boards) ? '' $include_boards,
)   
   );
$topics = array();
while (
$row_topics $smcFunc['db_fetch_assoc']($topics_result))
{
   
$topics[] = array(
      
'topic' => $row_topics['id_topic'],
      
'poster' => '<a style="color: ' $row_topics['online_color'] . ';" href="' $scripturl '?action=profile;u=' $row_topics['id_member_updated'] . '">' $row_topics['poster_name'] . '</a>',
      
'link' => '<a title="In&nbsp;' $row_topics['name'] .'" href="' $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new">' $row_topics['subject'] . '</a>',
      
'href' => $scripturl '?topic=' $row_topics['id_topic'] . '.msg' $row_topics['id_last_msg'] . ';topicseen#new',
  'time' => timeformat($row_topics['poster_time']),
  'new' => !empty($row_topics['is_read'])
   );
}
$smcFunc['db_free_result']($topics_result);
echo '
<div class="tabsmenucontent" style="padding: 2px">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="bordercolor">
<tr class="titlebg">
                <td valign="middle">Topic</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
<td valign="middle"></td>
</tr>'
;

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

// new log! What a headache!
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'], '</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>'
;
/***************************************************************************
*************** END THE TAB ************************************************
***************************************************************************/

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


?>
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: josh4596 on April 09, 2015, 09:31:30 AM
Heres a small change I made to this:

Code: [Select]
<?php

global $context$settings;

echo 
'
<script src="' 
$settings['theme_url'] .  '/CustomCoding/SpryTabbedPanels.js" type="text/javascript"></script> 
<link href="' 
$settings['theme_url'] .  '/CustomCoding/RoundedTabs.css" rel="stylesheet" type="text/css" />

<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup"> 
<li class="TabbedPanelsTab" tabindex="0">Tab1</li> 
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 3</li> 
<li class="TabbedPanelsTab" tabindex="0">Tab 4</li> 
<li class="TabbedPanelsTab" tabindex="0">Tab 5</li> 
</ul> 
<div class="TabbedPanelsContentGroup"> 
<div class="TabbedPanelsContent">test</div> 
<div class="TabbedPanelsContent"></div> 
<div class="TabbedPanelsContent"></div> 
<div class="TabbedPanelsContent"></div> 
<div class="TabbedPanelsContent"></div> 
</div> 
</div>
 
<script type="text/javascript"> 
<!-- 
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); 
//--> 
</script>
'
;


?>
All this does is pull the styling from your_current_theme_folder/CustomCoding/file.css. That way you can have a different look for the tabs on every theme. So you'll have to add a CustomCoding folder to every theme directory and put both files from the OP in that directory, then make sure the links at the top of the code direct to them properly. After that you can edit the css files to your liking. I've attached 2 screenshots of 2 of my styles as an example.
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: ♦ Ninja ZX-10RR ♦ on April 09, 2015, 11:09:17 PM
Is it possible to adjust this tab in order to show forum categories?
My aim would be to get rid of all categories in the board index and show just this block, replacing the standard display :) Something like Tab1=Category 1 Tab2=Category 2 and so on...
Maybe importing the style from the normal categories display? It would be easier...
Thanks in advance!
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on June 14, 2015, 08:18:53 PM
Hi all need a bit of help i updated simple portal to 2.3.6 no errors on install & now it seems to have made the tabbed  go out of whack the menu across the top  see pic attached & code  no code was changed
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: ♦ Ninja ZX-10RR ♦ on June 17, 2015, 11:03:31 AM
Can't really help without an URL and a very detailed description of the issue as I can't figure out anything from those 2 mini-screenshots...
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: swoodie on June 19, 2015, 06:52:31 AM
Can't really help without an URL and a very detailed description of the issue as I can't figure out anything from those 2 mini-screenshots...

thank you for your reply for some strange reason  after up grading the path changed to the  java script in the block all sorted now thank you
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: ♦ Ninja ZX-10RR ♦ on June 19, 2015, 06:59:29 AM
Well, glad it did ;D It probably knew it was going to be fixed anyways :P
Title: Re: Creating a Panels Tab in a Custom PHP Block Completed
Post by: Inti31 on June 26, 2018, 01:37:58 PM
okay, quick question - this block works fine
I turned now on https and i get this message, when I press F12 (Chrome):

Code: [Select]
SpryTabbedPanels.js:36 Uncaught TypeError: this.getElement is not a function
    at Object.Spry.Widget.TabbedPanels (SpryTabbedPanels.js:36)
    at index.php:1017

any idea?

line 36:
Code: [Select]
this.element = this.getElement(element);
SimplePortal 2.3.8 © 2008-2024, SimplePortal