This topic is locked
[SOLVED]

 Add Customer Review System To Classified Template Of Phprunner

2/6/2013 6:51:47 AM
PHPRunner General questions
V
Vinice1981 author

Topic: add customer review system to classified template of PHPrunner[/b]
Hi all

Need your help and expertise.

I am a newbie of PHPrunner .

I have searched through the forum but can't find a solution (only managed to find some unsolved rating script or star for rate in the forum).
a)PHPrunner version used: 6.2 build 14670.

b)Template used: classified template

c)Purpose: To add customer review system (to give comment and rate) in "view page of Clmain of classified template" and user profile.
I am using classified template to build my website.

I want to add customer review system to my classified website.
customer review system should include user rating (1 to 5), comment & average user rating to a user.
Registered user can only rate (include adding comment) once to the same user (to avoid duplicate rating) in "view page of Clmain of classified template".
Once rating is done, same user Mr. A need to wait for one month in order to rate the same user Mr.B again.

The average of user rating will then be calculated.
Guest user can only view the rate, comment and average of user rating profile in "view page of Clmain of classified template".
Guest user can also search user name and view user rating profile.
If one user deleted his ads posted, the rating& comment can still be viewed in his user profile.
For example in classified website , Mr. A is a seller and Mr. B is a registered user.

User Mr. A post his item for sale " Item A" in "clmain of classified website" .

User Mr. B can give comment and user rating in the "view page of clmain" of classified ads item for sale " Item A".

After a few users has given comment and user rating to Mr. A, an average user rating need to be calculated.
Example of "view page of clmain" of classified template:

a)Send Reply Link

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20636&image=1&table=forumtopics' class='bbc_emoticon' alt='B)' /> Send to Friend Link

c) View user Rating Link (average user rating calculated)

d) Give rate & comment link
After clicking " View user Rating Link ", this link will redirect to "user profile page" shown to public.
Example of " user profile" page to be shown to public:

a) User name

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20636&image=2&table=forumtopics' class='bbc_emoticon' alt='B)' /> average user rating calculated

c)rating with comment
Appreciate if any of you can give me the code and example to implement this customer review system.
Thanks.

Regards,

Vinice

admin 2/6/2013

In regards to rating control check StarRating plugin:

http://xlinesoft.com/plugins
To introduce comment system you need to add a new table to store UserID, Classified ad ID, rating (1-5) and comment text. It would make sense to make this table details table of clmain so Classified ad ID field is populated automatically.
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>
V
Vinice1981 author 2/7/2013

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>

&nbsp;&nbsp;&nbsp;&nbsp;

<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}&nbsp;&gt;&gt;&nbsp;{$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

V
Vinice1981 author 2/7/2013

Hi all

Basically, i want to create Ebay style customer review system in my website.

I am using PHPrunner version 6.2 build 14670 Classified template to build my website.
Appreciate if you can share your knowledge and code to implement this customer review system.
Example of links of Ebay style customer review system:
a)Feedback profile:

http://feedback.ebay.com.sg/ws/eBayISAPI.dll?ViewFeedback2&userid=tokio3388&ftab=AllFeedback
b)Seller info:

http://www.ebay.com.sg/itm/ws/eBayISAPI.dll?ViewItem&item=271148341101&ih=017&category=15687&ssPageName=STORE:PROMOBOX:ENDSOON#ht_2857wt_283
Regards,

Vinice

admin 2/8/2013

You need to contact support directly at http://xlinesoft.com/dss/support.asp sending your order number so we can see the level of support you currently have and how we can help you.

V
Vinice1981 author 2/8/2013

Hi Sergey Kornilov

Thanks for your advise.
Regards,

Vinice



You need to contact support directly at http://xlinesoft.com/dss/support.asp sending your order number so we can see the level of support you currently have and how we can help you.