Option to display gender on Comment
i found one post about
Option to display gender on user profile page
http://vanillaforums.org/discussion/comment/143606/#Comment_143606
but i want display it on the comment ?
anyone can help ?
Best Answers
-
UnderDog MVP
422 said:
Whos @423 ?A new version of @422 once he runs out of energy to post answers to silly questions :-|
sarowlwp said:
my question: i want display gender info on Comment Meta , i have done it in the profile page, but i can` get gender form discussion page , so any idea ?Show the exact code that you did on the profile page. Place it in < pre > tags or < code > tags or something else that makes the code readable.
There was an error rendering this rich post.
1 -
x00 MVP
The efficient solution is to cache the users, and join them pragmatically which is what JoinUsers does. Only it doesn't carry the gender across even though all the values are returned from the query.
look in dashboard/models/class.usermodel.php -> JoinUser
set the line to
$Join = GetValue('Join', $Options, array('Name', 'Email', 'Photo', 'Gender'));
This isn't the idea solution but it is simple for you, the plugin version would be more complex becuase there isn't a hook where you can add additional values in the mix, maybe somethign you can mention on github.
grep is your friend.
1
Answers
Can you not mention me on every post you make?!
grep is your friend.
ok,just , i konw you are an active dev for vanilla .
sorry to trouble you
Saro, the way I see it is that lots of 'regulars' on this forum will 'read' all topics (with new posts in my case) so you do not have to mention the 'regulars', because they'll read it anyways.
What you need to do a little more is first try the option (for example from the discussion you found) and then write down what didn't work.
You can say : I want a red door, but all I found was a blue door. Or you can say : I want a red door, I have the red paint, but could not find the right brushes. All the stores are closed, what to do?
Do you see my point?
There was an error rendering this rich post.
thx
got it
thx for you two . i will take your advice .
my question: i want display gender info on Comment Meta , i have done it in the profile page, but i can` get gender form discussion page , so any idea ?
Whos @423 ?
There was an error rendering this rich post.
A new version of @422 once he runs out of energy to post answers to silly questions :-|
Show the exact code that you did on the profile page. Place it in < pre > tags or < code > tags or something else that makes the code readable.
There was an error rendering this rich post.
Now i know how 006 felt about Roger Moore
There was an error rendering this rich post.
I thought that was Dudley Moore.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
he's one better.
@sarowlwp post your code, and the results. I'm sure one of the 'guys' will be able to point you in the right direction. I think this is the sort of specificity that underdog was aiming for.. but he's a lot more subtle than i am.
oh, and im both offended and grateful that you didn't @ me on this. (not an invitation, just trying for humor)
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
thx , i will change it , not @ anyone in the forum , you guys are nice ,sorry to trouble you all
here my code
file : views/discussion/helper_functions.php
i want inser gender info here and
echo $Author->Gender;
not work
doesnt echo ($this->User->Gender); work ?
There was an error rendering this rich post.
Fatal error: Using $this when not in object context in /home/aiqingda/www/www/themes/aiqingda/views/discussion/helper_functions.php on line 52
How have you got it working elsewhere?
There was an error rendering this rich post.
There may be a better way but this works. - but it will do a database read on every comment.
apparently it is Null in the $Sender, and $Object. I don't know if this is possibly a bug in the vanilla code or not.
you have to pull it out of the database yourself like below:
let us know if it works for you
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
nah
that is very inefficient to query each person in a loop.
$Author->Gender
not work becuase in user model JoinUsers$Join = GetValue('Join', $Options, array('Name', 'Email', 'Photo'));
is missing 'Gender'
You could add it, though not the most transportable solution.
grep is your friend.
thx you ! which source file it is ?
thx you ! which source file it is ?> peregrine said:
thx, i have think about it , worried about mysql server, cost too much resource
Addtion Question: any one konw about php HTML staticstic , i mean generate html file for most not change page , so speed up the forums ,and cost less resource ~
Best keep it to one question per thread
There was an error rendering this rich post.