Changeset 47
- Timestamp:
- 12/17/05 11:40:24 (3 years ago)
- Files:
-
- trunk/frontend/config/app.yml (modified) (1 diff)
- trunk/frontend/config/filters.yml (modified) (1 diff)
- trunk/frontend/lib/myTagFilter.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/frontend/config/app.yml
r42 r47 8 8 feed: 9 9 max_questions: 10 10 11 .global:12 host_exclude_regex: /^(www|askeet)/trunk/frontend/config/filters.yml
r40 r47 1 1 myTagFilter: 2 2 class: myTagFilter 3 param: 4 active: on 5 host_exclude_regex: /^(www|askeet)/ trunk/frontend/lib/myTagFilter.class.php
r40 r47 29 29 $loaded = true; 30 30 31 // have a tag in hostname? 32 $request = $this->getContext()->getRequest(); 33 $hostname = $request->getHost(); 34 if (!preg_match(APP_HOST_EXCLUDE_REGEX, $hostname) && $pos = strpos($hostname, '.')) 31 if ($this->getParameter('active')) 35 32 { 36 $tag = Tag::normalize(substr($hostname, 0, $pos)); 33 // have a tag in hostname? 34 $request = $this->getContext()->getRequest(); 35 $hostname = $request->getHost(); 36 if (!preg_match($this->getParameter('host_exclude_regex'), $hostname) && $pos = strpos($hostname, '.')) 37 { 38 $tag = Tag::normalize(substr($hostname, 0, $pos)); 37 39 38 // add a request parameter39 define('APP_PERMANENT_TAG', $tag);40 // add a request parameter 41 define('APP_PERMANENT_TAG', $tag); 40 42 41 // add a custom stylesheet 42 $request->setAttribute('app/tag_filter', $tag, 'helper/asset/auto/stylesheet'); 43 // add a custom stylesheet 44 $request->setAttribute('app/tag_filter', $tag, 'helper/asset/auto/stylesheet'); 45 } 43 46 } 44 47 }
