Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
bc897640
Commit
bc897640
authored
Feb 24, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1003 - Создать раздел и модуль Блог
parent
e446be09
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
19 deletions
+30
-19
common/modules/bids/controllers/BidController.php
common/modules/bids/controllers/BidController.php
+2
-0
common/modules/blog/models/PostLang.php
common/modules/blog/models/PostLang.php
+12
-0
common/modules/blog/views/post/_load.php
common/modules/blog/views/post/_load.php
+4
-10
common/modules/blog/views/post/_social.php
common/modules/blog/views/post/_social.php
+9
-0
common/modules/blog/views/post/view.php
common/modules/blog/views/post/view.php
+3
-9
No files found.
common/modules/bids/controllers/BidController.php
View file @
bc897640
...
...
@@ -47,6 +47,8 @@ class BidController extends \common\components\BaseController
$model->file = null;
}*/
// Yii::$app->user->identity->afterSubscribe(12);
$model
->
save
();
$model
->
send
();
...
...
common/modules/blog/models/PostLang.php
View file @
bc897640
...
...
@@ -82,4 +82,16 @@ class PostLang extends \common\components\ActiveRecordModel
{
return
$this
->
hasOne
(
Languages
::
className
(),
[
'id'
=>
'lang_id'
]);
}
public
function
cutText
(
$chars
)
{
$text
=
strip_tags
(
$this
->
text
,
'<a>'
);
$text
=
$text
.
" "
;
$text
=
substr
(
$text
,
0
,
$chars
);
$text
=
substr
(
$text
,
0
,
strrpos
(
$text
,
' '
));
$text
=
$text
.
"..."
;
return
'<p>'
.
$text
.
'</p>'
;
}
}
common/modules/blog/views/post/_load.php
View file @
bc897640
...
...
@@ -18,15 +18,9 @@ use yii\helpers\Url;
<?=
$model
->
getViews
()
->
count
()
?>
<div
class=
"blog_toltip_left"
>
Количество просмотров
</div>
</span>
<!-- <ul class="article_short_social">
<li>
<a href="#"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a>
</li>
</ul> -->
<?=
$this
->
render
(
'_social'
,
[
'link'
=>
Url
::
to
([
'/blog/'
.
$model
->
url
],
true
),
'title'
=>
$model
->
lang
->
title
])
?>
</div>
<div
class=
"article_short_tags"
>
...
...
@@ -43,7 +37,7 @@ use yii\helpers\Url;
echo
Html
::
img
(
$model
->
preview
);
endif
;
?>
<?=
$model
->
lang
->
text
?>
<?=
$model
->
lang
->
cutText
(
650
)
?>
</div>
</article>
...
...
common/modules/blog/views/post/_social.php
0 → 100644
View file @
bc897640
<ul
class=
"article_short_social"
>
<li>
<a
href=
"#"
onclick=
"return window.open('http://vkontakte.ru/share.php?url=
<?=
$link
?>
&title=
<?=
$title
?>
', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"
><img
src=
"/images/icon/sh_social_vk.png"
height=
"30"
width=
"30"
alt=
""
></a>
<a
href=
"#"
onclick=
"return window.open('http://www.facebook.com/share.php?u=
<?=
$title
?>
', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"
><img
src=
"/images/icon/sh_social_fb.png"
height=
"30"
width=
"30"
alt=
""
></a>
<a
href=
"#"
onclick=
"return window.open('http://twitter.com/timeline/home?status=
<?=
$title
?>
%20
<?=
$link
?>
', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');;"
><img
src=
"/images/icon/sh_social_tw.png"
height=
"30"
width=
"30"
alt=
""
></a>
<a
href=
"#"
onclick=
"return window.open('https://plus.google.com/share?url=
<?=
$link
?>
', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"
><img
src=
"/images/icon/sh_social_gp.png"
height=
"30"
width=
"30"
alt=
""
></a>
<!-- <a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a> -->
</li>
</ul>
\ No newline at end of file
common/modules/blog/views/post/view.php
View file @
bc897640
...
...
@@ -21,15 +21,9 @@ use yii\helpers\Html;
<?=
$model
->
getViews
()
->
count
()
?>
<div
class=
"blog_toltip_left"
>
Количество просмотров
</div>
</span>
<!-- <ul class="article_short_social">
<li>
<a href="#"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a>
</li>
</ul> -->
<?=
$this
->
render
(
'_social'
,
[
'link'
=>
Url
::
to
([
'/blog/'
.
$model
->
url
],
true
),
'title'
=>
$model
->
lang
->
title
])
?>
</div>
<div
class=
"article_short_tags"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment