@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $fields->push(new TabSet('Root', $mainTab = new Tab('Main'))); |
| 38 | 38 | $mainTab->setTitle(_t('SiteTree.TABMAIN', 'Main')); |
| 39 | 39 | |
| 40 | - $fields->addFieldToTab('Root.Main', new TextField('Title', 'The name of the category')); |
|
| 40 | + $fields->addFieldToTab('Root.Main', new TextField('Title', 'The name of the category')); |
|
| 41 | 41 | $fields->addFieldToTab('Root.Main', new NumericField('Width', 'The width of the advert in pixels')); |
| 42 | 42 | $fields->addFieldToTab('Root.Main', new NumericField('Height', 'The height of the advert in pixels')); |
| 43 | 43 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $fields->push(new TabSet('Root', $mainTab = new Tab('Main'))); |
| 37 | 37 | $mainTab->setTitle(_t('SiteTree.TABMAIN', 'Main')); |
| 38 | 38 | |
| 39 | - $fields->addFieldToTab('Root.Main', new TextField('Title', 'The name of the category')); |
|
| 39 | + $fields->addFieldToTab('Root.Main', new TextField('Title', 'The name of the category')); |
|
| 40 | 40 | $fields->addFieldToTab('Root.Main', new CheckboxField('Enabled', 'Are adverts for this category enabled?')); |
| 41 | 41 | |
| 42 | 42 | return $fields; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $advert = Advert::get()->filter('DigitalSignature', $digsig)->first(); // should only be the one but make sure |
| 34 | 34 | |
| 35 | 35 | if (!$advert) { |
| 36 | - $this->httpError(404, 'Advert "'.$digsig.'"" not found'); |
|
| 36 | + $this->httpError(404, 'Advert "' . $digsig . '"" not found'); |
|
| 37 | 37 | } else { |
| 38 | 38 | // record the click |
| 39 | 39 | $advert->Clickthroughs = $advert->Clickthroughs + 1; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $advert = Advert::get()->filter('DigitalSignature', $digsig)->first(); // should only be the one but make sure |
| 53 | 53 | if (!$advert) { |
| 54 | - $this->httpError(404, 'Advert "'.$digsig.'"" not found'); |
|
| 54 | + $this->httpError(404, 'Advert "' . $digsig . '"" not found'); |
|
| 55 | 55 | } else { |
| 56 | 56 | // record the click |
| 57 | 57 | $advert->Impressions = $advert->Impressions + 1; |
@@ -159,15 +159,15 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | // Normal operation: |
| 161 | 161 | $mimeType = HTTP::get_mime_type($file_name); |
| 162 | - header("Content-Type: {$mimeType}; name=\"".addslashes($file_name).'"'); |
|
| 163 | - header('Content-Disposition: attachment; filename='.addslashes($file_name)); |
|
| 162 | + header("Content-Type: {$mimeType}; name=\"" . addslashes($file_name) . '"'); |
|
| 163 | + header('Content-Disposition: attachment; filename=' . addslashes($file_name)); |
|
| 164 | 164 | header('Cache-Control: max-age=1, private'); |
| 165 | 165 | header("Content-Length: {$file_size}"); |
| 166 | 166 | header('Pragma: '); |
| 167 | 167 | |
| 168 | 168 | if (self::$use_x_sendfile) { |
| 169 | 169 | session_write_close(); |
| 170 | - header('X-Sendfile: '.$file_path); |
|
| 170 | + header('X-Sendfile: ' . $file_path); |
|
| 171 | 171 | exit(); |
| 172 | 172 | } elseif ($filePointer = @fopen($file_path, 'rb')) { |
| 173 | 173 | session_write_close(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $mainTab->setTitle(_t('SiteTree.TABMAIN', 'Main')); |
| 70 | 70 | |
| 71 | 71 | // human readable title |
| 72 | - $fields->addFieldToTab('Root.Main', new TextField('Title', |
|
| 72 | + $fields->addFieldToTab('Root.Main', new TextField('Title', |
|
| 73 | 73 | 'Human readable title for the advert')); |
| 74 | 74 | |
| 75 | 75 | // a Javascript toggle on this field displays either the adbroker text field, or an image with URL |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // quick tags, faster than the grid editor - these are processed prior to save to create/assign tags |
| 92 | - $fields->addFieldToTab('Root.Main', new TextField('WebsiteLink', |
|
| 92 | + $fields->addFieldToTab('Root.Main', new TextField('WebsiteLink', |
|
| 93 | 93 | 'The URL that will be shown when the advert image is clicked')); |
| 94 | 94 | |
| 95 | - $fields->addFieldToTab('Root.Main', new TextareaField('AdbrokerJavascript', |
|
| 95 | + $fields->addFieldToTab('Root.Main', new TextareaField('AdbrokerJavascript', |
|
| 96 | 96 | 'JavaScript provided by the adbroker')); |
| 97 | 97 | |
| 98 | 98 | $fields->addFieldToTab('Root.Main', $sdf = new DateField('StartDate', 'The date the advert becomes active')); |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | - last edited |
| 131 | 131 | Otherwise the clickthrough will fail |
| 132 | 132 | */ |
| 133 | - $data = $this->ID.'_'.$this->AdvertCategory()->Title.'_'.$this->AdvertLayoutType()->Title.'_'.$this->AdbrokerJavascript; |
|
| 134 | - $data .= '_'.$this->StartDate.'_'.$this->FinishDate.'_'.$this->ClickThroughs.'_advert'; |
|
| 133 | + $data = $this->ID . '_' . $this->AdvertCategory()->Title . '_' . $this->AdvertLayoutType()->Title . '_' . $this->AdbrokerJavascript; |
|
| 134 | + $data .= '_' . $this->StartDate . '_' . $this->FinishDate . '_' . $this->ClickThroughs . '_advert'; |
|
| 135 | 135 | $hashed = hash('sha512', $data); |
| 136 | 136 | //error_log("HASH CREATED:".$hashed); |
| 137 | 137 | return $hashed; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $where = "AdvertLayoutType.Title = '$adverttype'"; |
| 48 | 48 | |
| 49 | 49 | if (isset($advertcategory)) { |
| 50 | - $where .= ' AND Advert.AdvertCategoryID = '.$advertcategoryid; |
|
| 50 | + $where .= ' AND Advert.AdvertCategoryID = ' . $advertcategoryid; |
|
| 51 | 51 | $where .= ' AND (StartDate IS NULL OR !StartDate OR StartDate < NOW()) AND (FinishDate IS NULL OR !FinishDate OR NOW() < FinishDate)'; |
| 52 | 52 | |
| 53 | 53 | if (count(self::$advertsalreadyserved) > 0) { |
@@ -214,15 +214,15 @@ |
||
| 214 | 214 | |
| 215 | 215 | // Normal operation: |
| 216 | 216 | $mimeType = HTTP::getMimeType($file_name); |
| 217 | - header("Content-Type: {$mimeType}; name=\"".addslashes($file_name).'"'); |
|
| 218 | - header('Content-Disposition: attachment; filename='.addslashes($file_name)); |
|
| 217 | + header("Content-Type: {$mimeType}; name=\"" . addslashes($file_name) . '"'); |
|
| 218 | + header('Content-Disposition: attachment; filename=' . addslashes($file_name)); |
|
| 219 | 219 | header('Cache-Control: max-age=1, private'); |
| 220 | 220 | header("Content-Length: {$file_size}"); |
| 221 | 221 | header('Pragma: '); |
| 222 | 222 | |
| 223 | 223 | if (self::$use_x_sendfile) { |
| 224 | 224 | session_write_close(); |
| 225 | - header('X-Sendfile: '.$file_path); |
|
| 225 | + header('X-Sendfile: ' . $file_path); |
|
| 226 | 226 | exit(); |
| 227 | 227 | } elseif ($filePointer = @fopen($file_path, 'rb')) { |
| 228 | 228 | session_write_close(); |