Accidentally block others members

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.

I found a solution to this issue :

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

Can you help me, my site is multi language, how I do to make it work?

Quote · 30 Jul 2013

There was an addendum for the unblock that I did not add to my note.  Below is copied from my original forum topic.  What you need to do is to add a language key instead of the hard coded message.

========

They are strored in "sys_objects_actions" table as {cpt_block} and {cpt_unblock}    

    Change their "Eval" value as below

   1) for {cpt_block}

 

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); location.reload(); } ); } return false";

 

  2) for {cpt_unblock}

 

if ({ID} == {member_id} || !isBlocked({member_id}, {ID}) ) return;  return "if(confirm('Are you sure you want to Unblock this member?')){ $.post('list_pop.php?action=unblock', { ID: '{ID}' }, function(sData){ $('#ajaxy_popup_result_div_{ID}').html(sData); location.reload();} ); } return false";

 

Geeks, making the world a better place
Quote · 30 Jul 2013
 
 
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.