Forum

Notifications
Clear all

[MODULE] Recommendations

28 Posts
12 Users
0 Likes
15.2 K Views
(@tammy)
Posts: 2577
Member Moderator
Topic starter
 

Description: Recommendations module to allow the "archiving" of off-site stories on your site.

Demo: http://sgxover.hugosnebula.com

Download: http://efiction.hugosnebula.com

Click the downloads link.  You must be a member of my site to get to the downloads themselves.

 
Posted : 27/01/2007 4:07 pm
(@dreamhowler)
Posts: 147
Estimable Member
 

Tammy, is this ready for a live site yet?

*looks hopeful!*

Dreamy

Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 02/02/2007 1:04 am
(@tammy)
Posts: 2577
Member Moderator
Topic starter
 

Well it's up and working on my Wormhole Crossing site.  So far I'm the only one who's submitted any recommendations. 

 
Posted : 02/02/2007 1:16 am
(@dreamhowler)
Posts: 147
Estimable Member
 

Great! *bounces excitedly*

I saw your URL, and went to visit the site. I am quite excited as you must know since I have wanted this forever! LOL. I am using a very good links script right now, but it just don't list it like I wanted it to. I asked for a mod and the guy that responded keeps asking me to clarify what I want. *blinks*

I will upload it to the RQ and start putting in links and let you know! πŸ™‚ Do you want bugs here or on your site?

Dreamy

Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 02/02/2007 1:38 am
(@tammy)
Posts: 2577
Member Moderator
Topic starter
 

Put bug reports on my site.  No need to clutter things up here.

 
Posted : 02/02/2007 11:49 am
(@michelle)
Posts: 106
Estimable Member
 

URL: http://nan.waking-vision.com
Latest install of eFiction, 3.2.2
Latest Patche(s): Yes
Have you modified your eFiction?: Lastlogin (which doesn't seem to be working on the test site *shrugs*)
Version of PHP: 4.4.1
Version of MySQL: 4.0.23
Have you searched for your problem: Yes

I thought I'd give this a try on my test install, and I almost got it to work:) I can add recs and can browse them, but I can't access them from the profile page. It says I'm not authorizes to view this page. I looked at the different panels for this module and couldn't find anything to fix this. Tried to access it anonymously, as a member and as admin - all with the same success:(

Any ideas what I'm missing? See my account for what I mean: http://nan.waking-vision.com/viewuser.php?uid=1

 
Posted : 07/04/2007 4:38 pm
(@babaca)
Posts: 722
Member Moderator
 

You need to post this over on Tammy's website and not here. That's what she posted above your note. Are you sure you installed all of the module? Because I noticed in your browse menu recommendations aren't listed at all (and it is in mine). But yes I did notice on mine if I click on someone's recs it gives you a "your not authorized message". But really post this on Tammy's site because she'll get to it pretty quick. She resolved my earlier recommendations problem before. Just go to where you downloaded the module and look for the forum there.

******************************************
Mucking around in eFiction since circa 2001 (ver. 1.0)
Now running v.3

 
Posted : 07/04/2007 5:18 pm
(@tammy)
Posts: 2577
Member Moderator
Topic starter
 

Already answered on my site.  See the lastest replies to the "Recommendations Module" thread in the "Module Development" forum.

 
Posted : 07/04/2007 5:40 pm
(@michelle)
Posts: 106
Estimable Member
 

Thanks, worked like a charm!

 
Posted : 07/04/2007 6:53 pm
(@dreamhowler)
Posts: 147
Estimable Member
 

I updated the module at the end of October, and posted this bug to Tammy's site, however I guess she has been too busy lately, or RL is interfering, or she is working on something more important. *chuckles* So I wanted to see if anyone else could perhaps help me fix it.

  • Whole Admin section appears to be blank. When I hit Page Source, instead of code, it's blank as well, but I have checked the server file and it's not blank.
  • Can no longer approve recs other than my own.  I am having to go to the phpmyadmin part of my site to get them to show up.
  • When I upgraded to 1.3, it seems to have a duplicated all sections: Including Site info block, and the admin page. I was tired of the duplication: so I uninstalled the module and re-installed it. The duplication is gone now, but admin section doesn't work still.
  • Recommendations link on admin panel is blank. I have to go through the Modules panel to edit them

The following pages show a blank page, no errors, or anything.

modules/recommendations/admin.php
modules/recommendations/admin.php?action=manage 

See: http://rq.citadelofthewolf.com/index.php
Notes: I have latest patches of 3.3.1

Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 04/11/2007 2:48 pm
(@dreamhowler)
Posts: 147
Estimable Member
 

My friend tehbizness who I met on ScriptLance, was able to help me fix this. He's the great programmer that made my book review script for my site. πŸ™‚

Anyway, this is what he said:

I compared some of the coding with other files.  I looked at the first line of code in the admin.php page and saw that if CHARSET wasn't defined it exited.  So I fixed that.  Then I saw it wasn't including the file that CHARSET was defined in, so I fixed that. Then it had a bunch of text to output but it wasn't.  So I compared to another file of similar setup, assigned the template to it, and printed the output. Then it was looking for BASEDIR which wasn't defined where I looked so I defined the BASEDIR and got that to work.

So he modified the languages/en.php and modules/recommendations/admin.php


Languages: en.php

You need to define the BaseDir:

define ("_BASEDIR", "/home/SERVER/FTPUSERNAME/rq.citadelofthewolf.com/");

This must be your entire base directory


Admin Page:  I am not all sure what he changed, so I copied the entire admin file here.

<?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
// ----------------------------------------------------------------------
include ("../../header.php");
if(!defined("_CHARSET")) exit();

$current = "recommendations";
//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($_GET['action'] == "add" || $_GET['action'] == "edit") $displayform = 1;


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."modules/recommendations/languages/{$language}.php")) include_once(_BASEDIR."modules/recommendations/languages/{$language}.php");
else include_once(_BASEDIR."modules/recommendations/languages/en.php");
$output = "<div id='pagetitle'>"._RECADMIN."</div>";
if(!isADMIN) accessDenied( );

