Jump to content

How could I show a different query for a different div class?


sfraise

Recommended Posts

I'm not exactly sure how to go about this, but I have an IM & online friends script that shows the online friends both in a module position as well as in a jquery box. Currently it's set to link the results to the IM function for both positions, however I want the module position to link to their profile and the jquery box to link to the IM function.

 

Here is the bit of code where this is done:

<!-- 
I added this as the second option to link to the profile...  	
$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();
<!-- 
I need to add this here but obviously so far u can just have one or the other..
$jon->userdata=$text2;
-->
$jon->userdata=$text;
$jon->result=$exec;
$jon->count=$onlcnt;

 

It would be simple if I could do an if else depending on the div id or class it sits in but as far as I know there is no real way to do that. Anyone have any ideas on how to do this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.