]> git.mjollnir.org Git - s9y.git/commitdiff
Add un-escaped {$entry.html_title} variable
authorgarvinhicking <garvinhicking>
Tue, 11 Jul 2006 18:55:38 +0000 (18:55 +0000)
committergarvinhicking <garvinhicking>
Tue, 11 Jul 2006 18:55:38 +0000 (18:55 +0000)
docs/NEWS
include/functions_entries.inc.php
include/functions_permalinks.inc.php

index c41e81504908140b50576ef39a8b9d8df0de0564..0b377951237aa99642f17d760e0d0471ad275c42 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 1.1-alpha7()
 ------------------------------------------------------------------------
 
+    * Templating: Add new {$entry.html_title} variable that holds
+      unescaped HTML code of the Entry's title (garvinhicking)
+
     * BC-Break / Plugin API change: The serendipity_getTemplate() file
       now no longer returns FALSE when a file is not found, but instead
       the filename without a path. This is required so that the smarty-
index 3070f98c4c30c3bd62ab7798478f840cac03d55c..148a73d97db3fe6890d89d4783ea6c880388dd10 100644 (file)
@@ -934,6 +934,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
 
             $entry['link']      = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
             $entry['commURL']   = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL', false, array('timestamp' => $entry['timestamp']));
+            $entry['html_title']= $entry['title'];
             $entry['title']     = htmlspecialchars($entry['title']);
 
             $entry['title_rdf']          = preg_replace('@-{2,}@', '-', $entry['title']);
@@ -1442,7 +1443,7 @@ function serendipity_printArchives() {
             $output[$y]['months'][] = $data;
         }
     }
-    
+
     $serendipity['smarty']->assign_by_ref('archives', $output);
     $serendipity['smarty']->assign_by_ref('max_entries', $max);
 
