11
Mithrandir
Re: AMS and SmartSection.......GRRRRR

Quote:
In 2.0.x, I beleive that each option within the $options array was check to know if it was itself an array. If so, then the option was implode and transformed into a string. So the actual $options saved in the database was a serialized version of :


Nope. XOOPS 2.0.x saves block options as an imploded string with | as delimiter, effectively making it impossible to use multi-valued options (multi-selects etc.)

The "normal" approach used in some modules is to have the multi-select as the last option and when figuring out, which options have what value, an array_slice is used to put all option values above a certain index into one option (a little difficult to explain).

I'll look at the spotlight block and see what I can find.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

12
Mithrandir
Re: AMS and SmartSection.......GRRRRR

try this, in smartsection_items_spot_show()
(blocks/items_spot.php line 20 AND 119)

$sel_items explode(','$options[3]);


$sel_items is_array($options[3]) ? $options[3] : explode(','$options[3]);
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

13
marcan
Re: AMS and SmartSection.......GRRRRR
  • 2006/5/31 16:21

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Quote:
Nope. XOOPS 2.0.x saves block options as an imploded string with | as delimiter, effectively making it impossible to use multi-valued options (multi-selects etc.)

In fact, I'm doing it with no problem in XOOP 2.0.13.2... But it does not work anymore in 2.2.x.

Here is the result of a var_dump when editing the block options :
Quote:
array(7) {
[0]=>
string(1) "0"
[1]=>
string(1) "5"
[2]=>
string(1) "0"
[3]=>
string(5) "Array"
[4]=>

string(1) "1"
[5]=>
string(1) "1"
[6]=>
string(6) "bullet"
}

option[3] is actually saved as "Array"....

What am I missing ?

Thanks !
.:: marcan (aka mal aka Marc-André) ::.
.:: Open Source :: The SmartFactory ::.
.:: XOOPS Professional Services :: INBOX International ::.

Login

Who's Online

344 user(s) are online (265 user(s) are browsing Support Forums)


Members: 0


Guests: 344


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits