-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_item_block.inc.php
233 lines (209 loc) · 7.47 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?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
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $Item, $Skin, $app_version;
// Default params:
$params = array_merge( array(
'disp_title' => true,
'feature_block' => false,
'content_mode' => 'auto', // 'auto' will auto select depending on $disp-detail
'item_class' => 'evo_post',
'item_type_class' => 'evo_post__ptyp_',
'item_status_class' => 'evo_post__',
'item_disp_class' => NULL,
'image_class' => 'img-responsive',
'image_size' => 'fit-1280x720',
'author_link_text' => 'preferredname',
), $params );
echo '<div id="styled_content_block">'; // Beginning of post display
?>
<div id="<?php $Item->anchor_id() ?>" class="post <?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>">
<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
if( $params['disp_title'] && $disp != 'single' && $disp != 'page' )
{ // Don't display this on disp=single because there is already title header in h2
$title_before = '<h2 class="title">';
$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 class="title">';
$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' => 'permalink'
) );
}
?>
<?php
if( ! $Item->is_intro() )
{ // Don't display these data for intro posts
?>
<div class="small text-muted color-hover">
<?php
if( $Item->status != 'published' )
{
$Item->status( array( 'format' => 'styled' ) );
}
// Permalink:
$Item->permanent_link( array(
'before' => '<span>',
'after' => '</span>',
'text' => '#icon#',
) );
// We want to display the post time:
$Item->issue_time( array(
'before' => '<span class="time"><i class="fa fa-clock-o"></i>',
'after' => '</span>',
'time_format' => 'M j, Y',
) );
// Author
$Item->author( array(
'before' => '<span class="author"><i class="fa fa-user"></i>',
'after' => '</span>',
'link_text' => $params['author_link_text'],
) );
// Categories
$Item->categories( array(
'before' => '<span class="category"><i class="fa fa-archive"></i> ',
'after' => '</span>',
'include_main' => true,
'include_other' => true,
'include_external'=> true,
'link_categories' => true,
) );
// Link for editing
$Item->edit_link( array(
'before' => '<span class="edit"><i class="fa fa-pencil"></i> ',
'after' => '</span>',
'text' => 'Edit',
) );
?>
</div>
<?php
}
?>
<?php
if( $disp == 'single' )
{
?>
<div class="evo_container evo_container__item_single">
<?php
// ------------------------- "Item Single" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( /* TRANS: Widget container name */ NT_('Item Single'), array(
'widget_context' => 'item', // Signal that we are displaying within an Item
// The following (optional) params will be used as defaults for widgets included in this container:
// This will enclose each widget in a block:
'block_start' => '<div class="$wi_class$">',
'block_end' => '</div>',
// This will enclose the title of each widget:
'block_title_start' => '<h3>',
'block_title_end' => '</h3>',
// Template params for "Item Tags" widget
'widget_item_tags_before' => '<div class="small">'.T_('Tags').': ',
'widget_item_tags_after' => '</div>',
// Params for skin file "_item_content.inc.php"
'widget_item_content_params' => $params,
) );
// ----------------------------- END OF "Item Single" CONTAINER -----------------------------
?>
</div>
<?php
}
else
{
// this will create a <section>
// ---------------------- 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 -------------------------
// this will end a </section>
if( ! $Item->is_intro() )
{ // Don't display these data for intro posts
// List all tags attached to this post:
$Item->tags( array(
'before' => '<div class="small">'.T_('Tags').': ',
'after' => '</div>',
'separator' => ', ',
) );
}
?>
<div class="small color-hover">
<?php
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'comments',
'link_before' => '<span><i class="fa fa-comments-o"></i>',
'link_after' => '</span>',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
) );
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'trackbacks',
'link_before' => '<span>',
'link_after' => '</span>',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
) );
?>
</div>
<?php } ?>
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array_merge( array(
'before_section_title' => '<div class="clearfix"></div><h2 class="comments_title">',
'after_section_title' => '</h2>',
'author_link_text' => $params['author_link_text'],
), $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 ?>