Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
creating a banner exchange script - need help with logic
Old 12-14-2007, 05:59 PM creating a banner exchange script - need help with logic
Skilled Talker

Posts: 69
Trades: 0
I was wondering if anyone could help me out in figuring the ratio part of the script. I don't know where to start.

I was thinking of just having an element in a mysql table that would count the number of impressions lets say - up to 100. Then there would be a table to count how many credits have been earned. And then with php when the count reaches 100, the code would add like 50 credits and then restart the count. Is that feasible or is there something more efficient?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
comet is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-15-2007, 12:44 AM Re: creating a banner exchange script - need help with logic
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Define "credits" as related to your intention. I will follow up on your other thread.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 12-15-2007, 12:51 AM Re: creating a banner exchange script - need help with logic
Skilled Talker

Posts: 69
Trades: 0
Credit would be the number of times their banner is displayed at other websites in the banner exchange. Specifically, it would be called 'unused credits' because it's the amount of times their banner will be displayed until they run out and end up at zero (until they get more impressions).

That's where implementing a rate of x impressions equals x amount of credits applied to their account gets tricky for me. I'm not sure how to go about doing it.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
comet is offline
Reply With Quote
View Public Profile
 
Old 12-15-2007, 06:21 AM Re: creating a banner exchange script - need help with logic
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Hmmm...I'm not totally sure what you're asking, but let me take a wild guess and see if this at least helps.

Let's say that they get 50 credits per 100 impressions. Then, let's assume that the number of impressions is stored in a variable $impression_count (possibly pulled from a database field). Then, the total number of credits available would be floor($impression_count/100)*50. You could store the total number of credits used in another variable/field and that number would need to be always less than the bolded equation above.

For example, if the user had 248 impressions (i.e. $impression_count=248), then we'd have floor(248/100)*50 = floor(2.48)*50 = 2*50 = 100. If they had used 25 credits, then they'd have 100-25=75 credits available.

Hope that helps.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 12-15-2007, 08:17 PM Re: creating a banner exchange script - need help with logic
Skilled Talker

Posts: 69
Trades: 0
Thanks, got a good feeling about this one.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
comet is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to creating a banner exchange script - need help with logic
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.70638 seconds with 12 queries