Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 942
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Filtering Board News?

Started by FrostyWolf, May 24, 2011, 09:14:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FrostyWolf

My website is at frostywolf.com

Currently, in my Board News block, I am tracking the news in 3 diffrent boards, Minecraft News, Off-Topic News, and Terraria news.

Is there anyway to somehow filter each one with out giving it its own block?  As in if someone wanted to see just Minecraft News, they could click 'Minecraft', or Terraria News, click 'Terraria', etc?

I don't mind how it clumps them all together, but if I have visitors that only play minecraft, I wanted a easy way for them to sort just that news.

Thanks for any help.

AngelinaBelle

One approach for that was detailed in Sinan's Blocks-in-Blocks post.http://simpleportal.net/index.php?topic=5332.0
This requires using some custom php and javascript coding, though.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

FrostyWolf

#2
After a LOT of messing around, I managed:

$blocks = array(
array(
'label' => 'All News',
'type' => 'sp_boardnews',
'parameters' => array('board' => 3, 'limit' => 200, 'length' => 5000, 'per_page' => 5),
),
array(
'label' => 'Minecraft News',
'type' => 'sp_boardnews',
'parameters' => array('board' => 3, 'limit' => 200, 'length' => 5000, 'per_page' => 5),
),
array(
'label' => 'Terraria News',
'type' => 'sp_boardnews',
'parameters' => array('board' => 8, 'limit' => 200, 'length' => 5000, 'per_page' => 5),
),
array(
'label' => 'Off-Topic News',
'type' => 'sp_boardnews',
'parameters' => array('board' => 9, 'limit' => 200, 'length' => 5000, 'per_page' => 5),
),

);

global $txt;

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

$button_list[] = array(
'text' => 'sp_bib_label_' . $id,
'image' => '',
'lang' => true,
'url' => '#sp_bib_' . $id . '" id="sp_bib_button_' . $id . '" onclick="sp_bib_change(' . $id . '); return false;',
);
}
$button_list[0]['active'] = true;
echo '
<div style="overflow: auto;">
', template_button_strip($button_list), '
</div>';
foreach ($blocks as $id => $block)
{
echo '
<div id="sp_bib_', $id, '"', $id != 0 ? ' style="display: none;"' : '', '>';
$block['type']($block['parameters'], 0);
echo '
</div>';
}
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function sp_bib_change(id)
{
for (var i = 0; i < ', count($blocks), '; i++)
{
document.getElementById(\'sp_bib_\' + i).style.display = i == id ? \'\' : \'none\';
document.getElementById(\'sp_bib_button_\' + i).className = \'button_strip_\' + i + (i == id ? \' active\' : \'\');
} }// ]]></script>';


And it seems to work ok except for two issues.

Issue one: I can not get the first block too display more then one board.  It is currently only displaying board 3:
'parameters' => array('board' => 3)

but I need it to display boars 3, 8 and 9, but I don't know what the line should look like to do that.

The correct code to do this is:
'board' => '9|3|8'

Issue two: If you go to frostywolf.com and look at the block, there appears to be no transparancy at all around the corners of the header things, making them all have ugly white corners.

If I could have help ironing out these last two things this last thing that would be great!

AngelinaBelle

When I look, as guest, I do not see this problem. Please give me a theme number I can use.
http://frostywolf.com/index.php?theme=1
for example
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

FrostyWolf

Quote from: AngelinaBelle on June 01, 2011, 07:24:28 AM
When I look, as guest, I do not see this problem. Please give me a theme number I can use.
http://frostywolf.com/index.php?theme=1
for example

Theme 1 is it, the issue is only in the news block.

Heres some arrows pointing at what I am refering to.
http://s7.photobucket.com/albums/y260/Frostywolf1/whitecorners.png

It does it in IE9 and Chrome.

slop_chute


The all the images for the default theme have the white corners for a white background. You might want to go to the block settings for the News Server block and play with some of the option to change the class (other than windowbg)  or create a custom CSS for the block.  Anything beyond white is going to clash. This would be the simpliest way..

AngelinaBelle

You are correct, slop_chute. I think the simplest thing would be to edit the block "Server News". Select "no body". You might even select "no head"
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

FrostyWolf

Quote from: AngelinaBelle on June 07, 2011, 06:23:19 AM
You are correct, slop_chute. I think the simplest thing would be to edit the block "Server News". Select "no body". You might even select "no head"

Once again, great advice!  No body/title did the trick.

Tricky

This is a fantastic code thanks ever so much