if(isset($_POST['submit'])) {
$anonrecs = $_POST['anonrecs'] == 1 ? 1 : 0;
$rectarget = isNumber($_POST['rectarget']) && $_POST['rectarget'] < 3 ? $_POST['rectarget'] : 0;
$autovalrecs = $_POST['autovalrecs'] == 1 ? 1 : 0;
$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET anonrecs = '$anonrecs', rectarget = '$rectarget', autovalrecs = '$autovalrecs' WHERE sitekey = '".SITEKEY."'");
if($result) $output .= write_message(_ACTIONSUCCESSFUL."<br /><a href="'admin.php?action=modules&module=recommendations&admin=true'>"._CONTINUE."</a>");"
else $output .= write_error(_ERROR);
}
else if($action == "uninstall") {
$output .= write_message(_CONFIRMUNINSTALL."<br /><a href="'uninstall.php?confirm=yes'>"._YES."</a>" "._OR." <a href="'uninstall.php?confirm=no'>"._NO."</a>");"
}
else if($action == "featured") {
if(isset($_GET['retire']) && preg_match("/^[0-9]+$/", $_GET['retire']))
dbquery("UPDATE ".TABLEPREFIX."fanfiction_recommendations SET featured = 2 WHERE recid = ".$_GET['retire']);
if(isset($_GET['remove']) && preg_match("/^[0-9]+$/", $_GET['remove']))
dbquery("UPDATE ".TABLEPREFIX."fanfiction_recommendations SET featured = 0 WHERE recid = ".$_GET['remove']);
if(isset($_GET['feature']))
dbquery("UPDATE ".TABLEPREFIX."fanfiction_recommendations SET featured = 1 WHERE recid = ".$_GET['feature']);
$fresult = dbquery("SELECT rec.*, "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_recommendations as rec, "._AUTHORTABLE." WHERE rec.featured > 0 AND rec.uid = "._UIDFIELD);
$output .= "<div class='sectionheader'>"._FEATUREDRECS."</div>";
if(!dbnumrows($fresult)) $output .= write_message(_NORESULTS);
else {
$output .= "<table class="tblborder" cellpadding="5" style="margin: 1em auto;"><tr><th class="tblborder">"._STORIES."</th><th class="tblborder">"._STATUS."</th><th class="tblborder">"._OPTIONS."</th></tr>";
while($story = dbassoc($fresult)) {
$output .= "<tr><td class="tblborder"><a href=""viewstory.php?sid=$story[recid"]">$story[title]</a> "._BY." <a href=""viewuser.php?uid=$story[uid"]">$story[penname]</a></td><td class="tblborder" align="center">".($story['featured'] == 1 ? _ACTIVE : _RETIRED)."</td><td class="tblborder" align="center">".($story['featured'] == 1 ? "<a href=""admin.php?action=featured&retire=$story[recid"]">"._RETIRE."</a>" : "<a href=""admin.php?action=featured&feature=$story[recid"]">"._CURRENT."</a>")." | <a href=""admin.php?action=featured&remove=$story[recid"]">"._REMOVE."</a></td></tr>";
}
$output .= "</table>";
$output .= write_message(_FEATUREDNOTE);
}
}
else if($action == "manage") {
$validate = isset($_GET['validate']) && isNumber($_GET['validate']) ? $_GET['validate'] : false;
if($validate) {
dbquery("UPDATE ".TABLEPREFIX."fanfiction_recommendations SET validated = '1' WHERE recid = '$validate' LIMIT 1");
if($logging) {
list($recurl, $title) = dbrow(dbquery("SELECT url, title FROM ".TABLEPREFIX."fanfiction_recommendations WHERE recid ='$validate' LIMIT 1"));
dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_LOG_VALIDATE_REC, "<a href="'viewuser.php?uid=".USERUID."'>".USERPENNAME."</a>"," "<a href="'$recurl'>$title</a>"))."'," '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RC')");
}
$output .= write_message(_ACTIONSUCCESSFUL);
}
$recs = dbquery("SELECT rec.*, "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_recommendations as rec LEFT JOIN "._AUTHORTABLE." ON rec.uid = "._UIDFIELD." WHERE rec.validated = 0");
if(dbnumrows($recs)) {
$output .= "
<table class='tblborder' style='margin: 1em auto;'>
<tr>
<th class='tblborder'>"._TITLE."</th>
<th class='tblborder'>"._MEMBER."</th>
<th class='tblborder'>"._OPTIONS."</th>
</tr>";
while($rec = dbassoc($recs)) {
$output .= "
<tr>
<td class='tblborder'><a href="'".$rec['url'"]."'>".stripslashes($rec['title'])."</a> ".ratingpics($rec['rating'])."</td>
<td class='tblborder'>".($rec['uid'] > 0 ? "<a href="'"._BASEDIR."viewuser.php?uid=".$rec['uid'"]."'>".$rec['penname']."</a>" : $rec['recname'])."</td>
<td class='tblborder'><a href="'manage.php?action=edit&amp;edit=".$rec['recid'"]."'>"._EDIT."</a> | <a href="'manage.php?action=delete&amp;delete=".$rec['recid'"]."'>"._DELETE."</a> | <a href="'admin.php?action=manage&amp;validate=".$rec['recid'"]."' onClick='return confirm(""._CONFIRMVALID."")'>"._VALIDATE."</a></td>
</tr>";
}
$output .= "</table>";

}
else $output .= write_message(_NORESULTS);
$output .= write_message("<a href="'manage.php?action=add'>"._ADDREC."</a>");"

}
else {
$output .= "<div class='tblborder'><form method="POST" enctype="multipart/form-data" action="admin.php?action=modules&amp;module=recommendations&amp;admin=true">";
$output .= "<label for="anonrecs">"._ANONRECS.": </label><select name="anonrecs">
<option value="1"".($anonrecs == "1" ? " selected" : "").">"._YES."</option>
<option value="0"".($anonrecs == "0" ? " selected" : "").">"._NO."</option>
</select><br />
<label for="anonrecs">"._AUTOVALRECS.": </label><select name="autovalrecs">
<option value="1"".($autovalrecs == "1" ? " selected" : "").">"._YES."</option>
<option value="0"".($autovalrecs == "0" ? " selected" : "").">"._NO."</option>
</select><br />
<label for="reclink_target">"._TARGET.":</label><select name="rectarget" class="textbox">
<option value="0"".($rectarget == 0 ? "" : " selected").">"._SAMEWINDOW."</option>
<option value="1"".($rectarget == 1 ? " selected" : "").">"._NEWWINDOW."</option>
<option value="2"".($rectarget == 2 ? " selected" : "").">"._FRAMED."</option>
</select><br />";
$output .= "<div style='text-align: center; margin: 1ex auto;'><INPUT type="submit" class="button" name="submit" value=""._SUBMIT.""></div></form></div>";
$output .= write_message("<a href="'admin.php?action=uninstall'>"._UNINSTALLMODULE."</a>");"
$countquery = dbquery("SELECT count(recid) FROM ".TABLEPREFIX."fanfiction_recommendations WHERE validated = 0");
list($count) = dbrow($countquery);
if($count > 0) $output .= write_message(sprintf(_RECQUEUE, $count));
}
$tpl->assign("output", $output);
$tpl->printToScreen( );
?>

Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 16/12/2007 7:05 pm
(@purpleyin)
Posts: 16
Active Member
 

Thanks DreamHowler and tehbizness! (not to mention Tammy too for greating such a cool module in the first place)

I had the problem of the blank admin pages and not being able to validate recommendations because of it - had tried redownloading and un/reinstalling to no effect, but the code changes above fixed the problem. πŸ™‚

 
Posted : 10/02/2008 11:55 am
(@dreamhowler)
Posts: 147
Estimable Member
 

No problem! Glad we could help you out! πŸ™‚

Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 10/02/2008 5:17 pm
(@omega13a)
Posts: 7
Active Member
 

Validating new recommendations doesn't seam to work after upgrading eFiction to 3.4.2. Every time I click on validate, I get a blank page...

Fish need bicycles!

 
Posted : 09/04/2008 6:32 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
 

Make sure that you downloaded the Recs module for version 3.4 since an update of the module came out, and please post all help and support requests for Tammy's modules on her site!

Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 10/04/2008 3:36 am
Page 1 / 2
Share: