Next:
Yawns::Article
Previous:
Yawns::About
 [Table of Contents]

Yawns::Adverts



NAME

Yawns::Adverts - A module for working with user-submitted adverts.

SYNOPSIS

    #!/usr/bin/perl -w

    use Yawns::Adverts;
    use strict;

    my $add = Yawns::Adverts->new();

    $add->addAdvert( title => "Title",
                     link  => "http://foo.com/",
                     show  => 1000 );

DESCRIPTION

This module will deal with fetching, adding, and deleting user-submitted adverts to your Yawns website.

new

  Create a new instance of this object.

countActive

Return the number of adverts which are active.

countPending

Return the number of adverts which are pending approval.

addClick

Record an advert click to the given ID.

addAdvert

Add a new advert to the site.

getAdvert

 Retrieve all known information about the given advert.

deleteByUser

  Delete all adverts by the given user.

advertsByUser

  Return a hash-ref of all the adverts that the given user has posted.

removeAdvert

 Remove an advert from the site.

disableAdvert

 Disable an advert from the rotation

enableAdvert

 Enable an advert in the rotation.

deleteAdvert

  Delete an advert

fetchRandomAdvert

Fetch a random advert from the pool of available ones.

Choose only "enabled" adverts where the number of times that the advert has been shown is less than the number of times it has been paid to be displayed.

This will increase the "displayed" count - so it shouldn't be called unless the advert is intended to be displayed.

fetchAllActiveAdverts

Fetch all the adverts from the pool of active ones.

fetchAllAdverts

Fetch all the adverts, that is both active and inactive ones.

invalidateCache

  Clean any cached content we might have.

AUTHOR

Steve Kemp

http://www.steve.org.uk/

LICENSE

Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.


[Top] Generated by HTML::FromPod 0.49 on Fri Nov 21 03:03:57 2008