Recent Topics

1 May 14, 2006 15:45    

Hey,

I'm developing a plugin atm and it is customizable for the user. So it needs to be able to set cookies.

But the problem is that the plugin's php file is called after the headers have already been sent, so it is not possible to save a cookie without making a seperate page for saving the cookie.

Anyone found a workaround for this....

2 May 15, 2006 11:52

Use the session object :-

Set "cookie"

$Session->set( 'my_param', 'my_value');
$Session->dbsave();

Get "cookie"

$my_param = $Session->get( 'my_param');

¥

3 May 15, 2006 12:06

But wouldn't that make my cookie and value only avaliable for that session.

I would like the cookie's life to be pernament.

Though i think blueyed is adding the SkinInit event for such things, so should be no biggie anyway.

4 May 16, 2006 00:10

Just for the record: Plugin::session_set() / Plugin:session_get() would be the "clean way" to do it (it's a wrapper to Session::set()).

But: using the session data is problematic, because it's limited in size (TEXT and therefor ~64kb). Using it (especially with a large/no timeout) should be avoided.

I'll add a BeforeBlogDisplay in _blog_main.inc.php.

5 May 16, 2006 09:43

We live and learn :D

¥

6 May 17, 2006 00:21

Just for completion (and learning ;):

I've added the BeforeBlogDisplay hook to _blog_main.inc.php, which should be what you need, balupton.

8 May 19, 2006 20:00

blueyed wrote:

Just for completion (and learning ;):

I've added the BeforeBlogDisplay hook to _blog_main.inc.php, which should be what you need, balupton.

I just downloaded the latest nightly cvs snapshot;
http://doc.b2evolution.net/b2evo_HEAD_snapshot.tgz

And the term 'BeforeBlogDisplay' is not in any of the files....

9 May 20, 2006 10:27

/*
 * Now, we'll jump to displaying!
 */

// Trigger plugin event:
$Plugins->trigger_event( 'BeforeBlogDisplay' );

// Check if a temporary skin has been requested (used for RSS syndication for example):
if( !empty($tempskin) )
{


(around line 398)

¥

10 May 20, 2006 10:30

All right got it now, mustn't of been updated when i downloaded it, or i was re-downling a cached version. Oh well it's there now. :D


Form is loading...