4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on June 07, 2005, 04:47:18 AM

Title: [MOD] Email image validation results to the user v2
Post by: V@no on June 07, 2005, 04:47:18 AM
This is complete rewrite of SLL's "[MOD] Email image validation results to the user v1 (http://www.4homepages.de/forum/index.php?topic=3627.0)". Since SLL is no longer very active on this forum :( I decided create my own mod using his idea, with many new features and most significan change from v1 is that every member will receive only one email with list of accepted/declined images instead of separate email for each image.


------------ [ Features ] -------------

The validation page:
(http://img294.echo.cx/img294/4091/validate7rv.png)

And the email member received after validation the three images above:
(http://img294.echo.cx/img294/5372/validate25tr.png)

------------- [ Installation ] --------------

If u've installed "[MOD] Email image validation results to the user v1 (http://www.4homepages.de/forum/index.php?topic=3627.0)" by SLL, you'll need to uninstall it before installing this mod...

Step 1
Open admin/validateimages.php
Find:
Code: [Select]
  $image_list = (isset($HTTP_POST_VARS['image_list'])) ? $HTTP_POST_VARS['image_list'] : "";Insert below:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START INSERT
*/
  $msg_list = (isset($HTTP_POST_VARS['msg_list'])) ? $HTTP_POST_VARS['msg_list'] : "";
  $email_cache = array();
  $action = "validateimages";
/*
  MOD VALIDATION RESULT V2
  END INSERT
*/


Step 1.1
Find:
Code: [Select]
            echo $lang['image_add_success'].": <b>".stripslashes($image_name)."</b> (".$image_media_file.")<br />";Replace it with:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START ORIGINAL CODE

            echo $lang['image_add_success'].": <b>".stripslashes($image_name)."</b> (".$image_media_file.")<br />";

  MOD VALIDATION RESULT V2
  END ORIGINAL CODE
*/
/*
  MOD VALIDATION RESULT V2
  START REPLACE
*/
            echo $lang['image_add_success'].": <b><a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_id)."\" target=\"_blank\">".stripslashes($image_name)."</a></b> (".$image_media_file.")<br />";
            $email_cache[$user_id][] = array(
              "status" => 1,
              "send" => (isset($HTTP_POST_VARS['send'][$key]) && $HTTP_POST_VARS['send'][$key] == 2) ? 1 : 0,
              "image_id" => $image_id,
              "date" => $image_date,
              "image_media_file" => $image_media_file,
              "msg" => $msg_list[$key]
            );
/*
  MOD VALIDATION RESULT V2
  END REPLACE
*/


Step 1.2
Find:
Code: [Select]
        echo $lang['image_delete_success'].": <b>".stripslashes($image_name)."</b> (".$image_media_file.")<br />";Insert below:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START INSERT
*/
        $email_cache[$user_id][] = array(
          "status" => 0,
          "send" => (isset($HTTP_POST_VARS['send'][$key]) && $HTTP_POST_VARS['send'][$key] == 2) ? 1 : 0,
          "image_id" => 0,
          "date" => $image_date,
          "image_media_file" => $image_media_file,
          "msg" => $msg_list[$key]
        );
/*
  MOD VALIDATION RESULT V2
  END INSERT
*/


Step 1.3
Find:
Code: [Select]
}
  else {
    echo "<b>Just relaxing because you give me nothing to do!</b>";
Insert above (make sure insert it above the closing bracket "}" above the else !!!!:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START INSERT
*/
    if (!empty($email_cache))
    {
      if (!class_exists('Email')) include(ROOT_PATH.'includes/email.php');
      $user_ids = implode(",", array_keys($email_cache));
      $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_allowemails")."
              FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_id")." IN (".$user_ids.") AND ".get_user_table_field("", "user_level")." > ".GUEST;
      $result = $site_db->query($sql);
      $email_template = new Template(ROOT_PATH."lang/".$config['language_dir']."/email");
      while($row = $site_db->fetch_array($result))
      {
        if (!$row['user_allowemails']) continue; //comment this line out to disregard member's setting not to receive emails from administrators
        $list = "";
        $file_list = array();
        $site_url = $script_url;
        $site_url = preg_replace("#/?admin#", "", $site_url);
//        $site_url = "http://yoursite.com/4images"; // uncomment this line and update to the correct domain if your have problem with url in the email message
        $email_template->register_vars(array(
          "lang_upload_date" => $lang['validate_date'],
          "lang_file" => $lang['validate_file'],
          "lang_msg" => $lang['validate_msg'],
          "lang_status" => $lang['validate_status'],
        ));
        foreach ($email_cache[$row['user_id']] as $info)
        {
          if (!$info['send']) continue;
          $file_list[] = $info['image_media_file'];
//          $image_url = ($info['image_id']) ? "( ".$site_sess->url($site_url."/details.php?".URL_IMAGE_ID."=".$info['image_id'], "&")." )" : "";
          $image_url = ($info['image_id']) ? "( ".$site_url."/details.php?".URL_IMAGE_ID."=".$info['image_id']." )" : "";
          $email_template->register_vars(array(
            "status" => ($info['status']) ? $lang['validate_yes'] : $lang['validate_no'],
            "image_url" => $image_url,
            "image_id" => $info['image_id'],
            "date" => format_date($config['date_format']." ".$config['time_format'], $info['date']),
            "file" => $info['image_media_file'],
            "msg" => stripslashes($info['msg'])
          ));
          $list .= $email_template->parse_template("validation_email_bit");
        }
        if (empty($list)) continue;
        $site_email = new Email();
        $site_email->set_to($row['user_email']);
//        $site_email->set_from($config['site_email'], $config['site_name']);
        $site_email->set_subject($lang['valdiate_title']);
        $site_email->register_vars(array(
          "recipient_name" => $row['user_name'],
          "list" => $site_email->prepare_text($list),
          "file_list" => implode(", ", $file_list),
          "site_url" => $site_sess->url($site_url, "&"),
          "date" => format_date($config['date_format']." ".$config['time_format'], time()),
          "site_name" => $config['site_name']
        ));
        $site_email->set_body("validation_email", $config['language_dir']);
        $site_email->send_email();
      }
    }
    echo "<br />";
/*
  MOD VALIDATION RESULT V2
  END INSERT
*/
(make sure that between this block of code and the code u've inserted in previous step are only two (2) closing brackets ( } )!


Step 1.4
Find:
Code: [Select]
    echo "<td class=\"tableseparator\">".$lang['validate']."</td>\n<td class=\"tableseparator\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";Replace it with:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START ORIGINAL CODE

    echo "<td class=\"tableseparator\">".$lang['validate']."</td>\n<td class=\"tableseparator\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";

  MOD VALIDATION RESULT V2
  END ORIGINAL CODE
*/

/*
  MOD VALIDATION RESULT V2
  START REPLACE
*/
    show_hidden_input("cat_id", $cat_id);
    show_hidden_input("limitnumber", $limitnumber);
    echo "<script>
    var yes = false;
    var no = false;
    var send = true;
    var rc = new Array();
    function CheckAllradio(num, checked) {
      for (var i=0;i<document.form.elements.length;i++) {
        var e = document.form.elements[i];
        if (e.type=='radio' && e.value == num) {
          e.checked = checked;
        }
      }
    }
    </script>";
    echo "<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n<td class=\"tableseparator\" onClick=\"if(send){send=false;CheckAllradio(2, false);CheckAllradio(3, true);}else{send=true;CheckAllradio(2, true); CheckAllradio(3, false);}\">Send</td>\n<td class=\"tableseparator\" onClick=\"if(yes){yes=false;no=false}else{yes=true;no=false;}CheckAllradio(1, yes)\">".$lang['validate']."</td>\n<td class=\"tableseparator\" onClick=\"if(no){no=false;yes=false}else{no=true;yes=false;}CheckAllradio(0, no)\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
/*
  MOD VALIDATION RESULT V2
  END REPLACE
*/


Step 1.5
Find:
Code: [Select]
      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"1\"></td>";
      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"0\"></td>";
Replace it with:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START ORIGINAL CODE

      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"1\"></td>";
      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"0\"></td>";

  MOD VALIDATION RESULT V2
  END ORIGINAL CODE
*/
/*
  MOD VALIDATION RESULT V2
  START REPLACE
*/
      echo "<td>".(($image_row['user_id'] != GUEST) ? "<textarea name=\"msg_list[".$image_row['image_id']."]\" rows=\"3\" cols=\"40\">".((isset($HTTP_POST_VARS['msg_list'][$image_row['image_id']])) ? stripslashes($HTTP_POST_VARS['msg_list'][$image_row['image_id']]) : "")."</textarea>" : "")."</td>";
      echo "<td>".(($image_row['user_id'] != GUEST) ? "<input type=\"radio\" name=\"send[".$image_row['image_id']."]\" value=\"2\"".(((isset($HTTP_POST_VARS['send'][$image_row['image_id']]) && $HTTP_POST_VARS['send'][$image_row['image_id']] == 2) || !isset($HTTP_POST_VARS['send'][$image_row['image_id']])) ? " checked" : "").">yes&nbsp;<input type=\"radio\" name=\"send[".$image_row['image_id']."]\" value=\"3\"".(((isset($HTTP_POST_VARS['send'][$image_row['image_id']]) && $HTTP_POST_VARS['send'][$image_row['image_id']] == 3)) ? " checked" : "").">no" : "&nbsp;")."</td>";
      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"1\" onDblclick=\"this.checked=false;\"></td>";
      echo "<td><input type=\"radio\" name=\"image_list[".$image_row['image_id']."]\" value=\"0\" onDblclick=\"this.checked=false;\"></td>";
/*
  MOD VALIDATION RESULT V2
  END REPLACE
*/


Step 2
Open lang/<your language>/admin.php
At the end, just above closing ?> insert this:
Code: [Select]
/*
  MOD VALIDATION RESULT V2
  START INSERT
*/
$lang['valdiate_title'] = "Image Validation Results";
$lang['validate_yes'] = "added";
$lang['validate_no'] = "deleted";
$lang['validate_msg'] = "Message";
$lang['validate_file'] = "File";
$lang['validate_date'] = "Uploaded";
$lang['validate_status'] = "Status";
/*
  MOD VALIDATION RESULT V2
  END INSERT
*/


Step 3
Create a new template: lang/<your language>/email/validation_email.html
with the following code inside:
Code: [Select]
Dear {recipient_name},

You've uploaded to the "{site_name}" the following file(s):
{file_list}

The validation result is the following:
___________________________________________________
{list}--
Best regards, {site_name}
{site_url}


Step 4
Create a new template: lang/<your language>/email/validation_email_bit.html
with the following code inside:
Code: [Select]

{lang_file}: {file}
{lang_upload_date}: {date}
{lang_status}: {status} {image_url}
{lang_msg}: {msg}
___________________________________________________





------------- [ Appendix ] ----------------

The following tags are allowed to be used in validation_email.html template (Step 3):
{recipient_name} - will show name of the member to whom the email will be sent
{list} - a list of all validated files (parsed validation_email_bit.html template)
{file_list} - a comma separated list of validated files
{site_name} - site name from the settings
{site_url} - url to your site
{date} - date of validation

The following tags are allowed to be used in validation_email_bit.html template (Step 4):
{lang_upload_date} - text "Uploaded"
{lang_file} - text "File"
{lang_msg} - text "Message"
{lang_status} - text "Status"
{status} - "added" or "deleted"
{image_url} - a url to the image details (empty if image deleted)
{image_id} - image id
{date} - the date when file was uploaded
{file} - filename of the uploaded file
{msg} - a custom message from admin


--------------- [ FAQ ] ----------------

Q: When someone receive an email the url to the site is broken. Why?
A: This might happend on some sertain systems, to fix that, try uncomment this line in admin/validateimages.php
//        $site_url = "http://yoursite.com/4images"; // uncomment this line and update to the correct domain if your have problem with url in the email message
and change yoursite.com/4images to the correct path to your gallery

Q: Why some members dont receive any emails even though I selected "send" during validation?
A: If a member set in their profile "Do not receive emails from administrators" they will not receive validation results either.
But you can force email to be sent by commenting out this line:
        if (!$row['user_allowemails']) continue; //comment this line out to disregard member's setting not to receive emails from administrators

Q: When members receive email, the validation results list is showed in one line, without line breaks. Why?
A: When I was writing this mod I've experienced it myself, it turned out that 4images template engine (atleast in v1.7.1) removes line breaks if a template tag placed at the end of line.
To fix that, simply add one space after each last template tag on each line

Q: What exactly "Send" column does?
A: In some cases (dont ask me what) you might not want the member know if a sertain image was added or deleted, so, by selecting "no" in the "Send" column the file will not be added in the list in the email (if only one file validated and "Send" selected to "no", then no email will be sent at all to that member)

Q: What can I do if I selected a file to be added or deleted and then changed my mind and dont want do any actions to that sertain file? Is page refresh the only way?
A: Page refresh is one way, but not the only way. By double click on the "Add" or "Delete" radio button on the specific image it should "unselect" it.
Another way is click on the column name on top ("Validate" or "Delete"), ones it selected all files, click that column name again, it will unselect everything.
Title: Re: [MOD] Email image validation results to the user v2
Post by: JensF on June 09, 2005, 12:10:12 AM
Hi,

great Mod. Works fine!!!!
Title: Re: [MOD] Email image validation results to the user v2
Post by: ascanio on June 09, 2005, 12:48:09 AM
Niiiiiiiiiiice :) I was waiting for this MOD when I saw it on your Gallery :)
would I get any conflict if i install this mod because I have install the mod that send a email when the images are validated??
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on June 09, 2005, 01:07:15 AM
would I get any conflict if i install this mod because I have install the mod that send a email when the images are validated??
no if u uninstall it first (as it mentioned at the beginning of the installation guide)
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on July 31, 2006, 11:39:59 AM
Very nice, very helpful - a dream come true... :D

Thank you very much!
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 01, 2006, 03:50:03 PM
Is it possible to send automatically the name of the admin who judged the pics?
And I'd like to have the function that an additional mail is send to the webmaster/further email recipient.

Who can help?
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on August 01, 2006, 04:21:29 PM
well, I guess, you can try find in the code from step 1.3:
Code: [Select]
          "recipient_name" => $row['user_name'],
Insert below:
Code: [Select]
          "admin_name" => $user_info['user_name'],
          "admin_email" => $user_info['user_email'],

Then in the email template you can use {admin_name} and {admin_email} tags.
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 01, 2006, 04:56:47 PM
Very good!

But I also need a function that sends automatically not only the user this mail but also the webmaster
of the page. So he is informed about what is deleted and why - quality management... 8)
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on August 01, 2006, 09:07:51 PM
alright, then try insert below
Code: [Select]
        $site_email->set_to($row['user_email']);
This line:[qcode]        $site_email->set_bcc("your@email.com");
[/qcode]
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 02, 2006, 09:22:57 AM
Thanx a lot!
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 02, 2006, 01:58:47 PM
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/bos-fahrzeuge.info/httpdocs/includes/email.php on line 135

And no email was sent to webmaster, the user get one

And I've changed  "your@mail.com" to my Mailadress
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 11, 2006, 09:38:38 PM
Zeile 130-141 der includes/email.php
[qcode]  function set_simple_body($body = "") {
    $this->body = ((!empty($this->body)) ? $this->body : "").$this->prepare_text($body);
  }

  function set_bcc($bcc) {
    foreach ($bcc as $val) {  (135)
      $val = trim($val);
      if (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $val)) {
        $this->bcc[] = $val;
      }
    }
  }[/qcode]
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on August 12, 2006, 09:08:24 AM
Sorry, my misstake.
It should be:[qcode]        $site_email->set_bcc(array("your@email.com","your2@email2.com"));
[/qcode](you can add as many emails as you wish)
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on August 12, 2006, 09:18:32 PM
No Email was sent to the additional Mailaddress, the user got one...
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on August 12, 2006, 10:45:52 PM
and if you send emails to members via ACP (email members) do they receive them all?
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on November 05, 2006, 05:32:58 PM
In the mail for the users the part from the validation_email_bit looks like this:

Datei: Rettung_Schleswig_10-83-02.jpgUploaded: 05.11.2006 17:30Status:
abgelehnt/gelöscht Begründung/Hinweis: test

There are no line breaks...

And if I insert <br> you can see this in the mail

Datei: Rettung_Schleswig_10-83-02.jpg<br>
Uploaded: 05.11.2006 17:30<br>
Status: abgelehnt/gelöscht <br>
Begründung/Hinweis: test
Title: Re: [MOD] Email image validation results to the user v2
Post by: Knut63 on November 16, 2007, 01:46:33 PM
Is this mod ok with 1.7.4?
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on January 09, 2008, 11:01:11 AM
email_validation_bit.html sieht ja so aus:

{lang_file}: {file}
{lang_upload_date}: {date}
{lang_status}: {status} {image_url}
{lang_msg}: {msg}

Wenn die Email dann versendet wird, werden die einzelnen Zeilen aber nicht mit einem Zeilenumbruch versehen, sondern hintereinander weg geschrieben.

Datei: D-HZSB_2007-09-05_CHR_29_BWK_HH_Anflug_005.jpgHochgeladen: 08.01.2008
23:05Status: gelöscht Nachricht: test

Wenn ich jetzt mit <br> oder <br /> oder [n] arbeite, erfolgt ein Zeilenumbruch, aber die Tags werden mit ausgegeben:

