Posted by chrisg_2010 on January 6, 2013 at 9:34pm
Good evening,
I've been trying to get this to work a while now. I'm trying to find out which variable I can use to tell my theme whether a user relationship already exsists. E.g. if the user already has a relationship, don't show anything, otherwise show an Add Friend button.
<?php if ($user_relationships->relate_to) { ?> <a class="btn" href="#"><i class="icon-torso"></i>Add friend</a><?php } ?>
The above is my code in user-profile.tpl.php, I have used the Devel module, trawled through the UR code and I just can't seem to find anything that will do this job.
Any help is much appreciated! I am not experienced with PHP atall, my stengths are HTML and CSS.
Thanks,
Chris
Comments
Are you trying to make a
Are you trying to make a social network within drupal? Is that possible?
Not as such. I'm building a
Not as such. I'm building a community site for arts and crafts but socializing is quite a key part. I've now dropped UR in favour of Flag and just have 1 way relationships. I also got the button sorted and 2 blocks showing Followers of a user and who the user follows :)
i suscribe
I suscribe anything explain how add button of relation ship add friend or remove friend anithing )=