Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Add "WP Customer Reviews" to Byline (http://forum.bytesforall.com/showthread.php?t=16938)

longnha Mar 6, 2012 01:09 PM

[SOLVED] Add "WP Customer Reviews" to Byline
 
Hello,

I used "WP Customer Reviews" for my review site. I follow the instruction on this post: http://wordpress.org/support/topic/p...erately-needed to add average ratings.

The problem that is I cannot customize the position of the "average ratings".

Here is an example of how it look like: http://digitalcashpalace.com/forex-b...nk-fx-reviews/ ; now I want to move "Average Rating" to Byline position.

Anyone can help me in this case? thank you very much. :)

I use wordpress and Atahualpa latest version.


-------------------------------
Also, looking for someone to help me edit the theme, must have experience with "Atahualpa" , compare table and "WP Customer Reviews" (or other reviews-rating plugin). Please let me know how to contact you and maybe the cost also. :)

juggledad Mar 6, 2012 02:04 PM

you (or someone) will have to look at the code of the plugin and determine how it works, then add some code in bfa_post_parts.php to the 'byline' area to display what you want.

longnha Mar 6, 2012 02:24 PM

According to the guide, to add average rating:

Add the following function anywhere on this file:

HTML Code:

function get_average_rating() {
        global $post;
        $this->get_aggregate_reviews($post->ID);
        $average_score = number_format($this->got_aggregate["aggregate"], 1);

        return $average_score * 20; // 20% for each star if having 5 stars
    }

Then inside the function do_the_content($original_content), just after $the_content = ''; add the following:

HTML Code:

// build average ratings html
        $average_rating = 'Average Rating: <div class="sp_rating"><div class="base"><div class="average" style="width:'.$this->get_average_rating().'%"></div></div></div>';

Then find the following line:

$the_content .= '<div id="wpcr_respond_1">'; /* start the div */

and place the following just below it:

HTML Code:

// attach average ratings to beginning of reviews
        $the_content .= $average_rating;

I follow the guide and it work, but the position is above the reviews, not byline position as I want.


I Edited bfa_post_parts.php and added:
HTML Code:

// build average ratings html
        $average_rating = 'Average Rating: <div class="sp_rating"><div class="base"><div class="average" style="width:'.$this->get_average_rating().'%"></div></div></div>';

Then find the following line:

$the_content .= '<div id="wpcr_respond_1">'; /* start the div */

Inside "byline", I added:

HTML Code:

// build average ratings html
        $average_rating = 'Average Rating: <div class="sp_rating"><div class="base"><div class="average" style="width:'.$this->get_average_rating().'%"></div></div></div>';
// attach average ratings to beginning of reviews
        $the_content .= $average_rating;

But error:
Fatal error: Using $this when not in object context in /home/digital1/public_html/wp-content/themes/atahualpa/functions/bfa_post_parts.php on line 102

Could you please explain what's wrong with the code that I added.

Thank you:)

juggledad Mar 6, 2012 02:51 PM

$this is a PHP variable. You can do a google search on 'php $this' and read all about it.

Not knowing th eplugin or what they are trying to do, I can not explain why they are using it or why you got the error, but I would guess that it is a problen since you have the code in two different modules. That would be something to discuess with the plugin author.

longnha Mar 6, 2012 02:54 PM

Quote:

Originally Posted by juggledad (Post 81365)
$this is a PHP variable. You can do a google search on 'php $this' and read all about it.

Not knowing th eplugin or what they are trying to do, I can not explain why they are using it or why you got the error, but I would guess that it is a problen since you have the code in two different modules. That would be something to discuess with the plugin author.

Alright, I understood.

The plugin coded by PHP and the theme code by html. I have no other choice but accept the current position or move on another plugin since I don't know how to convert PHP to html.

Thank you very much.

juggledad Mar 6, 2012 04:09 PM

PHP is the language used in the plugin and theme (and wordpress) to create the HTML that the browsers interpret to display your web page (there is some jscript thrown in but it can be ignored in this case.)

If the plugin's author can't help you your choices are to move on to another plugin or hire someone to fix it for you. Good luck.

longnha Mar 6, 2012 04:27 PM

Quote:

Originally Posted by juggledad (Post 81372)
PHP is the language used in the plugin and theme (and wordpress) to create the HTML that the browsers interpret to display your web page (there is some jscript thrown in but it can be ignored in this case.)

If the plugin's author can't help you your choices are to move on to another plugin or hire someone to fix it for you. Good luck.

Could you recommend someone that able to fix it? or someone that able to design the new hold theme. I'm working on it for few days already but cannot seem fix it.

Thank you very much. :)

lmilesw Mar 6, 2012 05:15 PM

I could take a look. If you PM me I will send you my rates.

longnha Mar 6, 2012 05:21 PM

Quote:

Originally Posted by lmilesw (Post 81377)
I could take a look. If you PM me I will send you my rates.

PM sent. Thank you. :)

longnha Mar 7, 2012 08:32 AM

Hello,

I have another small problem with "WP Customer Reviews" and need help:

- I create a new posting template, here it is the example: http://digitalcashpalace.com/press-r...s-and-ratings/

- Now I want to link "Let your voice be heard. Write a review now" (at the top), link to "Rate/write review" box at bottom of the post.

The problem that is the "Rate/write review" box powered by Javascripts so I cannot find actual link to link it.

Could anyone able to find solution for this case? Thank you very much. :)

lmilesw Mar 7, 2012 09:49 AM

You could perhaps put an anchor tag in the post footer which would at least take them to where they can add a rating.

longnha Mar 8, 2012 05:35 AM

I use another plugin with more features and so far it work.

Thank you very much for your support. :)


All times are GMT -6. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.