We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
[ C ] Member location popup code needed
Topic Started: Jan 12 2015, 07:13 PM (844 Views)
Genosplace
Member Avatar
Member
[ *  * ]
Is there a way to make a code to see where members are located on the board by hovering your mouse over the username? I've seen it on another board (IP Board) that whether in the online list, or in a post you can put your mouse over a member name and a box pops up telling you what they are viewing.


Thanks for any help. :)

Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It would require AJAX every time you hover over a users username. You could make the AJAX request activate once only and it will continue to show what the AJAX grabbed for that user, it basically may be slightly inaccurate this way. If people went to the member list and started hovering over all the names it could really take up a lot of server resources, but of course it can be disabled in certain areas of the board. You just really want to deter AJAX when you can.
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
Thanks Cory. I didn't know how it worked. I am a member on an IP board that does it and thought it might be easy. I appreciate you explaining it to me. :up:
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Do you still want the code created under the circumstances of using AJAX and slight inaccuracy?
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
It would be nice but I was going on the fact that you said that "You just really want to deter AJAX when you can. " I trust you so if you think it's workable that would be great but if you think it's a bad idea I will leave it off. I will do whatever you think is best.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Probably not worth the AJAX for something that is readily available in the profile.
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
Very well. Thanks for taking a look at this Cory. :up:
Offline Profile Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
I'd actually say this is one of the times when an AJAX request is fine. My idea is, if the AJAX request will be loaded on every page load, it's a bad idea (obviously), but for something as trivial as hovering over a user's name, it's perfectly fine. Once the members realise that that is what hovering over a username does, then they would only hover over someone's username if they are wanting to see their location; i.e something that would take them an entire page load to do anyway (which would also use an ad credit, whereas the AJAX request wouldn't). In short, this is one of those times when an AJAX request is perfectly reasonable.
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
I like the sound of that Viral, especially the the ad credit part. Thanks so much.

Does this mean it's doable now? ^_^
Offline Profile Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
I don't have time myself, but yes it's definitely doable. Do you have a picture of what you want it to look like?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Viral
Jan 20 2015, 09:09 AM
My idea is, if the AJAX request will be loaded on every page load, it's a bad idea (obviously), but for something as trivial as hovering over a user's name, it's perfectly fine.
So, you're saying you shouldn't use an AJAX get request on hover, but on page load instead?

What if someone accesses a topic with 100 posts on one page and every post has a different author, wouldn't that be 100 AJAX requests at one time?
Offline Profile Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
No, I'm saying the opposite; forcing an AJAX request on each page load is bad but only doing it when a user performs a relatively infrequent action (such as hovering over a member's name), it would be fine. If there are 100 posts on one page, there are 0 AJAX requests until you hover over someone's name, at which point it would only use 1 AJAX request.
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
Just an observation here. When I go look in the board in someones profile it says they are viewing the calendar 99% of the time when they are not.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
$('a[href*="/profile/"]').hover(function() {
var $this = $(this);
$.get($(this).attr('href') + '?force_ads', function(data) {
var title = $('table.profile td.c_desc:contains(Last Activity) + td', data).text();
$($this).attr('title', title);
});
$(this).unbind('mouseenter mouseleave');
});
</script>
Genosplace
Jan 22 2015, 11:22 AM
Just an observation here. When I go look in the board in someones profile it says they are viewing the calendar 99% of the time when they are not.
This should fix that issue:
Code:
 
<script type="text/javascript">
$(window).load(function () {
$.get(location.href);
});
</script>
Offline Profile Goto Top
 
Genosplace
Member Avatar
Member
[ *  * ]
Thanks Cory. I can use the hover most everywhere except the front board page. I had all but given up on this.


You are the best and thank you again! :up:

Edited by Genosplace, Jan 28 2015, 06:38 PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1