WhiteNeo / lastposter-avatar-mybb18x-series

Shows avatar on MyBB forum index, showthread, forumdisplay and search parts
2 stars 1 forks source link

Mouse events - show popup for mentioned users in posts #4

Closed Eldenroot closed 6 years ago

Eldenroot commented 7 years ago

Would be really nice to show a popup for mentioned user in post (over @username) -> better than redirects to the member profile page. (Mentionme or DVZ mentions). Same feature has XenForo

WhiteNeo commented 7 years ago

i add onmouse over on modals if enabled i can use that to add it into that but i have to review it. Some users add it manually due it can be done because i add it globally.

you can use modals with code but mention plugin has no hooks it's mybb ones but i try to find preg_replacements for both plugins.

thanks for your sugestion.

El mar 19, 2017 1:12 p.m., "Eldenroot" notifications@github.com escribió:

Would be really nice to show a popup for mentioned user in post (over @username) -> better than redirects to the member profile page. (Mentionme or DVZ mentions). Same feature has XenForo

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WhiteNeo/lastposter-avatar-mybb18x-series/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXCCHlWcrhEpJeJccEB1C3RMwhhDTuVks5rnX4NgaJpZM4Mh1cS .

Eldenroot commented 7 years ago

@WhiteNeo - do you need any code changes in MentionMe plugin? I can contact the owner and ask him about it to add in next release (will be soon).

WhiteNeo commented 7 years ago

@Cu8eeeR I have added new function to use with all mods whenever you want :)

To use it is the same as formatted names, but you can add it into any link to retrieve info by ajax on hover events.

avatarep_modals_hover($myid, $name)

That is the way to call it you have to set $myid is an unique id for every element to call modals, and $name is the name of the modal, this is at your wishes.

Sample:

$profilelink = "<a href=\"member.php?uid={$uid}\">{$userprofile}";

You have to add the action to load modals and function at the end.

$profilelink = "<a href=\"member.php?uid={$uid}&action=avatarep_popup\">{$userprofile}".avatarep_modals_hover($myid, $name);

And the last thing is stting up myid val and name before the link.

$myid = $uniqueidelement; $name = "profile_modal"; $profilelink = "<a href=\"member.php?uid={$uid}&action=avatarep_popup\">{$userprofile}".avatarep_modals_hover($myid, $name);

The unique id elemet have to be settig up by the plugin to ot duplicate entries, and the name is in general for all modals for every mod you need to add.

I think is the most easiest way to call it from the plugin like formatted names, if WIldcard add it an id like #id@usermention#id like tyl or some mod i ca glitch that value or he can add it if function exists the load it but i will try next weekend to find a way to search inside post parser or msg parser but is not for sure it works due MentionMe and DVZ_Mentions has own methods to parse elements inside @names.

Eldenroot commented 7 years ago

Thats great, can you please create an issue about this here https://github.com/WildcardSearch/MentionMe - it would be probably better, because you know what you need to add

WhiteNeo commented 7 years ago

yes i have to review some details due i try to glitch but script was broken of by mentions so i am working on new function for this and other parts but i let you know when it is done actually i am on it.

El mar 20, 2017 2:11 p.m., "Eldenroot" notifications@github.com escribió:

Thats great, can you please create an issue about this here https://github.com/WildcardSearch/MentionMe - it would be probably better, because you know what you need to add

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WhiteNeo/lastposter-avatar-mybb18x-series/issues/4#issuecomment-287882821, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXCCPHtEuV9Iwt2lUui8mHYkFjbuUIcks5rnt1qgaJpZM4Mh1cS .

WhiteNeo commented 7 years ago

@Cu8eeeR It is time to test it i have tested with my own mentions plugins but i tested with Wildcard Mentions too and it works fine.

If you wish to test onl open forum.php file of MentionMe in this path (inc/plugins/MentionMe/forum.php)

Search this function mentionBuild($user)

I have it on line 235 of that file.

In line 268 you must find this:

$url = get_profile_link($user['uid']);

// the HTML id property is used to store the uid of the mentioned user for MyAlerts (if installed)
return <<<EOF

{$mybb->settings['mention_displaysymbol']}<a id="mention{$user['uid']}" href="{$url}{$action}"{$evento} class="mentionme_mention">{$username}{$mention_function} EOF;

Replace with:

if (function_exists(avatarep_hover_extends))
{
    global $mybb;
    if($mybb->settings['avatarep_menu'] == 1 && $mybb->settings['avatarep_menu_events'] == 2)
    {
        $id = (int)$user['uid'];
        $name = "mention_";
        $mention_function = avatarep_hover_extends($id, $name);
        $action = "?action=avatarep_popup";
        $evento = " onclick=\"return false;\"";             
    }
    else if($mybb->settings['avatarep_menu'] == 1 && $mybb->settings['avatarep_menu_events'] == 1)
    {
        $evento = " onclick=\"MyBB.popupWindow('member.php?uid={$user['uid']}&amp;action=avatarep_popup', null, true); return false;\"";    
    }   
}

