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
  • [Zen Cart] Can't execute Magic SEO URLs sitemaps
    I installed Magic SEO URLs Sitemaps Add-On for ZenCart MSU4.x/MSU5.x 2.0 on my server, when I try to generate sitemaps using: https://www.pechesudv155.owally.com/sitemaps.php I received :...
    by peter@pechesud.com
  • [phpBB3] Sharing users between phpBB / PrestaShop
    Hi i have 2 question 1- prestashop module support phpBB 3.3 ? 2- why we can not login in prestashop and phpbb with same user?
    by zohall
  • [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
Join our support forum » Pre-Sales Questions »
Featured Testimonials

We installed the WordPress Accelerator plugin and it's great! With 2 other plugins the website is blazing fast!!

Milko, the owner of Boxershorts Heren

I just want take a minute to say that I received a great & fast service, not only a great product to get better rank, also a great service after sale. C'est fantastique!

Todd, the owner of Saltwater fishing tackle & gear

More Testimonials »