Datei: D-HZSB_2007-09-05_CHR_29_BWK_HH_Anflug_005.jpg[n]
Hochgeladen: 08.01.2008 23:02[n]
Status: gelöscht [n]
Nachricht: test[n]

Wer kennt den richtigen Weg für ein gelesenen, aber nicht ausgegebenen Zeilenumbruch in diesem Fall?
Title: Re: [MOD] Email image validation results to the user v2
Post by: skiemor on January 09, 2008, 10:11:36 PM
email_validation_bit.html sieht ja so aus:

{lang_file}: {file}
{lang_upload_date}: {date}
{lang_status}: {status} {image_url}
{lang_msg}: {msg}

Wenn die Email dann versendet wird, werden die einzelnen Zeilen aber nicht mit einem Zeilenumbruch versehen, sondern hintereinander weg geschrieben.

Datei: D-HZSB_2007-09-05_CHR_29_BWK_HH_Anflug_005.jpgHochgeladen: 08.01.2008
23:05Status: gelöscht Nachricht: test

Wenn ich jetzt mit <br> oder <br /> oder [n] arbeite, erfolgt ein Zeilenumbruch, aber die Tags werden mit ausgegeben:

Datei: D-HZSB_2007-09-05_CHR_29_BWK_HH_Anflug_005.jpg[n]
Hochgeladen: 08.01.2008 23:02[n]
Status: gelöscht [n]
Nachricht: test[n]

