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


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

Vertical Fly-Out Menu in a Block

Started by jjwinc, April 28, 2010, 02:17:12 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

AngelinaBelle

#20
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
$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.
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?

jjwinc

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.

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">';

AngelinaBelle

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?

jjwinc

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

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

...looks like a section of interest.



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 />';

}

AngelinaBelle

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?

jjwinc

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?


AngelinaBelle

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?

jjwinc

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:

<?php// Version: 2.0 RC3; Post

AngelinaBelle

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?

jjwinc

 :-[

How embarrassing...LOL

<?php// Version: 2.3.1; Portal

AngelinaBelle

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?

jjwinc

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.

AngelinaBelle

... 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?

jjwinc

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.


<?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


<?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)     *

jjwinc

#34
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:

<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...

<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:

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

to this...

<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:



jjwinc

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.


AngelinaBelle

#36
It's probably doing just what it was told to do.  :D
Try this instead.
<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
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?

jjwinc

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:
<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!

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?