Favorites not working?

15 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 28, 2010   (RSS)

By ILLUME-MEDIA-LABS - July 12, 2010 - edited: July 12, 2010

Hey All,

How do I make the favorites script work? I have installed and added to the site, but am not sure what I am doing wrong. Here is a link to the favorites: http://www.illumemag.com/zine/articleDetail.php?Hundreds-Protest-in-Oakland-After-Mehserle-Verdict-13103

Its the first icon (notebook with a star) amongst the icon set.

Thanks.

Re: [Illume Magazine] Favorites not working?

By Jason - July 13, 2010

Hi,

I took a look. You don't actually link to the favorites plugin to make it work. What you actually do is add some javascript files to your page that makes a call to the .php page for you. If you look in the folder that came with your plugin, there should be a "readme.txt" file (I've attached it just in case it isn't there). This will take you through the steps of adding website favorites to your pages. NOTE: You must have the website Memberships plugin in activated and in use in order to have websiteFavorites work.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Attachments:

readme_001.txt 10K

Re: [Jason] Favorites not working?

By ILLUME-MEDIA-LABS - July 13, 2010

Hi Jason. Thanks for your help. I have updated with the instructions from the txt file. So now I am not receiving any errors. But I don't think the plugin is working. Would you mind testing it for me?

You can create an account by click on 'login' link on the header: www.illumemag.com and read any article and click on the 'star notebook' image. If you check your profile, the message we receive is 'there are no favorites yet'.

Thanks!

Re: [Illume Magazine] Favorites not working?

By Jason - July 13, 2010

Hi,

There is actually a fatal javascript error occurring when the page loads. In order to look into this further, I'm going to need you to send me you CMS login and FTP details to jason@interactivetools.com.

Please only email this information, don't post them to the forum.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Favorites not working?

By Djulia - July 22, 2010

Hi,

I have a problem with the plugin (cmsB 2.05 and websiteFavorites 1.00).

The selections are correctly recorded in the table, but impossible to obtain the list.

print_r($favoriteRecords) gives the error :
Notice: Undefined variable: favoriteRecords in ...

An idea ?

Thanks, :)
Djulia

Re: [Djulia] Favorites not working?

By Jason - July 22, 2010

Hi Djulia,

My first guess is that you're missing the code that retrieves the list of favorites from the database.

It should look something like this:

<?php
require_once "cmsAdmin/lib/viewer_functions.php";

// get favorite record nums
$tableOrTag = mysql_escape('news'); // update this with your table or tag name
$currentUserNum = mysql_escape( @$CURRENT_USER['num'] );
$favoriteNumsQuery = "SELECT recordNum FROM {$TABLE_PREFIX}_website_favorites WHERE tableOrTag = '$tableOrTag' AND createdByUserNum = '$currentUserNum'";

// load matching records
list($favoriteRecords, $favoriteMetaData) = getRecords(array(
'tableName' => 'news', // update this with your table or tag name
'perPage' => '10',
'where' => " num IN ($favoriteNumsQuery) ",
'loadCreatedBy' => false,
'allowSearch' => false,
));
?>


You just have to change "news" with the name of your table.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Favorites not working?

By Djulia - July 22, 2010 - edited: July 22, 2010

Hi Jason,

I have more error message, but the array "print_r($favoriteRecords)" is empty.

Another idea ?

Thanks ! :)
Djulia
Attachments:

listfav.php 2K

Re: [Djulia] Favorites not working?

By Jason - July 22, 2010

Hi,

Have you made sure that you have added favorites to the database? Also make sure that you're logged in while testing.

Other than that, I'll need a link to your site and have you attach the .php page that you're working with to take a closer look.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Favorites not working?

By Djulia - July 26, 2010 - edited: July 26, 2010

Hi Jason,

I have another problem with the use of link AJAX.
The use return a Javascript error on the pages which use rewriting rules.

You already made this observation on other sites?

Thanks for your assistance.

Djulia

Re: [Djulia] Favorites not working?

By Jason - July 26, 2010

Hi Djulia,

Could you tell me exactly what the error you're experiencing is?

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/