$url = get_profile_link($user['uid']);

// the HTML id property is used to store the uid of the mentioned user for MyAlerts (if installed)
return <<<EOF

{$mybb->settings['mention_displaysymbol']}<a id="mention{$user['uid']}" href="{$url}{$action}"{$evento} class="mentionme_mention">{$username}{$mention_function} EOF;

And done !!!

Plugin have to work if is present if not then nothing happens and all works as usual. but is for both instances modals with onclick events and hover events but you have to enable modals to work it on avatars if the option is disabled then the same happens MentionMe works as usual, a other mod should be added at the same wa i added on master the wa it works but here i share the entire code as a sample and is that what i have tested this days, at this point i have tested all instances and should work, this is the end of my work for mybb i have to retire myself due medical indications, so i will be back in future if posible, but for now i want only to finish this becuse is the last thing i should do i've to go, so test it and i am sure it works but i have to work more on code when i am back in few months.

See yah bro !!!

Eldenroot commented 7 years ago

@WhiteNeo - thx, I will try soon.

Can you post an issue for mentionme plugin to add this part of code for the next release to make it simpler for users?

WhiteNeo commented 7 years ago

I can't because Wildcard do not take in mind changes maded by others, i have sended some fixes for issues posted on mybb.com but i take the time to analize it and reproduce it, so i hve sended the fixed code and at this day that changes would never cames, so why i have to waste my time again doing something that he does not takes in mynd for sure.

I think if some users ask him is more easy to he can make a code for that because as fr as i know he never takes codes from others as i, only when is necesary or many people asks for it.

I think the users have to ask for this for wildcard adds it or at least think about it. I have tested with MentionMe and DVZ mentions and both of them works but the changes are different between every version, and i have my own version of mentions so i have tested on three and works fine, but due some ids are repeated sometimes popups shows more than once.

But that is due codes, i have added on plugin sides a unique ids for every element because when an element is duplicated or exists more than one time then SEO brokes due w3c customizations and style or design rules because every element have to be unique if uses ids, else you have to use classes instead ids. I added with classes but the id is there so popup loads as many times as that id exists on DOM.

2017-03-23 2:20 GMT-06:00 Eldenroot notifications@github.com:

@WhiteNeo https://github.com/WhiteNeo - thx, I will try soon.

Can you post an issue for mentionme plugin to add this part of code for the next release to make it simpler for users?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WhiteNeo/lastposter-avatar-mybb18x-series/issues/4#issuecomment-288647434, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXCCNHih1BM0XaOuWmue97hKFEXWyhvks5roitegaJpZM4Mh1cS .

Eldenroot commented 7 years ago

I can't because Wildcard do not take in mind changes maded by others, i have sended some fixes for issues posted on mybb.com but i take the time to analize it and reproduce it, so i hve sended the fixed code and at this day that changes would never cames, so why i have to waste my time again doing something that he does not takes in mynd for sure.

He is extremely busy, he will release a new version as soon as possible (I think it will be in April). However you can create an issue in his repository and ask him to add a piece of code which will be used by your and maybe others plugins in future.

WhiteNeo commented 7 years ago

i ask him when i have time i am very bussy too, and retired from mybb scene. I will try it on skype by the way when i can.

El mar 24, 2017 2:09 p.m., "Eldenroot" notifications@github.com escribió:

I can't because Wildcard do not take in mind changes maded by others, i have sended some fixes for issues posted on mybb.com but i take the time to analize it and reproduce it, so i hve sended the fixed code and at this day that changes would never cames, so why i have to waste my time again doing something that he does not takes in mynd for sure.

He is extremely busy, he will release a new version as soon as possible (I think it will be in April). However you can create an issue in his repository and ask him to add a piece of code which will be used by your and maybe others plugins in future.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WhiteNeo/lastposter-avatar-mybb18x-series/issues/4#issuecomment-289130783, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXCCAGKb_62tco1kfQIbP7EHve69k1lks5rpCMFgaJpZM4Mh1cS .

Eldenroot commented 7 years ago

@WhiteNeo - Hi, I have an issue to make it working properly (it was fine on my testing board, not now on my live).

Can you tell me: 1) what template additions are needed to make popup working (you didnt mention it in your tutorial) 2) I cannot find mention code above in mentionme file anymore 3) do I need to again modify your plugin to work?

WhiteNeo commented 7 years ago

Nope do not need any mods but MentionMe core like described, to load code, and then enables modal on plugin, configure it at your own desires and that is all.

I have it into my local and live forums working right now even DVZ Mentions on localhost goes fine, did you change core files in bridged plugins ?

Do you have this on your headerinclude ?

{$avatarep_script}

You need to add that var if you do not use mybb default modals, but plugin hover option.

WhiteNeo commented 6 years ago

Ok this was added but other programmers decide not to use anyway is present and working on :)