betareader module (fixed short php tag)
betareader module (fixed short php tag)

--- /dev/null
+++ b/modules/betareader/README.txt
@@ -1,1 +1,37 @@
+// ----------------------------------------------------------------------
+// Copyright (c) 2007 by Tammy Keefer
+// Also Like Module developed for eFiction 3.0
+// // http://efiction.hugosnebula.com/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
 
+This little module will let you add an option to the members list page to 
+display a list of the betareaders on your site.  It's designed to work with
+the default beta-reader field.  If you've installed a custom betareader 
+module make sure the name of the field is "betareader" and that it's a 
+yes/no field.  Otherwise, this module won't work.
+
+To install this module:
+
+1. Upload the entire betareader folder to the the modules folder within your 
+eFiction installation.
+
+2. Go to Admin->Modules and select "Install this Module" in the menu.
+
+To uninsall this module:
+
+1. Go to Admin->Modules and select "Uninstall this Module" in the menu.
+

--- /dev/null
+++ b/modules/betareader/changelog.txt
@@ -1,1 +1,3 @@
+05/31/08
 
+- Removed erroneous language file calls.

--- /dev/null
+++ b/modules/betareader/install.php
@@ -1,1 +1,51 @@
-
+<?php
+// ----------------------------------------------------------------------
+// Copyright (c) 2007 by Tammy Keefer
+// Also Like Module developed for eFiction 3.0
+// // http://efiction.hugosnebula.com/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
+$current = "adminarea";
+include ("../../header.php");
+                                      
+//make a new TemplatePower object
+if(file_exists( "$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl" );
+else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");
+$tpl->assignInclude( "header", "$skindir/header.tpl" );
+$tpl->assignInclude( "footer", "$skindir/footer.tpl" );
+include(_BASEDIR."includes/pagesetup.php");
+include_once(_BASEDIR."languages/".$language."_admin.php");
+if(!isADMIN) accessDenied( );       
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
+if($confirm == "yes") {
+	list($installed) = dbrow(dbquery("SELECT COUNT(code_module) FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_module = 'betareader'"));
+	if(!$installed) {
+		dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ( 'include(_BASEDIR.\"modules/betareader/members.php\");', 'membersList', 'betareader');");
+		include("version.php");
+		dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_modules`(`version`, `name`) VALUES('$moduleVersion', '$moduleName')");
+		dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ( 'include(_BASEDIR.\"modules/betareader/stats.php\");', 'sitestats', 'betareader');");
+	    }
+	$output = write_message(_ACTIONSUCCESSFUL);
+}
+else if($confirm == "no") {
+	$output = write_message(_ACTIONCANCELLED);
+}
+else {
+	$output = write_message(_CONFIRMINSTALL."<br /><a href='install.php?confirm=yes'>"._YES."</a> "._OR." <a href='install.php?confirm=no'>"._NO."</a>");
+}
+$tpl->assign("output", $output);
+$tpl->printToScreen( );
+?>

--- /dev/null
+++ b/modules/betareader/members.php
@@ -1,1 +1,11 @@
+<?php 
+if(!defined("_CHARSET")) exit( );
+list($field_id, $field_title) = dbrow(dbquery("SELECT field_id, field_title FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_name = 'betareader'"));
+$listOpts .= "<option value=\"authors.php?".($let ? "let=$let&amp;" : "")."list=beta\"".($list == "beta" ? " selected" : "").">$field_title</option>";
+if($list == "beta") {
+	$countquery = "SELECT COUNT(DISTINCT ai.uid) FROM ".TABLEPREFIX."fanfiction_authorinfo as ai, "._AUTHORTABLE." WHERE ai.field = '$field_id' AND ai.info = '"._YES."' AND "._UIDFIELD." = ai.uid".(isset($letter) ? " AND $letter" : "");
+	$authorquery = "SELECT ap.stories as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM ".TABLEPREFIX."fanfiction_authorinfo as ai, "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap ON "._UIDFIELD." = ap.uid WHERE ai.field = '$field_id' AND ai.info = '"._YES."' AND "._UIDFIELD." = ai.uid ".(isset($letter) ? " AND $letter" : "")." GROUP BY "._UIDFIELD;
+	$pagetitle .= $field_title;
+}
 
+?>

--- /dev/null
+++ b/modules/betareader/stats.php
@@ -1,1 +1,37 @@
+<?php
+// ----------------------------------------------------------------------
+// Copyright (c) 2007 by Tammy Keefer
+// Valid HTML 4.01 Transitional
+// Based on eFiction 1.1
+// Copyright (C) 2003 by Rebecca Smallwood.
+// http://efiction.sourceforge.net/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
 
+
+if(!defined("_CHARSET")) exit( );
+
+list($field_id, $field_title) = dbrow(dbquery("SELECT field_id, field_title FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_name = 'betareader'"));
+$query = dbquery("SELECT count(uid) FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field = '$field_id' AND info = '"._YES."'");
+list($count) = dbrow($query);
+if(!empty($blocks['info']['style']) && $blocks['info']['style'] == 2) {
+	$tpl->assignGlobal("totalbetas", $count);
+}
+else if(!empty($blocks['info']['style']) && $blocks["info"]["style"] == 1) {
+	$content = preg_replace("@\{totalbetas\}@", $count, $content);
+}
+else $content .= "<div><span class='label'>".$field_title.": </span>".$count."</div>";
+?>

--- /dev/null
+++ b/modules/betareader/uninstall.php
@@ -1,1 +1,49 @@
+<?php
+// ----------------------------------------------------------------------
+// Copyright (c) 2007 by Tammy Keefer
+// Also Like Module developed for eFiction 3.0
+// // http://efiction.hugosnebula.com/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
+$current = "adminarea";
+include ("../../header.php");
 
+//make a new TemplatePower object
+if(file_exists( "$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl" );
+else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");
+$tpl->assignInclude( "header", "$skindir/header.tpl" );
+$tpl->assignInclude( "footer", "$skindir/footer.tpl" );
+include(_BASEDIR."includes/pagesetup.php");
+include_once(_BASEDIR."languages/".$language."_admin.php");
+if(!isADMIN) accessDenied( );
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
+if($confirm == "yes") {
+	include("version.php");
+	dbquery("DELETE FROM `".TABLEPREFIX."fanfiction_modules` WHERE name = '$moduleName'");	
+	dbquery("DELETE FROM `".TABLEPREFIX."fanfiction_codeblocks` WHERE code_module = 'betareader'");	
+	$output = write_message(_ACTIONSUCCESSFUL);
+}
+else if($confirm == "no") {
+	$output = write_message(_ACTIONCANCELLED);
+}
+else {
+	$modquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_module = 'betareader'");
+	if(dbnumrows($modquery)) $output = write_message(_CONFIRMUNINSTALL."<a href='uninstall.php?confirm=yes'>"._YES."</a> "._OR." <a href='uninstall.php?confirm=no'>"._NO."</a>");
+	else $output .= write_message(_MODNOTINSTALLED);
+}
+$tpl->assign("output", $output);
+$tpl->printToScreen( );
+?>

--- /dev/null
+++ b/modules/betareader/update.php
@@ -1,1 +1,58 @@
+<?php
+// ----------------------------------------------------------------------
+// Copyright (c) 2007 by Tammy Keefer
+// Valid HTML 4.01 Transitional
+// Based on eFiction 1.1
+// Copyright (C) 2003 by Rebecca Smallwood.
+// http://efiction.sourceforge.net/
+// ----------------------------------------------------------------------
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License (GPL)
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
+// ----------------------------------------------------------------------
 
+$current = "betareader";
+include ("../../header.php");
+
+//make a new TemplatePower object
+if(file_exists( "$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl" );
+else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");
+$tpl->assignInclude( "header", "$skindir/header.tpl" );
+$tpl->assignInclude( "footer", "$skindir/footer.tpl" );
+include(_BASEDIR."includes/pagesetup.php");
+if(file_exists(_BASEDIR."languages/".$language."_admin.php")) include_once(_BASEDIR."languages/".$language."_admin.php");
+else include_once(_BASEDIR."languages/en_admin.php");
+if(file_exists(_BASEDIR."languages/".$language.".php")) include_once(_BASEDIR."languages/".$language.".php");
+else include_once(_BASEDIR."languages/en.php");
+if(!isADMIN) accessDenied( );
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
+include("version.php");
+list($currentVersion) = dbrow(dbquery("SELECT version FROM ".TABLEPREFIX."fanfiction_modules WHERE name = '$moduleName' LIMIT 1"));
+$installed = dbnumrows(dbquery("SELECT COUNT(code_module) FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_module = 'betareader'"));
+if(empty($currentVersion) || $currentVersion < "1.4" || !$installed) {
+if($confirm == "yes") {
+	dbquery("UPDATE ".TABLEPREFIX."fanfiction_modules SET version = '1.4' WHERE name = '$moduleName' LIMIT 1");
+	if($currentVersion < "1.2") dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ( 'include(_BASEDIR.\"modules/betareader/stats.php\");', 'sitestats', 'betareader');");
+	$output = write_message(_ACTIONSUCCESSFUL);
+}
+else if($confirm == "no") {
+	$output = write_message(_ACTIONCANCELLED);
+}
+else {
+	$output = write_message(_CONFIRMUPDATE."<br /><a href='update.php?confirm=yes'>"._YES."</a> "._OR." <a href='update.php?confirm=no'>"._NO."</a>");
+}
+}
+else $output .= write_message(_ALREADYUPDATED);
+$tpl->assign("output", $output);
+$tpl->printToScreen( );
+?>

--- /dev/null
+++ b/modules/betareader/version.php
@@ -1,1 +1,18 @@
+<?php
+/*
+This file will be called by admin/modules.php and update.php to determine if 
+the module version in the database is the current version of the module.  
+The version number in this file will be the current version.
+*/
 
+if(!defined("_CHARSET")) exit( );
+
+$moduleVersion = "1.4";
+$moduleName = "Beta-Reader List";
+
+$moduleDescription = "This tiny module adds a beta-reader option to the members page. Requires 3.1.";
+$moduleAuthor = "Tammy Keefer";
+$moduleAuthorEmail = "efiction@hugosnebula.com";
+$moduleWebsite = "http://efiction.hugosnebula.com";
+
+?>