Knowledgebase
View categorized listing of all common frequently asked questions.
Video Tutorials (jReviews 2.0)
Create a Movie & TV Show review website.
Customize the jReviews themes.
Review user profiles with the Everywhere addon.
Forum
Community forum
Submit a Ticket
Use your client area email to access the ticket system.
Downloads
Guides, modules and more...
CSV Import for Joomla and jReviews
 
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 09:52:58 PM
21662 Posts in 4948 Topics by 2838 Members
Latest Member: davidkan
News: Use your client area email when you sign up to the forum so we can identify you as a trial or licensed user. Otherwise we may not answer your questions.
 
jReviews Support Forum  |  jReviews 1.x - jReviews Modules and Hook Components  |  Modules & bots  |  VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products « previous next »
Pages: [1]
Author Topic: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products  (Read 3023 times)
axelman
Newbie
*
Offline Offline

Posts: 14


« on: February 25, 2008, 05:01:24 AM »

Hi everybody need your urgent help!!!

Well it was a frustrating weekend hired 3 developers to display the top 5 user rated products from Virtuemart integrated with Jreviews + Jreviews Everywhere and none of the 3 ever answered back, they just dissappear,  can some one please help me I'm not a developer but I'm trying to finish this part that now has taken more than 5 days.

Alejandro pointed me to this, but I dont have the knowlege, please check it out:

The dashboard only works with regular content, not JRE. The closest thing to it is this module
http://support.reviewsforjoomla.com/index.php?_m=downloads&_a=viewdownload&downloaditemid=3&nav=0,3


Now before the integration with Jreviews+Jreviews Everywhere I was using this function to retrive the top 5 user rated products, it was very simple and I could understand it:

$sql = "SELECT p.product_name, pv.*"
      . "\n FROM #__vm_product AS p left join #__vm_product_votes AS pv"
      . "\n on p.product_id=pv.product_id"
      . "\n ORDER BY rating desc limit 5";
      $database->setQuery( $sql );
      $rows = $database->loadObjectList( 'product_id' );
      //if (count($rows)>0) {
   ?>
   <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="solusionrating">
   <tr><td colspan="2" style="border-bottom:solid 1px #cccccc"><span>Solution Ratings</span></td></tr>
   <?
      foreach ($rows as $v ) {
            $rat  =($v->rating != NULL) ? $v->rating : 0;
            echo  "<tr><td class=\"tdsol\">".$v->product_name."</td><td align=\"right\">";
            echo "<img src=\"".$mosConfig_live_site."/templates/michael_hall/images/".$rat.".gif\"/>";
            echo "</td></tr>";
         }
      if (count($rows) < 4) {
         for ($i=0;$i<(4-count($rows));$i++) {
            echo  "<tr><td class=\"tdsol\" colspan=\"2\">&nbsp;</td></tr>";
         }
      }


But now I'm totally lost please I need some help with the queries to add them to the same function. Or if you would like to take a look in my site please let me know.

Thank you so much in advance  Huh Huh Huh Huh
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8593


« Reply #1 on: February 25, 2008, 07:55:04 AM »

Code:
$sql = "SELECT p.product_name, pv.*"
. ",\n (SUM(rating.ratings_sum-review.author*rating.ratings_sum)/SUM(rating.ratings_qty-review.author*rating.ratings_qty)) AS user_rating"
. "\n FROM #__vm_product AS p"
. "\n INNER JOIN #__jreviews_comments AS review ON review.pid = p.product_id AND review.published='1' and review.author='0'"
. "\n LEFT JOIN #__jreviews_ratings AS rating ON review.id = rating.reviewid"
. "\n ORDER BY user_rating desc limit 5";
$database->setQuery( $sql );
$rows = $database->loadObjectList( 'product_id' );

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="solusionrating">
<tr><td colspan="2" style="border-bottom:solid 1px #cccccc"><span>Solution Ratings</span></td></tr>
<?
  foreach ($rows as $v ) {
$rat  =($v->user_rating != NULL) ? $v->user_rating : 0;
echo  "<tr><td class=\"tdsol\">".$v->product_name."</td><td align=\"right\">";
echo "<img src=\"".$mosConfig_live_site."/templates/michael_hall/images/".$rat.".gif\"/>";
echo "</td></tr>";
}
  if (count($rows) < 4) {
for ($i=0;$i<(4-count($rows));$i++) {
echo  "<tr><td class=\"tdsol\" colspan=\"2\">&nbsp;</td></tr>";
}
  }
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
axelman
Newbie
*
Offline Offline

Posts: 14


« Reply #2 on: February 26, 2008, 06:31:22 PM »

Alejandro,

Thank you so much!!! the total count of Missing in Action pseudo-developers went up to 5, until you help me with the queries and fix things my self.

Your support and product are awsome.

Thanks, Thanks, Thanks!!!!
Logged
slimtim
Newbie
*
Offline Offline

Posts: 15


« Reply #3 on: August 21, 2008, 07:17:44 AM »

Is this the add-on jReviews module that is modified or is it the VirtueMart TopTen products Module that has been modified?

br // Slim
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8593


« Reply #4 on: August 21, 2008, 08:06:34 AM »

I think it's neither.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
slimtim
Newbie
*
Offline Offline

Posts: 15


« Reply #5 on: August 21, 2008, 12:55:47 PM »

oh, hum... am i able to use it some how anyway?

 Huh

// slim
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8593


« Reply #6 on: August 21, 2008, 01:59:58 PM »

Is there something wrong with the module in the KB downloads? I am not going to spend time on this because I am trying to finish Everywhere for 2.0 and also have some universal modules for Everywhere listings and reviews. That's the ultimate solution.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Pages: [1]
« previous next »
    Jump to: