AJAX Userinfo

It only shows "guest" when hovering. - AJAX Userinfo

It only shows "guest" when hovering.

by Lord Phobos » Sat Jan 26, 2019 6:09 pm

Hi

This extension worked nice for me so far, but now I've added this paid SEO extension, and it works nice as well.

But now, each username I hover with my mouse I get informations about "guest" user.
I think this is caused by the modified by SEO user links to profile?

In the FAQ of that SEO extension it says that for some extension I should add these lines:

Code: Select all

define('MSU_LOAD_LIB_ONLY_BB', true);
include('includes/magic_seo_url.php');

Code: Select all

msuTransformUrlBb( string $url )
function (transforms the given URL).
seo.png
seo.png (8.13 KiB) Viewed 78 times

But I really don't know where to add these lines.
Could you plz help me?
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: It only shows "guest" when hovering.

by Lord Phobos » Sat Jan 26, 2019 11:24 pm

I think the problem is in the script file:

I should find a way to tell the script how to read the rewritten SEO url of the user profile link.
This is an example of such a link: https://www.anonimagiocatori.it/members/diego-67

Code: Select all

(function($) {
	'use strict';

	/* Set div to mouse */
	$(document).mousemove( function(e) {
		var docX, docY, posX, posY;
		var popup_height = $('#popup').height();

		docX = e.clientX + $(window).scrollLeft();
		docY = e.clientY + $(window).scrollTop();

		if (docX > $(window).width() - 400) {
			posX = (docX - 350);
		} else {
			posX = docX;
		}
		if (docY > ($(window).height() + $(window).scrollTop()) - popup_height - 40) {
			posY = (docY - (popup_height + 20));
		} else {
			posY = (docY + 30);
		}
		$('#popup').css({'top':posY,'left':posX});
	});

	var data = new Array();
	var show_popup = false;
	$('a.username-coloured, a.username').mouseover(
		function() {
			var id = getURLParameter(($(this).attr('href')), 'u');
			var url = userinfo_url.replace('USERID', id);
			show_popup = true;
			if(typeof data[id] === 'undefined') {
				$.get(url, function( responseText ) {
					data[id] = responseText;
					$.each(data[id], function(index, value){
						$('#ajax_'+index).html(value);
					});
					if (show_popup) {
						$( '#popup').show();
					}
				});
			} else {
				$.each(data[id], function(index, value){
					$('#ajax_'+index).html(value);
				});
				if (show_popup) {
					$( '#popup').show();
				}
			}
		}
	);
	$('a.username-coloured, a.username').mouseout(
		function(){
			show_popup = false;
			$('#popup').hide();
			$('#popup').find('span').each(function(){
				$(this).html('');
			});
		}
	);
})(jQuery);

function getURLParameter(url, name) {
    return (RegExp(name + '=' + '(.+?)(&|$)').exec(url)||[,null])[1];
}
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: It only shows "guest" when hovering.

by Lord Phobos » Wed Jan 30, 2019 12:33 pm

Plz?
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: It only shows "guest" when hovering.

by Lord Phobos » Mon Feb 04, 2019 1:16 am

Here is the solution to my issue, if someone needs it in the future: https://www.inveostore.com/community/ph ... -809#p3505
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm