Changeset 729
- Timestamp:
- 12/23/07 12:26:17 (13 months ago)
- Files:
-
- 1 modified
-
trunk/common/mvblog.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/mvblog.php
r727 r729 194 194 public function get_articles($start, $limit, $archive=0, $dossier=0) { 195 195 // FB: 20070304: Check key and set a default if not set. 196 if (array_key_exists("top", $_REQUEST)) {196 if (array_key_exists("top", $_REQUEST)) 197 197 $top = $_REQUEST["top"]; 198 } 199 if (!isset($top) || empty($top)) {198 199 if (!isset($top) || empty($top)) 200 200 $top = 1; 201 } 201 202 //article url base 203 if ($this->settings["cleanurl"]) 204 $link = "post/%d#READMORE"; 205 else 206 $link = "index.php?action=view&id=%d#READMORE"; 207 208 //category url base 209 if ($this->settings["cleanurl"]) 210 $catlink = "category/%d"; 211 else 212 $catlink = "index.php?action=archive_cat&c=%d"; 202 213 203 214 $start = $top-1; … … 234 245 <?php if ($row["aside"] !=1) { ?> 235 246 <div class="log_post_head"> 236 <?php 237 if ($this->settings["cleanurl"]) 238 $link = "post/".$row["id"]."#READMORE"; 239 else 240 $link = "index.php?action=view&id=".$row["id"]."#READMORE"; 241 ?> 242 <h1 class="log_post_h1"><a href="<?php echo $link; ?>"><?php echo htmlspecialchars(stripslashes($row["title"])); ?></a></h1> 247 <h1 class="log_post_h1"><a href="<?php echo sprintf($link, $row["id"]); ?>"><?php echo htmlspecialchars(stripslashes($row["title"])); ?></a></h1> 243 248 <h2 class="log_post_h2"><?php echo gettext("category"); ?>: 244 249 <?php … … 246 251 foreach ($categories as $v) { 247 252 if (array_key_exists($v, $this->categories) && $this->categories[$v]["icon"] && $this->settings["show_cat_icons"]) 248 echo "< img src=\"images/categories/".$this->categories[$v]["icon"]."\" title=\"".htmlspecialchars($this->categories[$v]["name"])."\" alt=\"".htmlspecialchars($this->categories[$v]["name"])."\" class=\"category_icon\" /> ";253 echo "<a href=\"".sprintf($catlink, $v)."\"><img src=\"images/categories/".$this->categories[$v]["icon"]."\" title=\"".htmlspecialchars($this->categories[$v]["name"])."\" alt=\"".htmlspecialchars($this->categories[$v]["name"])."\" class=\"category_icon\" /></a> "; 249 254 elseif (array_key_exists($v, $this->categories)) 250 echo htmlspecialchars($this->categories[$v]["name"])." ";255 echo "<a href=\"".sprintf($catlink, $v)."\">".htmlspecialchars($this->categories[$v]["name"])."</a> "; 251 256 } 252 257 ?> … … 363 368 */ 364 369 public function show_article($id, $captcha_error = 0) { 370 //category url base 371 if ($this->settings["cleanurl"]) 372 $catlink = "category/%d"; 373 else 374 $catlink = "index.php?action=archive_cat&c=%d"; 375 365 376 if ($id == "httperror") { 366 377 $row = array( … … 377 388 $errormode = 1; 378 389 } else { 390 379 391 $res =& $this->db->query(sprintf("SELECT * FROM articles WHERE id = %d", $id)); 380 392 … … 404 416 $categories = explode(",", $row["categories_ids"]); 405 417 foreach ($categories as $v) { 406 if (array_key_exists($v, $this->categories)) 407 echo htmlspecialchars($this->categories[$v]["name"])." "; 418 if (array_key_exists($v, $this->categories) && $this->categories[$v]["icon"] && $this->settings["show_cat_icons"]) 419 echo "<a href=\"".sprintf($catlink, $v)."\"><img src=\"images/categories/".$this->categories[$v]["icon"]."\" title=\"".htmlspecialchars($this->categories[$v]["name"])."\" alt=\"".htmlspecialchars($this->categories[$v]["name"])."\" class=\"category_icon\" /></a> "; 420 elseif (array_key_exists($v, $this->categories)) 421 echo "<a href=\"".sprintf($catlink, $v)."\">".htmlspecialchars($this->categories[$v]["name"])."</a> "; 408 422 } 409 423 ?>
