Recent Topics

Delete custom blog settings from coll_settings

Started by on May 29, 2008 – Contents updated: May 29, 2008

May 29, 2008 19:23    

I can't figure out how to delete parameters defined with
$Blog->set_setting( 'my_param', 1 )

Something like $Blog->delete( 'my_param' ) would be cool, but it doesn't work.

Please help.

May 29, 2008 19:27

I've never tried to delete a setting before, chances are you'd need to use sql to remove the setting .... might be worth trying "NULL" as a value though ;)

¥

May 29, 2008 19:30

Thanks :)
Here is another question, why does my_param still there after I delete the blog?

May 29, 2008 19:32

Probably because it's not a default param, I guess the core only deletes expected params, sounds like a great post to make in the bugs forum huh? ;)

¥

May 29, 2008 19:37

I'll try with NULL. Sure it would be cool to see $Blog->delete( 'my_param' ) available in next releases.

May 29, 2008 19:38

Swift update, this *might* work ( see inc/settings/model/_abstractsettings.class.php approx 500 onwards ) :

PHP

$Blog->CollectionSettings->delete'my_param' );

¥

May 29, 2008 19:44

Undefined offset: 1 in ... inc\settings\model\_abstractsettings.class.php on line 517

May 29, 2008 19:45

Do I have to send my_param as array, right?

May 29, 2008 19:50

Never mind I'll use sql instead :)

May 30, 2008 04:00

To whom it may concern :roll:

PHP

$DB->query('
            DELETE FROM T_coll_settings
            WHERE cset_coll_ID = '.$Blog->ID.'
            AND cset_name = "my_param" ');


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.