vbracco 16 лет назад
Родитель
Сommit
3471ee1993
2 измененных файлов с 12 добавлено и 5 удалено
  1. 9 1
      classes/gelato.class.php
  2. 3 4
      index.php

+ 9 - 1
classes/gelato.class.php Просмотреть файл

@@ -191,6 +191,14 @@ class gelato extends Conexion_Mysql {
191 191
 		} else {
192 192
 			return "This URL is not an MP3 file.";
193 193
 		}		
194
-	}	
194
+	}
195
+
196
+	function getPermalink($post_id){
197
+		$strEnd = ($this->conf->urlFriendly) ? "/" : "";
198
+		$out = $this->conf->urlGelato;
199
+		$out .= ($this->conf->urlFriendly) ? "/post/" : "/index.php?post=";
200
+		$out .= $post_id.$strEnd;
201
+		return $out;
202
+	}
195 203
 } 
196 204
 ?>

+ 3 - 4
index.php Просмотреть файл

@@ -107,8 +107,8 @@ $theme = new themes;
107 107
                         while($register = mysql_fetch_assoc($rs)) {
108 108
 								$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
109 109
                                 if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
110
-								$strEnd=($conf->urlFriendly) ? "/" : "";
111
-								$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
110
+								
111
+								$permalink = $tumble->getPermalink($register["id_post"]);
112 112
 
113 113
 								$conversation = $register["description"];
114 114
 
@@ -204,8 +204,7 @@ $theme = new themes;
204 204
                 $register = $tumble->getPost($id_post);
205 205
 
206 206
 				$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
207
-				$strEnd=($conf->urlFriendly) ? "/" : "";
208
-				$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
207
+				$permalink = $tumble->getPermalink($register["id_post"]);
209 208
 
210 209
 				$conversation = $register["description"];
211 210