Author Topic: notify administrator when e-card was sent  (Read 14844 times)

0 Members and 1 Guest are viewing this topic.

Offline peterle

  • Newbie
  • *
  • Posts: 17
    • View Profile
notify administrator when e-card was sent
« on: June 10, 2003, 01:32:44 PM »
I wonder if one could somewhere add a command to send a simple e-mail to an account of the adminsitrator that a user (the user name) has just sent a e-card. I am not interested in the message, I only would like to know how many cards a user is sending -> this could be usefull to have an eye on my users (linking...) :wink:
_________________

<a href="http://peter.zoonited.net" target="_blank" class="postlink">http://peter.zoonited.net/templates/peli/images/4imgs.gif" border="0" /></a>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
notify administrator when e-card was sent
« Reply #1 on: June 10, 2003, 01:38:19 PM »
I think there is a mod that counts how many ecards were sent
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline peterle

  • Newbie
  • *
  • Posts: 17
    • View Profile
Am I blind?
« Reply #2 on: June 10, 2003, 02:54:57 PM »
Hi Vono,

perhaps I am blind: I was looking through the forum before I asked that question. Now after your reply I searched again - I do not find anything...I think I do not use the right keywords?!
Can you help me?

Thank you and grüezzi
_________________

<a href="http://peter.zoonited.net" target="_blank" class="postlink">http://peter.zoonited.net/templates/peli/images/4imgs.gif" border="0" /></a>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
notify administrator when e-card was sent
« Reply #3 on: June 10, 2003, 03:01:47 PM »
oopss...sry, I was refering to the mod that counts downloads...
sorry, the mod you requested is not exist (yet?)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #4 on: August 13, 2007, 11:01:39 AM »
I wonder if one could somewhere add a command to send a simple e-mail to an account of the adminsitrator that a user (the user name) has just sent a e-card.

Hallo,

nochmal deutsch: Gibt es eine Möglichkeit, als Admin über eine versendete eMail (parallel zum Empfänger) benachtichtigt zu werden?
Nicht, dass der Text mit angezeigt werden müsste! Ich will nur per eMail Nachricht erhalten, DASS eine eCard versendet wurde.

Thx
COMmander

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: notify administrator when e-card was sent
« Reply #5 on: August 13, 2007, 10:04:17 PM »
I like.

In postcards.php file,

find:

Quote
      $msg .= $lang['send_postcard_success'];
      $msg .= "<br /><a href=\"".$back_url."\">".$lang['back_to_gallery']."</a>";
      $action = "showcard";

replace:

Quote
$site_email->reset();
     
      $sql_admin = "
     
      SELECT " . get_user_table_field("", "user_name") . get_user_table_field(", ", "user_email") . "
      FROM " . USERS_TABLE . "
      WHERE " . get_user_table_field("", "user_level") . " = " . ADMIN . " AND " . get_user_table_field("", "user_allowemails") . " = 1
     
      ";
     
      $result = $site_db->query($sql_admin);
     
      if (isset($result) && $result) {
          while ($admin_row = $site_db->fetch_array($result)) {           
              $admin_name = $admin_row[$user_table_fields['user_name']];
              $admin_email = $admin_row[$user_table_fields['user_email']];
          }
              $site_email->set_to(stripslashes($admin_email));
              $site_email->set_from(stripslashes($config['site_email']));
              $site_email->set_subject($lang['send_postcard_emailsubject']);
              $site_email->register_vars(array(
              "sender_name" => stripslashes($sender_name),
              "sender_email" => stripslashes($sender_email),
              "admin_name" => stripslashes($admin_name),
              "recipient_name" => stripslashes($recipient_name),
              "postcard_url" => stripslashes($postcard_url),
              "postcard_send_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
              "site_name" => $config['site_name']
              ));
              $site_email->set_body("adm_postcard_message", $config['language_dir']);
              $site_email->send_email();
      }

      $msg .= $lang['send_postcard_success'];
      $msg .= "<br /><a href=\"".$back_url."\">".$lang['back_to_gallery']."</a>";
      $action = "showcard";

Go to lang/your_lang/email - create file: adm_postcard_message.html and add message like this:

Quote

Dear {admin_name},

{sender_name} just send postcard to: {recipient_name}
 on: {postcard_send_date} .

URL: {postcard_url}
Sender email: {sender_email}

Greets.
{site_name}

Done ! ;)
« Last Edit: August 13, 2007, 11:18:40 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #6 on: August 13, 2007, 10:43:38 PM »

I get an error:
Code: [Select]
DB Error: Bad SQL Query: SELECT user_nameuser_email FROM galery_users WHERE user_level = 9 AND user_allowemails = 1
Unknown column 'user_nameuser_email' in 'field list'

 :?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: notify administrator when e-card was sent
« Reply #7 on: August 13, 2007, 11:18:47 PM »
Fix.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #8 on: August 14, 2007, 07:53:50 AM »

It works!  :D

Long awaited - very cool, that you did it so smooth!

THX
COMmander

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #9 on: August 14, 2007, 08:22:17 AM »
HM ?! :?

I've got two installations - both 1.7.4.

With one (as written) does the script, what it should do - with the other installation i get a 500-script error after pushing the send-button.
The script sends the card to the reciever, but no notification comes to the admin. (The html-admin-notification-email is uploaded).

What's this?! Sounds, as it's a prob with my installations?!


edit: ----------
The "error"-istallation is an updated 1.7.3 - may this cause the error?
« Last Edit: August 14, 2007, 09:51:31 AM by COMmander »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: notify administrator when e-card was sent
« Reply #10 on: August 14, 2007, 01:04:16 PM »
Quote
The "error"-istallation is an updated 1.7.3 - may this cause the error?

Try with fresh folder in 2nd server (v1.7.4). See if works with code.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #11 on: August 14, 2007, 10:28:37 PM »
Try with fresh folder in 2nd server (v1.7.4). See if works with code.

As written I've got a second installation - there does the script good work.

Maybe the update from 1.7.2 to 1.7.3 wasn't done correct.

Does somebody use this mod with 1.7.2 or 1.7.3?
Or somebody has a hint, what part of the script can cause an 500 Server Error?

 :?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: notify administrator when e-card was sent
« Reply #12 on: August 14, 2007, 10:33:08 PM »
Quote
what part of the script can cause an 500 Server Error?

Chek web error logs from host cPanel. Right answer there. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline COMmander

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: notify administrator when e-card was sent
« Reply #13 on: August 14, 2007, 11:45:54 PM »
Chek web error logs from host cPanel. Right answer there. ;)

Code: [Select]
Errorlog:

[Tue Aug 14 23:41:18 2007] [error] [client 84.185.134.xx] File does not exist: /www/xxx/favicon.ico
[Tue Aug 14 23:42:57 2007] [error] [client 84.185.134.xx] malformed header from script. Bad header=No recipient addresses found i: /www/xxx/postcards.php

Hm - malformed headser?!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: notify administrator when e-card was sent
« Reply #14 on: August 14, 2007, 11:47:44 PM »
Quote
No recipient addresses found

Ok, so what is say mail error logs from host cPanel ? If no have, no big. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?