Add Confirmation to Blocking a Member

geek_girl posted 14th of December 2012 in Community Voice. 4 comments.

I have had members to accidentally block others because the block action does not have a confirmation; it posts a notice but it is possible for members to overlook the notice and to accidentally click on the block button; yes, it has happened more than once.  There is a solution; one needs to add a confirm() to the block action.  There is a module in the Market that makes it easy to edit actions as well as remove them from action blocks; I will leave it to my readers to find the module and it is not that expensive of a mod either.  Of course you don't need the mod to edit the actions.

 

To add confirmation to the block button add the part in red to the action code.

 

if ( {ID} == {member_id} || isBlocked({member_id}, {ID}) ) return;

return  "if(confirm('Are you sure you want to block this member?')) $.post('list_pop.php?action=block', { ID: '{ID}' }, function(sData){ $('#ajaxy_popup_result_div_{ID}').html(sData) } );return false;";

 

If you hit Cancel, the action is not taken.  If you hit OK, the action is taken and the member is blocked.

 
Recommended by
 
 
Comments
·Oldest
·Top
Please login to post a comment.
TruckingSpace
Here is your code for Report Spam:

if ({ID} == {member_id}) return;

return "if(confirm('Are you sure you want to report this member?')) $.post('list_pop.php?action=spam', { ID: '{ID}' }, function(sData){ $('#ajaxy_popup_result_div_{ID}').html(sData) } );return false;";
what file do i edit this in? sorry im a bit of an amateur ha ha
TruckingSpace
There is no file.. It is in your database..
mrxam
Thank you very much, all works. Can you help me, my site is multi language, how I do to make it work?
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.12817883491516