parameter name | type | description | mandatory |
item_id | number | Item's Opinian ID | no (but then 'slug' and 'category_id' are) |
slug | string | Item's Opinian slug (no control characters, ”-” for spaces) | must go in pair with category_id. not mandatory, but then 'item_id' is |
category_id | number | Item's Opinian category ID | must go in pair with slug. not mandatory, but then 'item_id' is |
page | number | Page of item reviews. 10 reviews per page. | no |
order | string | “last” / “best”. Default is last. | no |
countries | string | Filter for reviews user country. Comma separated list of ISO 3166-1 Alpha-2 Country Code. | no |
languages | string | Filter for reviews languages. Comma separated list of ISO 639-1 Language Code. | no |
<?php
$reviews = $Opinian->getRatings(array("slug"=>"paris-hilton", "category_id"=>234, "languages"=>"en,hr"));
if (!empty($Opinian->last_error))
echo $Opinian->last_error;
else
print_r($reviews);
?>
Arrays, data is inside “Rating” array key.
“User” array, inside “Review” array key.
parameter name | description |
username | Username of the user that wrote the review |
image | url to the thumbnailed user image |
profile_url | Url to the profile page on Opinian |
Array
(
[Review] => Array
(
[0] => Array
(
[User] => Array
(
[username] => Pero
[image] => http://www.opinian.com/img/profile_man.gif
[profile_url] => http://www.opinian.com/account/page/1542
)
[text] => Paris hilton je jedna <strong>divna</strong> djevojčica.
[created] => 2009-08-07, 08:19
[language] => hr
[country] => hr
)
[1] => Array
(
[User] => Array
(
[username] => Paris Wannabe
[image] => http://www.opinian.com/img/profile_woman.gif
[profile_url] => http://www.opinian.com/account/page/452
)
[text] => I really like Paris, and when i grow up i'd like to be JUST like her.
[created] => 2009-08-07, 08:19
[language] => en
[country] => us
)
)
)