collapse

* Simple Portal Archived Forum

This is an Archive Forum.

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

Visit our thread at Simple Machines Forum for current support.

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

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 225
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

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


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


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


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


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

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

Author Topic: Vertical Fly-Out Menu in a Block  (Read 17343 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #20 on: June 02, 2010, 01:01:53 PM »
I know some block template improvements are coming in 2.4, but I haven't looked at them. That makes me a pretty lousy beta tester. You might put in a feature request to allow the admin to choose whether or not to have the "force scroll bars" CSS class applied to individual blocks.
 
I have thought of a pretty ugly hard-coded way to go about it, but it ought to work.
 
In SimplePortal 2.3.2 for SMF 2.0RC3, in Portal.template.php, you will find
Code: [Select]
$block['type'] == 'sp_menu' in two functions -- template_block_core and template_block_curve.
This is where the code decides to use a different CSS class on the block depending on the value of $block['type'].
 
$block['type'] is not going to help you in this case, of course.
 
But $block['id'] can help you.  Suppose your block id is 86. Then, for template_block_core, you could make a change like:
Code: (find) [Select]
<td class="sp_block_padding', ($block['type'] == 'sp_menu') ? '' : ' sp_block',
Code: (replace) [Select]
<td class="sp_block_padding', (  ($block['type'] == 'sp_menu' || $block['id'] == 86) ? '' : ' sp_block'  ),

For the function template_block_curve, you'd make a similar change. I haven't had a look at that yet. I may not be available to do that for a couple of days, but perhaps, if you get stuck, a dev or experienced community member may be able to give you a couple of pointers.
« Last Edit: June 08, 2010, 11:51:44 AM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #21 on: June 02, 2010, 02:15:08 PM »
Your suggestion is making sense to me and I'm trying to make the updates, but I'm not seeing the code to which you are referring.  I, too, am running SP 2.3.2 and SMF 2.0RC3. 

First, I only see the $block['type'] == 'sp_menu' once and it's in template_block_core.  Secondly, it looks a little different.  You'll see your coding suggestion in there (block.id=21), but it doesn't do anything on my site.

Code: [Select]
function template_block_core($block)
{
global $settings;
echo '
<div class="', ($block['type'] == 'sp_menu' || $block['id'] == 21) ? '' : 'sp_block', !empty($block['style']['no_body']) ? '' : ' tborder', '">
<table class="sp_block">';

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #22 on: June 02, 2010, 06:11:06 PM »
That's good -- for non-curve-type themes. For core-type-themes, you need to find the similar thing in function template_block_curve
 
Something like:
Code: (find) [Select]
<div class="', $block['type'] != 'sp_menu' ? 'sp_block' : 'sp_content_padding'
Code: (replace) [Select]
<div class="', ( ($block['type'] == 'sp_menu' || $block['id'] == 21 )? 'sp_content_padding'  : 'sp_block' )

 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #23 on: June 07, 2010, 03:07:45 PM »
I'm wondering if I'm not looking at old template or something.  I just double checked to make sure I was running the latest/greatest of everything...and I am.  Here's my entire template_block_curve section found in Portal.template.php in the Themes/default directory.  None of it looks like what you're describing above, though, the one section near the bottom starting with

Code: [Select]
<div id="sp_block_' . $block['id'] . '"', empty($block['style']['body']['class'])
...looks like a section of interest.



Code: [Select]
function template_block_curve($block)

{

global $settings;



if ($block['collapsed'] && empty($block['force_view']))

$block['style']['body']['style'] .= 'display: none;';



if (empty($block['style']['no_title']))

{

echo '

<h3 class="', $block['style']['title']['class'], '"', !empty($block['style']['title']['style']) ? ' style="' . $block['style']['title']['style'] . '"' : '', '><span class="left"></span><span class="right"></span>';



if (empty($block['force_view']))

echo '

<a class="sp_float_right" style="padding-top: 7px;" href="javascript:void(0);" onclick="sp_collapseBlock(\'', $block['id'], '\')"><img id="sp_collapse_', $block['id'], '" src="', $settings['images_url'], $block['collapsed'] ? '/expand.gif' : '/collapse.gif', '" alt="*" /></a>';



echo '

', parse_bbc($block['label']), '

</h3>';

}



echo '

<div id="sp_block_' . $block['id'] . '"', empty($block['style']['body']['class']) ? '' : ' class="' . $block['style']['body']['class'] . '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>

<span class="topslice"><span></span></span>

<div class="sp_content_padding sp_block">';



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



echo '

</div>

<span class="botslice"><span></span></span>

</div>

<br />';

}

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #24 on: June 07, 2010, 05:06:32 PM »
I forgot you are still at simpleportal 2.3.1.
Code: (find, SimplePortal 2.3.1, template_block_curve) [Select]
<div class="sp_content_padding sp_block">'
Code: (replace) [Select]
<div class="', ( ($block['type'] == 'sp_menu' || $block['id'] == 21 )? 'sp_content_padding'  : 'sp_block' ), '">'

I do recommend coming up to SimplePortal 2.3.2, if at all possible.
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #25 on: June 08, 2010, 08:42:54 AM »
Something is amiss...I am running 2.3.2, or at least that's what it says under General Information on the Configuration tab.  Before I do anything, should I fix this?


Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #26 on: June 08, 2010, 09:13:17 AM »
Your profile says you are running SimplePortal 2.3.1, and I just assumed that was true.
 
Please have a look at the file  Portal.template.php and see what it says about version.
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #27 on: June 08, 2010, 09:40:52 AM »
Thanks for the reminder...I updated my Profile.  I  took a look at Portal.template.php and here's what it says at the top:

Code: [Select]
<?php
// Version: 2.0 RC3; Post

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #28 on: June 08, 2010, 10:38:33 AM »
That looks like the top of Post.template.php.
That happens to me ALL THE TIME.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #29 on: June 08, 2010, 11:04:16 AM »
 :-[

How embarrassing...LOL

Code: [Select]
<?php

// Version: 2.3.1; Portal

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #30 on: June 08, 2010, 11:36:55 AM »
That happens to me all the time. You have there a file from SimplePortal 2.3.1 -- not the latest and greatest.
 
Is that the only one? Or do you have other SimplePortal 2.3.1 files in /Templates/default/ or in /Sources/?
 
You should take a quick peek and decide if you want to manually copy the files into place or uninstall SimplePortal and re-install it (after making sure you have proper permissions, of course).
 
After that, you should have an easier time finding SimplePortal 2.3.2 strings.  :)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #31 on: June 08, 2010, 11:46:20 AM »
The rest of the Portal.xx.php files all say 2.3.2.  I haven't had a chance to check the source directory yet.  I will do so when I'm back at my desk.  I looks like I'll just need to upload Portal.template.php and I should be good.  I'll let you know how it turns out (probably tomorrow).

Thank you again for all the guidance.  It's greatly appreciated.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #32 on: June 08, 2010, 11:53:35 AM »
... and then you'll be ready to apply the changes.
 
Enjoy
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #33 on: June 09, 2010, 09:30:03 AM »
Okay, looks like something didn't take with the last upgrade I performed.  the Portalxx.php files in the Sources directory all have either v2.3 or v2.3.1 in them.  Assuming they should say v2.3.2, I'm going to do an uninstall and reinstall.  I need to browse the documentation before I do to make sure I'm not going to lose my blocks and articles as they stand now.
 

Code: [Select]
<?php

/**********************************************************************************

* PortalMain.php                                                                  *

***********************************************************************************

* SimplePortal                                                                    *

* SMF Modification Project Founded by [SiNaN] (sinan@simplemachines.org)          *

* =============================================================================== *

* Software Version:           SimplePortal 2.3                                    *

* Software by:                SimplePortal Team (http://www.simpleportal.net)     *


or


Code: [Select]
<?php

/**********************************************************************************

* PortalBlocks.php                                                                *

***********************************************************************************

* SimplePortal                                                                    *

* SMF Modification Project Founded by [SiNaN] (sinan@simplemachines.org)          *

* =============================================================================== *

* Software Version:           SimplePortal 2.3.1                                  *

* Software by:                SimplePortal Team (http://www.simpleportal.net)     *

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #34 on: June 09, 2010, 10:39:33 AM »
I'm happy to report that all of my files are now 2.3.2 AND I installed the coding changes you requested and...<drum roll>...it works in both IE and Firefox!

http://www.bowlthis.com/v2
ID: test
PW: testing


For those of you that may follow this thread, here are the changes that I finally made.  I'm using SMF 2.0 RC3 and SP 2.3.2.  In Portal.template.php in the Themes/Default directory, line 122, I changed this:

Code: [Select]
<td class="sp_block_padding', ($block['type'] == 'sp_menu') ? '' : ' sp_block', empty($block['style']['body']['class']) ? '' : ' ' . $block['style']['body']['class'], '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';
to this...

Code: [Select]
<td class="sp_block_padding', ($block['type'] == 'sp_menu' || $block['id'] == 21) ? '' : ' sp_block', empty($block['style']['body']['class']) ? '' : ' ' . $block['style']['body']['class'], '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';
Make sure to put the $block['id'] of the block you want to change (don't leave it 21).  The block ID can be obtained by going into Admin --> Simple Portal --> Blocks and editing the block in question.  The block ID will be displayed in the URL while you're in edit mode.



Next, on line 171, I changed:

Code: [Select]
<div class="', $block['type'] != 'sp_menu' ? 'sp_block' : 'sp_content_padding', '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';
to this...

Code: [Select]
<div class="', (($block['type'] == 'sp_menu' || $block['id'] == 21) ? 'sp_content_padding' : 'sp_block'), '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';

This time, please note, not only do you add your block ID, but you also have to switch sp_block and sp_content_padding and put parentheses around everything.  If you copy/paste this code, you should be good (just remember to change the block ID to your block ID.

Also note, change has been made to this code based on the next two follow-up messages.  The code above is correct.



Thank you for all of your help!  On to the next update!   :nervous-happy:


« Last Edit: June 09, 2010, 03:02:00 PM by jjwinc »

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #35 on: June 09, 2010, 10:52:36 AM »
AngelinaBelle,

Okay, so...I got a little too happy, too soon; there's still a problem.  The menu is flying out over the other blocks, but now it appears that ALL blocks have the overflow turned off because we're back to an image in a completely different block overlapping, too.  It's happening in both IE and FF.  It's almost like the Block.ID is being ignored.  The good news is, you have a copy of my code above.  :-) 

I may just add a bunch of blank lines in the Welcome block and call it a day, but since we've (read you've) worked on this so long, I thought I'd run it by you once more time.


Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #36 on: June 09, 2010, 11:26:34 AM »
It's probably doing just what it was told to do.  :D
Try this instead.
Code: [Select]
<div class="', (($block['type'] == 'sp_menu' || $block['id'] == 21) ? 'sp_content_padding' : 'sp_block'), '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';

Because you generally don't want sp_content_padding when it is not an sp_menu block.
 
----
Edit: fixed typo in code
« Last Edit: June 09, 2010, 08:41:33 PM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline jjwinc

  • Semi Newbie
  • *
  • Posts: 37
  • Gender: Male
    • ATU85
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #37 on: June 09, 2010, 01:46:04 PM »
I stared at that code a thousand times and the != didn't even register.  LOL  That latest change worked (but I had to change it to == rather than the single equal sign).   :)

This is what it looks like now:
Code: [Select]
<div class="', (($block['type'] == 'sp_menu' || $block['id'] == 21) ? 'sp_content_padding' : 'sp_block'), '"', !empty($block['style']['body']['style']) ? ' style="' . $block['style']['body']['style'] . '"' : '', '>';


Problem solved!  Thank you, AngelinaBelle!

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Vertical Fly-Out Menu in a Block
« Reply #38 on: June 09, 2010, 08:40:54 PM »
 :-[  typo.  Good eye. Have fun!
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?