Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,62 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
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
+
27
+$chapid = isset($_GET['chapid']) && isNumber($_GET['chapid']) ? $_GET['chapid'] : 0;
28
+
29
+		$adminquery = dbquery("SELECT "._EMAILFIELD." as email, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '".USERUID."' LIMIT 1");
30
+		list($adminemail, $adminname) = dbrow($adminquery);
31
+		if($adminemail)
32
+			$ademail = $adminemail;
33
+		else 
34
+			$ademail = $siteemail;
35
+	if(isset($_POST['submit'])) {
36
+		$subject = strip_tags(descript($_POST['subject']));
37
+		$letter = stripslashes(descript($_POST['letter']));
38
+		include("includes/emailer.php");
39
+		$result = sendemail($_POST['authorname'], $_POST['authoremail'], $adminname, $ademail, $subject, $letter, "html");
40
+		if($result) echo write_message(_EMAILSENT);
41
+		else echo write_error(_ERROR);
42
+	}
43
+	else {
44
+			$storyquery = dbquery("SELECT story.title, chapter.title as chapter, "._EMAILFIELD." as email, "._PENNAMEFIELD." as penname, chapter.uid FROM ".TABLEPREFIX."fanfiction_stories as story, ".TABLEPREFIX."fanfiction_chapters as chapter, "._AUTHORTABLE." WHERE chapter.uid = "._UIDFIELD." AND chapter.chapid = '$chapid' AND chapter.sid = story.sid LIMIT 1");
45
+			$story = dbassoc($storyquery);
46
+			$letterquery = dbquery("SELECT message_text, message_title FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'thankyou' LIMIT 1");
47
+			list($letter, $subject) = dbrow($letterquery);
48
+			$letter = stripslashes($letter);
49
+			$search = array("@\{sitename\}@", "@\{adminname\}@",  "@\{author\}@", "@\{storytitle\}@",  "@\{chaptertitle\}@", "@\{rules\}@");
50
+			$replace = array( $sitename, $adminname, $story['penname'], $story['title'], $story['chapter'], "<a href=\"$url/viewpage.php?id=rules\">"._RULES."</a>");
51
+			$letter = preg_replace($search, $replace, $letter);
52
+			$subject = preg_replace($search, $replace, $subject);
53
+			echo "<body>
54
+			<div id=\"pagetitle\"> $story[title]: $story[chapter] "._BY." $story[penname]</div>
55
+			<div style=\"line-height: 4ex; margin: 0 auto; width: 90%;\">
56
+				<form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=yesletter&amp;uid=$story[uid]\">
57
+				<input type=\"hidden\" name=\"authoremail\" value=\"$story[email]\"><input type=\"hidden\" name=\"authorname\" value=\"story[penname]\">
58
+				<label for=\"subject\">"._SUBJECT.":</label> <INPUT type=\"text\" class=\"textbox=\" size=\"40\"  name=\"subject\" value=\"$subject\"><br />
59
+				<textarea  name=\"letter\" cols=\"40\" rows=\"7\">$letter</TEXTAREA><br /><INPUT type=\"submit\" style=\"margin: 10px;\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\"></form></div></body></html>";
60
+	}
61
+	exit( );
62
+?>
0 63
\ No newline at end of file