Wer kennt den richtigen Weg für ein gelesenen, aber nicht ausgegebenen Zeilenumbruch in diesem Fall?

Ich kann dir meine Datei schicken, wird alles sauber umgebrochen, nachdem ich die <br> gelöscht hatte. Texteditiorproblem?

Sag' mir aber mal bitte, was das in der includes/email.php in Zeile 135 zu bedeuten hat. Was ist zu ändern? Ich kann V@nos Antwort leider nicht richtig deuten. ;-)
Muss ich das: $site_email->set_bcc(array("your@email.com","your2@email2.com")); als neue Zeile in der validateimagesl.php einfügen, z.B. unter $site_email->set_to($row['user_email']);?
Gruß Chris.
Title: Re: [MOD] Email image validation results to the user v2
Post by: skiemor on January 10, 2008, 07:27:59 AM
Is it possible to show a thumb in validation_email_bit.html? {image_url} ?

Chris.
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on January 10, 2008, 12:02:13 PM
Ja, dann häng deine Datei mal an, dann probier ich das mal aus...

Bei mir sah das in der validateimages.php so aus an der Stelle:
Code: [Select]
$site_email->set_to($row['user_email']);
$site_email->set_bcc(array("abc@def.de"));
Title: Re: [MOD] Email image validation results to the user v2
Post by: tansamalaja on January 10, 2008, 02:00:36 PM
Man kann natürlich Leerzeilen zwischen den Einträgen in der validation_email_bit.html machen,
dann klappt das auch - thx...  8)

