Questions and Answers

How do I collect points?

  • +4
    Chosen as best answer
  • +1
    Posted answer
  • +1
    Posted question
  • +1
    Thumb up
  • -1
    Thumb down
3

by Tim Walsh in Coding about October 28, 2011 open - report

code that will let only profile owners to see the content?

Hello everyone, I'm trying to extract the code to allow only profile owners to see a specific content. Here's what I've tried" viewer->isSelf($this->user) ):?> CONTENT HERE I'm using that code but it returns a "isSelf non-object" error..anyone has any idea on this? I believe I need to add something in the controller.php for the isSelf element..I just don't know what to add.. anyone can shed a light on this? I would really be great if someone can help me on this.. Thanks Warm Regards, Tim

Answers: 2  •  Score 0  •  Views: 1133

2 Answers
Browse by
  • 3

    by Tim Walsh about October 28, 2011

    Thanks for the reply..yes, that's the code I inserted..I'm inserting it in ./application/modules/User/widgets/profile-photo/index.tpl What I'm tyring to put is when the profile photo is hovered, there will be a link that will come out to redirect the user to change picture..much like facebook does..I'm able to have the hover effect but unfortunately it will also affect other profiles..so when I go to other profile and hover over their profile photos, the link will appear..so what I'd like to have is, restrict the hover link to appear only to the owner's profile and should not appear to other profile pictures when hovered..I guess it's somewhere along the isSelf code..but like I said, it returns an non-object error..Fatal error: Call to a member function isSelf() on a non-object in C:\xampp\htdocs\xxxxxxx\application\modules\User\widgets\profile-photo\index.tpl on line 15 I guess I need to add something in the Controller.php file contained in the same folder where the index.tpl of the profile-photo widget is placed..but I just don't know what to add.. Can you help me on this? I would really be grateful if someone can shed light on this one.. Thanks
    • Score: 0
  • 8

    by M about October 28, 2011

    What file are you editing? It should be $this->viewer->isSelf($this->user) if that's what you have.
    • Score: 0
You must login to post an answer.