Plugin Directory

Changeset 847230


Ignore:
Timestamp:
01/28/2014 08:20:41 PM (12 years ago)
Author:
ashdurham
Message:

Fix to report PDF when generating for text advert

Location:
adkingpro
Files:
94 added
3 edited

Legend:

Unmodified
Added
Removed
  • adkingpro/trunk/adkingpro.php

    r818427 r847230  
    44    Plugin URI: http://kingpro.me/plugins/ad-king-pro/
    55    Description: Ad King Pro allows you to manage, display, document and report all of your custom advertising on your wordpress site.
    6     Version: 1.9.9
     6    Version: 1.9.10
    77    Author: Ash Durham
    88    Author URI: http://durham.net.au/
     
    2929
    3030    global $akp_db_version;
    31     $akp_db_version = "1.9.9";
     31    $akp_db_version = "1.9.10";
    3232
    3333    function akp_install() {
  • adkingpro/trunk/readme.txt

    r818427 r847230  
    44Tags: advertising, ads, ad, adverts, advert, advertisements, advertisement, advertise, stats, stat, statistics, statistic, promotions, promotion, banners, banner, tracking, track, detailed, adkingpro, ad king pro, page, post, reporting, reports, report, csv, pdf, revenue, charge, money, theme, themes, flash, adsense, text, resize, rotate, slideshow, multiple
    55Requires at least: 3.0.1
    6 Tested up to: 3.7.1
    7 Stable tag: 1.9.9
     6Tested up to: 3.8
     7Stable tag: 1.9.10
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    131131== Changelog ==
    132132
     133= 1.9.10 =
     134* Fix to report PDF when generating for text advert
     135
    133136= 1.9.9 =
    134137* Updated Spanish translation
     
    234237== Upgrade Notice ==
    235238
     239= 1.9.10 =
     240* Fix to report PDF when generating for text advert
     241
    236242= 1.9.9 =
    237243* Updated Spanish translation
  • adkingpro/trunk/themes/default/pdf.php

    r721782 r847230  
    33    $pdf->AliasNbPages();
    44    $pdf->AddPage();
     5   
     6    $image_url = str_replace('http://'.$_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $image);
     7    if (file_exists($image_url)) {
     8        $imagesize = getimagesize($image_url);
     9        $imagesize[0] = ($imagesize[0] * 25.4) / 72;
     10        $imagesize[1] = ($imagesize[1] * 25.4) / 72;
     11        $imw = 190;
     12        $imh = 20;
     13        if ($imagesize[0] > $imagesize[1]) {
     14            if ($imagesize[0] > 190) {
     15                $wpc = 190 / $imagesize[0];
     16                $imh = $imagesize[1] * $wpc;
     17            } else {
     18                $imh = $imagesize[1];
     19                $imw = $imagesize[0];
     20            }
     21        } else {
     22            if ($imagesize[1] > 20) {
     23                $wph = 20 / $imagesize[1];
     24                $imw = $imagesize[0] * $wph;
     25            } else {
     26                $imh = $imagesize[1];
     27                $imw = $imagesize[0];
     28            }
     29        }
    530
    6     $imagesize = getimagesize(str_replace('http://'.$_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $image));
    7     $imagesize[0] = ($imagesize[0] * 25.4) / 72;
    8     $imagesize[1] = ($imagesize[1] * 25.4) / 72;
    9     $imw = 190;
    10     $imh = 20;
    11     if ($imagesize[0] > $imagesize[1]) {
    12         if ($imagesize[0] > 190) {
    13             $wpc = 190 / $imagesize[0];
    14             $imh = $imagesize[1] * $wpc;
    15         } else {
    16             $imh = $imagesize[1];
    17             $imw = $imagesize[0];
    18         }
    19     } else {
    20         if ($imagesize[1] > 20) {
    21             $wph = 20 / $imagesize[1];
    22             $imw = $imagesize[0] * $wph;
    23         } else {
    24             $imh = $imagesize[1];
    25             $imw = $imagesize[0];
    26         }
     31        $pdf->Image(str_replace('http://'.$_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $image), 10, 6, $imw, $imh);
    2732    }
    28 
    29     $pdf->Image(str_replace('http://'.$_SERVER['HTTP_HOST'], $_SERVER['DOCUMENT_ROOT'], $image), 10, 6, $imw, $imh);
    30 
     33   
    3134    $pdf->SetX(15); $pdf->SetY($pdf->GetY()+ $imh + 5);
    3235    $pdf->SetFont('Arial','BU',10);
Note: See TracChangeset for help on using the changeset viewer.