Skip to Content Skip to Menu

Is it possible to pull $user_id in module on prof

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
13 years 1 month ago #175591 by sfraise
I have kind of an odd-ball thing that I have a question on here.
I modified the awdwall component to nest within a module position in a tab on the cb profiles (instead of the component replacing the cb profile) and everything works ok. The problem is, when you go to someone else's profile you still see your own wall, not that user's wall. The reason is the component is originally designed to replace the cb profile and has two different files, one for your own wall and one for viewing someone else's wall. In order to rework the wall like I needed I did away with the second file and combined everything into the one. All I really need to do in order to get this 100% is to pull the $user_id (not the $myId) for the user that you're viewing when not ur own. Easy enough, except it seems you can't do this in an object nested into a module position on a profile.

So... long story short, is it possible to pull the $user_id through the api this way, or am I restricted to only being able to pull $myId without the code being in an actual cb plugin?

Also while I'm on the subject, I've been using an "if(empty($user_id)" statement to determine if you are viewing someone else's profile or not in all of my code. Is there a better way built into the api somewhere to run this check? This method seems to work fine, it just seems like there's probably a more elegant way of doing it that I'm probably missing.

Please Log in or Create an account to join the conversation.

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
13 years 1 month ago #175783 by sfraise
SOLVED

Here's what I ended up doing....
1. I'm using the mod_component from jomexperts.com
2. I added a $_GET line under the /* create url */ line.
3. I then modified the next line to added the id like $url=JURI::root().'index.php?'.$component.'&tmpl=component&print=1&wuid='.$user_id.'';... You would replace wuid with whatever option you need, for example cb would use user='.$user_id.'
4. Then in you actual component code you throw in another $_GET (again, replace wuid with whatever you're using.
5. You now have the id or whatever data you need to pass.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum