inherit
onewillingsniper@hotmail.com
185552
0
Mar 13, 2014 12:52:02 GMT -8
Willing Sniper
559
November 2012
sergentpepper
|
Post by Willing Sniper on Mar 22, 2014 9:38:19 GMT -8
PebbleThe IP button shows for all members. It would be nice if it didn't
|
|
inherit
162752
0
Nov 7, 2024 3:58:23 GMT -8
Pebble
Where it all does or doesn't happen!
1,437
January 2011
pebbleleague
|
Post by Pebble on Mar 22, 2014 11:19:16 GMT -8
PebbleThe IP button shows for all members. It would be nice if it didn't It should only show for staff as none staff don't see ip addresses. If your members are seeing the buttons then just set the plugin to only run for staff in the manage section of the plugins.
|
|
inherit
onewillingsniper@hotmail.com
185552
0
Mar 13, 2014 12:52:02 GMT -8
Willing Sniper
559
November 2012
sergentpepper
|
Post by Willing Sniper on Mar 22, 2014 13:56:40 GMT -8
Never mind. It's my fault.
|
|
inherit
195082
0
Mar 20, 2022 7:33:21 GMT -8
PF
1,089
June 2013
weedster
|
Post by PF on Mar 20, 2021 12:50:55 GMT -8
Pebble , hello. I have this plug-in installed on two forums of mine and they are very helpful. However, the buttons don't appear on another forum that I'm on. Even with the 'everyone' permission settings, it doesn't appear. I have it on 'staff' permission now. It's a new forum, so there aren't a lot of plug-ins installed. I have the Yootil plug-in at the top, then the IP Look Up next on the list. Any suggestions would be appreciated. Thank you. ETA: I also have the Guest IP Lookup installed and that doesn't appear either. I've never had any trouble with the buttons before on other forums.
|
|
Tommy
Junior Member
Posts: 344
inherit
241969
0
May 2, 2023 4:47:54 GMT -8
Tommy
344
February 2017
tommytdl
|
Post by Tommy on May 17, 2024 6:03:41 GMT -8
Hi Pebble, I might have asked this before but I can't find it anywhere and I have a bad case of CRS so anyway, is it in the realm of possibility to have a modification done on this plugin? We use this plugin literally every day, multiple times a day on new member signups and can't thank you enough for the time saving plugin. WMIP has us pretty well covered on the IP - we mostly search to see where the IP originated and if a mask is being used. The modification would be on the StopForumSpam search if we could have a choice of default the search username (or email) that would be amazing.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on May 18, 2024 2:43:57 GMT -8
<Script>
/* Change SFS button to look for email address (on profile pages) or display name (on mini-profile pages) */ /* Install: Global Footer */ $(()=>{ if(pb.data('route').name == 'user'){ let eml, sfs; if( (eml = $(`.content-box .headings:contains('Email:')`)).length && (sfs = $(`.button[title='stopforumspam.com']`)).length ){ /* change SFS button to look for email instead of IP */ sfs.attr('href', `https://www.stopforumspam.com/search/?q=${eml.next().text()}`); sfs.attr('title', `stopforumspam.com(${eml.next().text()})`) } } if(pb.data('proboards.post')){ /* Enable buttons on additional routes */ if (window.whatIP && (proboards.plugin.get('ip_lookup').settings.WMIPA==1||proboards.plugin.get('ip_lookup').settings.SFS==1) && $(`.button[title='stopforumspam.com'], .button[title='whatismyipaddress.com']`).length == 0){whatIP();} /* change SFS to look for display name instead of IP */ Object.keys(pb.data('proboards.post')).forEach((e,i,a)=>{ let post = $(`#post-${e}`), username = $(`.mini-profile .user-link`, post).attr('title').slice(1), displayname = pb.text.escape_html($(`.mini-profile .user-link`, post).html()), sfs = $(`.button[title='stopforumspam.com']`,post); sfs.attr('href', `https://www.stopforumspam.com/search/?q=${displayname}`); sfs.attr('title', `stopforumspam.com(${displayname})`) }) } });
</script>
|
|
Tommy
Junior Member
Posts: 344
inherit
241969
0
May 2, 2023 4:47:54 GMT -8
Tommy
344
February 2017
tommytdl
|
Post by Tommy on May 18, 2024 6:03:03 GMT -8
Chris it works great so thanks! I notice that the profile SFS button searches for email while the post button searches the username. I like it like this - it's an effective workaround - but I'm curious if this the expected outcome?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on May 19, 2024 1:45:10 GMT -8
Chris it works great so thanks! I notice that the profile SFS button searches for email while the post button searches the username. I like it like this - it's an effective workaround - but I'm curious if this the expected outcome? It was a workaround of necessity. The $[user.email] variable is generally included on the full profile page but not on pages that use the mini-profile, although it can be included in both templates. The code collects the username in addition to the display name but only uses the display name for now because of indecision on a workable method for both desktop and mobile-in-desktop mode (e.g., ALT+CLICK would not cut it). The leading alternative is to turn the SFS button into a dropdown, just like the Post Options "Cog" button, to allow for selection when more than one option is available on the current page. Update:
Added ability to choose from whatever data is available on the page <script>
/* Change SFS button to lookup email, display name, user name and IP */ /* Install: Global Footer */ $(()=>{ /* Set your preferred SFS lookup methods in ranking order here */ const SFS_PREF = ['email','displayname','username','IP']; //'email','displayname','username','IP' /* Install pbicons font */ $('head').append(`<link rel="stylesheet" type="text/css" href="//storage.proboards.com/1/css/dgCQWdSMUUGnieA0dXlf.css"/>`); const SFS = `stopforumspam.com`, WMIP = `whatismyipaddress.com`; if(pb.data('route').name == 'user'){ let eml, sfs; if( (eml = $(`.content-box .headings:contains('Email:')`)).length && (sfs = $(`.button[title^='${SFS}']`)).length ){ let user = { 'email': eml.next().text(), 'username': $('.show-user .title-bar').text().split('(')[1].split(')')[0], 'displayname': pb.data('page').member.name, 'IP': $('.options_menu .searchIP')[0].dataset.ip, } addSFSMenu(sfs,user) sfs.find('.status').html(`SFS(${user[sfs.data('query')]})`) } } if(pb.data('proboards.post')){ function upgradeSFS(){ /* Enable buttons on additional routes */ if (window.whatIP && (proboards.plugin.get('ip_lookup').settings.WMIPA==1||proboards.plugin.get('ip_lookup').settings.SFS==1) && $(`.button[title^='${SFS}'], .button[title^='${WMIP}']`).length == 0){whatIP();} /* change SFS button in posts to preferred lookup identifier */ Object.keys(pb.data('proboards.post')).forEach((post_id,post_meta,a)=>{ let post = $(`#post-${post_id}`), user = { email: $(`.mini-profile`,post).text().match(/[\w-\.]+@([\w-]+\.)+[\w-]{2,4}/)?.at(0)??null, username: $(`.mini-profile .user-link`, post).attr('title')?.slice(1)??null, displayname: pb.text.escape_html($(`.mini-profile .user-link,.user-guest[itemprop="name"]`, post)?.html()??'')||null, IP: $(`.searchIP`,post).data('ip')||null }, sfs = $(`.button[title='stopforumspam.com']`,post); sfs.attr('href', `https://www.stopforumspam.com/search/?q=${user.displayname}`); sfs.attr('title', `stopforumspam.com(${user.displayname})`); addSFSMenu(sfs,user); sfs.find('.status').html(`SFS(${user[sfs.data('query')]})`) }) } upgradeSFS();pb.events.on('afterSearch',upgradeSFS); } function addSFSMenu(btn,user){ let menuItems = `<ul class="options_menu hide uiy-menu ui-helper-clearfix uiy-selectMenu" style="max-width:none"> <li class="sfs-email" data-user-id="${user.email}"><a><span class="icon pbi-at"></span>Email(${user.email})</a><span class="arrow right"><span></span></span></li> <li class="sfs-displayname" data-user-id="${user.displayname}"><a><span class="icon pbi-eraser"></span>Displayed Name(${user.displayname})</a><span class="arrow right"><span></span></span></li> <li class="sfs-username" data-user-id="${user.username}"><a><span class="icon pbi-link"></span>Login Name(${user.username})</a><span class="arrow right"><span></span></span></li> <li class="sfs-IP" data-user-id="${user.IP}"><a><span class="icon pbi-pagination-double-chevron-right"></span>IP(${user.IP})</a><span class="arrow right"><span></span></span></li </ul>` /* set default action for the SFS button */ for(let c of SFS_PREF){ if(user[c]){ btn.attr('href', c=='IP'?`https://www.${SFS}/ipcheck/${user[c]}`:`https://www.${SFS}/search/?q=${user[c]}`) .attr('title', `${SFS}(${user[c]})`) .attr('data-query',c) break; } } $(menuItems).each(function() { $(this).selectMenu({ container: btn.empty().prop('onclick',()=>(ev)=>{if(btn.hasClass('open-menu'))return false;}), status: 'SFS', statusClick: !1, staticStatus: !0, beforeShow: function() { //debugger; if(btn.hasClass('status-click')){ btn.removeClass('status-click'); btn.removeClass("open-menu"); return false; } btn.addClass("open-menu"); for(let g in user){ if(!user[g]) $(this).menu("hideOption", `sfs-${g}`) } }, onClose: function() { btn.removeClass("open-menu") }, menuOptions: { click: function(e, t) { e.preventDefault(); let m = $(t.item), i = m.attr("class"); switch(i){ case "sfs-email": btn.attr('href',`https://www.stopforumspam.com/search/?q=${user.email}`) .data('query', 'email'); break; case "sfs-displayname": btn.attr('href',`https://www.stopforumspam.com/search/?q=${user.displayname}`) .data('query','displayname') break; case "sfs-username": btn.attr('href',`https://www.stopforumspam.com/search/?q=${user.username}`) .data('query', 'username'); break; case "sfs-IP": btn.attr('href',`https://www.stopforumspam.com/ipcheck/${user.IP}`) .data('query','IP') } btn.attr('title',`${SFS}(${user[btn.data('query')]})`) .find('.status').html(`SFS(${user[btn.data('query')]})`) } , noshow: function(ev){ debugger; return; if(ev.currentTarget.classList.contains('status')) menuItems.menu('close'); }, } }); //prevent menu showing on status click (just perform the default action) btn.bind_first('mousedown',function(e){ if(e.target !== e.currentTarget && e.target.className && e.target.className.indexOf('status')!=-1){ $(e.currentTarget).addClass('status-click'); } }) .find('.icon').attr('title','Change Lookup') }).appendTo(btn.parent()) } })
</script>Edit History:Added display name lookup for guest posts (deleted accounts are still IP only) Corrected guest IP being sent as a SEARCH rather than an IPCHECK Posted an updated code that allows user data selection
|
|
Tommy
Junior Member
Posts: 344
inherit
241969
0
May 2, 2023 4:47:54 GMT -8
Tommy
344
February 2017
tommytdl
|
Post by Tommy on May 21, 2024 15:51:31 GMT -8
This is amazing Chris, thank you! Initial testing and it's working very good and seriously way above and beyond what we were hoping for.
|
|