* Change on themes {$postType} from numbers to type string.
* fixed a bug when commenting is disabled and a other changes on indexmaster
parent
53a6dba3ed
commit
3290ea1a8d
43
index.php
43
index.php
|
|
@ -18,7 +18,7 @@ require_once('entry.php');
|
||||||
global $user, $tumble, $conf;
|
global $user, $tumble, $conf;
|
||||||
|
|
||||||
$theme = new themes;
|
$theme = new themes;
|
||||||
// Our first approach to MVC... ¿our second? visit http://www.flavorphp.com
|
// Our first approach to MVC... <EFBFBD>our second? visit http://www.flavorphp.com
|
||||||
|
|
||||||
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@ $theme = new themes;
|
||||||
}
|
}
|
||||||
|
|
||||||
$theme->set('id_post',$id_post);
|
$theme->set('id_post',$id_post);
|
||||||
$theme->set('error','');
|
$theme->set('error','');
|
||||||
|
|
||||||
if (isset($_GET["page"])) {
|
if (isset($_GET["page"])) {
|
||||||
$page_num = $_GET["page"];
|
$page_num = $_GET["page"];
|
||||||
|
|
@ -61,7 +61,7 @@ $theme = new themes;
|
||||||
$page_title_divisor = " » "; // it should be set in configuration
|
$page_title_divisor = " » "; // it should be set in configuration
|
||||||
$page_title_len = 50; // it should be set in configuration
|
$page_title_len = 50; // it should be set in configuration
|
||||||
if ($id_post) {
|
if ($id_post) {
|
||||||
$register = $tumble->getPost($id_post);
|
$register = $tumble->getPost($id_post);
|
||||||
if (empty($register["title"])) {
|
if (empty($register["title"])) {
|
||||||
if (!empty($register["description"])) {
|
if (!empty($register["description"])) {
|
||||||
$page_title_data = trimString($register["description"], $page_title_len);
|
$page_title_data = trimString($register["description"], $page_title_len);
|
||||||
|
|
@ -70,7 +70,7 @@ $theme = new themes;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$page_title_data = $register["title"];
|
$page_title_data = $register["title"];
|
||||||
}
|
}
|
||||||
if (!empty($page_title_data)) {
|
if (!empty($page_title_data)) {
|
||||||
$page_title .= $page_title_divisor.stripslashes($page_title_data);
|
$page_title .= $page_title_divisor.stripslashes($page_title_data);
|
||||||
}
|
}
|
||||||
|
|
@ -82,6 +82,7 @@ $theme = new themes;
|
||||||
$theme->set('Description',$conf->description);
|
$theme->set('Description',$conf->description);
|
||||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||||
$theme->set('Template_name',$conf->template);
|
$theme->set('Template_name',$conf->template);
|
||||||
|
$theme->set('allowComments',$conf->allowComments);
|
||||||
|
|
||||||
$theme->set('isAuthenticated',$user->isAuthenticated());
|
$theme->set('isAuthenticated',$user->isAuthenticated());
|
||||||
if($user->isAuthenticated()){
|
if($user->isAuthenticated()){
|
||||||
|
|
@ -116,12 +117,11 @@ $theme = new themes;
|
||||||
$register["title"] = stripslashes($register["title"]);
|
$register["title"] = stripslashes($register["title"]);
|
||||||
$register["description"] = stripslashes($register["description"]);
|
$register["description"] = stripslashes($register["description"]);
|
||||||
|
|
||||||
$postType = $tumble->getType($register["id_post"]);
|
|
||||||
|
|
||||||
$row['Date_Added'] = $formatedDate;
|
$row['Date_Added'] = $formatedDate;
|
||||||
$row['Permalink'] = $permalink;
|
$row['Permalink'] = $permalink;
|
||||||
$row['postType'] = $postType;
|
$row['postType'] = type2Text($register["type"]);
|
||||||
switch ($postType){
|
|
||||||
|
switch ($register['type']){
|
||||||
case "1":
|
case "1":
|
||||||
$row['Title'] = $register["title"];
|
$row['Title'] = $register["title"];
|
||||||
$row['Body'] = $register["description"];
|
$row['Body'] = $register["description"];
|
||||||
|
|
@ -216,9 +216,9 @@ $theme = new themes;
|
||||||
|
|
||||||
$row['Date_Added'] = $formatedDate;
|
$row['Date_Added'] = $formatedDate;
|
||||||
$row['Permalink'] = $permalink;
|
$row['Permalink'] = $permalink;
|
||||||
$postType = $tumble->getType($register["id_post"]);
|
$row['postType'] = type2Text($register["type"]);
|
||||||
$row['postType'] = $postType;
|
|
||||||
switch ($postType) {
|
switch ($register['type']) {
|
||||||
case "1":
|
case "1":
|
||||||
$row['Title'] = $register["title"];
|
$row['Title'] = $register["title"];
|
||||||
$row['Body'] = $register["description"];
|
$row['Body'] = $register["description"];
|
||||||
|
|
@ -266,16 +266,11 @@ $theme = new themes;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->allowComments) {
|
|
||||||
|
|
||||||
$comment = new comments();
|
|
||||||
$rsComments = $comment->getComments($register["id_post"]);
|
|
||||||
|
|
||||||
$user = new user();
|
$user = new user();
|
||||||
$username = $user->getUserByID($register["id_user"]);
|
$username = $user->getUserByID($register["id_user"]);
|
||||||
|
|
||||||
$row["User"] = $username["name"];
|
$row["User"] = $username["name"];
|
||||||
|
|
||||||
if (empty($register["title"])) {
|
if (empty($register["title"])) {
|
||||||
if (!empty($register["description"])) {
|
if (!empty($register["description"])) {
|
||||||
$postTitle = trimString($register["description"]);
|
$postTitle = trimString($register["description"]);
|
||||||
|
|
@ -284,14 +279,15 @@ $theme = new themes;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$postTitle = $register["title"];
|
$postTitle = $register["title"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$row["Post_Title"] = $postTitle;
|
$row["Post_Title"] = $postTitle;
|
||||||
$row["Comments_Number"] = $comment->countComments($register["id_post"]);
|
|
||||||
|
|
||||||
$rows[] = $row;
|
$comment = new comments();
|
||||||
$theme->set('rows',$rows);
|
$row["Comments_Number"] = $comment->countComments($register["id_post"]);
|
||||||
|
|
||||||
|
if ($conf->allowComments) {
|
||||||
|
$rsComments = $comment->getComments($register["id_post"]);
|
||||||
$comments = array();
|
$comments = array();
|
||||||
while($rowComment = mysql_fetch_assoc($rsComments)) {
|
while($rowComment = mysql_fetch_assoc($rsComments)) {
|
||||||
$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
|
$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
|
||||||
|
|
@ -314,6 +310,9 @@ $theme = new themes;
|
||||||
$theme->set('Form_Action',$conf->urlGelato."/admin/comments.php");
|
$theme->set('Form_Action',$conf->urlGelato."/admin/comments.php");
|
||||||
$theme->set('whois',$whois);
|
$theme->set('whois',$whois);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rows[] = $row;
|
||||||
|
$theme->set('rows',$rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@
|
||||||
{block {$rows} as {$row}}
|
{block {$rows} as {$row}}
|
||||||
<div class="date">
|
<div class="date">
|
||||||
{$row.Date_Added}
|
{$row.Date_Added}
|
||||||
</div>
|
</div> {$row.postType}
|
||||||
{if {$row.postType}==1}
|
{if {$row.postType}=='regular'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
{$row.Body}
|
{$row.Body}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==2}
|
{elseif {$row.postType}=='photo'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="photo">
|
<div class="photo">
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
<div class="caption">{$row.Caption}</div>
|
<div class="caption">{$row.Caption}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==3}
|
{elseif {$row.postType}=='quote'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="quote">
|
<div class="quote">
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<div class="source">— {$row.Source}</div>
|
<div class="source">— {$row.Source}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==4}
|
{elseif {$row.postType}=='link'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="link">
|
<div class="link">
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
<div class="description">{$row.Description}</div>
|
<div class="description">{$row.Description}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==5}
|
{elseif {$row.postType}=='conversation'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="conversation">
|
<div class="conversation">
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
{$row.Conversation}
|
{$row.Conversation}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==6}
|
{elseif {$row.postType}=='video'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="video">
|
<div class="video">
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
<div class="caption">{$row.Caption}</div>
|
<div class="caption">{$row.Caption}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{elseif {$row.postType}==7}
|
{elseif {$row.postType}=='mp3'}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||||
<div class="video">
|
<div class="video">
|
||||||
|
|
@ -98,73 +98,77 @@
|
||||||
|
|
||||||
{if !{$id_post}}
|
{if !{$id_post}}
|
||||||
<div class="totalComments">
|
<div class="totalComments">
|
||||||
<h3>Posted by {$row.User} - <a href="{$row.Permalink}#comments">( {$row.Comments_Number} ) comments</a></h3>
|
<h3>Posted by {$row.User} {if {$allowComments}}- <a href="{$row.Permalink}#comments">( {$row.Comments_Number} ) comments{/if}</a></h3>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{if {$id_post}}
|
{if {$id_post}}
|
||||||
<div class="containerComments">
|
{if {$row.Comments_Number}>0}
|
||||||
<h3 id="comments">{$row.Comments_Number} answers to “{$row.Post_Title}”</h3>
|
<div class="containerComments">
|
||||||
<ol class="commentlist">
|
<h3 id="comments">{$row.Comments_Number} answers to “{$row.Post_Title}”</h3>
|
||||||
{block {$comments} as {$comment}}
|
<ol class="commentlist">
|
||||||
<li class="alt" id="comment-{$comment.Id_Comment}">
|
{block {$comments} as {$comment}}
|
||||||
<cite>
|
<li class="alt" id="comment-{$comment.Id_Comment}">
|
||||||
<a href="#comment-{$comment.Id_Comment}" title="Comment permalink">#</a>
|
<cite>
|
||||||
{$comment.Comment_Author} said:
|
<a href="#comment-{$comment.Id_Comment}" title="Comment permalink">#</a>
|
||||||
</cite>
|
{$comment.Comment_Author} said:
|
||||||
<br />
|
</cite>
|
||||||
<span class="timestampComment"> at {$comment.Date}</span><br /><br />
|
<br />
|
||||||
{$comment.Comment}
|
<span class="timestampComment"> at {$comment.Date}</span><br /><br />
|
||||||
<br /><br />
|
{$comment.Comment}
|
||||||
</li>
|
<br /><br />
|
||||||
{/block}
|
</li>
|
||||||
</ol>
|
{/block}
|
||||||
</div>
|
</ol>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{if {$allowComments}}
|
||||||
|
<div class="containerFormComments">
|
||||||
|
<h3 id="respond">Add your comment</h3>
|
||||||
|
|
||||||
<div class="containerFormComments">
|
<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
|
||||||
<h3 id="respond">Add your comment</h3>
|
<p>
|
||||||
|
<label for="username">
|
||||||
<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
|
<small>Name:</small>
|
||||||
<p>
|
</label>
|
||||||
<label for="username">
|
<input name="username" id="username" value="{whois.User_Cookie}" size="22" tabindex="1" type="text" />
|
||||||
<small>Name:</small>
|
</p>
|
||||||
</label>
|
<p>
|
||||||
<input name="username" id="username" value="{whois.User_Cookie}" size="22" tabindex="1" type="text" />
|
<label for="email">
|
||||||
</p>
|
<small>E-mail:</small>
|
||||||
<p>
|
</label>
|
||||||
<label for="email">
|
<input name="email" id="email" value="{whois.Email_Cookie}" size="22" tabindex="2" type="text" />
|
||||||
<small>E-mail:</small>
|
</p>
|
||||||
</label>
|
<p>
|
||||||
<input name="email" id="email" value="{whois.Email_Cookie}" size="22" tabindex="2" type="text" />
|
<label for="web">
|
||||||
</p>
|
<small>Website:</small>
|
||||||
<p>
|
</label>
|
||||||
<label for="web">
|
<input name="web" id="web" value="{whois.Web_Cookie}" size="22" tabindex="3" type="text" />
|
||||||
<small>Website:</small>
|
</p>
|
||||||
</label>
|
<p>
|
||||||
<input name="web" id="web" value="{whois.Web_Cookie}" size="22" tabindex="3" type="text" />
|
<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
|
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
|
||||||
</p>
|
Some HTML allowed:<br />
|
||||||
<p>
|
|
||||||
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
|
<code>
|
||||||
Some HTML allowed:<br />
|
<blockquote> <code> <em> <strong> <a>
|
||||||
|
</code>
|
||||||
<code>
|
</span>
|
||||||
<blockquote> <code> <em> <strong> <a>
|
</p>
|
||||||
</code>
|
<p>
|
||||||
</span>
|
<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
|
<input name="id_post" id="id_post" value="{id_post}" type="hidden" />
|
||||||
</p>
|
<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
|
||||||
<p>
|
</p>
|
||||||
<input name="id_post" id="id_post" value="{id_post}" type="hidden" />
|
</form>
|
||||||
<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
|
</div>
|
||||||
</p>
|
{/if}
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{else}
|
{else}
|
||||||
{pagination}
|
{pagination}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue