Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-07-26 16:09:37

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

txp_public_login

I need to read the public cookie content.
Do we have access to cs(‘txp_public_login’) on a multisite installation?


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2014-07-27 05:22:28

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: txp_public_login

Sorry folks my question isn’t clear.

Here is my attempt:

if (@txpinterface == 'public') {
	register_callback('plugin_name', 'textpattern');
}
function plugin_name($event, $step) {
	if ( cs('txp_login_public') ) {
		// do some things on the public side.
	}
}

On a single installation of TXP, this above works fine.
I don’t know if the txp_login_public cookie is created on a multisite installation. In this case, what about that:

global $prefs;
// Allow use of cross domains 'txp_login_public' cookie (support multi-sites installation)
setcookie('txp_login_public', cs('txp_login_public'), time(), '/', '.'.$prefs['siteurl']);

Thanks by advance for your answer.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB