How to maintain banner of website partnerships?

Asked

Viewed 184 times

3

I’m developing a site where I will put banner of partner sites (visits touch) but I don’t know how should be the insertion of the partners banners but I thought of two ways.

  1. Insert direct into HTML and manually set the banner size (larger banner for the partners that most generate me traffic).
  2. Save banner HTML (eg: <a title="site" href="#" target="_blank"> <img src="http://site/banners/50x50.png" alt="site" /></a>) in database together with the amount of visits generated by it so that automatically the site Acople the banner to the site field.

Which of the forms is more usual? Is there another more suitable way? below an example of banners partnership rectangles/squares represent the banners being that the largest are the banners of the largest traffic generators.

inserir a descrição da imagem aqui

  • 2

    I really think there’s no pattern. Changing Subject matter, just for study, as such a read on this link, is a related subject: http://stackoverflow.com/a/14405396/1518921

  • Setting size at hand will have give a lot of maintenance problem, it is better to use a <li> and let HTML set the size of the elements automatically.

  • I answered my own question in the simplest way I could find, if I have a bolder solution than mine or some question / tip about my solution architecture, comment or answer if your solution is better to validate without doubt.

1 answer

1


To keep the banner data of the partners' sites I created two tables in the database one to keep the partner type (I think optional) and one to save the banner data:

INSERT INTO partner_type(valor, name) VALUES(1,'Big');
INSERT INTO partner_type(valor, name) VALUES(2,'Medium');

INSERT INTO partner_banner(partner_name, partner_url, partner_image, partner_type) 
VALUES('Site name','http://www.xxx.com.br/','http://localhost/xxx/images/temp/LinkExchangeBanners/70x70.jpg',1);
INSERT INTO partner_banner(partner_name, partner_url, partner_image, partner_type) 
VALUES('Site name 2','http://www.zzz.com.br/','http://localhost/zzz/images/temp/LinkExchangeBanners/70x70.jpg',1);

and created these functions to search for bank values:

    function selectBigPartner(){
        $this->selectBigPartnerCreateStmt();
        $result = $this->rowStmtExecute();
        return $result;
    }

        function selectBigPartnerCreateStmt(){
            $select = 'SELECT partner_name, partner_url, partner_image FROM partner_banner WHERE partner_type = 1';
            $this->stmt = $this->conn->prepare($select);
        }

        function rowStmtExecute(){
            $this->stmt->execute();
            $result = $this->stmt->fetchAll(PDO::FETCH_ASSOC);
            if(!empty($result)){
                return $result;
            }else{
                return false;
            }
        }

This solution works well while banners are manually inserted.

  • I answered my own question in the simplest way I could find, if I have a bolder solution than mine or some question / tip about my solution architecture, comment or answer if your solution is better to validate without doubt.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.