Fork me on GitHub

Impression method for AD  Bottom

  • hi all,

    Fine, Actually i am a fresher to this Post Nuke. So might be my question will be useless for some post nuke kings.... wink

    My Question is

    How can i use that impression method for my adverticement...basically i have article pages...in that article page i need to find the length of the article ...if the article is very huge i can display 3 adverticement or if the article is some what big i can use 2 adverticement...like that...

    so i want to know , how to use that impression technique for this adverticement...and if possible let me know on which file and on which funciton i need to change...

    Thanks
    Arivoli
  • Impressions are the basis of the default banner system (Administration -> Banners), so covering that ideology is done. What you need to do is setup postnuke to display multiple banners? because PN doesn't handle this well on it own right now this requires a bit of a hack as far as I know. (More info here)

    The second segment of your question asks whether or not it is possible to determine the length of an article and basically break it up with banners, yes this is possible but again it will require modification to accomplish, editing of the theme in this case. You will have to understand the PHP language under the default templating system, you will need to modify the themearticle() function and use PHP code to find length, determine appropriate insertion points and insert banner tags on the article variables ($info, $preformat, $links)

    These are the only ways I know how to accomplish these things based off of articles/forum posts and my little experience so there might actually be other more practical ways to accomplish them. I fear I am no PostNuke king but only a simple peasant.
  • Hi, :)
    ya you are right....that impression setting is in the administrator pannel...
    but what i want is,
    c i am displaying some of the banners or images (which are all active) in the article page...
    if the user click that particular image it is going to that refered URL...but how can i update the impression value after user clicks that ad... ? :(

    basically what is my requirements is, based on the impression value i need to display the ad...if the impression value for that particular ad is reached its max limit..i should not show that ad after words...is like that...

    let me know your idea about modifying that impression value ....

    thanks....
  • The module takes care of this for you, have you tried out the banner module yet? You setup your clients, then setup the banners and when you add your banners there is a purchased impressions value for the number of clicks that the banner will remain active for. The banner module will automatically decrement the impressions value when a banner is clicked.
  • hi, thanks for giving ideas...

    i couldn't able to get your way...
    c i am using the following code to display the adverticement in the article page which is fully edited by (based on client requirements)

    ------Sample CODE --------------------


    $string = explode(' ', $string);
    $numspaces = count($string);
    $frac = (int)($numspaces/($NUMADS+1));
    $nth = $frac;
    $cnt =0;



    while(list($imgurl, $clickurl)= $result->fields ) {

    $align = 'align="right" vspace=15 hspace=10';
    if (1 == $cnt % 2) {
    $align='align="left" hspace=10 vspace=10';
    }

    if ($info[tid] !=17){//dont add adverts to press releases.
    $image[] = '';
    }
    $result->MoveNext();
    $cnt = $cnt + 1;
    $location[] = $nth;
    $nth = $nth + $frac;

    }

    //this is used to count the number of character and set the maximum ads to display in the article -Arivoli
    if($NUMADS > $cnt) // this is used to check which one is max whether total banners or available banners
    {
    $tcnt=$cnt;
    }else
    {
    $tcnt=$NUMADS;
    }
    //this is used to randomly pick the ads (ie storing all random numbers between 1 and maximum count)/this is used to randomly pick the ads (ie storing all random numbers between 1 and maximum count)
    $randomNumbers = array(); // storage array
    $randomNumbers=getRandomArray(1, $tcnt,$tcnt);


    for ($i = 0; $i < $tcnt; $i++) {

    array_splice($string, $location[$i], 0, $image[$randomNumbers[$i]]);
    }
    //setting maximum ads ends here


    /* for ($i = 0; $i < count($string); $i++) {
    array_splice($string, $location[$i], 0, $image[$i]);
    }*/

    $string = implode(' ', $string);




    $preformat['maintext']=$string;

    if (!empty($preformat['notes'])) {
    $preformat['fulltext'] = "$preformat[maintext]

    $preformat[notes]";
    } else {
    $preformat['fulltext'] = " $preformat[maintext]";
    }

    -------------Sample code ends here --------------------------------------


    Note : in the above code $string variable contains the article text....

    here how can i give that impression track code.....

    i think now you will get clear-cut picture of my probs....
    Let me know your feedback and idea....
    Thanks ...
    :)
  • hi,sorry ignore the previous msg,
    actually i did what i want, using funcs.php file ... :))
    but i just want to know the diff between
    1. Impression
    2. Click...

    From my point of view impression is nothing but how many times the banners has been displayed....the "Click" means how many times the user clicked that URL....
    I am right?
    let me know your idea...
    Thanks... )

This list is based on users active over the last 60 minutes.