Ha! Yeah I hear you. Every time I load up a regex library I feel like there ought to be a better way... luckily I'm at least semi-proficient at writing a regular expression, but don't ask me to make sense of one after a week's time LOL
Access Logged In user Information on Server side.
-
Hi,
How can I get 'Current Logged In user' information such as 'uid', 'username' into my plugins hook. For Eg. I need currently logged in user information into "filter:controllers.topic.get" hook.
If it is not available then how I can initiate communication from 'SERVER' side to 'CLIENT' side,
So that I can get logged in user information to 'SERVER' side.Thanks!!
-
I'm not sure if you can get the hook on the client side. You could listen for ajaxify events maybe, detect if a post is being loaded, and modify that maybe.
-
@akumbhare the uid field of the object passed into the callback of the server side
filter:topic.get
hook is the uid of the user requesting the page, not the uid of the person who wrote the post. -
@akumbhare the linked code is in
master
. You're certainly using thev0.6.x
branch. I don't see theuid
passed in thev0.6.x
branch.