Description: This mod enables admins on a site to search user history based on searching for the username. For our site it's useful to evaluate whether a person would make a good validated author.
Requirements: I wrote this for eFic 3.5.5. We have logging turned on.
Mod History: As of now (Oct 17, 2016) this is new! π It's also my first mod.
Oct 28, 2016: adding change to acceptance and rejection template
Instructions:I added a new php file under the admin directory with the code below. Love to know what people think! I might add something to submission.php or user.php to make this a quick link but for now it's a standalone page.
<?php
$current="User History";
$displayform = 1;
$output .= "<h1>User History Search</h1><br><p>Please enter the username you'd like to lookup and click search</p><br>";
$output .= "<form action="admin.php?action=userhistory" method="post"><input type="text" name="searchterm" value="";
if(isset($_POST['searchterm'])) $output .= $_POST['searchterm']; else $output .= "Username";
$output .=""><input type="submit" value="Search"></form><br><br>";
if(isset($_POST['searchterm'])) {
$searchterm = escapestring($_POST['searchterm']); trim ($searchterm);
$query = "SELECT * FROM `fanfiction_log` WHERE `log_action` like '%".$searchterm."%'";
$result = dbquery($query);
if (!$result) {
echo mysql_error();}
$output.= "<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style><table>";
$output.= "<tr><th>Date</th><th>Message</th></tr>";
while ($row =dbassoc($result)){
$output.= "<tr>";
$output.= "<td>".$row['log_timestamp']."</td>";
$output.= "<td>".$row['log_action'];"</tr>";
}}
$output .= "</table>";
$tpl->assign("output", $output);
$tpl->printToScreen();
dbclose( );
exit( );
Go to your Admin panel, settings, and Acceptance Letter template (then do this to the Rejection Letter Template):
add {author} as the greeting.