Al Brookbanks Posted October 11, 2003 Share Posted October 11, 2003 (edited) Name: add_comments.zip Version: 1.0 Author: Joker Short Description: Add comments Long Description: Add comments to every product! [Download File] This MOD has been upgraded to add_comments1_2.zip please download the most stable version from the link below:add_comments1_2.zip Edited November 21, 2004 by brooky Link to comment Share on other sites More sharing options...
Guest tinusrinus Posted January 11, 2004 Share Posted January 11, 2004 Hi there, I have this mod instald in a local test shop but there is something i don't understand!! I can add some comments to every product when i'm viewing the product, so far so good , BUT!!! where the @#$* can i find the comments back in my admin or shop???????? Maybe i don't understand what this mod is all about but it can also be that I and only I did something wrong so please help me out here When i enter the database with the php_admin tool i can review the comments but i think that thats not the meaning of this mod!!!!! so if someone can help me out i like to hear it. Regards Rob<<<<<<<<<<<< :dizzy: Link to comment Share on other sites More sharing options...
Guest Joker Posted August 6, 2004 Share Posted August 6, 2004 Use add_comments update version 1.2 Link to comment Share on other sites More sharing options...
Guest Joker Posted August 6, 2004 Share Posted August 6, 2004 If you want, than customers see stars in main page, not only in product page, then open index.php. Go to line 369, it's look like: echo"<td align=\"center\"><a href=\"view_product.php?product=$product\">$title</a> After </a> add: "; //add stars to product if have stars $sql_stars_select = mysql_query( "select * from ".$prefix."store_comments where product='$product' and status='1'"); $totalrows_stars = mysql_num_rows($sql_stars_select); if($totalrows_stars!==0) { $counter = 0; $stars_count = 0; while ($row = mysql_fetch_array($sql_stars_select)) { $stars=$row["stars"]; $stars_count = $stars_count + $stars; ++ $counter; } $stars = $stars_count / $counter; $stars = round ($stars, 0) + 1; // add stars pictures to products if ($stars>0 && $stars < 6) {echo" <img src=\"../images/stars-$stars.gif\" width=\"64\" height=\"12\">";} } // end add product stars echo" Brgrds, Joker Link to comment Share on other sites More sharing options...
Guest OSKicks Posted August 8, 2004 Share Posted August 8, 2004 thanks joker man i been wondering that stuff or a long time :) Link to comment Share on other sites More sharing options...
Guest Posted August 10, 2004 Share Posted August 10, 2004 Hi, Brooky's link does not work, can anyone repost the files for adding comments to products... Thanks, Kim M :) Link to comment Share on other sites More sharing options...
Guest Posted October 25, 2004 Share Posted October 25, 2004 Is there a way that I can approve all comments before it submits? Link to comment Share on other sites More sharing options...
Guest Joker Posted November 13, 2004 Share Posted November 13, 2004 If you use other mods then update view_product.php in store catalog and nav.php in admin catalog manually! Changes in view_product.php... 1. After lines:       <tr height=\"30\">   <td width=\"33%\" height=\"30\" background=\"images/grey_bev.gif\">$la_view_prod_code $product</td>   <td height=\"30\" align=\"right\" valign=\"middle\" background=\"images/grey_bev.gif\">$la_order_quan: <INPUT TYPE=\"text\" class=\"textbox\" size=\"3\" value=\"1\" name=\"quan\"></td>   <td height=\"30\" align=\"center\" background=\"images/grey_bev.gif\" align=\"right\" valign=\"middle\">      <table width=\"94\" height=\"24\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">     <tr valign=\"middle\">     <td height=\"24\" width=\"94\" background=\"images/white_button.gif\" valign=\"middle\" align=\"center\" style='cursor:hand;' onClick='add_product.submit();'><a href='#'><font class=\"wht_btn\">$la_add_to_basket</font></a></td>     </tr>    </table>     </td></form>   </tr>   </table>  </td> </tr> add line: <tr>  <td align=\"right\"></br><a href=\"addcomment.php?product=$product&session=$session\" target=\"_self\"><b>$la_add_comments</b></a></td> </tr> 2. after lines:     <td height=\"24\" width=\"94\" background=\"images/white_button.gif\" valign=\"middle\" align=\"center\" style='cursor:hand;' onClick='add_product.submit();'><a href='#'><font class=\"wht_btn\">$la_add_to_basket</font></a></td>     </tr>    </table>     </td></form>   </tr>   </table>  </td> </tr> <tr>  <td align=\"right\"></br><a href=\"addcomment.php?product=$product&session=$session\" target=\"_self\"><b>$la_add_comments</b></a></td> </tr> </table><br><br>"; add lines: /// add comments ////////////////////////////////   $sql_select = mysql_query( "select * from ".$prefix."store_comments where product='$product' and status='1' order by id asc");  $totalrows = mysql_num_rows($sql_select);    if($totalrows!==0)  {   $counter = 0;   while ($row = mysql_fetch_array($sql_select))   {   $name=$row["name"];   $comments=$row["comments"];   $status=$row["status"];   $stars=$row["stars"];     $name = stripslashes($name);   $comments = stripslashes($comments);     if ($status==1)   {    if ($counter == 0)    {     echo"<p align=\"left\"><font size=\"3\" color=990033><b>$la_nav_comments</b></font></p>";     $counter = 1;    }    echo"<p align=\"left\"><font size=\"2\">";    if ($stars==0)         {echo"<img src=\"images/stars-1.gif\" width=\"64\" height=\"12\">";}        else if ($stars==1)         {echo"<img src=\"images/stars-2.gif\" width=\"64\" height=\"12\">";}        else if ($stars==2)         {echo"<img src=\"images/stars-3.gif\" width=\"64\" height=\"12\">";}        else if ($stars==3)         {echo"<img src=\"images/stars-4.gif\" width=\"64\" height=\"12\">";}        else if ($stars==4)         {echo"<img src=\"images/stars-5.gif\" width=\"64\" height=\"12\">";}    echo"<b>$name</br></b> $comments</br></font><p>";      }   }  } ///////////// end add comments //////////////////////// Changes in nav.php 1. After lines:  ['<?echo$la_nav_security;?>', '#',    ['<?echo$la_nav_ip;?>', '<?echo"$site_url/admin/ip.php";?>'],    ['<?echo$la_nav_pass;?>', '<?echo"$site_url/admin/password.php";?>'],    ], add lines:  ['<?echo$la_nav_comments;?>', '#',    ['<?echo$la_nav_comments_new;?>', '<?echo"$site_url/admin/comments.php?value=0";?>'],    ['<?echo$la_nav_comments_public;?>', '<?echo"$site_url/admin/comments.php?value=1";?>'],    ], Upload other files to admin and store catalog and that's all. PS – you must use update mod what I posted to this phorum August, 6 2004 Brgrds, Joker Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 Thanks Joker! You're one of the best. This is such an important mod - so many thanks for sorting that out. If I'd installed it first it wouldn't have been a problem of course ;-) Many thanks. Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 Thank you so much JOKER! This is truly a great MOD, and having it FREE makes it all better Thanks for the time you took to sort this out, its truly appreciated! Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 Just one more thing ;-) In the version that I downloded from front page here yesterday, this uses the INDEX.PHP and SEARCH.PHP also. Either do we have the mods listed for these as updates, or does the new version no longer need them (which I find hard to believe). I've updated the files to v1.1 as per message above here, aka admin/comments.php but admin/addcomments.php didn't exist before. It was in MAIN ! Should there be 2 or just 1 in admin or main ?? Chris, have you managed to work it out ? Please LMK ;-) Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 mine works right now... http://shoandgo.com/CCmods I am currently installing it again on my real store - http://shoandgo.com/store Where it says admin/****.php - its comments.php under the main site. I got confused too If you have AOL AIM, I will talk to you on that - i993eclipse I do not think you need the search.php nor index.php as I am not going to use them on my real store. Ill let you know how it goes... Chris Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 This Grigsoft.com Compare It utility is fantastic ;-) AFAIK here are the changes for INDEX.PHP ONLY IF you have a modified one. INDEX.PHP *AFTER // warning if install.php has not been deleted if ((file_exists("$site_dir/install.php"))OR(file_exists("$site_dir/upgrade.php"))) { print "<b><font color='red'>$la_store_security</b>"; exit; } include("header.inc.php"); *ADD // delete sessions in conjunction with cookie length +1 day $expire_days = $site_cookie / 86400; $expire_days = $expire_days + 1; $expire_days = sprintf("%.0f", $expire_days); $today_date=date("Ymd"); $expired_date = $today_date - $expire_days; mysql_query( "DELETE FROM ".$prefix."store_shopping WHERE date <= '$expired_date'"); *AFTER $bgcolour=$colour_4; while($row = mysql_fetch_array($result)) { $product=$row["product"]; $description= $row["description"]; $price=$row["price"]; $sale_price=$row["sale_price"]; $image=$row["image"]; *ADD $comcount=$row["comcount"]; (before $title=$row["title"] *AFTER echo"<tr bgcolor=\"$bgcolour\">"; if($gd_version!==0){ echo"<td bgcolor=\"$bgcolour\" align=\"center\"><a href=\"view_product.php?product=$product\"><img src=\"images/thumb_$image\" border=\"0\"></a></td>";} else{ echo"<td bgcolor=\"$bgcolour\" align=\"center\"><a href=\"view_product.php?product=$product\"><img src=\"images/$image\" width=\"75\" height=\"75\" border=\"0\"></a></td>";} *REPLACE THE LINE (i.e. the end </td> moves) echo"<td align=\"center\"><a href=\"view_product.php?product=$product\">$title</a></td> AND ADD echo"<td align=\"center\"><a href=\"view_product.php?product=$product\">$title</a>"; if ($comcount > 0) echo" ($comcount)"; echo"</td> //mod ends Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 whats the index do though? Whats so special about it? PS: Anyone know how to make it say something like this when there are no reviews? : There are no reviews yet. To be the first one, click here Thanks Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 Now I am confused ;-) Where it says admin/****.php - its comments.php under the main site. I got confused too Can you list the files and where you have them for me? AFAIK the index just adds a review count or star to the product listing. Same for search page. If there are reviews this will be noted in the search. Currently comments are added in the database, but I can't see them in admin or as a customer. But I do have the instock mod fitted and I remember someone said their was an issue between them..... Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2004 Share Posted November 13, 2004 OK I've solved one major issue. The SQL database field was entered as STATUS in capitals, where as the PHP it was using status (lower case). The Admin section had the same capitalisation problem! Which do people suggest should be altered database or scripts? I now have the Comments mod working WITH the InStock mod. Chris, AYPK here is some code to say NO COMMENTS yet if there are none. view_product.php echo"<b>$name</br></b> $comments</br></font><p>"; } } } //NEW NO COMMENT BIT by PB **** else { echo"<p align=\"left\"><font size=\"3\" color=990033><b>$la_nav_comments</b></font></p>"; echo"<p align=\"left\"><font size=\"2\">"; echo" No comments yet. </font></p><BR>"; } // end add comments // } }//end if there is a result Link to comment Share on other sites More sharing options...
Guest Joker Posted November 13, 2004 Share Posted November 13, 2004 One more small update! Open file inventory.php in admin catalog and search lines: $result = "delete FROM ".$prefix."store_options_bot WHERE product='$product'"; $row = mysql_query($result); after this lines add lines: $result = "delete FROM ".$prefix."store_comments WHERE product='$product'"; $row = mysql_query($result); Why this update? If you will be delete product, then script must delete this product comments too. Brgrds, Joker Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2004 Share Posted November 14, 2004 Edit : Nevermind, I see what it does odd, I dont see anything about reviews on my index.php page - http://shoandgo.com/CCmods/index.php Chris Link to comment Share on other sites More sharing options...
Guest Posted November 17, 2004 Share Posted November 17, 2004 :P Sorry that page couldn't be found. Please be sure to update your bookmarks. If you were attempting to download Hacks or Modification please visit our "Download" section at the left of this screen. If you feel the URL you attempted to visit should have been correct please contact us and will will atempt to fix it at the first opportunity. Thank you for visting CubeCart.com. i Can't Download That Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 http://www.cubecart.com/site/downloads/index.php?fileId=30 :) Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 okay..wow...now im lost. Can someone please make a final compiled ZIP file of the updated version?? Thanks. :) Link to comment Share on other sites More sharing options...
Guest Joker Posted November 19, 2004 Share Posted November 19, 2004 Send me e-mail, I send you ;o) Brgrds, Joker Link to comment Share on other sites More sharing options...
Guest Posted November 19, 2004 Share Posted November 19, 2004 wats ur e-mail??? lol. PM it to me. Link to comment Share on other sites More sharing options...
Guest Posted November 20, 2004 Share Posted November 20, 2004 wats ur e-mail??? lol. PM it to me. what do you not get? its the download? Chris Link to comment Share on other sites More sharing options...
Guest Posted November 20, 2004 Share Posted November 20, 2004 Yeah, there's so many new updates to it...that I have no idea which one to alter and which one to use... Link to comment Share on other sites More sharing options...
Recommended Posts