~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
<?php
/**
 * Demo file displaying a summary of the last posts in each blog
 *
 * 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
 */

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

/**
 * Initialize Quam Plures
 *
 * Not _blog_main.inc.php because we are not trying to initialize any particular blog
 */
require_once $inc_path.'_main.inc.php';

load_funcs( 'templates/_template.funcs.php' );

// --------------------- 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() )
{
	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 echo T_('Summary Demo'); ?></title>
	<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_('Summary Demo') ?></h1>
	</div>

	</div>

	<div class="pageSubTitle">
	<?php echo T_('This demo template displays a summary of last posts in all blogs') ?>
	</div>

	<div class="main">
	<?php
	load_class('items/model/_itemlist.class.php');
	$BlogCache = & get_Cache( 'BlogCache' );
	$blog_array = $BlogCache->load_public( 'ID' );
	// loop through all public blogs
	foreach( $blog_array as $blog )
	{
		# by uncommenting the following lines you can hide some blogs
		// if( $blog == 2 ) continue; // hides blog 2...

		$l_Blog = & $BlogCache->get_by_ID( $blog );
		?>
		<h3><a href="<?php echo $l_Blog->gen_blogurl(); ?>" title="<?php $l_Blog->disp( 'shortdesc', 'htmlattr' ); ?>"><?php $l_Blog->disp( 'name', 'htmlattr' ); ?></a></h3>
		<ul>
		<?php
		// get the 3 last posts for each blog
		$BlogBList = new ItemList2( $l_Blog, NULL, 'now', 3 );
		$BlogBList->set_filters( array(
			'order' => 'DESC',
			'unit' => 'posts',
		) );
		$BlogBList->query();

		while( $Item = & $BlogBList->get_item() )
		{
			?>
			<li lang="<?php $Item->lang() ?>">
			<?php
			// display issue date/time of item
			$Item->issue_date( array(
				'before' => ' ',
			) );

			// display and link item title
			$Item->title( array(
				'link_type' => 'permalink',
			) );
			?>
			<span class="small">[<?php $Item->lang() ?>]</span>
			</li>
			<?php
		}
		?>
		<li><a href="<?php echo $l_Blog->gen_blogurl(); ?>"><?php echo T_('More posts...') ?></a></li>
		</ul>
		<?php
	}
	?>
	</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 ?>