Help (php amateur hour)

From: CHYRON (DSMITHHFX)14 Apr 2012 16:45
To: Matt 5 of 7
That removes the categories tab from everyone, including admins. At least it doesn't throw an error.

Let me try this again. I missed a bit of your code, so I just pasted in the whole thing. Now it behaves correctly, but is throwing the following errors (which are appearing on every page):
---
Message: Undefined property: CI::$current_user
Filename: libraries/Module.php
Line Number: 137
---
AND
---
Message: Trying to get property of non-object
Filename: blog/details.php
Line Number: 78
---
the details.php array is somehow referenced by Module.php, I guess.
EDITED: 14 Apr 2012 16:55 by DSMITHHFX
From: Matt14 Apr 2012 17:11
To: CHYRON (DSMITHHFX) 6 of 7
I don't know PyroCMS nor codeignitor so I'm not going to be able to help you beyond the basic PHP syntax.

I can tell you that the error means the Module_Blog class nor it's parent Module class have a property named current_user, which is referenced in the if statement you had in your first post and which I simply copied and pasted wholesale into my example.

If you can find some other code in PyroCMS to get the current user then you can possibly copy that to use that and modify the if statement to use that code.

Honestly, you'll be better off asking the PyroCMS team / community I reckon.
From: CHYRON (DSMITHHFX)14 Apr 2012 17:26
To: Matt 7 of 7
OK thanks. I thought it might be a (relatively) simple syntax issue, as is often the case with my hacking efforts.