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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.