Mosets Reviews Plugin

15 years 6 months ago #5376 by Dehaw
Mosets Reviews Plugin was created by Dehaw
I found a bug with the sql statement within the reviews plugin today, it currently reads:

[code:1]$database->setQuery( "SELECT r.*, l.* FROM #__mt_reviews AS r, #__mt_links AS l "
. "WHERE r.link_id = l.link_id AND l.link_published='1' AND l.link_approved='1' AND r.rev_approved='1' AND r.user_id='".$user->id."'"
. "ORDER BY r.rev_date DESC"«»);[/code:1]

It should read:

[code:1]$database->setQuery( "SELECT r.*, l.* FROM #__mt_reviews AS r, #__mt_links AS l "
. "WHERE r.link_id = l.link_id AND l.link_published='1' AND l.link_approved='1' AND r.rev_approved='1' AND l.user_id='".$user->id."'"
. "ORDER BY r.rev_date DESC"«»);[/code:1]

I changed:

[code:1]r.user_id='".$user->id."[/code:1]

With:

[code:1]l.user_id='".$user->id."[/code:1]

and now it shows the correct reviews that relates to that users links.

I hope this helps someone.

Please Log in to join the conversation.

15 years 6 months ago #5414 by gotMoxie
Replied by gotMoxie on topic Re:Mosets Reviews Plugin
By changing that 'r.user_id' to 'l.user_id' you are now pulling the Links that the profiled user Owns with hrefs to the reviews of their Link.

The plug-in was written to pull the Reviews that the profiled user has written (about other people's Links).

Does that make sense?

I'm not sure I see the use in the revision that you made as the My Links plug-in already pulls the profiled user's Links.

I guess with the change you made the plug-in could be called "Reviews of My Links".

If that is what you are after, I'm glad it works for you. But the original code works the way I had envisioned the plug-in.

Sam Lewis
Moxie Media, LLC

Sam Lewis
Moxie Media, LLC

CB3PD

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.435 seconds

Facebook Twitter LinkedIn