There are two things I am having a problem with now that efiction is finally installed and bridged.
1. Member profile info. This is displaying info from the smf profiles, which is good, except that is is only displaying very limited information
- real name,
- date joined forum,
- membership status
- avatar
Does anyone know how to get it to display all (or more) the information in the smf profile summary? We have some writing related fields in there that would be useful if they were displayed in efiction
I looked at the editbio.php in /user but all it says is:
$output .= "<script language="javascript" type="text/javascript">
location = "".$path_to_smf."index.php?action=profile";
</script>";
?>
I would like it to display the full profile summary, which is where it seems to be pointing, but where are all the fields eg YIM, AIM, Website, etc?
2. Acceptance / Rejection letters
Since bridging I am unable to send these out. I did test it before bridging and it worked. Now after bridging when I try to send acceptance/rejection letters I get this error:
Error!We encountered an error. Please go back and try again.
I guess it must be something to do with not being able to find the members maybe? Can anyone tell me how to fix it?
(I found reference in another topic to admin/stories as related to the acceptance/rejection letter) Here is the file. Do I need to change something it in because the efiction is bridged?
<?php
// ----------------------------------------------------------------------
// eFiction 3.2
// 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( );
function featured( ) {
global $tableprefix;
if($_GET['retire'])
mysql_query("UPDATE ".$tableprefix."fanfiction_stories SET featured = 2 WHERE sid = ".$_GET['retire']);
if($_GET['feature'])
mysql_query("UPDATE ".$tableprefix."fanfiction_stories SET featured = 1 WHERE sid = ".$_GET['feature']);
$fquery = "SELECT stories.*, stories.title as title, author.penname, DATE_FORMAT(stories.updated, '%Y.%m.%d') as updatesort, DATE_FORMAT(stories.date, '$datim') as date, DATE_FORMAT(stories.updated, '$datim') as updated FROM ".$tableprefix."fanfiction_authors as author, ".$tableprefix."fanfiction_stories as stories WHERE stories.featured > 0 AND stories.uid = author.uid ORDER BY stories.featured";
$fresult = mysql_query($fquery) or die(_FATALERROR."Query: ".$fquery."<br />Error: (".mysql_errno( ).") ".mysql_error( ));
$output .= "<center><table class="tblborder" cellpadding="5"><tr><th colspan="2" align="center">"._FEATUREDSTORIES."</th></tr>";
if(!mysql_num_rows($fresult)) $output .= "<tr><td colspan="2" align="center">"._NOSTORIES."</td><tr>";
while($story = mysql_fetch_array($fresult)) {
$output .= "<tr><td class="tblborder"><a href=""viewstory.php?sid=".$story['sid'"]."">$story[title]</a> "._BY." <a href=""viewuser.php?uid=".$story['uid'"]."">".$story['penname']."</a></td><td class="tblborder" align="center">".($story['featured'] == 1 ? "<a href=""admin.php?action=featured&retire=".$story['sid'"]."">"._CURRENT."</a>" : "<b>"._RETIRED."</b>")."</td></tr>";
}
$output .= "</table>"._FEATUREDNOTE;
return $output;
}
// end featured
function submitted()
{
global $tableprefix, $admincats, $allowed_tags;
$output .= "<center><h4>"._SUBMITTED."</h4></center>";
$query = "SELECT story.title as storytitle, chapter.uid, chapter.sid, story.catid, chapter.chapid, chapter.inorder, chapter.title, author.penname FROM (".$tableprefix."fanfiction_chapters as chapter, ".$tableprefix."fanfiction_authors as author) LEFT JOIN ".$tableprefix."fanfiction_stories as story ON story.sid = chapter.sid WHERE chapter.validated = '0' AND chapter.uid = author.uid ORDER BY story.title ASC, chapter.inorder ASC";
$result = mysql_query($query) or die(_FATALERROR."Query: ".$query."<br />Error: (".mysql_errno( ).") ".mysql_error( ));
$output .= "<table class="tblborder" cellspacing="0" cellpadding="3" align="center"><tr class="tblborder"><th>"._TITLE."</th><th>"._AUTHOR."</th><th>"._CATEGORY."</th><th>"._OPTIONS."</th></tr>";
$array = explode(",", $admincats);
while ($story = mysql_fetch_assoc($result))
{
unset($catstring);
$result3 = mysql_query("SELECT catid, category FROM ".$tableprefix."fanfiction_categories WHERE FIND_IN_SET(catid, '".$story['catid']."')");
while($cats = mysql_fetch_array($result3)) {
$catstring[] = "<a href=""categories.php?catid=".$cats['catid'"]."">".$cats['category']."</a>";
}
if(!$admincats || sizeof(array_intersect(explode(",", $story['catid']), explode(",", $admincats)))) {
$output .= "<tr class="tblborder">";
$output .= "<td class="tblborder"><a href=""viewstory.php?sid=".$story['sid'"]."">".$story['storytitle']."</a>";
if($story['title']) $output .= " <b>:</b> <a href=""viewstory.php?sid=".$story['sid'"]."&chapter=".$story['inorder']."">".$story['title']."</a>";
$output .= "<td class="tblborder"><a href=""viewuser.php?uid=".$story['uid'"]."">".$story['penname']."</a></td>";
$output .= "<td class="tblborder">".(is_array($catstring) ? implode(", ", $catstring) : "")."</td>";
$output .= "<td class="tblborder"><a href=""admin.php?action=validate&chapid=".$story['chapid'"]."">"._VALIDATE."</a> | "._DELETE.": <a href=""stories.php?action=delete&chapid=".$story['chapid'"]."&sid=".$story['sid']."&admin=1&uid=".$story['uid']."">"._CHAPTER."</a> "._OR." <a href=""stories.php?action=delete&sid=".$story['sid'"]."&admin=1">"._STORY."</a> | <a href=""javascript:pop('admin.php?action=yesletter&uid=".$story['uid'"]."&chapid=".$story['chapid']."', 500, 400, 'yes')">"._YESLETTER."</a> | <a href=""javascript:pop('admin.php?action=noletter&uid=".$story['uid'"]."&chapid=".$story['chapid']."', 500, 400, 'yes')">"._NOLETTER."</a></td></tr>";
}
}
$output .= "</table>";
return $output;
}
// end submitted function
function validate( ) {
global $tableprefix, $level, $store, $storiespath, $allowed_tags, $admincats, $sitename, $siteemail, $url, $alertson;
$output .= "<center><h4>"._VIEWSUBMITTED."</h4></center>";
if($_GET['validate'] == "yes") {
$storyquery = mysql_query("SELECT story.validated, story.catid, story.sid, story.title, story.summary, story.uid, author.penname, chapter.inorder FROM ".$tableprefix."fanfiction_stories as story, ".$tableprefix."fanfiction_chapters as chapter, ".$tableprefix."fanfiction_authors as author WHERE author.uid = story.uid AND chapter.sid = story.sid AND chapter.chapid ='".$_GET['chapid']."' LIMIT 1");
list($validated, $catid, $sid, $title, $summary, $authoruid, $author, $inorder) = mysql_fetch_array($storyquery);
if($admincats == "0" || sizeof(array_intersect(explode(",", $catid), explode(",", $admincats)))) {
include("includes/emailer.php");
if($validated != "1") {
mysql_query("UPDATE ".$tableprefix."fanfiction_stories SET validated = '1', updated = NOW() WHERE sid = '".$_GET['sid']."'");
$categories = explode(",", $catid);
include("functions.php");
foreach($categories as $cat) {
categoryitems($cat, 1);
}
if($alertson) {
$subject = _NEWSTORYAT;
$mailtext = sprintf(_AUTHORALERTNOTE, $title, $author, $summary, $sid);
$favorites = mysql_query("SELECT author.uid, email, penname FROM ".$tableprefix."fanfiction_favauth as fav, ".$tableprefix."fanfiction_authors as author WHERE fav.favuid = $authoruid AND fav.uid = author.uid");
while($favuser = mysql_fetch_array($favorites)) {
sendemail($favuser['penname'], $favuser['email'], $sitename, $siteemail, $subject, $mailtext, "html");
}
}
}
else if($alertson) {
$subject = _STORYALERT;
$mailtext = sprintf(_STORYALERTNOTE, $title, $author, $sid, $inorder);
$favorites = mysql_query("SELECT author.uid, penname, email FROM ".$tableprefix."fanfiction_favstor as fav, ".$tableprefix."fanfiction_authors as author WHERE sid = '$sid' AND fav.uid = author.uid");
while($favuser = mysql_fetch_array($favorites)) {
sendemail($favuser['penname'], $favuser['email'], $sitename, $siteemail, $subject, $mailtext, "html");
}
}
mysql_query("UPDATE ".$tableprefix."fanfiction_chapters SET validated = '1' WHERE chapid = '".$_GET['chapid']."'");
mysql_query("UPDATE ".$tableprefix."fanfiction_stories SET updated = NOW( ) WHERE sid = '$sid'");
$output .= "<center><b>"._STORYVALIDATED."</b></center>";
}
else
$output .= "<br /><br /><center>"._NOTAUTHORIZEDADMIN." "._TRYAGAIN."</center><br /><br />";
}
else {
$result = mysql_query("SELECT story.title as storytitle, story.sid, story.catid, story.rid, story.gid, story.charid, story.wid, story.summary as storysummary, chapter.chapid, chapter.title, chapter.storytext, author.penname, chapter.uid as uid FROM ".$tableprefix."fanfiction_authors as author, ".$tableprefix."fanfiction_stories as story, ".$tableprefix."fanfiction_chapters as chapter WHERE chapter.chapid = '".$_GET['chapid']."' AND chapter.sid = story.sid AND chapter.uid = author.uid");
$story = mysql_fetch_array($result);
$output .= "<b>"._AUTHOR.":</b> ".$story['penname']."<br />";
$output .= "<b>"._TITLE.":</b> ".$story['storytitle'].": ".$story['title'];
$output .= "<br />";
$result3 = mysql_query("SELECT catid, category FROM ".$tableprefix."fanfiction_categories WHERE FIND_IN_SET(catid, '".$story['catid']."')");
$catstring = "";
$count = 0;
while($cats = mysql_fetch_array($result3)) {
if($count > 0) $catstring .= ", ";
$catstring .= "<a href=""categories.php?catid=".$cats['catid'"]."">".$cats['category']."</a>";
$categories[] = $cats['catid'];
$count++;
}
$output .= "<b>"._CATEGORY.":</b> $catstring<br />";
$output .= "<b>"._GENRES.":</b> ".(isset($story['gid']) ? preg_replace("/,/", ", ", $story['gid']) : _NONE);
$output .= "<br />";
$output .= "<b>"._RATING.":</b> ".$story['rid']."<br />";
if($story['wid'] != "")
{
$output .= "<b>"._WARNINGS.":</b> ".(isset($story['wid']) ? preg_replace("/,/", ", ", $story['wid']) : _NONE);
$output .= "<br />";
}
$output .= "<b>"._CHARACTERS.":</b> ".$story['charid'];
$output .= "<br />";
$output .= "<b>"._SUMMARY.":</b> ".$story['storysummary']."<br />";
$output .= "<a href=""admin.php?action=validate&sid=".$story['sid'"]."&chapid=".$story['chapid']."&validate=yes">"._VALIDATE."</a> | <a href=""stories.php?action=editstory&sid=$story[sid"]&admin=1">"._EDIT." - "._STORY."</a> | <a href=""stories.php?action=delete&sid=$story[sid"]">"._DELETE." - "._STORY."</a> | <a href=""javascript:pop('admin.php?action=yesletter&uid=$story[uid"]&chapid=$story[chapid]', 400, 300, 'yes')">"._YESLETTER."</a> | <a href=""javascript:pop('admin.php?action=noletter&uid=$story[uid"]&chapid=$story[chapid]',400, 300, 'yes')">"._NOLETTER."</a><br />";
if($store == "files")
{
$file = "$storiespath/".$story['uid']."/".$story['chapid'].".txt";
$log_file = fopen($file, "r");
$file_contents = fread($log_file, filesize($file));
$storytext .= $file_contents;
fclose($log_file);
}
else if($store == "mysql")
{
$storytext .= $story['storytext'];
}
if(strpos($story, "<br>") === false && strpos($story, "<p>") === false && strpos($story, "<br />") === false) $storytext = nl2br($storytext);
$storytext = format_story($storytext, $allowed_tags));
$output .= $storytext;
$output .= "<br /><br />";
$output .= "<a href=""admin.php?action=validate&sid=".$story['sid'"]."&chapid=".$story['chapid']."&validate=yes">"._VALIDATE."</a> | <a href=""stories.php?action=editchapter&chapid=".$story['chapid'"]."&admin=1">"._EDIT." - "._CHAPTER."</a> | <a href=""stories.php?action=delete&chapid=".$story['chapid'"]."&sid=".$story['sid']."&admin=1&uid=".$story['uid']."">"._DELETE." - "._CHAPTER."</a> | <a href=""javascript:pop('admin.php?action=yesletter&uid=".$story['uid'"]."&chapid=".$story['chapid']."', 400, 300, 'yes')">"._YESLETTER."</a> | <a href=""javascript:pop('admin.php?action=noletter&uid=".$story['uid'"]."&chapid=".$story['chapid']."',400, 300, 'yes')">"._NOLETTER."</a><br />";
}
return $output;
}
// end validate
function yesletter( ) {
global $tableprefix, $level, $adminemail, $sitename, $siteemail, $allowed_tags;
if($_POST['submit']) {
if($adminemail)
$ademail = $adminemail;
else
$ademail = $siteemail;
$subject = stripinput($_POST['subject']);
$letter = nl2br(stripinput($_POST['letter']));
include("includes/emailer.php");
$result = sendemail($_POST['email'], $_POST['email'], $adminname, $ademail, $subject, $letter, "html");
if($result) echo "<div style='text-align: center;'>"._EMAILSENT."</div>";
else echo "<div style='text-align: center;'>"._ERROR."</div>";
}
else {
$authorquery = mysql_query("SELECT email,penname FROM ".$tableprefix."fanfiction_authors WHERE uid = '".$_GET['uid']."' LIMIT 1");
$author = mysql_fetch_array($authorquery);
$storyquery = mysql_query("SELECT story.title, chapter.title as chapter FROM ".$tableprefix."fanfiction_stories as story, ".$tableprefix."fanfiction_chapters as chapter WHERE chapter.chapid = '".$_GET['chapid']."' AND chapter.sid = story.sid LIMIT 1");
$story = mysql_fetch_array($storyquery);
$letter = file_get_contents("messages/thankyou.txt");
echo "<body>";
echo "<table><tr><td>Story:</td><td>".$story['title'].": ".$story['chapter']."</td></tr>";
echo "<tr><td>"._BY.":</td><td>".$author['penname']."</td></tr>";
echo "<form method="POST" enctype="multipart/form-data" action="admin.php?action=yesletter">
<tr><td>To:</td><td><INPUT type="text" class="textbox=" name="email" value="".$author['email'].""></td></tr>
<tr><td>From:</td><td><INPUT type="text" class="textbox=" name="ademail" value="$adminemail"></td></tr>
<tr><td>Subject:</td><td><INPUT type="text" class="textbox=" name="subject" value="Your Submission to $sitename"></td></tr>
<tr><td colspan="2"><textarea class="textbox" name="letter" cols="50" rows="8">$letter</TEXTAREA></td></tr><tr><td colspan="2"><INPUT type="submit" class="button" name="submit" value=""._SUBMIT.""></form></td></tr></table></body></html>";
}
exit( );
}
// end yesletter
function noletter( ) {
global $tableprefix, $level, $adminemail, $sitename, $siteemail, $allowed_tags, $adminloggedin;
if($_POST['submit'])
{
if($adminemail)
$ademail = $adminemail;
else
$ademail = $siteemail;
$subject = stripinput($_POST['subject']);
$letter = nl2br(stripinput($_POST['letter']));
include("includes/emailer.php");
$result = sendemail($_POST['email'], $_POST['email'], $adminname, $ademail, $subject, $letter, "html");
if($result) echo "<div style='text-align: center;'>"._EMAILSENT."</div>";
else echo "<div style='text-align: center;'>"._ERROR."</div>";
}
else
{
$authorquery = mysql_query("SELECT email,penname FROM ".$tableprefix."fanfiction_authors WHERE uid = '".$_GET['uid']."' LIMIT 1");
$author = mysql_fetch_array($authorquery);
$storyquery = mysql_query("SELECT story.title, chapter.title as chapter FROM ".$tableprefix."fanfiction_stories as story, ".$tableprefix."fanfiction_chapters as chapter WHERE chapter.chapid = '".$_GET['chapid']."' AND chapter.sid = story.sid LIMIT 1");
$story = mysql_fetch_array($storyquery);
$letter = file_get_contents("messages/nothankyou.txt");
echo "<body>";
echo "<table><tr><td>Story:</td><td>".$story['title'].": ".$story['chapter']."</td></tr>";
echo "<tr><td>"._BY.":</td><td>".$author['penname']."</td></tr>";
echo "<form method="POST" enctype="multipart/form-data" action="admin.php?action=noletter">
<tr><td>To:</td><td><INPUT type="text" class="textbox=" name="email" value="".$author[email].""></td></tr>
<tr><td>From:</td><td><INPUT type="text" class="textbox=" name="ademail" value="$adminemail"></td></tr>
<tr><td>Subject:</td><td><INPUT type="text" class="textbox=" name="subject" value="Your Submission to $sitename"></td></tr>
<tr><td colspan="2"><textarea class="textbox" name="letter" cols="50" rows="8">$letter</TEXTAREA></td></tr><tr><td colspan="2"><INPUT type="submit" class="button" name="submit" value=""._SUBMIT.""></form></td></tr></table></body></html>";
}
exit( );
}
// end noletter
?>
Thanks
I don't know about question two. I have them bridged, and as far as I know, it's sending out acceptance/rejection letters, but not other emails.
Question two would require some database edits. If you added new tables to the fanfiction_authors tables (otherwise, besides bio, I don't know which fields you're referring to), then you'd have to move them to the fanfiction_authorprefs table and rewrite some code to pull those from that table.
thanks for your reply.
Regarding question one - profile info - I dont understand why it is only displaying those fields from SMF profile and not the complete profile summary.
It is not using the efiction bio/profile info, so I dont understand why I would have to edit the database?
As for the question two, acceptance/rejection letter problem. I just get that error every time I click on send acceptance/rejection letter. I click on acceptance letter for example, and it brings up the box where you can edit the text, then when I click on submit I get the error. I can validate, just not send out letters 🙁
Click image for bigger size:
Is it odd that it only says ' : by' at the top of the form? should it have something on the other side of the ':' ?
Above is what I get after I 'submit'
thanks for your reply.
Regarding question one - profile info - I dont understand why it is only displaying those fields from SMF profile and not the complete profile summary.
It is not using the efiction bio/profile info, so I dont understand why I would have to edit the database?
Well, I suppose you could do it both ways. You could just edit the php to pull the info from the smf database, but the fields you mention that are writing specific aren't going to be in the smf database. efiction still pulls info from the author_prefs table which is why I suggested you use it. Ideally, you'd want to have the things that are overlapping, like bios just come from the smf databse, and the writing specific information come from the efiction database. Either way you do it will require php and possible database edits.
My letters are doing the same thing, but I had to go and look just now, and I don't really know why and I don't have time to look at it now. My guess is it's a bug in the bridge script, but Tammy would have to shed light on that. If she doesn't reply to this thread soon, you should start a thread in the bugs forum.
thanks for your reply.
Regarding question one - profile info - I dont understand why it is only displaying those fields from SMF profile and not the complete profile summary.
It is not using the efiction bio/profile info, so I dont understand why I would have to edit the database?
Well, I suppose you could do it both ways. You could just edit the php to pull the info from the smf database, but the fields you mention that are writing specific aren't going to be in the smf database. efiction still pulls info from the author_prefs table which is why I suggested you use it. Ideally, you'd want to have the things that are overlapping, like bios just come from the smf databse, and the writing specific information come from the efiction database. Either way you do it will require php and possible database edits.
Thanks Clarissa but I still dont understand. It is displaying smf profile info, and not efiction profile info. But my question is really, why does it only display part of the smf profile data if it is pointing at smf profile?
It is displaying smf profile instead of efiction profile but instead of the full smf profile, it only shows these fields:
- real name,
- date joined forum,
- membership status
- avatar
There are a lot more fields in the standard smf profile so why doesnt it show those?
I dont understand what you mean about the database edits as it isnt using efiction fields - right?
I don't know about question two. I have them bridged, and as far as I know, it's sending out acceptance/rejection letters, but not other emails.
Question two would require some database edits. If you added new tables to the fanfiction_authors tables (otherwise, besides bio, I don't know which fields you're referring to), then you'd have to move them to the fanfiction_authorprefs table and rewrite some code to pull those from that table.
the fields I'm referring to are in the SMF forum profile - same ones as you have on this forum, but they dont all show up in the member profile on efiction, only the fields I listed above - so where are the rest of them?
My letters are doing the same thing, but I had to go and look just now, and I don't really know why and I don't have time to look at it now. My guess is it's a bug in the bridge script, but Tammy would have to shed light on that. If she doesn't reply to this thread soon, you should start a thread in the bugs forum.
Thanks, I will await a reply and report it if not
It is displaying smf profile instead of efiction profile but instead of the full smf profile, it only shows these fields:
- real name,
- date joined forum,
- membership status
- avatarThere are a lot more fields in the standard smf profile so why doesnt it show those?
I don't understand what you mean about the database edits as it isnt using efiction fields - right?
Ok, I'm just going to explain how efiction handles author information. There are two tables with information--the authors (members) table and the authors_prefs table. When not bridged, efiction pulls information from both of them. When it is bridged with SMF, it only pulls from the authors_prefs table and uses the SMF members table. If you have, as you say, "writer specific" information, then you'd need to move those tables to the prefs table and modify the code to pull them and assign them a tpl (so they can be used in the templates).
If you just want to pull information from the existing SMF information table, then you'd have to modify your efiction files to pull the information from the database and, again, assign it a tpl. The reason it's not pulling all the fields from the smf member's table is that the bridge is very basic. You'd need to mod it to get it to do what you want.
Thanks for your reply and explanation.
I don't know how to do what you just explained. If there were some detailed instructions then I could follow them and make the changes but without something to follow, I'm a bit stuck.
All I want is for the SMF forum profile fields to display in the author bio page - the same SMF forum profile fields as you have in this forum. I don't know how to do that without a lot more guidance and instructions,and I don't want to mess up my database.
So currently I am stuck in the middle with a profile that only displays 5 fields - penname, realname, member level, member since, and avatar.
At the moment it is currently useless because I don't have the SMF profile fields that I want and neither do I have the efiction profile fields because its 'bridged'.
If anyone knows how to do what I want or has done it themselves I would appreciate some help
thanks
I am also seeing the accept/reject email issue being described here on my site. I am using my vBulletin bridge, but this is based on the included SMF bridge, so it is possible that the same root issue is to blame.
Edit: I just did some quick browsing and think I may have found the issue. I checked yesletter.php and the query is formatted like this
$adminquery = dbquery("SELECT email, penname FROM ".$tableprefix."fanfiction_authors WHERE uid = '$useruid' LIMIT 1");
That does not use any of the associations from queries.php, so it is referencing the unused fanfiction_authors table instead of the bridged user table.


