~edb/quam-plures/item_show_attachments

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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<?php
/**
 * Demo file displaying multiple blogs on the same page
 *
 * Note: This is a very advanced use of Quam Plures! Most of the time, calling
 * your blog through index.php (or a stub file) with a template will be enough.
 * You should try to customize a template before trying to use this file.
 *
 * Quam Plures - {@link http://quamplures.net/}
 * Released under GNU GPL License - {@link http://quamplures.net/license.html}
 * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
 * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * @package templates
 * @subpackage oddballs
 */

// select which blog you want to display here
$blog = 1;
// force it to ignore the blog's designated template
$template = '';
// restrict posts to those published, thus hiding drafts.
$show_statuses = array();
// set a limit before which posts will be ignored
$timestamp_min = '';
// set a limit after which posts will be ignored
$timestamp_max = 'now';

# Tell Quam Plures not to redirect.
# This is necessary only if "301" for homepage is checked and the blog URL is
# set to something else than this page -- which is the case on demo installs.
# For production systems, properly set the blog URL then remove the line below:
$redir = 'no';

/**
 * Load Quam Plures configuration
 */
require_once dirname(__FILE__).'/qp_config/_config.php';

/**
 * Initialize Quam Plures
 *
 * Loads the blog identified by $blog with other params above
 */
require_once $inc_path.'_blog_main.inc.php';

// Make sure includes will check in the current folder!
$ads_current_template_path = dirname(__FILE__).'/';

// --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
// This is totally optional. General caching must be enabled
// in Global settings, otherwise this will do nothing.
load_class( '_core/model/_pagecache.class.php' );
$PageCache = new PageCache( NULL );

