Page 1 of 1

[phpBB3] AJAX Userinfo Extension

Posted: Sat Feb 02, 2019 11:07 am
by Lord Phobos
Hi!

I'm having trouble with this extension: https://www.phpbb.com/customise/db/exte ... _userinfo/

I tried asking support from the author but for no avail, since now.

My request for support describing the issue is at the following link: https://www.phpbb.com/customise/db/exte ... pic/201286

I'll paste it here for your convenience:

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).

Image


But I really don't know where to add these lines.
Could you plz help me?


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];
}

Re: [phpBB3] AJAX Userinfo Extension

Posted: Sat Feb 02, 2019 11:55 am
by inveo
To resolve the issue you are having you may either:

1) edit your tpl file and replace double quotes with single quotes (i.e. " to '). Then MSU will keep the original URL.

OR

2) use the following getUserid() function instead of getURLParameter():

Code: Select all

function getUserid(url) {
    return (RegExp('-([0-9]+)').exec(url)||[,null])[1];
}

Re: [phpBB3] AJAX Userinfo Extension

Posted: Sun Feb 03, 2019 7:34 am
by Lord Phobos
I tried your second solution, altering only the last part of that script file, from

Code: Select all

function getURLParameter(url, name) {
    return (RegExp(name + '=' + '(.+?)(&|$)').exec(url)||[,null])[1];
}


to

Code: Select all

function getUserid(url) {
    return (RegExp('-([0-9]+)').exec(url)||[,null])[1];
}


but this way the extension simply stopped working.

Maybe I should alter something else in that script file? But I don't know how.

As for the first one solution, what do you mean for a TPL file?

Thanks again.

Re: [phpBB3] AJAX Userinfo Extension

Posted: Sun Feb 03, 2019 8:05 am
by inveo
To use the solution no.2, you need to ADD:

Code: Select all

function getUserid(url) {
    return (RegExp('-([0-9]+)').exec(url)||[,null])[1];
}


and REPLACE:

Code: Select all

var id = getURLParameter(($(this).attr('href')), 'u');


with:

Code: Select all

var id = getUserid(($(this).attr('href')));


in /tas2580/userinfo/styles/all/template/script.js file and you are done.

Re: [phpBB3] AJAX Userinfo Extension

Posted: Sun Feb 03, 2019 8:10 am
by Lord Phobos
Now it works perfectly, many thanks!!

Cart  
(empty)

Cart Check out  »

Prices are tax inclusive.

The VAT rate for your country (US) * is 0,0 % because it is not a member of the European Union (EU).

* Please create an account if your country does not match.

Community feed
  • [phpBB3] AJAX Userinfo Extension
    Hi! I'm having trouble with this extension: https://www.phpbb.com/customise/db/exte ... _userinfo/ I tried asking support from the author but for no avail, since now. My request for support...
    by Lord Phobos
  • [phpBB3] Upgrade to phpBB 3.2.3
    Hello.. after Upgrade to phpBB 3.2.3 I am getting this message.. How can I solve this issue..? Thank you
    by ingbrzy
  • [phpBB3] URL path changed
    Hello.. I have changed my site path after moving to new hosting and now can not activate SEO module.. new path http://www.miuios.cz/domains/miuios.cz/ could you help me? thank you
    by ingbrzy2
  • [phpBB3] Chinese language support
    Hi, i bought magic seo for phpbb because it says that it supports a wide range of alphabets and UTF-8, however i found that it doesn't. I'm preparing a website in Chinese and all forums having a...
    by iwsmike
  • [WP2PS] Yoast SEO plugin
    Thanks for your support installing the PS-WP integration. However there is some errors when PS-WP integration is activated. 1. Error generating sitemap with Yoas SEO plugin (it disappears when...
    by argidomin
Join our support forum » Pre-Sales Questions »
Featured Testimonials

Great work - great support - great tool! Thank you for your whole work and your great support. We're very glad with the plugin and our online portals now run much faster than before.

Alexander, the owner of Die Wirtschaft Köln

I can't thank you enough for your fantastic service and recommended me your plugin. The site is a lot faster now!

Phuong, the owner of Oceanbox Designs

More Testimonials »