| ... | ... |
@@ -37,7 +37,7 @@ else {
|
| 37 | 37 |
$revcount = dbquery("SELECT COUNT(reviewid) FROM ".TABLEPREFIX."fanfiction_reviews WHERE uid = '$uid' AND review != 'No Review'");
|
| 38 | 38 |
list($reviewcount) = dbrow($revcount); |
| 39 | 39 |
if($reviewcount) {
|
| 40 |
- $revquery = dbquery("SELECT rev.*, UNIX_TIMESTAMP(rev.date) as date, "._PENNAMEFIELD." FROM ".TABLEPREFIX."fanfiction_reviews as rev, "._AUTHORTABLE." WHERE rev.uid = "._UIDFIELD." AND rev.uid = '$uid' AND rev.review != 'No Review' ORDER BY type, item LIMIT $offset, $itemsperpage");
|
|
| 40 |
+ $revquery = dbquery("SELECT rev.*, rev.date as date, "._PENNAMEFIELD." FROM ".TABLEPREFIX."fanfiction_reviews as rev, "._AUTHORTABLE." WHERE rev.uid = "._UIDFIELD." AND rev.uid = '$uid' AND rev.review != 'No Review' ORDER BY type, item LIMIT $offset, $itemsperpage");
|
|
| 41 | 41 |
$counter = 0; |
| 42 | 42 |
$count = 0; |
| 43 | 43 |
while($reviews = dbassoc($revquery)) {
|
| ... | ... |
@@ -37,7 +37,7 @@ else {
|
| 37 | 37 |
$revcount = dbquery("SELECT COUNT(reviewid) FROM ".TABLEPREFIX."fanfiction_reviews WHERE uid = '$uid' AND review != 'No Review'");
|
| 38 | 38 |
list($reviewcount) = dbrow($revcount); |
| 39 | 39 |
if($reviewcount) {
|
| 40 |
- $revquery = dbquery("SELECT rev.*, rev.date as date, "._PENNAMEFIELD." FROM ".TABLEPREFIX."fanfiction_reviews as rev, "._AUTHORTABLE." WHERE rev.uid = "._UIDFIELD." AND rev.uid = '$uid' AND rev.review != 'No Review' ORDER BY type, item LIMIT $offset, $itemsperpage");
|
|
| 40 |
+ $revquery = dbquery("SELECT rev.*, UNIX_TIMESTAMP(rev.date) as date, "._PENNAMEFIELD." FROM ".TABLEPREFIX."fanfiction_reviews as rev, "._AUTHORTABLE." WHERE rev.uid = "._UIDFIELD." AND rev.uid = '$uid' AND rev.review != 'No Review' ORDER BY type, item LIMIT $offset, $itemsperpage");
|
|
| 41 | 41 |
$counter = 0; |
| 42 | 42 |
$count = 0; |
| 43 | 43 |
while($reviews = dbassoc($revquery)) {
|
| ... | ... |
@@ -113,4 +113,4 @@ else {
|
| 113 | 113 |
} |
| 114 | 114 |
$tpl->gotoBlock("_ROOT");
|
| 115 | 115 |
$tpl->assign("output", $output);
|
| 116 |
-?> |
|
| 117 | 116 |
\ No newline at end of file |
| 117 |
+?> |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,116 @@ |
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// eFiction 3.2 |
|
| 4 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 5 |
+// Valid HTML 4.01 Transitional |
|
| 6 |
+// Based on eFiction 1.1 |
|
| 7 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 8 |
+// http://efiction.sourceforge.net/ |
|
| 9 |
+// ---------------------------------------------------------------------- |
|
| 10 |
+// LICENSE |
|
| 11 |
+// |
|
| 12 |
+// This program is free software; you can redistribute it and/or |
|
| 13 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 14 |
+// as published by the Free Software Foundation; either version 2 |
|
| 15 |
+// of the License, or (at your option) any later version. |
|
| 16 |
+// |
|
| 17 |
+// This program is distributed in the hope that it will be useful, |
|
| 18 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 |
+// GNU General Public License for more details. |
|
| 21 |
+// |
|
| 22 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 23 |
+// ---------------------------------------------------------------------- |
|
| 24 |
+ |
|
| 25 |
+if(!defined("_CHARSET")) exit( );
|
|
| 26 |
+if(!function_exists("catlist")) include("includes/listings.php");
|
|
| 27 |
+ |
|
| 28 |
+if(!isset($uid)) {
|
|
| 29 |
+ $uid = USERUID; |
|
| 30 |
+ $output .= "<div id='pagetitle'>"._YOURREVIEWS."</div>"; |
|
| 31 |
+} |
|
| 32 |
+else {
|
|
| 33 |
+ $authquery = dbquery("SELECT "._PENNAMEFIELD." FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '$uid'");
|
|
| 34 |
+ list($penname) = dbrow($authquery); |
|
| 35 |
+ $output .= "<div class='sectionheader'>"._REVIEWSBY." ".$penname."</div>"; |
|
| 36 |
+} |
|
| 37 |
+$revcount = dbquery("SELECT COUNT(reviewid) FROM ".TABLEPREFIX."fanfiction_reviews WHERE uid = '$uid' AND review != 'No Review'");
|
|
| 38 |
+list($reviewcount) = dbrow($revcount); |
|
| 39 |
+if($reviewcount) {
|
|
| 40 |
+ $revquery = dbquery("SELECT rev.*, rev.date as date, "._PENNAMEFIELD." FROM ".TABLEPREFIX."fanfiction_reviews as rev, "._AUTHORTABLE." WHERE rev.uid = "._UIDFIELD." AND rev.uid = '$uid' AND rev.review != 'No Review' ORDER BY type, item LIMIT $offset, $itemsperpage");
|
|
| 41 |
+ $counter = 0; |
|
| 42 |
+ $count = 0; |
|
| 43 |
+ while($reviews = dbassoc($revquery)) {
|
|
| 44 |
+ $tpl->newBlock("listings");
|
|
| 45 |
+ if(empty($lastreview)) $lastreview = array('type' => '', 'item' => '');
|
|
| 46 |
+ $adminlink = ""; |
|
| 47 |
+ if(file_exists("$skindir/reviewblock.tpl")) $revlist = new TemplatePower( "$skindir/reviewblock.tpl" );
|
|
| 48 |
+ else $revlist = new TemplatePower("default_tpls/reviewblock.tpl");
|
|
| 49 |
+ $revlist->prepare( ); |
|
| 50 |
+ if($reviews['type'] == 'ST') {
|
|
| 51 |
+ $storyquery = dbquery(_STORYQUERY." AND sid = '".$reviews['item']."' LIMIT 1"); |
|
| 52 |
+ $stories = dbassoc($storyquery); |
|
| 53 |
+ $authoruid = $stories['uid']; |
|
| 54 |
+ if($lastreview['type'] != 'ST' || $lastreview['item'] != $reviews['item']) {
|
|
| 55 |
+ $tpl->newBlock("storyblock");
|
|
| 56 |
+ include("includes/storyblock.php");
|
|
| 57 |
+ } |
|
| 58 |
+ if($reviews['chapid']) {
|
|
| 59 |
+ $chapquery = dbquery("SELECT title, inorder FROM ".TABLEPREFIX."fanfiction_chapters WHERE chapid = '".$reviews['chapid']."' LIMIT 1");
|
|
| 60 |
+ list($chaptitle, $chapnum) = dbrow($chapquery); |
|
| 61 |
+ } |
|
| 62 |
+ } |
|
| 63 |
+ else if($reviews['type'] == "SE" && ($lastreview['type'] != 'SE' || $lastreview['item'] != $reviews['item'])) {
|
|
| 64 |
+ $storyquery = dbquery(_SERIESQUERY." AND seriesid = '".$reviews['item']."' LIMIT 1"); |
|
| 65 |
+ $stories = dbassoc($storyquery); |
|
| 66 |
+ $authoruid = $stories['uid']; |
|
| 67 |
+ include("includes/seriesblock.php");
|
|
| 68 |
+ } |
|
| 69 |
+ else {
|
|
| 70 |
+ $codeblocks = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'reviewsby'");
|
|
| 71 |
+ while($code = dbassoc($codeblocks)) {
|
|
| 72 |
+ eval($code['code_text']); |
|
| 73 |
+ } |
|
| 74 |
+ } |
|
| 75 |
+ if(isADMIN) $adminlink = _ADMINOPTIONS.": [<a href=\"reviews.php?action=edit&reviewid=".$reviews['reviewid']."\">"._EDIT."</a>]"; |
|
| 76 |
+ if( isADMIN || (USERUID && USERUID == $reviews['uid'])) $adminlink .= " [<a href=\"reviews.php?action=delete&reviewid=".$reviews['reviewid']."\">"._DELETE."</a>]"; |
|
| 77 |
+ if($reviews['uid']) {
|
|
| 78 |
+ if(USERUID == $reviews['uid'] && $revdelete == 2 && !isADMIN) $adminlink .= " [<a href=\"reviews.php?action=delete&reviewid=".$reviews['reviewid']."\">"._DELETE."</a>]"; |
|
| 79 |
+ $reviewer = "<a href=\"viewuser.php?uid=".$reviews['uid']."\">".$reviews['reviewer']."</a>"; |
|
| 80 |
+ $member = _SIGNED; |
|
| 81 |
+ } |
|
| 82 |
+ else {
|
|
| 83 |
+ if(USERUID == $authoruid && $revdelete && !isADMIN) $adminlink .= " [<a href=\"reviews.php?action=delete&reviewid=".$reviews['reviewid']."\">"._DELETE."</a>]"; |
|
| 84 |
+ $reviewer = $reviews['reviewer']; |
|
| 85 |
+ $member = _ANONYMOUS; |
|
| 86 |
+ } |
|
| 87 |
+ if(!empty($authoruid) && USERUID == $authoruid) $adminlink .= " [<a href=\"user.php?action=revres&reviewid=".$reviews['reviewid']."\">"._RESPOND."</a>]"; |
|
| 88 |
+ $revlist->newBlock("reviewsblock");
|
|
| 89 |
+ $revlist->assign("reviewer" , $reviewer );
|
|
| 90 |
+ $revlist->assign("review" , $reviews['review']);
|
|
| 91 |
+ $revlist->assign("reviewdate", date("$dateformat", $reviews['date']) );
|
|
| 92 |
+ $revlist->assign("rating", ratingpics($reviews['rating']) );
|
|
| 93 |
+ $revlist->assign("member", $member );
|
|
| 94 |
+ $revlist->assign("chapter", (isset($chaptitle) ? _CHAPTER." $chapnum: $chaptitle" : (!empty($stories['title']) ? $stories['title'] : _NONE)) );
|
|
| 95 |
+ $revlist->assign("chapternumber", isset($chapnum) ? $chapnum : "" );
|
|
| 96 |
+ if(!empty($adminlink)) $revlist->assign("adminoptions", "<div class=\"adminoptions\">$adminlink</div>");
|
|
| 97 |
+ $revlist->assign("oddeven", ($counter % 2 ? "odd" : "even"));
|
|
| 98 |
+ unset($adminlink); |
|
| 99 |
+ $tpl->gotoBlock("listings");
|
|
| 100 |
+ $tpl->assign("pagelinks", $revlist->getOutputContent( ));
|
|
| 101 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 102 |
+ $counter++; |
|
| 103 |
+ $lastreview = $reviews; |
|
| 104 |
+ } |
|
| 105 |
+ if($reviewcount > $itemsperpage) {
|
|
| 106 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 107 |
+ $tpl->newBlock("listings");
|
|
| 108 |
+ $tpl->assign("pagelinks", build_pagelinks(basename($_SERVER['PHP_SELF'])."?action=reviewsby&uid=$uid&", $reviewcount, $offset));
|
|
| 109 |
+ } |
|
| 110 |
+} |
|
| 111 |
+else {
|
|
| 112 |
+ $output .= write_message(_NORESULTS); |
|
| 113 |
+} |
|
| 114 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 115 |
+ $tpl->assign("output", $output);
|
|
| 116 |
+?> |
|
| 0 | 117 |
\ No newline at end of file |