Hi Sergey
Thanks for the quick response.
Thanks for introducing the star rating plugin too.
The star rating plugin looks impressive. However, I am still struggling to implement comment system.
I would like to implement comment system and rating without plugin first.
I have uploaded to demo account: http://demo.asprunner.net/tanz_tan3_yahoo_com/darenclass6v2Build14670RevC/clmain_list.php.
The customer review system suppose to be added in the view page of clmain_view.php. However, it doesn't work.
++++++++++++++++++++++++++++++++++++++++++++++++
Question 1:
Can you explain the meaning of ". It would make sense to make this table details table of clmain so Classified ad ID field is populated automatically" by showing a picture of table SQL query?
I did the following for SQL query, is it correct?
SELECT
comments.ID,
comments.ClassifiedAdID,
comments.Rating,
comments.CommentsTEXT,
comments.RatePosted,
comments.RatedByUserID,
comments.UserToBeRated
FROM comments
INNER JOIN clmain ON comments.ClassifiedAdID = clmain.ID
INNER JOIN clusers ON comments.RatedByUserID = clusers.fullname
++++++++++++++++++++++++++++++++++++++++++++++++
Question 2:
can you give an example and where to add this code calculate the average rating?
To calculate the average rating for any given ad you need to run a separate query like this one:
select avg(rating) from Comments where ClassifieldAdID = <ad ID from clmain>
$sql=" select avg(rating) from Comments where ClassifieldAdID = <ad ID from clmain>";
Question 3: What are the code need to be added into "editor" page and " event" page?
I realised there are some default code from clreply_add.php of classified template that able to copy and paste some session data.
I am thinking of a registered user can add comment in clmain_view.php by copying over some session data as below:
MainID:{$xtClassifiedAdID}
Category:{$xtCategory}
SubCategory:{$xtSubcategory}
Rated by UserID:{$xtUserID}
Title:{$xtTitle}
I tried to leverage the code from clreply_add.php of classified template by having code as below but still cannot implement the customer review system:
Code #1 added
I have added two links " add user rating" and " view user rating" into "editor" page of clmain_view.php :
<A href="comments_add.php" target=_blank>add user rating </A>
<A href="comments_view.php" target=_blank>view user rating </A>
00000000000000000000000000000000000000000
Code #2 added
I have added some codes into "editor" page of comments_add.php :
<TD class="runner-cc runner-brickcontents" colSpan=2>
<B>
<P>MainID:{$xtClassifiedAdID}</P></B>
<P><B>Category:{$xtCategory}</B>
</P><B>
<P><B>SubCategory:{$xtSubcategory}</B>
</P>
<P>Rated by UserID:{$xtUserID}</B> </P>
<P><B>Title:{$xtTitle}</P></B></TD>
00000000000000000000000000000000000000000
code3 added
before display of" event" page from comments_add.php
$xt->assign("xtCategory",$_SESSION["Category"]);
// Place event code here.
//$xt->assign("xtCategory",$_SESSION["Category"]);
$xt->assign("xtCategory",$_SESSION["Category"]);
$xt->assign("xtSubcategory",$_SESSION["Subcategory"]);
$xt->assign("xtClassifiedAdID",$_SESSION["ClassifiedAdID"]);
$xt->assign("xtUserID",$_SESSION["UserID"]);
$xt->assign("xtTitle",$_SESSION["Title"]);
// Use "Add Action" button to add code snippets.
++++++++++++++++++++++++++++++++++++++++++++++++
4 Default code from clreply_add.php of classified template as below:
a) default Code from "editor" page of clmain_view.php :
<A
href="clreply_add.php" target=_blank>Send
Reply</A>
b)default Code from "editor" page of clreply_add.php :
{$xtCategory} >> {$xtSubcategory}</TD>
c) dafault Code from before display of" event" page from clreply_add.php
$xt->assign("xtCategory",$_SESSION["Category"]);
$xt->assign("xtSubcategory",$_SESSION["Subcategory"]);
//$xt->assign("xtPicture","<img src=\"files/".$_SESSION["Picture"]."\" width=100>");
$xt->assign("xtPicture","<img src=\"userfiles/".$_SESSION["UserID"].$_SESSION["Picture"]."\" width=150>");
$xt->assign("xtTitle",$_SESSION["Title"]);
$xt->assign("xtPosted",$_SESSION["Posted"]);
$xt->assign("xtDetails",$_SESSION["Details"]);
Regards,
Vinice