@@ -3,7 +3,6 @@ |
||
3 | 3 | use Ffcms\Core\Helper\Date; |
4 | 4 | use Ffcms\Core\Helper\Type\Any; |
5 | 5 | use Ffcms\Core\Helper\Type\Arr; |
6 | -use Ffcms\Core\Helper\Type\Obj; |
|
7 | 6 | use Ffcms\Core\Helper\Type\Str; |
8 | 7 | use Ffcms\Core\Helper\Url; |
9 | 8 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | // build sitemap from content items via business model |
159 | 159 | $sitemap = new EntityBuildMap($langs); |
160 | 160 | foreach ($profiles->get() as $user) { |
161 | - $sitemap->add('profile/show/' . $user->user_id, $user->updated_at, 'weekly', 0.2); |
|
161 | + $sitemap->add('profile/show/'.$user->user_id, $user->updated_at, 'weekly', 0.2); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | try { |
@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | // get page index and current user object |
43 | - $page = (int)$this->request->query->get('page', 0); |
|
43 | + $page = (int) $this->request->query->get('page', 0); |
|
44 | 44 | $offset = $page * static::NOTIFY_PER_PAGE; |
45 | 45 | $user = App::$User->identity(); |
46 | 46 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | // set user id from ?id= get param if form not sended |
41 | 41 | if (!$model->send()) { |
42 | - $uid = (int)$this->request->query->get('id'); |
|
42 | + $uid = (int) $this->request->query->get('id'); |
|
43 | 43 | if ($uid > 0) { |
44 | 44 | $model->id = $uid; |
45 | 45 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // get blocked users |
58 | 58 | $query = Blacklist::where('user_id', '=', $user->getId()); |
59 | 59 | |
60 | - $page = (int)$this->request->query->get('page'); |
|
60 | + $page = (int) $this->request->query->get('page'); |
|
61 | 61 | $offset = $page * static::BLOCK_PER_PAGE; |
62 | 62 | |
63 | 63 | // build pagination |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | { |
31 | 31 | $records = null; |
32 | 32 | // set current page and offset |
33 | - $page = (int)$this->request->query->get('page', 0); |
|
33 | + $page = (int) $this->request->query->get('page', 0); |
|
34 | 34 | $cfgs = $this->application->configs; |
35 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
35 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
36 | 36 | if ($userPerPage < 1) { |
37 | 37 | $userPerPage = 1; |
38 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | switch ($name) { |
42 | 42 | case 'rating': // rating list, order by rating DESC |
43 | 43 | // check if rating is enabled |
44 | - if ((int)$cfgs['rating'] !== 1) { |
|
44 | + if ((int) $cfgs['rating'] !== 1) { |
|
45 | 45 | throw new NotFoundException(); |
46 | 46 | } |
47 | 47 | $records = (new ProfileRecords())->orderBy('rating', 'DESC'); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if (Str::likeEmpty($value)) { |
51 | 51 | throw new NotFoundException(); |
52 | 52 | } |
53 | - $records = (new ProfileRecords())->where('hobby', 'like', '%' . $value . '%'); |
|
53 | + $records = (new ProfileRecords())->where('hobby', 'like', '%'.$value.'%'); |
|
54 | 54 | break; |
55 | 55 | case 'city': |
56 | 56 | if (Str::likeEmpty($value)) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if ($value === null || !Any::isInt($value)) { |
63 | 63 | throw new NotFoundException(); |
64 | 64 | } |
65 | - $records = (new ProfileRecords())->where('birthday', 'like', $value . '-%'); |
|
65 | + $records = (new ProfileRecords())->where('birthday', 'like', $value.'-%'); |
|
66 | 66 | break; |
67 | 67 | case 'all': |
68 | 68 | $records = (new ProfileRecords())->orderBy('id', 'DESC'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | 'pagination' => $pagination, |
93 | 93 | 'id' => $name, |
94 | 94 | 'add' => $value, |
95 | - 'ratingOn' => (int)$cfgs['rating'] |
|
95 | + 'ratingOn' => (int) $cfgs['rating'] |
|
96 | 96 | ]); |
97 | 97 | } |
98 | 98 | } |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | // check if request is sended |
41 | 41 | if ($model->send() && $model->validate()) { |
42 | 42 | // get records from db |
43 | - $records = ProfileRecords::where('nick', 'like', '%' . $model->query . '%'); |
|
44 | - $page = (int)$this->request->query->get('page'); |
|
45 | - $userPerPage = (int)$cfgs['usersOnPage']; |
|
43 | + $records = ProfileRecords::where('nick', 'like', '%'.$model->query.'%'); |
|
44 | + $page = (int) $this->request->query->get('page'); |
|
45 | + $userPerPage = (int) $cfgs['usersOnPage']; |
|
46 | 46 | if ($userPerPage < 1) { |
47 | 47 | $userPerPage = 1; |
48 | 48 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'model' => $model, |
67 | 67 | 'records' => $records, |
68 | 68 | 'pagination' => $pagination, |
69 | - 'ratingOn' => (int)$cfgs['rating'] |
|
69 | + 'ratingOn' => (int) $cfgs['rating'] |
|
70 | 70 | ]); |
71 | 71 | } |
72 | 72 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function show($userId) |
33 | 33 | { |
34 | 34 | $cfg = $this->application->configs; |
35 | - if (!(bool)$cfg['guestView'] && !App::$User->isAuth()) { |
|
35 | + if (!(bool) $cfg['guestView'] && !App::$User->isAuth()) { |
|
36 | 36 | throw new ForbiddenException(__('You must login to view other profile')); |
37 | 37 | } |
38 | 38 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | App::$Session->getFlashBag()->add('error', __('This user are in your black list or you are in blacklist!')); |
56 | 56 | } else { |
57 | 57 | // check if message added |
58 | - if ($wallModel->makePost($targetPersone, $viewerPersone, (int)$cfg['delayBetweenPost'])) { |
|
58 | + if ($wallModel->makePost($targetPersone, $viewerPersone, (int) $cfg['delayBetweenPost'])) { |
|
59 | 59 | App::$Session->getFlashBag()->add('success', __('The message was successful posted!')); |
60 | 60 | } else { |
61 | 61 | App::$Session->getFlashBag()->add('warning', __('Posting message was failed! Please, wait few seconds')); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | // pagination and query params |
68 | - $wallPage = (int)$this->request->query->get('page'); |
|
69 | - $wallItems = (int)$cfg['wallPostOnPage']; |
|
68 | + $wallPage = (int) $this->request->query->get('page'); |
|
69 | + $wallItems = (int) $cfg['wallPostOnPage']; |
|
70 | 70 | $wallOffset = $wallPage * $wallItems; |
71 | 71 | |
72 | 72 | // get wall posts by target user_id |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'notify' => App::$Session->getFlashBag()->all(), |
97 | 97 | 'wallRecords' => $wallRecords, |
98 | 98 | 'pagination' => $wallPagination, |
99 | - 'ratingOn' => (int)$cfg['rating'] === 1 |
|
99 | + 'ratingOn' => (int) $cfg['rating'] === 1 |
|
100 | 100 | ]); |
101 | 101 | } |
102 | 102 | } |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // build sitemap items using iteration - 5000 rows per each one |
86 | - $iterations = (int)($contentCount / static::SITEMAP_CONTENT_COUNT_ITERATION); |
|
86 | + $iterations = (int) ($contentCount / static::SITEMAP_CONTENT_COUNT_ITERATION); |
|
87 | 87 | for ($i = 0; $i <= $iterations; $i++) { |
88 | 88 | // check if lifetime is expired for current sitemap index |
89 | - $xmlTime = File::mTime('/upload/sitemap/content.' . $i . '.' . $langs[0] . '.xml'); |
|
89 | + $xmlTime = File::mTime('/upload/sitemap/content.'.$i.'.'.$langs[0].'.xml'); |
|
90 | 90 | $updateDelay = static::SITEMAP_UPDATE_DELAY * 60; |
91 | 91 | $updateDelay += mt_rand(0, 1800); // +- 0-30 rand min for caching update |
92 | 92 | // do not process if cache time is not expired |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $category = $content->getCategory(); |
105 | 105 | $uri = '/content/read/'; |
106 | 106 | if (!Str::likeEmpty($category->path)) { |
107 | - $uri .= $category->path . '/'; |
|
107 | + $uri .= $category->path.'/'; |
|
108 | 108 | } |
109 | 109 | $uri .= $content->path; |
110 | 110 | $sitemap->add($uri, $content->created_at, 'weekly', 0.7); |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | // add categories |
113 | 113 | $categories = ContentCategory::all(); |
114 | 114 | foreach ($categories as $item) { |
115 | - if ((bool)$item->getProperty('showCategory')) { |
|
116 | - $uri = '/content/list/' . $item->path; |
|
115 | + if ((bool) $item->getProperty('showCategory')) { |
|
116 | + $uri = '/content/list/'.$item->path; |
|
117 | 117 | $sitemap->add($uri, date('c'), 'daily', 0.9); |
118 | 118 | } |
119 | 119 | } |
120 | 120 | // save data to xml file |
121 | - $sitemap->save('content.' . $i); |
|
121 | + $sitemap->save('content.'.$i); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->layout = null; |
40 | 40 | |
41 | 41 | // check if rss display allowed for this category |
42 | - if ((int)$model->category['configs']['showRss'] !== 1) { |
|
42 | + if ((int) $model->category['configs']['showRss'] !== 1) { |
|
43 | 43 | throw new ForbiddenException(__('Rss feed is disabled for this category')); |
44 | 44 | } |
45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // set channel data |
54 | 54 | $channel->title($model->category['title']) |
55 | 55 | ->description($model->category['description']) |
56 | - ->url(App::$Alias->baseUrl . '/content/list/' . $model->category['path']) |
|
56 | + ->url(App::$Alias->baseUrl.'/content/list/'.$model->category['path']) |
|
57 | 57 | ->appendTo($feed); |
58 | 58 | |
59 | 59 | // add content data |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | // add title, short text, url |
64 | 64 | $item->title($row['title']) |
65 | 65 | ->description($row['text']) |
66 | - ->url(App::$Alias->baseUrl . $row['uri']); |
|
66 | + ->url(App::$Alias->baseUrl.$row['uri']); |
|
67 | 67 | // add poster |
68 | 68 | if ($row['thumb'] !== null) { |
69 | - $item->enclosure(App::$Alias->scriptUrl . $row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
69 | + $item->enclosure(App::$Alias->scriptUrl.$row['thumb'], $row['thumbSize'], 'image/jpeg'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // append response to channel |