Wieder was gelernt...
Code: [Select]
{lang_file}: {file}

{lang_upload_date}: {date}

{lang_status}: {status} {image_url}

{lang_msg}: {msg}
Title: Re: [MOD] Email image validation results to the user v2
Post by: jeromerookie on August 11, 2008, 07:44:19 AM
hi.
is this mod running with the 1.7.6 Version ? I've installed it but no mail are sent?
thank you
Jerome
Title: Re: [MOD] Email image validation results to the user v2
Post by: yesme on February 14, 2009, 08:49:44 AM
Hi,

My 4image version is 1.7.6

The code for Step 1 require us to replace with the new codes but beware of the differentiation of the code. For security reason, I had changed codes below by myself.

Old Code
Code: [Select]
echo $lang['image_add_success'].": <b>".stripslashes($image_name)."</b> (".$image_media_file.")<br />";
Latest Code for v1.7.6
Code: [Select]
echo $lang['image_add_success'].": <b>".format_text(stripslashes($image_name), 2)."</b> (".$image_media_file.")<br />";
Please guide me if the codes is incorrect.  :mrgreen:

Thank you.
Title: Re: [MOD] Email image validation results to the user v2
Post by: V@no on February 14, 2009, 09:53:10 PM
Yes, that is correct.
Title: Re: [MOD] Email image validation results to the user v2
Post by: rinaldos on February 16, 2009, 09:32:50 AM
Hello,
this mod works perfect with 1.76 :-)

