Browse Source

fixed a bug when no posts.

Victor De la Rocha 16 years ago
parent
commit
f976025030
2 changed files with 118 additions and 115 deletions
  1. 1 1
      index.php
  2. 117 114
      themes/tumblr/index.htm

+ 1 - 1
index.php View File

@@ -200,7 +200,7 @@ $theme = new themes;
200 200
 
201 201
                         $theme->set('pagination',$p->getPagination());
202 202
                 } else {
203
-                        $template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");
203
+                        $theme->set('error','No posts in this tumblelog.');
204 204
                 }
205 205
         } else {
206 206
                 $register = $tumble->getPost($id_post);

+ 117 - 114
themes/tumblr/index.htm View File

@@ -30,133 +30,136 @@
30 30
 			</div>
31 31
 		{/if}
32 32
 
33
-		{block {$rows} as {$row}}
34
-			<div class="date">
35
-				{$row.Date_Added}
36
-			</div>
37
-			{if {$postType}==1}
38
-				<div class="post">
39
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
33
+		{if {$error}}
34
+			<div class="error">{$error}</div>
35
+		{else}
36
+			{block {$rows} as {$row}}
37
+				<div class="date">
38
+					{$row.Date_Added}
39
+				</div>
40
+				{if {$postType}==1}
41
+					<div class="post">
42
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
40 43
 
41
-					<div class="regular">
42
-						<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
43
-						{$row.Body}
44
+						<div class="regular">
45
+							<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
46
+							{$row.Body}
47
+						</div>
44 48
 					</div>
45
-				</div>
46
-			{elseif {$postType}==2}
47
-				<div class="post">
48
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
49
-					<div class="photo">
50
-						<a {$row.Effect}><img src="{$row.PhotoURL}" alt="{$row.PhotoAlt}" /></a><br/>
51
-						<div class="caption">{$row.Caption}</div>
49
+				{elseif {$postType}==2}
50
+					<div class="post">
51
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
52
+						<div class="photo">
53
+							<a {$row.Effect}><img src="{$row.PhotoURL}" alt="{$row.PhotoAlt}" /></a><br/>
54
+							<div class="caption">{$row.Caption}</div>
55
+						</div>
52 56
 					</div>
53
-				</div>
54
-			{elseif {$postType}==3}
55
-				<div class="post">
56
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
57
-					<div class="quote">
58
-						<span class="quote"><big class="quote"><a href="{$row.Permalink}">&#147;</a></big> {$row.Quote}</span>
59
-						<div class="source">&mdash; {$row.Source}</div>
57
+				{elseif {$postType}==3}
58
+					<div class="post">
59
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
60
+						<div class="quote">
61
+							<span class="quote"><big class="quote"><a href="{$row.Permalink}">&#147;</a></big> {$row.Quote}</span>
62
+							<div class="source">&mdash; {$row.Source}</div>
63
+						</div>
60 64
 					</div>
61
-				</div>
62
-			{elseif {$postType}==4}
63
-				<div class="post">
64
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
65
-						<div class="link">
66
-							&#187; <a href="{$row.URL}">{$row.Name}</a>
67
-						<div class="description">{$row.Description}</div>
65
+				{elseif {$postType}==4}
66
+					<div class="post">
67
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
68
+							<div class="link">
69
+								&#187; <a href="{$row.URL}">{$row.Name}</a>
70
+							<div class="description">{$row.Description}</div>
71
+						</div>
68 72
 					</div>
69
-				</div>
70
-			{elseif {$postType}==5}
71
-				<div class="post">
72
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
73
-					<div class="conversation">
74
-							...<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
75
-						{$row.Conversation}
73
+				{elseif {$postType}==5}
74
+					<div class="post">
75
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
76
+						<div class="conversation">
77
+								...<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
78
+							{$row.Conversation}
79
+						</div>
76 80
 					</div>
77
-				</div>
78
-			{elseif {$postType}==6}
79
-				<div class="post">
80
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
81
-					<div class="video">
82
-						{$row.Video}
83
-						<div class="caption">{$row.Caption}</div>
81
+				{elseif {$postType}==6}
82
+					<div class="post">
83
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
84
+						<div class="video">
85
+							{$row.Video}
86
+							<div class="caption">{$row.Caption}</div>
87
+						</div>
84 88
 					</div>
85
-				</div>
86
-			{elseif {$postType}==7}
87
-				<div class="post">
88
-					<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
89
-					<div class="video">
90
-						{$row.Mp3}
91
-						<div class="caption">{$row.Caption}</div>
89
+				{elseif {$postType}==7}
90
+					<div class="post">
91
+						<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
92
+						<div class="video">
93
+							{$row.Mp3}
94
+							<div class="caption">{$row.Caption}</div>
95
+						</div>
92 96
 					</div>
93
-				</div>
94
-			{/if}
97
+				{/if}
95 98
 
96
-		<div class="totalComments">
97
-			<h3>Posted by {$row.User} - <a href="{$row.Permalink}#comments">( {$row.Comments_Number} ) comments</a></h3>
98
-		</div>
99
-	{/block}
99
+			<div class="totalComments">
100
+				<h3>Posted by {$row.User} - <a href="{$row.Permalink}#comments">( {$row.Comments_Number} ) comments</a></h3>
101
+			</div>
102
+		{/block}
100 103
 
101
-	{if {$id_post}}
102
-		<div class="containerComments">
103
-			<h3 id="comments">{$row.Comments_Number} answers to &#8220;{$row.Post_Title}&#8221;</h3>
104
-			<ol class="commentlist">
105
-				{block {$comments} as {$comment}}
106
-				<li class="alt" id="comment-{$comment.Id_Comment}">
107
-					<cite>
108
-						<a href="#comment-{$comment.Id_Comment}" title="Comment permalink">#</a>&nbsp;&nbsp;
109
-						{$comment.Comment_Author} said:
110
-					</cite>
111
-					<br />
112
-					<span class="timestampComment"> at {$comment.Date}</span><br /><br />
113
-					{$comment.Comment}
114
-					<br /><br />
115
-				</li>
116
-				{/block}
117
-			</ol>
118
-		</div>
104
+		{if {$id_post}}
105
+			<div class="containerComments">
106
+				<h3 id="comments">{$row.Comments_Number} answers to &#8220;{$row.Post_Title}&#8221;</h3>
107
+				<ol class="commentlist">
108
+					{block {$comments} as {$comment}}
109
+					<li class="alt" id="comment-{$comment.Id_Comment}">
110
+						<cite>
111
+							<a href="#comment-{$comment.Id_Comment}" title="Comment permalink">#</a>&nbsp;&nbsp;
112
+							{$comment.Comment_Author} said:
113
+						</cite>
114
+						<br />
115
+						<span class="timestampComment"> at {$comment.Date}</span><br /><br />
116
+						{$comment.Comment}
117
+						<br /><br />
118
+					</li>
119
+					{/block}
120
+				</ol>
121
+			</div>
119 122
 
120
-		<div class="containerFormComments">
121
-		<h3 id="respond">Add your comment</h3>
123
+			<div class="containerFormComments">
124
+			<h3 id="respond">Add your comment</h3>
122 125
 
123
-		<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
124
-			<p>
125
-				<label for="username">
126
-					<small>Name:</small>
127
-				</label>
128
-				<input name="username" id="username" value="{whois.User_Cookie}" size="22" tabindex="1" type="text" />
129
-			</p>
130
-			<p>
131
-				<label for="email">
132
-					<small>E-mail:</small>
133
-				</label>
134
-				<input name="email" id="email" value="{whois.Email_Cookie}" size="22" tabindex="2" type="text" />
135
-			</p>
136
-			<p>
137
-				<label for="web">
138
-					<small>Website:</small>
139
-				</label>
140
-				<input name="web" id="web" value="{whois.Web_Cookie}" size="22" tabindex="3" type="text" />
141
-			</p>
142
-			<p>
143
-				<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
144
-			</p>
145
-			<p>
146
-				<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> syntax is supported.</span>
147
-			<p>
148
-				<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
149
-			</p>
150
-			<p>
151
-				<input name="id_post" id="id_post" value="{id_post}" type="hidden" />
152
-				<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
153
-			</p>
154
-		</form>
155
-	</div>
156
-	{else}
157
-		{pagination}
126
+			<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
127
+				<p>
128
+					<label for="username">
129
+						<small>Name:</small>
130
+					</label>
131
+					<input name="username" id="username" value="{whois.User_Cookie}" size="22" tabindex="1" type="text" />
132
+				</p>
133
+				<p>
134
+					<label for="email">
135
+						<small>E-mail:</small>
136
+					</label>
137
+					<input name="email" id="email" value="{whois.Email_Cookie}" size="22" tabindex="2" type="text" />
138
+				</p>
139
+				<p>
140
+					<label for="web">
141
+						<small>Website:</small>
142
+					</label>
143
+					<input name="web" id="web" value="{whois.Web_Cookie}" size="22" tabindex="3" type="text" />
144
+				</p>
145
+				<p>
146
+					<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
147
+				</p>
148
+				<p>
149
+					<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> syntax is supported.</span>
150
+				<p>
151
+					<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
152
+				</p>
153
+				<p>
154
+					<input name="id_post" id="id_post" value="{id_post}" type="hidden" />
155
+					<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
156
+				</p>
157
+			</form>
158
+		</div>
159
+		{else}
160
+			{pagination}
161
+		{/if}
158 162
 	{/if}
159
-
160 163
 	</div>
161 164
 	<div id="footer">
162 165
 		subscribe via <a href="{URL_Tumble}/rss.php">rss</a> &nbsp;/&nbsp;