• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [solved] Store Session-Data for regular Visitors with CMSMS. Need directions.
PostPosted: Thu Dec 25, 2008 5:38 pm 
Hi there,

I have a problem that I do not really know how to approach.

Following Scenario:
A user opens a page in CMSMS that contains information generated by a plug-in. The users are not registered front end users or something - just "regular" visitors. Now I want to store parts of this data (string-data, defined number of fields) somehow - so that when the user accesses another page, I can reuse the data stored to adjust the other pages content (use the stored data as parameters for plug-ins).

So I need to have the data available from within the templates.

TEMPLATE A -> PLUG-in A -> GENERATED DATA -> TEMPLATE B,C,D... ->PLUG-in B

I used to do this by transferring the data via the URL, but I would prefer a handling which allows me to set a cookie or do it all server-sided (preferred).

Does CMSMS have such abilities already or is there a module I could use?

Mhh... I just thought that I could probably use one of the shopping carts modules. If they require logged in users, probably I can "fake" users with kind of a random string/number. What do you think? Does someone has more experience and can point me into a direction? What commands should I look at? Have a good site or tutorial that explains it very brief and holds some code examples? No detailed description needed (however, I wouldn't mind ;D), I just don't really know where to start in this topic.

Thanks and Best regards
Nils


Last edited by nhaack on Thu Dec 25, 2008 6:55 pm, edited 1 time in total.

Top
  
 
 Post subject: Re: Store Session-Data for regular Visitors with CMSMS. Need directions.
PostPosted: Thu Dec 25, 2008 5:47 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 6585
Location: Fernie British Columbia, Canada
Just write a UDT to store things in the session
then you can extract them with $smarty.session.myvariable.

i.e (untested).... create a udt called session_set that looks something like this.
Code:
if( isset($params['var'])
{
  $var = trim($params['var']);
  if( isset($params['value']) )
     {
        $_SESSION[$var] = $params['value'];
     }
 else
     {
        @unset($_SESSION[$var]);
     }
}


You call it like {session_set var='test' value='123'}
You extract the value with {$smarty.session.test} on any page.

They'll be in the session till the user closes the browser window, or you delete them.

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: Store Session-Data for regular Visitors with CMSMS. Need directions.  [SOLVED]
PostPosted: Thu Dec 25, 2008 6:55 pm 
Hi Calguy,

It's easier than I thought. Thanks a lot for the hint :)

Best
Nils


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
A2 Hosting