Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Can I set a different query result for different div id's or class's somehow?
Old 12-06-2010, 04:56 PM Can I set a different query result for different div id's or class's somehow?
Junior Talker

Posts: 2
Trades: 0
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;
sfraise is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Can I set a different query result for different div id's or class's somehow?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34275 seconds with 12 queries