-
Notifications
You must be signed in to change notification settings - Fork 0
/
_item_block.inc.php
executable file
·208 lines (187 loc) · 6.48 KB
/
_item_block.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?php
/**
* This is the template that displays the item block
*
* This file is not meant to be called directly.
* It is meant to be called by an include in the main.page.php template (or other templates)
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/gnu-gpl-license}
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
*
* @package evoskins
* @subpackage bootstrap
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $Item, $Skin, $app_version;
// Default params:
$params = array_merge( array(
'feature_block' => false,
'content_mode' => 'auto', // 'auto' will auto select depending on $disp-detail
// Classes for the <article> tag:
'item_class' => 'bPost evo_post evo_content_block',
'item_type_class' => 'evo_post__ptyp_',
'item_status_class' => 'evo_post__',
'image_class' => 'img-responsive',
'image_size' => 'fit-1280x720',
'author_link_text' => 'preferredname',
), $params );
echo '<div class="styled_content_block">'; // Beginning of post display
?>
<div id="<?php $Item->anchor_id() ?>" class="<?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>">
<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
if( $disp != 'single' && $disp != 'page' )
{ // Don't display this on disp=single because there is already title header in h2
$title_before = '<h2>';
$title_after = '</h2>';
if( $Item->is_intro() )
{ // Display a link to edit the post only for intro post, because for all other posts it is displayed below under title
$title_before = '<div class="post_title"><h2>';
$title_after = '</h2>'.$Item->get_edit_link( array(
'before' => '<div class="'.button_class( 'group' ).'">',
'after' => '</div>',
'text' => $Item->is_intro() ? get_icon( 'edit' ).' '.T_('Edit Intro') : '#',
'class' => button_class( 'text' ),
) ).'</div>';
}
$Item->title( array(
'before' => $title_before,
'after' => $title_after,
'link_type' => '#'
) );
}
?>
<?php
if( ! $Item->is_intro() )
{ // Don't display these data for intro posts
?>
<div class="small text-muted">
<?php
if( $Item->status != 'published' )
{
$Item->status( array( 'format' => 'styled' ) );
}
// Permalink:
$Item->permanent_link( array(
'text' => '',
) );
// We want to display the post time:
$Item->issue_time( array(
'before' => ' '.T_('posted on').' ',
'after' => ' ',
'time_format' => 'M j, Y',
) );
// Author
$Item->author( array(
'before' => ' '.T_('| by').' ',
'after' => ' ',
'link_text' => $params['author_link_text'],
) );
// Categories
$Item->categories( array(
'before' => T_('in').' ',
'after' => ' ',
'include_main' => true,
'include_other' => true,
'include_external'=> true,
'link_categories' => true,
) );
// Link for editing
$Item->edit_link( array(
// 'before' => ' • ',
'before' => ' | ',
'after' => '',
) );
?>
</div>
<?php
}
?>
<?php
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', $params );
// Note: You can customize the default item content by copying the generic
// /skins/_item_content.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
?>
<?php
if( ! $Item->is_intro() )
{
// List all tags attached to this post:
$Item->tags( array(
'before' => '<div class="small tag_content">'.T_('Tags').': ',
'after' => '</div>',
'separator' => ', ',
) );
}
?>
<div class="small comment_content">
<?php
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'comments',
'link_before' => '',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
) );
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'trackbacks',
'link_before' => ' • ',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
) );
?>
</div>
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array_merge( array(
'before_section_title' => '<div class="clearfix"></div><h4>',
'after_section_title' => '</h4>',
'author_link_text' => $params['author_link_text'],
'pagination' => array(
'block_start' => '<div class="center"><ul class="pagination">',
'block_end' => '</ul></div>',
'page_current_template' => '<span>$page_num$</span>',
'page_item_before' => '<li>',
'page_item_after' => '</li>',
'page_item_current_before' => '<li class="active">',
'page_item_current_after' => '</li>',
'prev_text' => '<i class="fa fa-angle-double-left"></i>',
'next_text' => '<i class="fa fa-angle-double-right"></i>',),
), $params ) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------
?>
<?php
if( evo_version_compare( $app_version, '6.7' ) >= 0 )
{ // We are running at least b2evo 6.7, so we can include this file:
// ------------------ WORKFLOW PROPERTIES INCLUDED HERE ------------------
skin_include( '_item_workflow.inc.php' );
// ---------------------- END OF WORKFLOW PROPERTIES ---------------------
}
?>
<?php
if( evo_version_compare( $app_version, '6.7' ) >= 0 )
{ // We are running at least b2evo 6.7, so we can include this file:
// ------------------ META COMMENTS INCLUDED HERE ------------------
skin_include( '_item_meta_comments.inc.php', array(
'comment_start' => '<article class="evo_comment evo_comment__meta panel panel-default">',
'comment_end' => '</article>',
) );
// ---------------------- END OF META COMMENTS ---------------------
}
?>
<?php
locale_restore_previous(); // Restore previous locale (Blog locale)
?>
</div>
<?php echo '</div>'; // End of post display ?>