How to keep banner of partnerships on site?

3

I'm developing a website where I'll put banner of partner sites (visit visits) but I do not know what the insertion of the partners' banners should be, but I thought in two ways.

  • Insert direct into HTML and manually set the size of the banner (larger banner for the partners that most generate traffic).
  • Save the HTML of the banner (ex: <a title="site" href="#" target="_blank"> <img src="http://site/banners/50x50.png"alt="site" /></a> ) in the database along with the amount of visits generated by it so that the site automatically attaches the banner to the field of the site.
  • Which is more usual? Is there another more appropriate way? below an example of partnership banners rectangles / squares represent the banners and the biggest ones are the banners of the biggest traffic generators.

        
    asked by anonymous 15.04.2015 / 18:49

    1 answer

    1

    To maintain the data of the banners of the partner sites I created two tables in the database one to keep the type of the partner (I think it is 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 inserted manually.

        
    24.06.2015 / 14:22