Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How would I include Fivestar User ratings in Author Panel?
How would I include Fivestar User ratings in Author Panel?
Comments
Comment #1
MichelleI haven't the foggiest idea... Moving it over there. They can add it in using the hook if they want. (I'll explain further if it's needed)
Michelle
Comment #2
Richard Blackborder CreditAttribution: Richard Blackborder commentedNigeria does the info here fix your problem?
#483738: Showing the user rating widget in places other than the user profile.
Comment #3
MichelleIf it's added to the user object on user load, which is what that implies, then you can access it with the $account variable in the AP template.
Michelle
Comment #4
Richard Blackborder CreditAttribution: Richard Blackborder commentedIt is indeed. Sounds like a fix to me.
Comment #5
Nigeria CreditAttribution: Nigeria commentedCould someone please show me a code example for
a) a page or node
b) a block
Thanks in advance
Comment #6
Richard Blackborder CreditAttribution: Richard Blackborder commentedThis is a thread about Author Panel and Fivestarextra, so I'm leaving questions about nodes and blocks for the issue in #2.
Comment #7
drecute CreditAttribution: drecute commented@Michele
After going through the author_pane module, I tried implementing the hook like this
Can you please lead me from here.
I also noticed that one cannot access fivestarextra in Author Pane from $account or $user or $profile. It seems the module(fivestarextra) is only available on the user profile page.
Comment #8
MichelleI don't use Fivestar Extra so I have no idea. Setting this back to active since you need more help.
Michelle
Comment #9
Tafa CreditAttribution: Tafa commentedHi,
I was just wondering if you managed to get past this issue. If so, would you be able to share some of your knowledge to us as I am trying to do the same here too.
Thanks
T
Comment #10
Q2U CreditAttribution: Q2U commentedSubscribe
Comment #11
yosisays CreditAttribution: yosisays commentedSubscribing
Comment #12
yosisays CreditAttribution: yosisays commentedWell its been a full year since I've seen any activity in this thread. Has anyone been able to work on this?
Comment #13
MichelleConsidering the last commit was August 29, 2009, I think this module is abandoned.
Michelle
Comment #14
rogical CreditAttribution: rogical commentedCan anyone give some guides how to show fivestar in author pane?
And read-only to self while voteable to others.
thanks!
Comment #15
alexmoreno CreditAttribution: alexmoreno commentedfor anyone looking for a solution, try:
Comment #16
MichelleYou don't ever want to load a UID into the $user variable as you risk that colliding with the global $user. Always use $account (for clarity) or at least something other than $user. Further, in this case, you aren't even using the $user variable so that loading serves no purpose. Using echo on a form is a bit icky but at least doesn't pose a security risk.
Comment #17
alexmoreno CreditAttribution: alexmoreno commentedthanks a lot, yes $usuario for example is what i often to use.
Which one is the correct manner to put the form in a tpl.php?
Thanks a lot :-).
Comment #18
ericduran CreditAttribution: ericduran commentedIn Drupal 7 fivestar is a field. You can include it in any entity like any other field. Then you can print it in the tpl like you should any other field.
Does this help?
Comment #19
yosisays CreditAttribution: yosisays commentedMichelle, per #15 and your response in #16 (and the post in http://drupal.org/node/673114#comment-5695056), does this mean that its now possible to add a user rating widget into the user profile author panel for user ratings?
Comment #20
MichelleI have no idea. I was just commenting on the coding quality in the snippet.
Comment #22
dbt102 CreditAttribution: dbt102 commentednode --> https://www.drupal.org/docs/7/howtos/create-a-node-in-code
block --> https://www.drupal.org/docs/7/creating-custom-modules/declaring-the-block
I think this issue got highjacked along the line, but thanks for great replies.