index 560782799c1909dc002aadaf94c44899fb540349..d28c622a8c4c99247a03cfecd1d6b48b810a43cc 100644 (file)
@@ -136,7 +136,7 @@ function serendipity_makeFilename($str, $stripDots = false) {
 
     // Remove excess separators
     $str = trim($str, $to[0]);
-    
+
     if (empty($str)) {
         if (isset($GLOBALS['i18n_unknown'])) {
             $str = $GLOBALS['i18n_unknown'];
@@ -160,67 +160,67 @@ function serendipity_initPermalinks() {
     if (!isset($serendipity['permalinkStructure'])) {
         $serendipity['permalinkStructure'] = 'archives/%id%-%title%.html';
     }
-    
+
     if (!isset($serendipity['permalinkFeedAuthorStructure'])) {
         $serendipity['permalinkFeedAuthorStructure'] = 'feeds/authors/%id%-%realname%.rss';
     }
-    
+
     if (!isset($serendipity['permalinkFeedCategoryStructure'])) {
         $serendipity['permalinkFeedCategoryStructure'] = 'feeds/categories/%id%-%name%.rss';
     }
-    
+
     if (!isset($serendipity['permalinkCategoryStructure'])) {
         $serendipity['permalinkCategoryStructure'] = 'categories/%id%-%name%';
     }
-    
+
     if (!isset($serendipity['permalinkAuthorStructure'])) {
         $serendipity['permalinkAuthorStructure'] = 'authors/%id%-%realname%';
     }
-    
+
     if (!isset($serendipity['permalinkArchivesPath'])) {
         $serendipity['permalinkArchivesPath'] = 'archives';
     }
-    
+
     if (!isset($serendipity['permalinkArchivePath'])) {
         $serendipity['permalinkArchivePath'] = 'archive';
     }
-    
+
     if (!isset($serendipity['permalinkCategoriesPath'])) {
         $serendipity['permalinkCategoriesPath'] = 'categories';
     }
-    
+
     if (!isset($serendipity['permalinkAuthorsPath'])) {
         $serendipity['permalinkAuthorsPath'] = 'authors';
     }
-    
+
     if (!isset($serendipity['permalinkUnsubscribePath'])) {
         $serendipity['permalinkUnsubscribePath'] = 'unsubscribe';
     }
-    
+
     if (!isset($serendipity['permalinkDeletePath'])) {
         $serendipity['permalinkDeletePath'] = 'delete';
     }
-    
+
     if (!isset($serendipity['permalinkApprovePath'])) {
         $serendipity['permalinkApprovePath'] = 'approve';
     }
-    
+
     if (!isset($serendipity['permalinkFeedsPath'])) {
         $serendipity['permalinkFeedsPath'] = 'feeds';
     }
-    
+
     if (!isset($serendipity['permalinkPluginPath'])) {
         $serendipity['permalinkPluginPath'] = 'plugin';
     }
-    
+
     if (!isset($serendipity['permalinkAdminPath'])) {
         $serendipity['permalinkAdminPath'] = 'admin';
     }
-    
+
     if (!isset($serendipity['permalinkSearchPath'])) {
         $serendipity['permalinkSearchPath'] = 'search';
     }
-    
+
     /* URI paths
      * These could be defined in the language headers, except that would break
      * backwards URL compatibility
@@ -235,7 +235,7 @@ function serendipity_initPermalinks() {
     @define('PATH_PLUGIN',      $serendipity['permalinkPluginPath']);
     @define('PATH_ADMIN',       $serendipity['permalinkAdminPath']);
     @define('PATH_SEARCH',      $serendipity['permalinkSearchPath']);
-    
+
     /* URI patterns
      * Note that it's important to use @ as the pattern delimiter. DO NOT use shortcuts
      * like \d or \s, since mod_rewrite will use the regexps as well and chokes on them.
@@ -259,7 +259,7 @@ function serendipity_initPermalinks() {
  */
 function &serendipity_permalinkPatterns($return = false) {
     global $serendipity;
-    
+
     $PAT = array();
 
     $PAT['UNSUBSCRIBE']              = '@/'  . $serendipity['permalinkUnsubscribePath'].'/(.*)/([0-9]+)@';
@@ -323,7 +323,7 @@ function serendipity_searchPermalink($struct, $url, $default, $type = 'entry') {
         if (is_array($permalink)) {
             return $permalink['entry_id'];
         }
-    }    
+    }
 
     return $default;
 }
@@ -354,12 +354,12 @@ function serendipity_getPermalink(&$data, $type = 'entry') {
         case 'category':
             return serendipity_categoryURL($data, '', false);
             break;
-            
+
         case 'author':
             return serendipity_authorURL($data, '', false);
             break;
     }
-    
+
     return false;
 }
 
@@ -404,16 +404,16 @@ function serendipity_insertPermalink(&$data, $type = 'entry') {
         case 'entry':
             $idfield = 'id';
             break;
-            
+
         case 'author':
             $idfield = 'authorid';
             break;
-            
+
         case 'category':
             $idfield = 'categoryid';
             break;
     }
-    
+
     return(serendipity_db_query(sprintf("INSERT INTO {$serendipity['dbPrefix']}permalinks
                                                     (permalink, entry_id, type)
                                              VALUES ('%s', '%s', '%s')",
@@ -503,9 +503,9 @@ function serendipity_makePermalink($format, $data, $type = 'entry') {
                     $data['entry']['timestamp'] = time();
                 }
             }
-        
+
             $ts = serendipity_serverOffsetHour($data['entry']['timestamp']);
-        
+
             $replacements =
                 array(
                     (int)$data['id'],
@@ -516,7 +516,7 @@ function serendipity_makePermalink($format, $data, $type = 'entry') {
                 );
             return str_replace($entryKeys, $replacements, $format);
             break;
-            
+
         case 'author':
             $replacements =
                 array(
@@ -527,7 +527,7 @@ function serendipity_makePermalink($format, $data, $type = 'entry') {
                 );
             return str_replace($authorKeys, $replacements, $format);
             break;
-            
+
         case 'category':
             $replacements =
                 array(