Check out menu_item_getinfo, you are already passing something called position, so you might wanna add something like userid to that string and parse it later, however I don't see you using the position so I don't see the point of it.
Try to make it yourself, I can put you on the right path later