Thanks for this usefull addon

Ingo
Title: Re: [MOD] Email image validation results to the user v2
Post by: cpuswe on March 15, 2009, 08:32:07 PM
First of all, nice to see you back here V@no!

Second, works great with 1.7.4 (with the addition to yesme:s post)

Third, how difficult would it be to add the image name as a variable in the validation_email_bit.html? I can see that $image_name variable are used in validateimages.php at least.

Thanks!

/Thomas
Title: Re: [MOD] Email image validation results to the user v2
Post by: crs on May 01, 2009, 01:26:03 AM
Hi V@no, great mod but i have a question:

Is it possible, that the user can decide if he wants to get an email about his uploads?
Maybe the user doesn´t want those emails.

It Would be great if he hase an option for this in his user center...

Greetz
Title: Re: [MOD] Email image validation results to the user v2
Post by: MrAndrew on February 06, 2012, 02:17:07 PM
Is it possible to use html codes in message? Same with this mod http://www.4homepages.de/forum/index.php?topic=29749...

Thx
Title: Re: [MOD] Email image validation results to the user v2
Post by: clubbu on August 14, 2012, 10:36:12 AM
hello,
sending notifications is no longer working.

It 'something happened?

I reinstalled the mod also

The error log is empty
Title: Re: [MOD] Email image validation results to the user v2
Post by: senloel on November 25, 2013, 07:20:55 PM
Ok, hab mich mal an dieses Problem gewagt und auch schon einen Teilerfolg erzielen können.

In der E-Mail werden unter einem neuen Punkt die Checkboxen angezeigt, jedoch immer nur eine, also nicht mehrere.

Ich vermute mal, dass der Fehler hier liegt und man die Werte eigentlich in einem array speichern muss:

$msg_list = (isset($HTTP_POST_VARS['msg_list'])) ? $HTTP_POST_VARS['msg_list'] : "";
$reason_list = (isset($HTTP_POST_VARS['reason_list'])) ? $HTTP_POST_VARS['reason_list'] : "";
$email_cache = array();
$action = "validateimages";

($reason_list ist für die Ckeckboxen)

