Resource icon

vBulletin Email Change Alert 1.2

No permission to download
  • Thread starter
  • Moderator
  • #1

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
MarkFL submitted a new resource:

Email Change Alert - Allows you to be notified whenever a user changes their email address.

Overview:

This product allows you to be notified whenever a user changes their email address. You can choose to have selected users be notified by PM, or to set up a forum in which changes are posted to a specified thread, or both. You set the PM/thread title, and the format of the report.

View attachment 47993

Updates:

Version 1.1:

  • Changed PHP hook location so that alert(s) are sent only when everything is...
Read more about this resource...
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
Hi Mark,
If user has been deleted from forum as I did today, when I try to read the message I had
from the system mod, (That user has changed the email) I have the error:

SELECT COUNT(*) AS total
FROM usernote AS usernote
WHERE userid =;

How to fix it?

Thanks
 
  • Thread starter
  • Moderator
  • #3

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
That query isn't part of this product. :D
 
  • Thread starter
  • Moderator
  • #5

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
Yes you are write, I had a note,
Actually I never get answers here
https://theadminzone.com/threads/ozzmodz-usernote-count-in-postbit-vb4-vb3-8-vb3-7-vb3-6.142016/#post-1078902

Thank you and sorry
Okay, I would try to locate where in that product that particular query exists, and see what variable is supposed to contain the userid. Then wrap the query in a conditional such that the query is made only when there is a valid userid.

Do you have this product installed?

Search Plugins

This makes searching for plugin code much easier, and is a must have for any vB 4. coder, in my opinion.
 
  • Thread starter
  • Moderator
  • #7

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
Yes I have that installed, thank you to bother :)
Okay, good, use that product and search on:

SELECT COUNT(*) AS total

and select Ozzy's product to limit the search...then post the actual query, and I will show you how to edit it...:D
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
Code:
global $vbulletin;

if ($this->registry->options['ozzmodz_usernote_postbit_active'])
{
    $usernotes = $vbulletin->db->query_first("
        SELECT COUNT(*) AS total
        FROM " . TABLE_PREFIX . "usernote AS usernote
        WHERE userid = " . $post['userid']
    );

    $usernotes2 = vb_number_format($usernotes['total']);

    $ozzmodz_usernote_count = vB_Template::create('ozzmodz_usernote_count');
    $ozzmodz_usernote_count->register('usernotes2', $usernotes2);
    $ozzmodz_usernote_count->register('post', $post);

    switch ($this->registry->options['ozzmodz_usernote_postbit_location'])
    {
        //case 1: $template_hook['postbit_start'] .= $ozzmodz_usernote_count->render(); break;
        case 2: $template_hook['postbit_userinfo_left'] .= $ozzmodz_usernote_count->render(); break;
        case 3: $template_hook['postbit_userinfo_right_after_posts'] .= $ozzmodz_usernote_count->render(); break;
        case 4: $template_hook['postbit_userinfo_right'] .= $ozzmodz_usernote_count->render(); break;
        case 5: $template_hook['postbit_messagearea_start'] .= $ozzmodz_usernote_count->render(); break;
        case 6: $template_hook['postbit_signature_start'] .= $ozzmodz_usernote_count->render(); break;
        case 7: $template_hook['postbit_signature_end'] .= $ozzmodz_usernote_count->render(); break;
        //case 8: $template_hook['postbit_controls'] .= ozzmodz_usernote_count->render(); break;
    }
}
Postbit_display_complete
 
  • Thread starter
  • Moderator
  • #9

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
Okay, try changing it to this:

PHP:
global $vbulletin;

if ($this->registry->options['ozzmodz_usernote_postbit_active'] AND $post['userid'])
{
   $usernotes = $vbulletin->db->query_first("
       SELECT COUNT(*) AS total
       FROM " . TABLE_PREFIX . "usernote AS usernote
       WHERE userid = " . $post['userid']
   );

   $usernotes2 = vb_number_format($usernotes['total']);

   $ozzmodz_usernote_count = vB_Template::create('ozzmodz_usernote_count');
   $ozzmodz_usernote_count->register('usernotes2', $usernotes2);
   $ozzmodz_usernote_count->register('post', $post);

   switch ($this->registry->options['ozzmodz_usernote_postbit_location'])
   {
       //case 1: $template_hook['postbit_start'] .= $ozzmodz_usernote_count->render(); break;
       case 2: $template_hook['postbit_userinfo_left'] .= $ozzmodz_usernote_count->render(); break;
       case 3: $template_hook['postbit_userinfo_right_after_posts'] .= $ozzmodz_usernote_count->render(); break;
       case 4: $template_hook['postbit_userinfo_right'] .= $ozzmodz_usernote_count->render(); break;
       case 5: $template_hook['postbit_messagearea_start'] .= $ozzmodz_usernote_count->render(); break;
       case 6: $template_hook['postbit_signature_start'] .= $ozzmodz_usernote_count->render(); break;
       case 7: $template_hook['postbit_signature_end'] .= $ozzmodz_usernote_count->render(); break;
       //case 8: $template_hook['postbit_controls'] .= ozzmodz_usernote_count->render(); break;
   }
}
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
Ok thank you very much, I will change it, I can not test right now, I must have the same situation, I have deleted the messages before asking help.

I appreciate this Mark
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
I made the same condition with an unregister user, I delete him and it is ok, no error with the change alert message.
Thanks my freind
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
When ever make an update... What about an option in "thread Notification Type" to put username that will be the owner of the thread.
By default is the same user that changes the email. :) Thanks
 
  • Thread starter
  • Moderator
  • #14

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
When ever make an update... What about an option in "thread Notification Type" to put username that will be the owner of the thread.
By default is the same user that changes the email. :) Thanks
Are you using the vB3 version of this product? It would be easy I suppose to give the option to designate a thread author for the threads generated by this product, but what advantage would there be?
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
Wrong sorry, better someone to remove this to vb4.
All modification that have an option to make thread that I have has an option to put username.
Example, I do not want user to have grow up post with this mod. and the category I have these threads I have there post count.

:)
 
  • Thread starter
  • Moderator
  • #16

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
Okay, I have moved the posts to the vB4 version product thread. I will add the requested feature soon. :)
 
  • Thread starter
  • Moderator
  • #17

MarkFL

La Villa Strangiato
Joined
Jul 3, 2017
Messages
1,252
Update - Version 1.2:

  • Added setting to allow for the designation of alert thread author userid.
 

Stratos

Participant
Joined
Mar 15, 2012
Messages
76
You are a masterpiece :tup:
Tested in vb4.2.0 and in vb4.2.5 with PHP7, excellent in all tests. Thank you very much.
 
Top