Jump to content

Add comments


Recommended Posts

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 by brooky
Link to comment
Share on other sites

  • 3 months later...

Guest tinusrinus

Hi there,

I have this mod instald in a local test shop but there is something i don't understand!! :(:D

I can add some comments to every product when i'm viewing the product, so far so good :D ,

BUT!!! where the @#$* */*:w00t: 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 :wacko:

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!!!!! :rolly:

so if someone can help me out i like to hear it.

Regards Rob<<<<<<<<<<<< :errm: :dizzy:

Link to comment
Share on other sites

  • 6 months later...
Guest Joker

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

  • 2 months later...
  • 3 weeks later...

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

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

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

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

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

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

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

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

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

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

:P ;):):o:o:o

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

×
×
  • Create New...