This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Show Star Ratings on Another Page
#1

Hi
I am new to this and would like to know how to get the stars on one page and then go to the complete comments form on another page like this photoshop.jpg page
Any help welcome
thanks
peter


Attached Files Thumbnail(s)
   
Reply
#2

Hi,

The best way forward would be to adjust the 'Recent Comments' add-on.

On line 14 (where the add-on echos all of the data), you could add this bit to it:
PHP Code:
<?php 
$comment
["rating"]

For example:
PHP Code:
<?php 
echo $comment["name"] . " rated " . $comment["rating"] . " out of 5 on <a href='" . $page["url"] . "'>" . $page["reference"] . "</a> at " . date("g:ia (j-F)", strtotime($comment["dated"]));

This will display the rating number (1,2,3,4,5). You could write some code to instead display the amount of star images according to which number it is. Note that a rating of 0 means that the user did not rate the page.

Have you completed the interview?
Reply
#3

Hi Steven
Thanks for your quick reply.
I shall try setting this up
Peter
Reply
#4

Hi Steven
Lovely add-on.

Even got it quite styled a bit. Just one thing I didn't get going ... instead of just linking to the page, how could I achieve it gets straight to the actual post (which is in most cases all the way to the bottom of the page - it would save people scrolling down to find it.)

Cheereoh
Norbs
Reply
#5

Sorry, forgot.
How do I achieve to show the newest post instead, meaning it should first show the newest, then the 2nd newest and then the 3rd ... newest. (now it goes the same but from the back, meaning the oldest)

I tried changing DESC to ASC but it didn't do anything.

Thanks a lot
Reply
#6

Hi,

On line 14, change this part:
PHP Code:
<?php 
$page
["url"]

To this:
PHP Code:
<?php 
$page
["url"] . "#comments"

Have you completed the interview?
Reply
#7

I don't know why it's displaying your comments in the wrong order.

Descending is the correct way.

It should be listing them with the newest at the top (like on the commentics.org homepage).

Have you completed the interview?
Reply
#8

Hi Steven check this link, left hand column, you can see ... http://chinabiz21.com/chinabusiness/chin...opment.php
So what can I do (need to do) to make the comments appear, starting with the latest and then backwards...? [must be something conflicting the SQL call cause I also tried to do this using other columns than "dated". e.g., id... and it's always the same, it will start showing the "oldest' first and 2nd oldest and so on.]

Thanks

Reply
#9

Hi,

I think I have the solution.

Just remove the apostrophes around the word dated.

So change this:
PHP Code:
<?php 
ORDER BY
'dated' DESC

To this:
PHP Code:
<?php 
ORDER BY dated DESC

Have you completed the interview?
Reply
#10

no single quotes.... that's it!
works like a charm (amazing the trouble these little twin brother can cause)
Thanks Steven
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by DuO-VB
21-Mar-2014, 04:26 PM
Last Post by Steven
01-Feb-2013, 03:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)