Changeset 1354 for branches/1.2


Ignore:
Timestamp:
03/20/10 04:35:02 (3 years ago)
Author:
nick_ramsay
Message:

[Branch 1.2] Custom iconv function, plus more SMTP email fixes

Location:
branches/1.2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/content/plugins/messaging/libs/MessagingFuncs.php

    r1253 r1354  
    195195         
    196196        // Hi username... 
    197         $email_message = "Hi " . $this->to . "," . $skip_line; 
     197        $email_message = $h->lang['messaging_email_greeting'] . $this->to . "," . $skip_line; 
    198198         
    199199        // You've been sent a private message from... 
  • branches/1.2/content/plugins/submit/libs/SubmitFunctions.php

    r1208 r1354  
    703703            $encoding=trim($matches[1]); 
    704704 
    705             //you need iconv to encode to utf-8 
    706             if (function_exists("iconv")) 
    707             { 
    708                 if (strcasecmp($encoding, 'utf-8') != 0) { 
    709                     //convert the html code into utf-8 whatever encoding it is using 
    710                     $string=iconv($encoding, 'UTF-8//IGNORE', $string); 
    711                 } 
     705            //you need iconv to encode to utf-8 (if not, use custom iconv in funcs.strings.php) 
     706            if (strcasecmp($encoding, 'utf-8') != 0) { 
     707                //convert the html code into utf-8 whatever encoding it is using 
     708                $string=iconv($encoding, 'UTF-8//IGNORE', $string); 
    712709            } 
    713710        } 
  • branches/1.2/content/plugins/user_signin/readme.txt

    r1247 r1354  
    1515Changelog 
    1616--------- 
     17v.0.4 2010/03/20 - Nick - Fix for emails when using SMTP email authentication 
    1718v.0.3 2010/02/26 - Nick - New plugin hook in the registration form; mail sent through Hotaru's email function 
    1819v.0.2 2010/02/23 - Nick - Throws out killspammed, banned or suspended users when checking the cookie 
  • branches/1.2/content/plugins/user_signin/user_signin.php

    r1247 r1354  
    33 * name: User Signin 
    44 * description: Provides user registration and login 
    5  * version: 0.3 
     5 * version: 0.4 
    66 * folder: user_signin 
    77 * type: signin 
     
    589589        $body .= $h->lang['user_signin_register_emailconf_body_sign']; 
    590590        $to = $user->email; 
    591         $headers = "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 
    592591         
    593592        /* 
     
    598597        */ 
    599598 
    600         $h->email($to, $subject, $body, $headers);     
     599        $h->email($to, $subject, $body);     
    601600    } 
    602601     
  • branches/1.2/content/plugins/users/libs/UserFunctions.php

    r1353 r1354  
    123123            $to = $mod['email']; 
    124124             
    125             if (SMTP == 'true') { 
    126                 $recipients['To'] = $to; 
    127                 $h->email($recipients, $subject, $body); 
    128             } else { 
    129                 $h->email($to, $subject, $body); 
    130             } 
     125            $h->email($to, $subject, $body); 
    131126        } 
    132127         
  • branches/1.2/functions/funcs.strings.php

    r1100 r1354  
    558558 
    559559 
     560if(!function_exists("iconv")) 
     561{ 
     562    /** 
     563     * Convert string to requested character encoding if iconv library not installed 
     564     * 
     565     * @param string $from 
     566     * @param string $to 
     567     * @param string $string 
     568     * @return string 
     569     * @link http://www.jpfox.fr/?post/2007/07/25/165-alternative-a-la-fonction-php-iconv 
     570     */ 
     571    function iconv($from, $to, $string) 
     572    { 
     573        $converted = htmlentities($string, ENT_NOQUOTES, $from);  
     574        $converted = html_entity_decode($converted, ENT_NOQUOTES, $to); 
     575        return $converted; 
     576    } 
     577} 
     578 
     579 
     580/** 
     581 * Count urls within a block of text 
     582 * 
     583 * @return int  
     584 * @link http://www.liamdelahunty.com/tips/php_url_count_check_for_comment_spam.php 
     585 */ 
     586function countUrls($text = '') 
     587{ 
     588    //$http = substr_count($text, "http"); 
     589    $href = substr_count($text, "href"); 
     590    $url = substr_count($text, "[url"); 
     591     
     592    return $href + $url; 
     593} 
     594 
     595 
    560596/** 
    561597 * Strip foreign characters from latin1/utf8 database yuckiness 
     
    573609    return $str; 
    574610} 
    575  
    576  
    577 /** 
    578  * Count urls within a block of text 
    579  * 
    580  * @return int  
    581  * @link http://www.liamdelahunty.com/tips/php_url_count_check_for_comment_spam.php 
    582  */ 
    583 function countUrls($text = '') 
    584 { 
    585     //$http = substr_count($text, "http"); 
    586     $href = substr_count($text, "href"); 
    587     $url = substr_count($text, "[url"); 
    588      
    589     return $href + $url; 
    590 } 
    591611?> 
  • branches/1.2/libs/EmailFunctions.php

    r1353 r1354  
    6666        if (SMTP == 'true') { 
    6767            // note: this overwrites headers passed to this function: 
    68             $this->headers = array ('From' => $this->from, 'To' => $this->to['To'], 'Subject' => $this->subject); 
     68            if (is_array($this->to)) { $to = $this->to['To']; } else { $to = $this->to; } 
     69            $this->headers = array ('From' => $this->from, 'To' => $to, 'Subject' => $this->subject); 
    6970        } else { 
    7071            // if not using SMTP and no headers passed to this function, use default 
Note: See TracChangeset for help on using the changeset viewer.