Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27945/include
Modified Files:
Tag: branch-smarty
functions_smarty.inc.php functions_entries.inc.php
Log Message:
* Added entries_header hook for smarty showing headers
* Finetuned smarty plugin hook function
* Fixed entryproperties embeddage of search/fetchEntry
.CVS: ----------------------------------------------------------------------
Index: functions_smarty.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/Attic/functions_smarty.inc.php,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- functions_smarty.inc.php 8 Nov 2004 12:20:03 -0000 1.1.2.2
+++ functions_smarty.inc.php 11 Nov 2004 12:45:21 -0000 1.1.2.3
@@ -16,26 +16,28 @@
function serendipity_smarty_hookPlugin($params, &$smarty) {
global $serendipity;
static $hookable = array('frontend_header',
+ 'entries_header',
'entries_footer',
'frontend_comment');
- if ( !isset($params['hook']) ) {
+ if (!isset($params['hook'])) {
$smarty->trigger_error(__FUNCTION__ .": missing 'hook' parameter");
return;
}
- if ( !in_array($params['hook'], $hookable) ) {
+ if (!in_array($params['hook'], $hookable)) {
$smarty->trigger_error(__FUNCTION__ .": illegal hook '". $params['hook'] ."'");
return;
}
- if ( !isset($params['data']) ) {
+ if (!isset($params['data'])) {
$params['data'] = &$serendipity;
}
- if ( !isset($params['adddata']) ) {
- $params['add'] = null;
+
+ if (!isset($params['addData'])) {
+ $params['addData'] = null;
}
- serendipity_plugin_api::hook_event($params['hook'], $params['data'], $params['add']);
+ serendipity_plugin_api::hook_event($params['hook'], $params['data'], $params['addData']);
}
Index: functions_entries.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/Attic/functions_entries.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- functions_entries.inc.php 9 Nov 2004 19:11:30 -0000 1.1.2.3
+++ functions_entries.inc.php 11 Nov 2004 12:45:21 -0000 1.1.2.4
@@ -293,17 +293,16 @@
global $serendipity;
$cond = array();
- $cond['drafts'] = '';
+ $cond['and'] = '';
if ($fetchDrafts == 'false') {
- $cond['drafts'] = " AND e.isdraft = 'false' AND e.timestamp <= " . time();
+ $cond['and'] = " AND e.isdraft = 'false' AND e.timestamp <= " . time();
}
- $cond['admin'] = '';
if (isset($serendipity['GET']['adminModule']) && $serendipity['GET']['adminModule'] == 'entries' && $serendipity['serendipityUserlevel'] < USERLEVEL_CHIEF) {
- $cond['admin'] = " AND e.authorid = '" . $serendipity['authorid'] . "'";
+ $cond['and'] = " AND e.authorid = '" . $serendipity['authorid'] . "'";
}
- serendipity_plugin_api::hook_event('frontend_fetchentry', $cond);
+ serendipity_plugin_api::hook_event('frontend_fetchentry', $cond, array('noSticky' => true));
$querystring = "SELECT
*,
@@ -313,13 +312,10 @@
{$serendipity['dbPrefix']}entries e
LEFT JOIN {$serendipity['dbPrefix']}authors a
ON e.authorid = a.authorid
- LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep
- ON e.id = ep.entryid
-
+ {$cond['joins']}
WHERE
e.$key LIKE '" . serendipity_db_escape_string($val) . "'
- {$cond['admin']}
- {$cond['drafts']}
+ {$cond['and']}
LIMIT 1";
$ret = serendipity_db_query($querystring, true);
@@ -419,6 +415,7 @@
}
$cond = array();
+ $cond['and'] = " AND isdraft = 'false' AND timestamp <= " . time();
serendipity_plugin_api::hook_event('frontend_fetchentries', $cond);
$querystring = "SELECT $distinct
e.id,
@@ -439,12 +436,9 @@
ON e.authorid = a.authorid
LEFT JOIN {$serendipity['dbPrefix']}entrycat ec
ON e.id = ec.entryid
- LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep
- ON e.id = ep.entryid
+ {$cond['joins']}
WHERE
$find_part
- AND isdraft = 'false'
- AND timestamp <= " . time() . "
{$cond['and']}
$group
ORDER BY timestamp DESC";
|