Notifications
Clear all

[Solved] Favourites no longer working after bridge

2 Posts
1 Users
0 Reactions
1,374 Views
(@YourFanfiction)
Posts: 0
 

URL to your eFiction: http://www.yourfanfiction.com/
Version of eFiction: 3.5.3
Have you bridged eFiction, if so with what?: SMF 1.1.16
Version of PHP: PHP 5.2.16
Version of MySQL: 5.1.52
Have you searched for your problem: yes
If so, what terms did you try: smf favourite problem, smf favourites
Test Account: U/N: Test P/W: admin123
State the nature of your problem: I've recently bridged my existing efiction site to a new smf site. It's mostly working, bar a few teething problems. One of these problems is that my users can no longer add an author to their favourites, if they're going from the authors efiction profile page. I have noticed that the link from the efiction author's profile page shows up as this:
http://www.yourfanfiction.com/user.php?uid=USERUID&action=favau&author=2
Whereas going from the favourite author link on one of the fictions pages, the link looks like this:
http://www.yourfanfiction.com/user.php?action=favau&add=2

Also, here's the code from my profile.php:

$tpl->newBlock("profile");
$result2 = dbquery("SELECT *, UNIX_TIMESTAMP(date) as date FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
$userinfo = dbassoc($result2);
$nameinfo = "";
if($userinfo['email'])
$nameinfo .= " [<a href=""viewuser.php?action=contact&amp;uid=".$userinfo['uid'"]."">"._CONTACT."</a>]";
if(!empty($favorites) && isMEMBER && $userinfo['uid'] != USERUID) {
$fav = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_favorites WHERE uid = '".USERUID."' AND type = 'AU' AND item = '".$userinfo['uid']."'");
if(dbnumrows($fav) == 0) $nameinfo .= " [<a href=""user.php?action=favau&amp;uid=".USERUID."&amp;add=".$userinfo['uid'"]."">"._ADDAUTHOR2FAVES."</a>]";
}
$tpl->assign("userpenname", $userinfo['penname']." ".$nameinfo);
$tpl->assign("membersince", date("$dateformat", $userinfo['date']));
if($userinfo['realname'])
$tpl->assign("realname", $userinfo['realname']);
if($userinfo['bio']) {
$bio = nl2br($userinfo['bio']);
$tpl->assign("bio", stripslashes($bio));
}

I've changed it slightly based on someone else's code so that, instead of contacting the author, a user can view their smf profile. I'm assuming it's a section in this code that's messing up my links, so if anyone can suggest how I can fix this, I would be eternally grateful πŸ™‚


 
Posted : 14/07/2012 6:45 pm
(@YourFanfiction)
Posts: 0
 

Fixed! I changed

<a href=""user.php?action=favau&amp;uid=".USERUID."&amp;add=".$userinfo['uid'"]."">"._ADDAUTHOR2FAVES."</a>

to

<a href="""._BASEDIR."user.php?action=favau&amp;add=".$userinfo['uid'"]."&amp;author=".$stories['uid'].($stories['coauthors'] ? ",".$stories['coauthors'] : "")."">"._ADDAUTHOR2FAVES."</a>

 
Posted : 01/08/2012 10:18 am
Share: