Gossamer Forum
Home : Products : DBMan : Installation :

Help with modifications for Classified use.

(Page 2 of 2)
> >
Quote Reply
Re: Help with modifications for Classified use. In reply to
Possibly your email field is incorrect.

Check the line

print MAIL "To: $rec{'email'}\n";

and make sure you have changed email to match the name of your email field. (I put it in bold before, but I forgot to mention it.)


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
Ahh... details details. Apparently my email field name is 'Email'. Gotta love case-sensitivity Smile

Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
I have another question in regards to the validation routine. Would it be possible to change the record date to the date when the record is validated?

So for example if a user places an Ad and specifies 14 days to run, it will run 14 days following validation date vs. posting date.

Thanks,
Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
Sure. In sub validate_records, after

$rec{'Validated'} = "Yes";

add

$rec{'Date'} = &get_date();

I got the email that my record was added and validated. All seems to be working fine. Smile


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
Ok, I know I'm full of questions, but here's another feature I would like to have implemented in the code.

If a user sells his/her item and decides to delete the record, would it be possible to apply a credit on their account for the unused days?

Here's what I was thinking, but if you have any better ideas, let me know.

Add a new field to the default.pass file for debit/credit/zero balances.

So, for instance, if someone submits a record for 14 days and use it all, then it would be a zero balance in their record. If they sell their item and delete their record after 12 days, they will have 2 days of credit
So the formula would be:
(credit = total - (2 days x cost/char x # chars)

That value would be placed in a field in default.pass.

If they add a new record, it will look at that field and if it's a positive value, it will take that amount and subtract it from the value of the new ad.

What do you think?

Thanks Smile
Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
I suppose that would be okay. You've already added a lot to the .pass file anyway. Another field at this point won't matter. Smile

So now you need to figure out how much the person gets back, right?

I'll have to think about it and get back to you.


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
Exactly, as a credit to their account. The field will either be a zero value if the ad runs in it's entirety, or a positive credit value if not. It'll never be a negative value, because they'll have to pay for the ad prior to validation.

If they place an ad, it'll check to see if there is a positive value in their credit field, and deduct it from the total if so. If they place a new ad the value is less than the credit amount, it'll subtract them and place the new credit value back in the field. If the ad amount exceeds their credit value, it'll zero out their credit field and charge them the difference.

Thanks Smile
Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
Actually, I just had another thought. If they have a credit amount, it should be only deducted upon validation of the new record. If they decide to place an ad, and never pay for it, it'll never be validated, but they can keep their full credit amount.

Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
Okay, Frank. It's on my list. I'll get to it as soon as I can.


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
These are the steps I've worked out for how to proceed with your credit thing. Is this what you want?

They delete a record
Check to see if the date of deletion is less than the validated date plus the number of days the ad was supposed to run.
If so, subtract the days remaining * the rate from the cost
Add the amount to the last field in the .pass file.

They add a record.
On the preview screen, give the total cost of the ad minus any credit they already have.
Save the full cost of the ad, but mention the credit in the email that goes out after adding
On the validation form, include the amount due -- cost minus credit
Upon validation, deduct the cost of the current ad from the credit amount, if the cost of the current ad is less than the credit amount. If the cost of the current ad is greater than or equal to the credit amount, set the credit amount to 0.

------------------
JPD







[This message has been edited by JPDeni (edited September 02, 1999).]
Quote Reply
Re: Help with modifications for Classified use. In reply to
That sounds like exactly what I need. Here are the fields I have defined in my db, so you can incorporate them into your code if you like:

Duration, CharLength, and Cost.

Much appreciated Smile
Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
I always run into questions as I start to write code. These are the ones that have come up --

How many fields do you now have in your .pass file?

Does your CharLength field take into consideration spaces and punctuation?

The Duration field holds the number of days, yes?

What is the name of the field that holds the date the record was validated?


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
Assuming that each permission is it's own field, then I have 16 total.

As for CharLength... No, actually now that I think about it, CharLength isn't being used for anything but counting the number of characters as they are being typed in. I'm actually using your $ad_length = length($ad); to integrate into the cost. So don't worry about using CharLength. Sorry about that.

The duration is indeed the number of days for the ad to run.

The field date for the validation is actually just the Date field. It replaces the date when it's validated.

Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
That's 16 fields *before* the addition of the credit field? (Gotta be sure! Smile )

I had already assumed that the CharLength field wasn't what you wanted and incorporated the $ad_length variable.

What I have so far is determining if there are any days left and calculating the amount of credit. I ran into trouble when I started with the .pass file and realized I didn't know where to put the number. Smile


------------------
JPD





Quote Reply
Re: Help with modifications for Classified use. In reply to
Yes, that's before the addition of the credit field, so that field would be #17. Smile

Frank
Quote Reply
Re: Help with modifications for Classified use. In reply to
JPD- Have you had any time to work on the credit mod yet?

I suppose the situation will be slightly changed now that I'm using a relational database. My user credit information is a field in the user.db file.

Thanks,
Frank

[This message has been edited by fharris (edited October 18, 1999).]
Quote Reply
Re: Help with modifications for Classified use. In reply to
Then lets start over with a new thread in the other forum. Smile


------------------
JPD





> >