// Check for cached content & Start caching if needed:
if( ! $PageCache->check() )
{
	template_init( $disp ); // do $disp-based initializations...
	add_js_for_toolbar(); // registers javascripts for the navbar
	header_content_type( 'text/html' ); // sets charset
	?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang(); ?>" lang="<?php locale_lang(); ?>">
	<head>
	<?php
	// spark the plugin manager
	$Plugins->trigger_event( 'TemplateBeginHtmlHead' );
	?>
	<title><?php // title for the current request
	request_title( array(
		'auto_pilot' => 'seo_title'
	) ); ?></title>
	<?php
	template_content_meta(); // Content-Type meta tag
	template_base_tag(); // for css and img includes
	template_description_tag(); // description meta tag
	template_keywords_tag(); // keywords meta tag
	robots_tag(); // robots meta tag
	meta_generator_tag(); // for QP's stats
	if( $Blog->get_setting( 'feed_content' ) != 'none' )
	{
		template_feed_tags();
	}
	?>
	<link rel="EditURI" type="application/rsd+xml" title="RSD" href="<?php echo $srvc_url; ?>rsd.php?blog=<?php echo $Blog->ID; ?>" />
	<meta name="viewport" content="width = 750" />
	<link rel="stylesheet" href="qp_rsc/css/standalone.css" type="text/css" />
	<?php
	include_headlines(); // output collected <head> lines
	?>
	</head>

	<body>
	<?php
	// spark the plugin manager
	$Plugins->trigger_event( 'TemplateBeginHtmlBody' );

	// --- --- --- --- --- --- --- --- --- --- ---
	// --- TOOLBAR INCLUDED HERE ---
	template_include( '_toolbar.inc.php' );

	if( is_logged_in() )
	{
		echo "\n".'<div id="template_wrapper" class="template_wrapper_loggedin">'."\n";
	}
	else
	{
		echo "\n".'<div id="template_wrapper" class="template_wrapper_anonymous">'."\n";
	}
	?>

	<div class="pageHeader">
	<?php
	// display the Public Blog List widget
	template_widget( array(
		'widget' => 'bloglist',
		'block_start' => '<div class="bloglist">',
		'block_end' => '</div>',
		'block_display_title' => false,
		'list_start' => '',
		'list_end' => '',
		'item_start' => '',
		'item_end' => '',
		'item_selected_start' => '',
		'item_selected_end' => '',
		'link_selected_class' => 'buttons',
		'link_default_class' => 'buttons',
	) );
	?>

	<div class="pageTitle">
	<h1 id="pageTitle"><?php echo T_('Multiblog demo') ?></h1>
	</div>

	</div>

	<div class="pageSubTitle">
	<?php echo T_('This demo template displays 3 blogs at once (1 on the left, 2 on the right)') ?>
	</div>

	<div class="main">

	<div class="bPosts">
	<h2>#1: <a href="<?php $Blog->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog->disp( 'name', 'htmlbody' ) ?></a></h2>
	<?php
	// title for the current request
	request_title( array(
		'title_before' => '<h2>',
		'title_after' => '</h2>',
	) );

	// display a message if list is empty
	display_if_empty( array() );

	// loop through as long as we have an Item...
	while( $Item = & mainlist_get_item() )
	{
		// display the date if it changed
		$MainList->date_if_changed( array() );

		// --- --- --- --- --- --- --- --- --- --- ---
		// --- POST CONTENT INCLUDED HERE ---
		template_include( '_item_block.inc.php', array() );
	}

	// prev/next links on multi-post pages
	mainlist_page_links( array(
		'block_start' => '<p class="center"><strong>',
		'block_end' => '</strong></p>',
		'links_format' => '$prev$ :: $next$',
		'prev_text' => '&lt;&lt; '.T_('Previous'),
		'next_text' => T_('Next').' &gt;&gt;',
	) );

	// --- --- --- --- --- --- --- --- --- --- ---
	// --- MAIN CONTENT INCLUDED HERE ---
	template_include( '$disp$', array(
		// these cases already handled by this file
		'disp_posts' => '',
		'disp_single' => '',
		'disp_page' => '',
	) );
	?>
	</div>

	<div class="bSideBar">

	<div class="bSideItem">
	<?php
	$BlogCache = & get_Cache( 'BlogCache' );
	$Blog_B = & $BlogCache->get_by_ID( 2, false );
	if( empty($Blog_B) )
	{
		echo sprintf( T_('Blog #%d doesn\'t seem to exist.'), 2 );
	}
	else
	{
		?>
		<h3>#2: <a href="<?php $Blog_B->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog_B->disp( 'name', 'htmlbody' ) ?></a></h3>
		<?php
		$BlogBList = new ItemList2( $Blog_B, $timestamp_min, $timestamp_max, $posts );
		$BlogBList->set_filters( array(
			'authors' => $author,
			'ymdhms' => $m,
			'week' => $w,
			'order' => $order,
			'orderby' => $orderby,
			'unit' => $unit,
		) );

		// Run the query:
		$BlogBList->query();

		while( $Item = & $BlogBList->get_item() )
		{
			?>
			<div id="<?php $Item->anchor_id(); ?>" class="bPostSide bPostSide<?php $Item->status_raw() ?>" lang="<?php $Item->lang() ?>">
			<h4 class="bTitle"><?php $Item->title( array() ); ?></h4>
			<div class="bText"><?php echo $Item->get_excerpt(); ?></div>
			</div>
			<?php
		}
	}
	?>
	</div>

	<div class="bSideItem">
	<?php
	$Blog_roll = & $BlogCache->get_by_ID( 3, false );
	if( empty($Blog_roll) )
	{
		echo sprintf( T_('Blog #%d doesn\'t seem to exist.'), 3 );
	}
	else
	{
		?>
		<h3>#3: <a href="<?php $Blog_roll->disp( 'blogurl', 'raw' ) ?>"><?php echo $Blog_roll->disp( 'name', 'htmlbody' ) ?></a></h3>
		<?php
		$LinkblogList = new ItemList2( $Blog_roll, $timestamp_min, $timestamp_max, $posts );
		$LinkblogList->set_filters( array(
			'authors' => $author,
			'ymdhms' => $m,
			'week' => $w,
			'order' => $order,
			'orderby' => $orderby,
			'unit' => $unit,
		) );

		// Run the query:
		$LinkblogList->query();

		while( $Item = & $LinkblogList->get_item() )
		{
			?>
			<div id="<?php $Item->anchor_id(); ?>" class="bPostSide bPostSide<?php $Item->status_raw(); ?>" lang="<?php $Item->lang(); ?>">
			<h4 class="bTitle">
			<?php
			// display the item's permalink
			$Item->permanent_link( array(
				'text' => '#icon#',
			) );

			// display and link item title
			$Item->title( array() );
			?></h4>
			<div class="bText">
			<?php
			// display item's teaser
			$Item->content_teaser( array(
				'disppage' => 1,
				'stripteaser' => false,
			) );
			?>
			</div>
			</div>
			<?php
		}
	}
	?>
	</div>

	<div class="bSideItem">
	<h3><?php echo T_('Misc') ?></h3>
	<ul>
	<?php
	// Administrative links:
	user_login_link( '<li>', '</li>' );
	user_register_link( '<li>', '</li>' );
	user_admin_link( '<li>', '</li>' );
	user_profile_link( '<li>', '</li>' );
	user_subs_link( '<li>', '</li>' );
	user_logout_link( '<li>', '</li>' );
	?>
	</ul>
	</div>

	</div>

	</div>

	<div class="footer">
	<?php echo sprintf( T_('This is a demo page for <a href="%s">%s</a>.'), $app_homepage, $app_name ); ?>
	</div>

	</div>
	</body>
	</html>
	<?php
	// save collected cached data (if needed)
	$PageCache->end_collect();
}
$Hit->log(); // log the hit on this page ?>