Current time: 05-20-2012, 09:44 AM Hello There, Guest! (LoginRegister)




MySubscriptions, Donation Bar, MyDownloads, MyAchievements and support for our free and paid plugins. All that for $7!

Advertise Here!
Are you looking to advertise on this forum? Please read this announcement thread.

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Advertisements
09-27-2011, 10:21 PM (This post was last modified: 09-27-2011 10:23 PM by Mihu.)
Post: #1
My Advertisements
Hi!
Pirata please excuse me for this post, in this section but I can`t post a reply to My Advertisements thread because I`m not a subscriber.
I have to report a problem / bug with this plugin. I think that you forgot to add a test in function myadvertisements_click, because when you acces an address like this :
DOMAIN/xmlhttp.php?aid=AD_ID, it increase the number of clicks for zone AD_ID.
I`ve made a fix for this problem. In my opinion the function myadvertisements_click should be :
PHP Code:
function myadvertisements_click()
{
    global 
$mybb$db;
    
    if (
$mybb->settings['myadvertisements_disabled'])
        return;
    
    
// in case we switch page (we clicked a lin, right?) the script is not stopped
    
ignore_user_abort(true);
    
    if (isset(
$mybb->input['action']) && $mybb->input['action'] == "do_click" && isset($mybb->input['my_post_key']) && verify_post_key($mybb->input['my_post_key'], true)) 
    {
        
// this query could be avoided if we logged all advertisement ID's in cache or something
        // TODO: store active advertisements ID's and expiration time in cache and check if the aid exists in the line below instead of running the query
        
$query $db->simple_select('myadvertisements_advertisements''*''aid='.intval($mybb->input['aid']));
        
$ad $db->fetch_array($query);
        if (!
$ad)
            return; 
// do not log clicks as the ad doesn't exist
            
        // increase clicks
        
$db->update_query('myadvertisements_advertisements', array('clicks' => 'clicks+1'), 'aid='.$ad['aid'], 1true);
    }

Thanks for reading this!Wink
Find all posts by this user
Quote this message in a reply

09-28-2011, 07:19 AM
Post: #2
RE: My Advertisements
I don't understand exactly what I forgot. From my tests it is working fine

[Image: s.png]
Find all posts by this user
Quote this message in a reply
09-28-2011, 11:38 PM
Post: #3
RE: My Advertisements
What I would like to say is that anyone can increase the number of clicks for an area of ​​advertising without click on it!
You forgot to test the post key, that it is send by Ajax.Request.
Now I hope that you understand which is the problem.
Find all posts by this user
Quote this message in a reply
09-29-2011, 06:17 PM
Post: #4
RE: My Advertisements
Thanks, I'll look into that in about 10 minutes after I sort out some issues. Thank you for the report. I'll release 2.0 which contains ads disabling

[Image: s.png]
Find all posts by this user
Quote this message in a reply

10-03-2011, 07:58 AM
Post: #5
RE: My Advertisements
With pleasure!
Find all posts by this user
Quote this message in a reply
10-06-2011, 06:31 AM
Post: #6
RE: My Advertisements
pirata if you need a moderator im here to help i have my own forum i was wondering if i could post it anywhere so that people could help me on it ?
Find all posts by this user
Quote this message in a reply
10-06-2011, 06:36 AM
Post: #7
RE: My Advertisements
So you want to ask for help (which is only available to subscribers) but you're offering yourself to be a moderator?

[Image: s.png]
Find all posts by this user
Quote this message in a reply

10-06-2011, 10:03 PM
Post: #8
RE: My Advertisements
(10-06-2011 06:31 AM)iTwist Wrote:  pirata if you need a moderator im here to help i have my own forum i was wondering if i could post it anywhere so that people could help me on it ?

/facepalm
Fail troll is fail. You don't ask to be moderator here, and you can't get support here unless you pay for a subscription.

If you PM me asking me to download and give you a paid plugin, you'll be reported to Pirata and be left a negative rep. If you want the plugin, then pay for a subscription, you cheap skates!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)