Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    911
    Thanks
    302
    Thanked 2 Times in 2 Posts

    Question ASP/SQL - Problem

    Hi,

    I am designing a small advertisement management program in asp, and Sql Server 2000 as database.

    My table has the following fields which are pretty self explanatory:


    bannerId, bannertitle, bannerurl, imageURL, bannerpirority

    bannerId = Autoincrement to generate unique id for a banner ad
    bannertitle = String title of the banner
    bannerurl = URL where the image is linked
    imageURL = URL of the image file
    bannerpirority = pirority of the banner to be displayed (1 = lowest, 5 = highest)


    Now, I want to display the banner on a page based on its pirority, like if there are 3 banners A, B, C which have the pirority 1,2,3 respectively so banner C should be displayed more times as compared to banner B. Banner B should be displayed more times then banner A


    Hope you got me, its like the more pirority a banner gets, the more its being displayed.


    I am using the following SQl Query but I dnt think its the proper logic, can u plz help me?

    select top 1 * from tbl_banner_management order by newid(), bannerpirority desc
    Thanx in advance for your help.

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    You know that ASP has an AdRotator component, that does exactly what you're doing, included as standard, right?

    http://www.w3schools.com/asp/asp_adrotator.asp

  • #3
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    911
    Thanks
    302
    Thanked 2 Times in 2 Posts
    i know about this component but i want to create my own


    Thanx

  • #4
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    911
    Thanks
    302
    Thanked 2 Times in 2 Posts
    Hi,

    I have not yet received a satisfying reply so far

    Ok lets tweak this a lil bit.

    we can have a percentage based ad management system.

    Like I have 3 banners in my database.

    Banner A - To receive 50% Views
    Banner B - To receive 30% Views
    Banner C - To receive 20% Views

    So suppose I refresh the page 10 times, I should get the following views of my banners

    Banner A - 5 views
    Banner B - 3 views
    Banner C - 2 Views

    Can u guys help me with this?


    Thanx in advance

  • #5
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    And I will say to you again: you're wasting your time.

    I don't think you appreciate just how complex the specific bit of functionality that you're talking about really is. It's not simply a case of calculating 30% of 10. And it is probably for precisely this reason that Micro$oft, in their infinite goodness, decided to include this very, very complex bit of code as a component in its own right. And I guarantee you; even if you did figure out a way to do it, it won't run nearly as fast as the component.

    By all means develop an application for managing advertisement assets: for storing images; mapping them to campaign URLs; tracking clickthroughs and conversion rates; generating the code that the adRotator component uses. I'm not saying that hasn't been done before, either, but... the reason you haven't received a "satisfying reply" is that everybody who's read this is wondering why on earth you'd want to even try it.

  • #6
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    911
    Thanks
    302
    Thanked 2 Times in 2 Posts
    Hello Spudhead,

    Thanx for the reply.

    Using the ad rotator component I can keep a track of how many clicks the ad has got but I dnt think there is any way to monitor how many views the banner has got.

    Am I right?

  • #7
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    No, but you can work that out for yourself. You know your total pageviews at any one time (or should do if you've got some basic hit tracking on your pages), and you know from your adRotator configuration file what ratio of pageviews that ad has been shown on. It's the same logic you were discussing above, but in reverse.

  • #8
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    911
    Thanks
    302
    Thanked 2 Times in 2 Posts
    ummm...That doesn't make any sense


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •