Selaa lähdekoodia

Correct XML validation / bug fixed on get the username

pecesama 16 vuotta sitten
vanhempi
commit
c7fd8be234
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      api.php

+ 7 - 4
api.php Näytä tiedosto

@@ -22,15 +22,18 @@ if(!defined('entry')) define('entry',true);
22 22
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
23 23
 ?>
24 24
 	<gelato version="1.0">
25
-<?php
26
-	
25
+<?php	
27 26
 	if (isset($_GET["action"]) && $_GET["action"] == "read") {
28 27
 		if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 0; }
29 28
 		if (isset($_GET["total"])) { $total = $_GET["total"]; } else { $total = 20; }
30 29
 		if (isset($_GET["type"])) { $hasType = true; } else { $hasType = false; }
31
-		if ($total > 50) { $total = 50; }		
30
+		if ($total > 50) { $total = 50; }
31
+		$user = new user();
32
+		$userData = $user->getUserByID(1);
33
+		$username = ($userData["name"] == "") ? "gelato" : $userData["name"];
32 34
 ?>		
33
-		<tumblelog name="<?php echo $_SESSION["user_login"];?>" timezone="<?php echo $conf->offsetCity;?>" title="<?php echo $conf->title;?>"><?php 	
35
+		<tumblelog name="<?php echo $username;?>" timezone="<?php echo $conf->offsetCity;?>" title="<?php echo $conf->title;?>">
36
+<?php 	
34 37
 		echo "\n\t".$conf->description."\n";
35 38
 ?>
36 39
 			<feeds>