jReviews Support Forum

jReviews 1.x - jReviews Modules and Hook Components => Modules & bots => Topic started by: axelman on February 25, 2008, 05:01:24 AM



Title: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: axelman 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  ??? ??? ??? ???


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: Alejandro 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>";
}
  }


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: axelman 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!!!!


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: slimtim 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


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: Alejandro on August 21, 2008, 08:06:34 AM
I think it's neither.


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: slimtim on August 21, 2008, 12:55:47 PM
oh, hum... am i able to use it some how anyway?

 ???

// slim


Title: Re: VirtueMart Jreviews+JreviewsEverywhere top 5 user rated products
Post by: Alejandro 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.