1
deka87
How do I save catads form settings for registered users?
  • 2012/7/4 12:25

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Hi guys,

I have the catads module installed on my website so I've got an ad posting form there. There are users who submit alot of ads weekly and they have to fill in the same info with minor changes all over again when they post another ad. What I wonder is what is the way to store an info for several fields I choose for every separate user who submits a new job (like if he choosed "France" from the country list and clicked something like "Submit the form and save the form settings" he will next time have the "country" field prefilled with France). What is the better way to do this? Cache or maybe separate table in mysql, I need an advice.

Thanks in advace.

Deka

2
Peekay
Re: How do I save catads form settings for registered users?
  • 2012/7/4 13:32

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I suppose you could put the field values into a session VAR, or use a short-term cookie. EU cookie laws have recently changed and you should explain that a cookie will be set to preserve a user's preference.

You could store the pref in a DB table, but seems like a lot of extra coding for what it's worth.

Which version of Catads do you use?

3
deka87
Re: How do I save catads form settings for registered users?
  • 2012/7/4 13:57

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Well, I am not sure about sessions, but using cookies seems fine. However, is it ok if I set to store cookies for let's say a month? Also storing info in DB seems like a perfect solution because I can store it for ever, but im not sure if it is any better than cookies talking into account maybe server load or anything. Which would you use Peekay, never mind the coding? I use Catads 1.4 ;-D

4
Peekay
Re: How do I save catads form settings for registered users?
  • 2012/7/4 15:59

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


The cookie approach sounds OK to me. Although, if an advertiser posted from a different location they would need to complete the whole form. You could always add rows to the module DB if cookies turn out to be a pain. To avoid unnecessary overhead, as you have suggested you could add a checkbox like 'Store my location details Y/N'. You would definitely need to add that as a user pref if you used cookies.

Or... you could just modify the PHP to pull the field data from the last advertisement they posted.

It is a good idea though.

5
deka87
Re: How do I save catads form settings for registered users?
  • 2012/7/4 16:14

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Quote:
Or... you could just modify the PHP to pull the field data from the last advertisement they posted.


or from the last ad they posted with the Store data checkbox checked. You're genious, Peekay, that's how I will try to make it work

Login

Who's Online

155 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 155


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits