Kaynağa Gözat

Add to the single pages the post title. Patch by trevi55

pecesama 17 yıl önce
ebeveyn
işleme
24428754b0
2 değiştirilmiş dosya ile 25 ekleme ve 4 silme
  1. 24 3
      index.php
  2. 1 1
      themes/tumblr/template_header.htm

+ 24 - 3
index.php Dosyayı Görüntüle

@@ -54,9 +54,30 @@ $template = new plantillas($conf->template);
54 54
         $gelato_includes .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"".$conf->urlGelato."/admin/css/lightbox.css\" />\n";    
55 55
         $gelato_includes .= "\t<script language=\"javascript\" type=\"text/javascript\" src=\"".$conf->urlGelato."/admin/scripts/jquery.js\"></script>\n";
56 56
         $gelato_includes .= "\t<script language=\"javascript\" type=\"text/javascript\" src=\"".$conf->urlGelato."/admin/scripts/lightbox.js\"></script>";
57
-        
58
-        $input = array("{Gelato_includes}","{Title}", "{Description}", "{URL_Tumble}", "{Template_name}");
59
-        $output = array($gelato_includes, $conf->title, $conf->description, $conf->urlGelato, $conf->template);
57
+		
58
+		$page_title = $conf->title;
59
+		$page_title_divisor = " &raquo; "; // it should be set in configuration
60
+		$page_title_len = 50; // it should be set in configuration
61
+		if ($id_post) {
62
+			$register = $tumble->getPost($id_post);
63
+			$textile = new Textile();
64
+			if (empty($register["title"])) {
65
+				if (!empty($register["description"])) {
66
+					if (strlen($register["description"]) > $page_title_len) {
67
+						$page_title_data = substr($register["description"], 0, $page_title_len)."...";
68
+					}
69
+				}
70
+			} else {
71
+				$page_title_data = $register["title"];
72
+			}
73
+			$page_title_data = strip_tags($textile->TextileThis($page_title_data));
74
+			if (!empty($page_title_data)) {				
75
+				$page_title .= $page_title_divisor.stripslashes($page_title_data);
76
+			}
77
+		}
78
+	
79
+		$input = array("{Gelato_includes}","{Title}", "{Page_Title}", "{Description}", "{URL_Tumble}", "{Template_name}");
80
+		$output = array($gelato_includes, $conf->title, $page_title, $conf->description, $conf->urlGelato, $conf->template);
60 81
         
61 82
         $template->cargarPlantilla($input, $output, "template_header");
62 83
         $template->mostrarPlantilla();

+ 1 - 1
themes/tumblr/template_header.htm Dosyayı Görüntüle

@@ -3,7 +3,7 @@
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 <head>	
5 5
 	{Gelato_includes}	
6
-    <title>{Title}</title>
6
+    <title>{Page_Title}</title>
7 7
     <!--[if IE]>
8 8
         <style type="text/css">
9 9
             div.post div.quote span.quote big.quote {