Kann mir hier vielleicht jemand weiterhelfen?

Danke und Grüße,
Patrick

Hab mir meinen Code nochmal angeschaut: Für die Checkboxen habe ich die gleichen Dinge kopiert wie bei den Radio-Boxen, wahrscheinlich liegt eher hier der Fehler?

      echo "".(($image_row['user_id'] != GUEST) ? "
            <input type=\"checkbox\" name=\"reason_list[".$image_row['image_id']."]\" value=\"test1\">".((isset($HTTP_POST_VARS['reason_list'][$image_row['image_id']])) ?              stripslashes($HTTP_POST_VARS['reason_list'][$image_row['image_id']]) : "")."Test1
            <input type=\"checkbox\" name=\"reason_list[".$image_row['image_id']."]\" value=\"test2\">".((isset($HTTP_POST_VARS['reason_list'][$image_row['image_id']])) ?              stripslashes($HTTP_POST_VARS['reason_list'][$image_row['image_id']]) : "")."Test2" : "")."</td>";

Bei den Radio-Boxen, die ja schon im Code waren, sieht das ganze so aus:

      echo "<td>".(($image_row['user_id'] != GUEST) ? "<input type=\"radio\" name=\"send[".$image_row['image_id']."]\" value=\"2\"".(((isset($HTTP_POST_VARS['send']

[$image_row['image_id']]) && $HTTP_POST_VARS['send'][$image_row['image_id']] == 2) || !isset($HTTP_POST_VARS['send'][$image_row['image_id']])) ? " checked" :

"").">yes&nbsp;<input type=\"radio\" name=\"send[".$image_row['image_id']."]\" value=\"3\"".(((isset($HTTP_POST_VARS['send'][$image_row['image_id']]) && $HTTP_POST_VARS

['send'][$image_row['image_id']] == 3)) ? " checked" : "").">no" : "&nbsp;")."</td>";


Ich würde mich wirklich über jede Hilfe freuen!

Vielen Dank und Grüße,
Patrick
Title: Re: [MOD] Email image validation results to the user v2
Post by: senloel on November 28, 2013, 06:02:33 PM
Mein neuster Stand der Dinge: Hab gerade diverse Internetforen durchforstet es wird aber weiterhin entweder nur ein oder gar kein Wert der Checkboxen übergeben:

Folgendes habe ich mittlerweile im Code:

Definition der Variable:
$reason_list = $_POST['reason_list'];

Und bei den Checkboxen:
echo "<input type=\"checkbox\" name=\"reason_list[".$image_row['image_id']."]\" value=\"test1\">Test1
        <input type=\"checkbox\" name=\"reason_list[".$image_row['image_id']."]\" value=\"test2\">Test2";

...aber leider funktioniert es immer noch nicht  :cry:

Gibts evtl. irgendwelche Denkanstöße?

Danke für jede Hilfe!

Grüße,
Patrick
Title: Re: [MOD] Email image validation results to the user v2
Post by: Rembrandt on November 29, 2013, 07:38:31 PM
Ich würde an deiner Stelle ein Option Dropdownfeld benutzen, da hast du weniger Probleme mit den Style.
Zur Zeit kann ich dir auf die schnelle nicht weiterhelfen, erst hatte ich 14 Tage Probleme mit dem Ischiasnerv (Spritze, Infusionen, e.t.c), Gestern Zahnextraktion Ergebnis Fieber geschwollene Backe  :evil:

mfg Andi   
Title: Re: [MOD] Email image validation results to the user v2
Post by: senloel on November 29, 2013, 08:17:41 PM
Ich würde an deiner Stelle ein Option Dropdownfeld benutzen, da hast du weniger Probleme mit den Style.
Zur Zeit kann ich dir auf die schnelle nicht weiterhelfen, erst hatte ich 14 Tage Probleme mit dem Ischiasnerv (Spritze, Infusionen, e.t.c), Gestern Zahnextraktion Ergebnis Fieber geschwollene Backe  :evil:

mfg Andi   

