Results 1 to 10 of 10

Thread: Comments not sending emails?

  1. #1
    Join Date
    Sep 2010
    Posts
    7

    Default Comments not sending emails?

    I have VS 2.7 on my server and everything seems to be working fine expect for when someone posts a comment on a video. It doesn't send out an email to other commenters saying there is a reply. Does anyone know why or how to fix it so when a user replies to a video a email is sent out to anyone else that commented to a video?

  2. #2

    Default

    Currently this feature is not available.

    If you would like to add this feature to your vshare site,
    please open a ticket at http://helpdesk.buyscripts.in with your vshare admin and ftp login details.

    Thanks,

    Buyscripts Team

  3. #3
    Join Date
    Sep 2010
    Posts
    7

    Default

    Thanks. Well I better open a ticket because I don't have a working app if users can't interact with it. Can't they just send me the files? I don't really like the idea of giving out ftp details when it's not needed.

    Also I'm having trouble putting together BBcode for phpBB3. I can get the player to load on the forums but it won't play the movie, says something about crossdomain things. Can I edit that in the crossdomain file to allow it to play vids on another domain?

  4. #4

    Default

    Hi,

    Quote Originally Posted by riffster View Post
    I have VS 2.7 on my server and everything seems to be working fine expect for when someone posts a comment on a video. It doesn't send out an email to other commenters saying there is a reply. Does anyone know why or how to fix it so when a user replies to a video a email is sent out to anyone else that commented to a video?
    This will fix the email issue (only for v2.7)

    Open ajax/video_comment_add.php

    Replace
    Code:
    db_close();
    With
    Code:
    $sql = "SELECT `video_title`, `video_seo_name` FROM `videos` WHERE
           `video_id`='" . (int) $video_id . "'";
    $video_result = mysql_query($sql) or mysql_die($sql);
    $video_info = mysql_fetch_assoc($video_result);
    $video_title = $video_info['video_title'];
    $video_seo_name = $video_info['video_seo_name'];
    $video_url = VSHARE_URL . '/view/' . $video_id . '/' . $video_seo_name . '/';
    
    $sql = "SELECT * FROM `email_templates` WHERE
           `email_id`='video_comment_mail'";
    $result = mysql_query($sql) or mysql_die();
    
    if (mysql_num_rows($result) == 0)
    {
        $email_subject = '[SITE_NAME] - [USERNAME] has commented a video.';
        $email_body = '<p>Hi [RECIEVER_NAME],</p><p>[USERNAME] has commented a video \"[VIDEO_TITLE]\"</p><p>Click the following link to view the video and comments.</p><p><a href=\"[VIDEO_URL]\">[VIDEO_TITLE]</a></p><p>Thank you,</p><p><a href=\"[SITE_URL]\">[SITE_NAME]</a></p>';
        
        $sql = "INSERT INTO `email_templates` SET
               `email_id`='video_comment_mail',
               `email_subject`='[SITE_NAME] - [USERNAME] has commented a video.',
               `email_body`='<p>Hi [RECIEVER_NAME],</p><p>[USERNAME] has commented a video \"[VIDEO_TITLE]\"</p><p>Click the following link to view the video and comments.</p><p><a href=\"[VIDEO_URL]\">[VIDEO_TITLE]</a></p><p>Thank you,</p><p><a href=\"[SITE_URL]\">[SITE_NAME]</a></p>',
               `comment`='Send mail when comment a video.'";
        mysql_query($sql) or mysql_die();
    }
    else
    {
        $email_info = mysql_fetch_assoc($result);
        $email_subject = $email_info['email_subject'];
        $email_body = $email_info['email_body'];
    }
    
    $email_subject = str_replace('[USERNAME]', $_SESSION['USERNAME'], $email_subject);
    $email_subject = str_replace('[SITE_NAME]', $config['site_name'], $email_subject);
    
    $sql = "SELECT DISTINCT `comment_user_id` FROM `comments` WHERE
           `comment_video_id`='" . (int) $video_id . "'";
    $result = mysql_query($sql) or mysql_die();
    
    if (mysql_num_rows($result) > 1)
    {
        while ($comment_info = mysql_fetch_assoc($result))
        {
            $video_commented_user_id = $comment_info['comment_user_id'];
            
            if ($video_commented_user_id != $_SESSION['UID'])
            {
                $sql = "SELECT `user_name`,`user_email` FROM `users` WHERE
                       `user_id`='" . (int) $video_commented_user_id . "'";
                $tmp = mysql_query($sql) or mysql_die();
                
                if (mysql_num_rows($tmp) > 0)
                {
                    $tmp_info = mysql_fetch_assoc($tmp);
                    
                    $email_body_tmp = $email_body;
                    $email_body_tmp = str_replace('[USERNAME]', $_SESSION['USERNAME'], $email_body_tmp);
                    $email_body_tmp = str_replace('[VIDEO_TITLE]', $video_title, $email_body_tmp);
                    $email_body_tmp = str_replace('[VIDEO_URL]', $video_url, $email_body_tmp);
                    $email_body_tmp = str_replace('[SITE_URL]', VSHARE_URL, $email_body_tmp);
                    $email_body_tmp = str_replace('[SITE_NAME]', $config['site_name'], $email_body_tmp);
                    $email_body_tmp = str_replace('[RECIEVER_NAME]', $tmp_info['user_name'], $email_body_tmp);
                                    
                    $headers  = 'MIME-Version: 1.0' . "\r\n";
                    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                    $headers .= 'From: ' . $config['site_name'] . ' <' . $config['admin_email'] . '>' . "\r\n";
                    
                    mail($tmp_info['user_email'], $email_subject, $email_body_tmp, $headers);
                }
            }
        }
    }
    db_close();
    You can edit email template(video_comment_mail) from admin area.

    Thanks,
    Buyscript Team
    Last edited by vshare2; 09-24-2010 at 04:34 AM.

  5. #5
    Join Date
    Sep 2010
    Posts
    7

    Default

    Nice one. Thanks a lot.:cool:

  6. #6
    Join Date
    Sep 2010
    Posts
    7

    Default

    Didn't work?

  7. #7
    Join Date
    Sep 2010
    Posts
    7

    Default

    error_reporting(0); if I set that to 1 will it show the errors?

  8. #8

    Default

    Hello,

    I have modified the above code i posted. Please try again and let me know the result.

    Thanks.

  9. #9
    Join Date
    Sep 2010
    Posts
    7

    Default

    No luck with that. Also you have a bug in your sql when a comment is deleted, it's not updating the count of the comments.

  10. #10
    Join Date
    Oct 2010
    Posts
    3

    Default

    I think this is better option for me.
    I implement this very soon.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •