I'm not sure exactly how to do what I need here, I have an IM & online friends script that displays the results both in a module position as well as in a jquery box. Both are populated by the same queries and I've simply styled the 2 positions according to their div containers.
The problem is I need the username links in the jquery to function as it is now where when you click on it you call the IM function, however I need the links in the module position to link to the user's profile. This would be simple if I could somehow set up an if else statement depending on the div container but as far as I know there's no real way to do that. Does anyone have any ideas on how to get this done?
Here's the spot of code where the magic happens:
Code:
$res[$show_name]=str_replace("'"," ",$res[$show_name]);
/*I added this to create the profile link... $text2.="<div onmousedown=\"createChatBoxmesg('".$res[$show_name]."','".$res['id']."')\"><a class=\"texts\" href='index.php?option=com_comprofiler'><img style='padding:0px 5px 0px 0px;' src='".$res['avatar']."' height='25' width='25' />".$res[$show_name]."</a></div><hr/>"; */
$text.="<div onmousedown=\"createChatBoxmesg('".$res[$show_name]."','".$res['id']."')\"><a class=\"texts\" href='javascript:void(0)'><img style='padding:0px 5px 0px 0px;' src='".$res['avatar']."' height='25' width='25' />".$res[$show_name]."</a></div><hr/>";
}
}
$query="SELECT * FROM frei_chat WHERE frei_chat.to=$usr_id AND recd=0 ORDER BY sent";
$db->setQuery($query);
$jon->messages=$db->loadAssocList();
/*This goes with my addition above but obviously you can only have one or the other... $jon->userdata=$text2; */
$jon->userdata=$text;
$jon->result=$exec;
$jon->count=$onlcnt;
|