1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
-
- namespace app\home\controller;
-
- use core\basic\Controller;
- use core\basic\Config;
-
- class ExtLabelController
- {
-
- protected $content;
-
-
- public function run($content)
- {
-
- $this->content = $content;
-
-
- $this->test();
-
-
- $this->citytag();
-
-
- return $this->content;
- }
-
-
- private function test()
- {
- $this->content = str_replace('{pboot:userip}', get_user_ip(), $this->content);
- }
-
-
- private function citytag(){
- $cur_city = cookie('city');
- if( !! $cur_city ){
- $citys = Config::get('citys');
- $city = $citys[$cur_city];
- $this->content = str_replace('{xx}', $city['title'], $this->content);
- $this->content = str_replace('{citylink}', $city['etitle'], $this->content);
- }else{
- $this->content = str_replace('{xx}', '', $this->content);
- $this->content = str_replace('{citylink}', '', $this->content);
- }
- }
-
-
- }
|