Skip to content

Commit

Permalink
blog.sql now has extra fields for comments. index.DOMDocument.php is …
Browse files Browse the repository at this point in the history
…a DOMDocument implementation of index.php
  • Loading branch information
eebrah committed Dec 12, 2013
1 parent b1529be commit 8cf1a57
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 35 deletions.
23 changes: 19 additions & 4 deletions Article.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,29 @@ function getArticles( $returnType = 0, $filter = "all" ) {
}
break;

case "published" : {}
case "published" : {

$query .= '
`postDetails`.`status` = 1';

}
break;

case "pending" : {}
case "pending" : {

$query .= '
`postDetails`.`status` = 0';

}
break;

case "retracted" : {}
case "retracted" :
case "withdrawn" : {

$query .= '
`postDetails`.`status` = 2';

}
break;

}
Expand Down Expand Up @@ -367,5 +383,4 @@ function articleExists( $returnType = 0, $articleID ) {

}


?>
76 changes: 45 additions & 31 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,19 @@
<div class="sideColumn">
<ul>
<li>
<a href="?section=articles">articles <sup>[ ' . count( $articles ) . ' ]</sup></a>
<a href="?section=articles">articles</a>
<ul>
<li>
<a href="?section=articles&amp;action=list">list articles</a>
<a href="?section=articles&amp;action=list">all <sup>[ ' . count( getArticles( 0, "all" ) ) . ' ]</sup></a>
</li>
<li>
<a href="?section=articles&amp;action=add">add new article</a>
<a href="?section=articles&amp;action=list&amp;filter=published">published <sup>[ ' . count( getArticles( 0, "published" ) ) . ' ]</sup></a>
</li>
<li>
<a href="?section=articles&amp;action=list&amp;filter=pending">pending <sup>[ ' . count( getArticles( 0, "pending" ) ) . ' ]</sup></a>
</li>
<li>
<a href="?section=articles&amp;action=add&amp;filter=withdrawn">withdrawn <sup>[ ' . count( getArticles( 0, "withdrawn" ) ) . ' ]</sup></a>
</li>
</ul>
</li>
Expand Down Expand Up @@ -334,7 +340,15 @@

case "list" : {

$articles = getArticles();
$filter = "all";

if( isset( $_REQUEST[ "filter" ] ) ) {

$filter = $_REQUEST[ "filter" ];

}

$articles = getArticles( 0, $filter );

if( count( $articles ) > 0 ) {

Expand Down Expand Up @@ -388,7 +402,7 @@

$pageBody .= '
<div class="dialog">
<p>You have no articles</p>
<p>no articles matching your criteria were found</p>
</div>';

}
Expand Down Expand Up @@ -423,31 +437,31 @@
else {

$pageBody .= '
<div>
<form action="?section=articles&amp;action=add"
method="post">
<fieldset class="info">
<legend>article info</legend>
<div class="row">
<label>title</label>
<input type="text"
name="title"
placeholder="article title"
required="required" />
</div>
<div class="row">
<label>article</label>
<textarea name="body"
placeholder="type the article here"
required="reuired"></textarea>
</div>
</fieldset>
<fieldset class="buttons">
<button type="reset">reset</button>
<button type="submit">submit</button>
</fieldset>
</form>
</div>';
<div>
<form action="?section=articles&amp;action=add"
method="post">
<fieldset class="info">
<legend>article info</legend>
<div class="row">
<label>title</label>
<input type="text"
name="title"
placeholder="article title"
required="required" />
</div>
<div class="row">
<label>article</label>
<textarea name="body"
placeholder="type the article here"
required="reuired"></textarea>
</div>
</fieldset>
<fieldset class="buttons">
<button type="reset">reset</button>
<button type="submit">submit</button>
</fieldset>
</form>
</div>';

}

Expand Down Expand Up @@ -654,7 +668,7 @@

$pageBody .= '
<div class="dialog">
<p>You have no comments</p>
<p>no commentsmatching your criteria were found</p>
</div>';

}
Expand Down
Loading

0 comments on commit 8cf1a57

Please sign in to comment.