Jump to content


Photo
- - - - -

User get emails instead of Subscribers


  • Please log in to reply
2 replies to this topic

#1 krizztus

krizztus

    Junior Member

  • Members
  • Pip
  • 4 posts

Posted 20 July 2012 - 08:25 AM

Hi,

When 10 users follow me and get emails , when i upload a movie, not the subscribers get the emails, NO , i get 10 emails then ....

The problem ist here

/modules/upload/video.php
$sql = "SELECT sv.SUID, s.username, s.email FROM video_subscribe AS sv, signup AS s
WHERE sv.UID = " .$uid. " AND sv.UID = s.UID";
$rs = $conn->execute($sql);
if ( $conn->Affected_Rows() > 0 ) {
$subscribers = $rs->getrows();
$mail = new VMail();
$mail->setNoReply();
$sql = "SELECT * FROM emailinfo WHERE email_id = 'subscribe_email' LIMIT 1";
$rs = $conn->execute($sql);
$email_path = $config['BASE_DIR']. '/templates/' .$rs->fields['email_path'];
$sender = ( $anonymous == 'yes' ) ? 'anonymous' : $_SESSION['username'];
$mail->Subject = str_replace('$sender_name', $sender, $rs->fields['email_subject']);
print_r($subscribers);
foreach ( $subscribers as $subscriber ) {
$smarty->assign('video_link', $video_link);
$smarty->assign('username', $subscriber['username']);
$smarty->assign('sender_name', $_SESSION['username']);
$body = $smarty->fetch($email_path);
$mail->AltBody = $body;
$mail->Body = nl2br($body);
$mail->AddAddress($subscriber['email']);
//$mail->Send();
$mail->ClearAddresses();
}
}

I inserted a print_r($subscribers)..and the resuilt ist

Array
(
[0] => Array
(
[0] => 31
[SUID] => 31
[1] => meike
[username] => meike
[2] => meike@sexplicy.net
[email] => meike@sexplicy.net
)

[1] => Array
(
[0] => 39
[SUID] => 39
[1] => meike
[username] => meike
[2] => meike@sexplicy.net
[email] => meike@sexplicy.net
)

[2] => Array
(
[0] => 55
[SUID] => 55
[1] => meike
[username] => meike
[2] => meike@sexplicy.net
[email] => meike@sexplicy.net
)

[3] => Array
(
[0] => 97
[SUID] => 97
[1] => meike
[username] => meike
[2] => meike@sexplicy.net
[email] => meike@sexplicy.net
)

U see ...its always ME in that array...
also echo $subscriber['email']; delivers MY Emailadress?!

I will check sql statement no..what it returns

#2 krizztus

krizztus

    Junior Member

  • Members
  • Pip
  • 4 posts

Posted 20 July 2012 - 08:26 AM

The problem ist, that active uploaders get punished by spam mails :)

SELECT sv.SUID, s.username, s.email FROM video_subscribe AS sv, signup AS s WHERE sv.UID = 4 AND sv.UID = s.UID

THIS is the problem....always delivers my username and email

Edited by krizztus, 20 July 2012 - 08:29 AM.


#3 Roadtrain

Roadtrain

    Junior Member

  • Members
  • Pip
  • 2 posts

Posted 08 December 2012 - 02:41 PM

Encountered this issue as well and fixed it. All you have to do is:

file: /modules/upload/video.php

find:
AND sv.UID = s.UID";

replace with:
AND sv.SUID = s.UID";