Archived
Beautify, add missing code comments
This commit is contained in:
@@ -460,6 +460,9 @@ function serendipity_checkAutologin($ident, $iv) {
|
|||||||
return $cookie;
|
return $cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a session cookie which can identify a user accross http/https boundaries
|
||||||
|
*/
|
||||||
function serendipity_setAuthorToken() {
|
function serendipity_setAuthorToken() {
|
||||||
$hash = sha1(uniqid(rand(), true));
|
$hash = sha1(uniqid(rand(), true));
|
||||||
serendipity_setCookie('author_token', $hash);
|
serendipity_setCookie('author_token', $hash);
|
||||||
@@ -1950,6 +1953,13 @@ function serendipity_setFormToken($type = 'form') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load available/configured options for a specific theme (through config.inc.php of a template directory)
|
||||||
|
* into an array.
|
||||||
|
*
|
||||||
|
* @param array Referenced variable coming from the config.inc.php file, where the config values will be stored in
|
||||||
|
* @return array Final return array with default values
|
||||||
|
*/
|
||||||
function &serendipity_loadThemeOptions(&$template_config) {
|
function &serendipity_loadThemeOptions(&$template_config) {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
$_template_vars =& serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}options
|
$_template_vars =& serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}options
|
||||||
@@ -1969,6 +1979,13 @@ function &serendipity_loadThemeOptions(&$template_config) {
|
|||||||
return $template_vars;
|
return $template_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a member of a group has permissions to execute a plugin
|
||||||
|
*
|
||||||
|
* @param string Pluginname
|
||||||
|
* @param int ID of the group of which the members should be checked
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
function serendipity_hasPluginPermissions($plugin, $groupid = null) {
|
function serendipity_hasPluginPermissions($plugin, $groupid = null) {
|
||||||
static $forbidden = null;
|
static $forbidden = null;
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|||||||
@@ -952,17 +952,15 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
|
|||||||
$entry['is_cached'] = true;
|
$entry['is_cached'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--JAM: Highlight-span search terms
|
//--JAM: Highlight-span search terms
|
||||||
if ($serendipity['action'] == 'search') {
|
if ($serendipity['action'] == 'search') {
|
||||||
$searchterms = str_replace('"', '', $serendipity['GET']['searchterms']);
|
$searchterms = str_replace('"', '', $serendipity['GET']['searchterms']);
|
||||||
$searchterms = explode($searchterms, ' ');
|
$searchterms = explode($searchterms, ' ');
|
||||||
foreach($searchterms as $searchdx => $searchterm) {
|
foreach($searchterms as $searchdx => $searchterm) {
|
||||||
$searchclass = "foundterm foundterm".$searchdx;
|
$searchclass = "foundterm foundterm".$searchdx;
|
||||||
$entry['body'] = preg_replace('/('.$searchterm.')/mi',
|
$entry['body'] = preg_replace('/('.$searchterm.')/mi', '<span class="'.$searchclass.'">\1</span>', $entry['body']);
|
||||||
'<span class="'.$searchclass.'">\1</span>',
|
}
|
||||||
$entry['body']);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($entry['properties']['ep_cache_extended'])) {
|
if (!empty($entry['properties']['ep_cache_extended'])) {
|
||||||
$entry['extended'] = &$entry['properties']['ep_cache_extended'];
|
$entry['extended'] = &$entry['properties']['ep_cache_extended'];
|
||||||
|
|||||||
Reference in New Issue
Block a user