Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript
Author Message
devilchi
New Member
New Member



Joined: Aug 21, 2006
Posts: 6

PostPosted: Tue Jan 27, 2009 9:33 pm Reply with quote

I am working on a theme for my ravennuke site and have come across something I have never had to play with before. I have a lot of customized blocks that show/hide and also divs that can be positioned around the screen. Now I need to find away to make them persistent for the user as they go thru my site. I know this would probably be done with cookies but my question is if i have 20 items that need to be set would that mean 20 different cookies? Thats what Im getting from the tutorials I been reading. Maybe Im just misunderstanding them. I have limited coding experience. If there is a better way or a best way to handle this could some one please point me in the right direction. The functions are in javascript so thats why this post is in the javascript forum.

Thank you for your time.
Devilchi
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Jan 28, 2009 3:42 am Reply with quote

Nah, you can put as much data as you want in a cookie. Mostly it just stores strings.
You could concatenate all your block states as a set of block switches, 1s and 0s. Or do something more complicated if you have a dynamic number of blocks
"block1"=>1,"block2"=>0, etc

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Jan 30, 2009 6:30 am Reply with quote

evaders99, I thought that there was a limit imposed based upon the request headers, which is where I believe the cookie data is passed back-and-forth in??? I just can't remember what that size limit is.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Jan 30, 2009 9:33 am Reply with quote

Could you develop a MYSQL table that is modeled on the current blocks table but contains your on off switches (like Evaders suggested)? Then write a little modification to mainfile to have it read in that table and present the data. There are several functions in mainfile that work together to show blocks ... you might need to hack into those too.

Not clear from your post whether the blocks vary by user. If so you might need to stuff the uid into the table too.
 
View user's profile Send private message Visit poster's website
devilchi







PostPosted: Fri Jan 30, 2009 9:55 am Reply with quote

Thanks alot guys. Im going to dig deeper into this and maybe come up with some sort of hack so i can let every registered used position things how they want and only let guests move things around during there session time. I also need to figure out if this is really something my users will use or just something "I" think would be cool myself. Sometimes those two blend into a fog lol. Thanks again
 
evaders99







PostPosted: Fri Jan 30, 2009 11:05 pm Reply with quote

I was curious about montego question...
so 4KB seems to be the standard for one cookie data, more than enough to handle any data you should be passing via cookies. Incidentally, there's a limit of the number of cookies, 20 per site. So even more reason to compact your data into one cookie
[ Only registered users can see links on this board! Get registered or login! ]
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript

View next topic
View previous topic
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©