Hm, das Problem am Dropdownfeld ist der größere Zeitaufwand beim Anklicken, aber eine Alternative ist es allemal, vielen Dank!

Das klingt ja übel, gute Besserung :!:

Wenn's dir dann wieder besser geht würd ich mich freuen, wenn du nochmal über meinen Code schauen könntest ;)
Title: Re: [MOD] Email image validation results to the user v2
Post by: Rembrandt on November 29, 2013, 09:40:34 PM
.....
Hm, das Problem am Dropdownfeld ist der größere Zeitaufwand beim Anklicken, aber eine Alternative ist es allemal, vielen Dank!
....
Wenn's dir dann wieder besser geht würd ich mich freuen, wenn du nochmal über meinen Code schauen könntest ;)
Drei Tabletten, jetzt geht's  :mrgreen:
Vorteil bei dem Dropdownfeld ist das du eine ganze Liste voll als Auswahl zur Verfügung stellen kannst ohne das es dir das Layout zerlegt.
suche in lang/your lang/admin.php "?>" und füge darüber ein:

$reason_optionlist = array(
  "Nachrichtentext 1"  => "erste",
  "Nachrichtentext 2" => "zweite",
  "Nachrichtentext 3" => "dritte",
);

suche in admin/validateimages.php:

$site_upload = new Upload();

füge darüber ein:

function show_reason_list($setting_name, $setting_value) {
  global $reason_optionlist;
  echo "<select name=\"msg_list[".$setting_name."]\">";
  foreach ($reason_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}

suche:

echo "<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n<td class=\"tableseparator\" onClick=\"if(send){send=false;CheckAllradio(2, false);CheckAllradio(3, true);}else{send=true;CheckAllradio(2, true); CheckAllradio(3, false);}\">Send</td>\n<td class=\"tableseparator\" onClick=\"if(yes){yes=false;no=false}else{yes=true;no=false;}CheckAllradio(1, yes)\">".$lang['validate']."</td>\n<td class=\"tableseparator\" onClick=\"if(no){no=false;yes=false}else{no=true;yes=false;}CheckAllradio(0, no)\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";

ersetze:

echo "<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n<td class=\"tableseparator\" onClick=\"if(send){send=false;CheckAllradio(2, false);CheckAllradio(3, true);}else{send=true;CheckAllradio(2, true); CheckAllradio(3, false);}\">Send</td>\n<td class=\"tableseparator\" onClick=\"if(yes){yes=false;no=false}else{yes=true;no=false;}CheckAllradio(1, yes)\">".$lang['validate']."</td>\n<td class=\"tableseparator\" onClick=\"if(no){no=false;yes=false}else{no=true;yes=false;}CheckAllradio(0, no)\">".$lang['delete']."</td>\n<td class=\"tableseparator\"> </td>\n<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";

suche:

echo "<td>".(($image_row['user_id'] != GUEST) ? "<textarea name=\"msg_list[".$image_row['image_id']."]\" rows=\"3\" cols=\"40\">".((isset($HTTP_POST_VARS['msg_list'][$image_row['image_id']])) ? stripslashes($HTTP_POST_VARS['msg_list'][$image_row['image_id']]) : "")."</textarea>" : "")."</td>";

füge darunter ein:

      echo "<td>";
      show_reason_list($image_row['image_id'],$HTTP_POST_VARS['msg_list'][$image_row['image_id']]);
      echo "</td>";


mfg Andi
Title: Re: [MOD] Email image validation results to the user v2
Post by: senloel on November 30, 2013, 10:28:34 AM
Hey,

tja, was soll ich sagen? :D
Dein Einsatz hier ist echt der Hammer  :thumbup:

Das Problem besteht aber leider weiterhin: Ich habe die Dropdownlist auf "multiple" gestellt, nun wird jedoch weiterhin nur einer der markierten Werte gesendet, ansonsten klappt alles ;)

Hättest du noch eine Idee woran das liegen könnte?

Vielen Dank für deine Hilfe!

Patrick

PS: Das mit den Checkboxen wär kein Problem, da ich mir die validateimages.php schon für Dropdown oder Checkboxen eingerichtet hab ;)