• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getLangInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getLangInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getLangInfo函数的具体用法?PHP getLangInfo怎么用?PHP getLangInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getLangInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: alipayurl

 function alipayurl($order_no, $fee, $paytype)
 {
     $param = array('_input_charset' => $this->charset, 'service' => 'create_direct_pay_by_user', 'notify_url' => $this->baseurl . '/alipay.php', 'return_url' => $this->baseurl . '/alipay.php', 'payment_type' => '1', 'subject' => getLangInfo('olpay', "olpay_{$paytype}_title", array('order_no' => $order_no)), 'body' => getLangInfo('olpay', "olpay_{$paytype}_content"), 'out_trade_no' => $order_no, 'total_fee' => $fee, 'seller_email' => $this->seller_email);
     if ($this->alipay_key && $this->alipay_partnerID) {
         $url = $this->alipay_url;
         $param['partner'] = $this->alipay_partnerID;
         ksort($param);
         reset($param);
         $arg = '';
         foreach ($param as $key => $value) {
             if ($value) {
                 $url .= "{$key}=" . urlencode($value) . "&";
                 $arg .= "{$key}={$value}&";
             }
         }
         $url .= 'sign=' . md5(substr($arg, 0, -1) . $this->alipay_key) . '&sign_type=MD5';
     } else {
         $url = $this->pwpay_url;
         foreach ($param as $key => $value) {
             if ($value) {
                 $url .= "{$key}=" . urlencode($value) . "&";
             }
         }
     }
     return $url;
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:26,代码来源:onlinepay.php


示例2: init

 function init($id)
 {
     $this->_hid = $id;
     require_once R_P . 'mode/house/require/core.php';
     $houseService = house::loadClass('house');
     $housefieldsService = House::loadService('HouseFieldsService');
     $house = $houseService->getHouseInfoByHid($id);
     empty($house) && Showmsg('data_error');
     $title = $content = sprintf("[url=%s] %s [/url]", $this->_url . "&q=info&hid=" . $this->_hid, $house['name']);
     $position = '';
     if ($house['area']) {
         $areaField = $housefieldsService->getCompsiteFieldsByType('area');
         //所属区域
         $area = $areaField[$house['area']];
         $area = sprintf("[url=%s] %s [/url]", $this->_url . "&q=list&area=" . $house['area'], $area);
         $postion .= $area;
     }
     if ($house['plate']) {
         $plateField = $housefieldsService->getCompsiteFieldsByType('plate');
         //所在商圈
         $plate = $plateField[$house['plate']];
         $plate = sprintf("[url=%s] %s [/url]", $this->_url . "&q=list&plate=" . $house['plate'], $plate);
         $postion .= $plate;
     }
     $postion .= $house['address'];
     $mailSubject = getLangInfo('app', 'house_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_houseinfo', array('title' => $title, 'postion' => $postion));
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:house.weibo.php


示例3: getChName

function getChName($key)
{
    global $db_rvrcname, $db_moneyname, $db_creditname, $db_currencyname, $_CREDITDB;
    switch ($key) {
        case 'postnum':
            $name = getLangInfo('other', 'upgrade_post');
            break;
        case 'digests':
            $name = getLangInfo('other', 'sort_digests');
            break;
        case 'rvrc':
            $name = $db_rvrcname;
            break;
        case 'money':
            $name = $db_moneyname;
            break;
        case 'credit':
            $name = $db_creditname;
            break;
        case 'currency':
            $name = $db_currencyname;
            break;
        case 'onlinetime':
            $name = getLangInfo('other', 'sort_onlinetime');
            break;
        case is_int($key):
            $name = $_CREDITDB[$key][0];
            break;
        default:
            $name = '';
    }
    return $name;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:33,代码来源:upgrade.php


示例4: Showmsg

function Showmsg($msg_info)
{
    $msg_info = getLangInfo('msg', $msg_info);
    $response = ACloud_Sys_Core_Common::loadSystemClass('response');
    $response->setErrorCode(99999);
    $response->setResponseData($msg_info);
    echo $response->getOutputData();
    exit;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:ver.customized.functions.php


示例5: writetoollog

function writetoollog($log)
{
    global $db, $db_bbsurl;
    $log['type'] = getLangInfo('toollog', $log['type']);
    $log['filename'] = Char_cv($log['filename']);
    $log['username'] = Char_cv($log['username']);
    $log['descrip'] = Char_cv(getLangInfo('toollog', $log['descrip'], $log));
    $db->update("INSERT INTO pw_toollog SET " . pwSqlSingle(array('type' => $log['type'], 'filename' => $log['filename'], 'nums' => $log['nums'], 'money' => $log['money'], 'descrip' => $log['descrip'], 'uid' => $log['uid'], 'touid' => $log['touid'], 'username' => $log['username'], 'ip' => $log['ip'], 'time' => $log['time'])));
}
开发者ID:adi00,项目名称:wumaproject,代码行数:9,代码来源:tool.php


示例6: createfail

function createfail($checkpwd, $showinfo = '', $type = 'fail')
{
    if ($checkpwd) {
        $showinfo = 'fail' == $type && '' != $showinfo ? getLangInfo('msg', $showinfo) : $showinfo;
        echo "{$type}\t{$showinfo}";
        ajax_footer();
    }
    return false;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:index.php


示例7: writeforumlog

function writeforumlog($log)
{
    $log['username1'] = S::escapeChar($log['username1']);
    $log['username2'] = S::escapeChar($log['username2']);
    $log['field1'] = S::escapeChar($log['field1']);
    $log['field2'] = S::escapeChar($log['field2']);
    $log['field3'] = S::escapeChar($log['field3']);
    $log['descrip'] = S::escapeChar(getLangInfo('log', $log['descrip'], $log));
    $GLOBALS['db']->update("INSERT INTO pw_forumlog SET " . S::sqlSingle(array('type' => $log['type'], 'username1' => $log['username1'], 'username2' => $log['username2'], 'field1' => $log['field1'], 'field2' => $log['field2'], 'field3' => $log['field3'], 'descrip' => $log['descrip'], 'timestamp' => $log['timestamp'], 'ip' => $log['ip']), false));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:10,代码来源:writelog.php


示例8: wap_msg

function wap_msg($msg, $url = "", $t = "10")
{
    @extract($GLOBALS, EXTR_SKIP);
    global $db_bbsname, $db_obstart;
    ob_end_clean();
    $db_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
    wap_header('msg', $db_bbsname, $url, $t);
    $msg = getLangInfo('wap', $msg);
    wap_output("<p>{$msg}" . ($url ? " <a href='{$url}'>" . getLangInfo('wap', 'wap_msg_view') . "</a>" : '') . "</p>\n");
    wap_footer();
}
开发者ID:adi00,项目名称:wumaproject,代码行数:11,代码来源:wap_mod.php


示例9: alipayurl

 function alipayurl($order_no, $fee, $paytype, $extra = '')
 {
     $param = array('_input_charset' => $this->charset, 'service' => 'create_direct_pay_by_user', 'notify_url' => $this->baseurl . '/alipay.php', 'return_url' => $this->baseurl . '/alipay.php', 'payment_type' => '1', 'subject' => getLangInfo('olpay', "olpay_{$paytype}_title", array('order_no' => $order_no)), 'body' => getLangInfo('olpay', "olpay_{$paytype}_content"), 'out_trade_no' => $order_no, 'total_fee' => $fee, 'extra_common_param' => $this->formatExtra($extra), 'seller_email' => $this->seller_email);
     if ($this->alipay_key && $this->alipay_partnerID) {
         $url = $this->urlCompound($this->alipay_url, $this->alipay_partnerID, $this->alipay_key, $param);
     } else {
         Showmsg('支付失败,本站点尚未填写支付宝商户信息(partnerID和key),请登录后台->网上支付填写!');
         $url = $this->urlCompound($this->pwpay_url, $this->pwpay_partnerID, $this->pwpay_key, $param);
     }
     return $url;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:11,代码来源:onlinepay.php


示例10: alterinfo

 function alterinfo()
 {
     if ($this->post->groupid != 3 && $this->atcdb['postdate'] + 300 < $GLOBALS['timestamp']) {
         global $altername, $db_anonymousname, $timeofedit, $timestamp;
         $altername = $this->data['anonymous'] && $this->post->uid == $this->atcdb['authorid'] ? $db_anonymousname : $this->post->username;
         $timeofedit = get_date($timestamp);
         $alterinfo = getLangInfo('post', 'edit_post');
     } else {
         $alterinfo = '';
     }
     return $alterinfo;
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:12,代码来源:postmodify.class.php


示例11: getParamDiscrip

function getParamDiscrip($type, $stamp = 'subject')
{
    if ($type == 'title') {
        $temp = getParamName($type, $stamp);
        return $title . $temp;
    } elseif ($type == 'descrip') {
        return getLangInfo('other', 'element_descrip') . getLangInfo('other', 'element_length');
    } elseif ($type == 'image') {
        return getLangInfo('other', 'element_image_size');
    } else {
        return getLangInfo('other', 'element_' . $type) . getLangInfo('other', 'set_param_type');
    }
}
开发者ID:adi00,项目名称:wumaproject,代码行数:13,代码来源:invokeconfig.php


示例12: getParamName

function getParamName($type, $stamp = 'subject')
{
    if ($type == 'title') {
        if ($stamp == 'forum') {
            return getLangInfo('other', 'element_title_forum');
        } elseif ($stamp == 'user') {
            return getLangInfo('other', 'element_title_user');
        } elseif ($stamp == 'tag') {
            return getLangInfo('other', 'element_title_tag');
        } else {
            return getLangInfo('other', 'element_title');
        }
    }
    return getLangInfo('other', 'element_' . $type);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:15,代码来源:editcontent.php


示例13: _initAction

 function _initAction($piece)
 {
     $datasourceService = $this->_getSourceService();
     $temp = array();
     $temp['title'] = getLangInfo('other', 'set_invoke_action');
     $temp_func = '<select onchange="pieceActionChange(' . $piece['id'] . ',this.value);" name="p_action[' . $piece['id'] . ']">';
     $stamp = $datasourceService->getSourceTypes();
     foreach ($stamp as $key => $value) {
         $selected = $key == $piece['action'] ? 'selected' : '';
         $temp_func .= '<option value="' . $key . '" ' . $selected . '>' . $value['title'] . '</option>';
     }
     $temp['html'] = $temp_func;
     $piece['p_action'] = $temp;
     return $piece;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:15,代码来源:pieceoperate.class.php


示例14: init

 function init($id)
 {
     $this->_cid = $id;
     require_once R_P . 'mode/cms/require/core.php';
     $articleDB = C::loadDB('article');
     $article = $articleDB->get($this->_cid);
     empty($article) && Showmsg('data_error');
     $this->_url = $this->_url . "&id=" . $this->_cid;
     $title = $content = '我发现了一篇文章' . sprintf("[url=%s] %s [/url]", urlRewrite($this->_url), $article['subject']) . ',特别推荐。';
     $descrip = $article['descrip'];
     $mailSubject = getLangInfo('app', 'cms_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_cmsinfo', array('title' => $title, 'descrip' => $descrip));
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:16,代码来源:cms.weibo.php


示例15: Getrewhtml

function Getrewhtml($lou, $ifreward, $pid)
{
    global $rewardtype, $rw_b_name, $rw_a_name, $groupid, $admincheck, $authorid, $winduid, $tid, $rewdb, $timeleave;
    $html = "<div class=\"tips\" style=\"width:auto;\">";
    if ($lou == 0) {
        if ($rewardtype == '0') {
            $html .= '<span class="s3">' . getLangInfo('bbscode', 'rewarding');
            if ($timeleave > 3600) {
                $html .= ceil($timeleave / 3600) . getLangInfo('bbscode', 'hour');
            } elseif ($timeleave > 0) {
                $html .= ceil($timeleave / 60) . getLangInfo('bbscode', 'minute');
            } else {
                $html .= getLangInfo('bbscode', 'timeover');
            }
            $html .= ')...</span><div class="tac">' . getLangInfo('bbscode', 'reward_bestanswer') . ": {$rewdb['cbval']}&nbsp;{$rw_b_name}</div>";
            if ($rewdb['caval'] > 0) {
                $html .= "<div class=\"tac\">" . getLangInfo('bbscode', 'reward_hlp') . ": {$rewdb['caval']} {$rw_a_name}</div>";
            }
            if ($groupid == '3' || $admincheck) {
                $html .= "<div class=\"tac\"><a href=\"job.php?action=endreward&tid={$tid}\">" . getLangInfo('bbscode', 'reward_cancle') . '</a>&nbsp;</div>';
            } elseif ($authorid == $winduid && $timeleave < 0) {
                $html .= '<div class="tac"><a href="job.php?action=rewardmsg&tid=' . $tid . '" title="' . getLangInfo('bbscode', 'reward_title') . '" onClick="javascript:if(confirm(\'' . getLangInfo('bbscode', 'reward_msgtoadmin') . '\')){return true;}else{return false;}">' . getLangInfo('bbscode', 'reward_toadmin') . '</a>&nbsp;</div>';
            }
        } else {
            $html .= "<span class=\"s3\">" . getLangInfo('bbscode', 'reward_finished') . "</span><div class=\"tac\">" . getLangInfo('bbscode', 'reward_bestanswer') . ": {$rewdb['cbval']}&nbsp;{$rw_b_name}</div>";
            if ($rewardtype == 1) {
                $html .= "<div class=\"tac\">" . getLangInfo('bbscode', 'reward_author') . ": {$rewdb['author']}</div>";
            } else {
                $html .= "<div class=\"tac\">" . getLangInfo('bbscode', 'reward_endinfo_' . $rewardtype) . "</div>";
            }
        }
    } else {
        if ($rewardtype == '1' && $ifreward > 1) {
            $html .= "<span class=\"s3\">" . getLangInfo('bbscode', 'reward_best_get') . "</span>: (+{$rewdb['cbval']})&nbsp;{$rw_b_name}";
        } elseif ($ifreward == '1') {
            $html .= "<span class=\"s3\">" . getLangInfo('bbscode', 'reward_help_get') . "</span>: (+1)&nbsp;{$rw_a_name}";
        } elseif ($authorid == $winduid && $rewardtype == '0' && $ifreward == 0) {
            $html .= "<span class=\"s3\">" . getLangInfo('bbscode', 'reward_manager') . "</span>: [<a href=\"job.php?action=reward&tid={$tid}&pid={$pid}&type=1\">" . getLangInfo('bbscode', 'reward_bestanswer') . "</a>]";
            $rewdb['caval'] > 0 && ($html .= "[<a href=\"job.php?action=reward&tid={$tid}&pid={$pid}&type=2\">" . getLangInfo('bbscode', 'reward_help') . "</a>]");
        }
    }
    $html .= "</div><div class=\"c\"></div>";
    return $html;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:44,代码来源:readrew.php


示例16: Getrewhtml

function Getrewhtml($lou, $ifreward, $pid)
{
    global $rewardtype, $rw_b_name, $rw_a_name, $groupid, $admincheck, $authorid, $winduid, $tid, $rewdb, $timeleave;
    $html = "";
    if ($lou == 0) {
        if ($rewardtype == '0') {
            $html .= $timeleave < 0 ? '<span class="s2 mr10">' . getLangInfo('bbscode', 'reward_timeout') : '<span class="s2 mr10">' . getLangInfo('bbscode', 'rewarding');
            if ($timeleave > 3600) {
                $html .= ceil($timeleave / 3600) . getLangInfo('bbscode', 'hour');
            } elseif ($timeleave > 0) {
                $html .= ceil($timeleave / 60) . getLangInfo('bbscode', 'minute');
            }
            $html .= $timeleave > 0 ? ')' : '';
            $html .= '</span><br><span>' . getLangInfo('bbscode', 'reward_bestanswer') . "£º{$rewdb['cbval']}&nbsp;{$rw_b_name}</span>£¬";
            if ($rewdb['caval'] > 0) {
                $html .= getLangInfo('bbscode', 'reward_hlp') . ": {$rewdb['caval']} {$rw_a_name}¡£";
            }
            if ($groupid == '3' || $admincheck) {
                $html .= "&nbsp;&nbsp;<a href=\"job.php?action=endreward&tid={$tid}\" class=\"s4\">" . getLangInfo('bbscode', 'reward_cancle') . '</a>&nbsp;';
            } elseif ($authorid == $winduid && $timeleave < 0) {
                $html .= '&nbsp;&nbsp;<a href="job.php?action=rewardmsg&tid=' . $tid . '" title="' . getLangInfo('bbscode', 'reward_title') . '" onClick="javascript:if(confirm(\'' . getLangInfo('bbscode', 'reward_msgtoadmin') . '\')){return true;}else{return false;}"  class=\\"s4\\">' . getLangInfo('bbscode', 'reward_toadmin') . '</a>&nbsp;';
            }
        } else {
            $html .= "<span class=\"s2 mr10\">" . getLangInfo('bbscode', 'reward_finished') . "</span><br><span>" . getLangInfo('bbscode', 'reward_bestanswer') . "£º{$rewdb['cbval']}&nbsp;{$rw_b_name}</span>£¬";
            if ($rewardtype == 1) {
                $html .= getLangInfo('bbscode', 'reward_author') . "£º{$rewdb['author']}";
            } else {
                $html .= getLangInfo('bbscode', 'reward_endinfo_' . $rewardtype);
            }
        }
    } else {
        if ($rewardtype == '1' && $ifreward > 1) {
            $html .= "<span class=\"s2\">" . getLangInfo('bbscode', 'reward_best_get') . "£º</span>+{$rewdb['cbval']}&nbsp;{$rw_b_name}";
        } elseif ($ifreward == '1') {
            $html .= "<span class=\"s2\">" . getLangInfo('bbscode', 'reward_help_get') . "£º</span>+1&nbsp;{$rw_a_name}";
        } elseif ($authorid == $winduid && $rewardtype == '0' && $ifreward == 0) {
            $html .= "<span class=\"s2\">" . getLangInfo('bbscode', 'reward_manager') . "£º</span><a href=\"job.php?action=reward&tid={$tid}&pid={$pid}&type=1\" class=\"s4 mr5\">[" . getLangInfo('bbscode', 'reward_bestanswer') . "]</a>";
            $rewdb['caval'] > 0 && ($html .= "<a href=\"job.php?action=reward&tid={$tid}&pid={$pid}&type=2\" class=\"s4\">[" . getLangInfo('bbscode', 'reward_help') . "]</a>");
        }
    }
    $html .= "";
    return $html;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:43,代码来源:readrew.php


示例17: pwSendMsg

/**
 * 发送社区短消息或系统通知
 * 重构新消息中心 
 * @param array $msg 信息格式如下:
 * 	$msg = array(
 *		'toUser'	=> 'admin', //接收者用户名,可为数组群发:array('admin','abc')
 *		'toUid'		=> 1,		//接收者uid,可为数组群发:array(1,2),当与 toUser 同时存在时,自然失效
 *		'fromUid'	=> 2,		//发送者UID,与fromUser同时存在才有效 (可选,默认为'0')
 *		'fromUser'	=> 'pwtest',//发送者用户名,与fromUid同时存在才有效(可选,默认为'SYSTEM')
 *		'subject'	=> 'Test',	//消息标题
 *		'content'	=> '~KO~',	//消息内容
 *		'other'		=> array()	//其他信息变量
 *	);
 * @return boolean 返回消息发送是否完成
 */
function pwSendMsg($msg)
{
    global $db, $timestamp;
    if (!$msg['toUser'] && !$msg['toUid'] || !$msg['subject'] || !$msg['content']) {
        return false;
    }
    $msg['subject'] = getLangInfo('writemsg', $msg['subject'], $msg);
    $msg['content'] = getLangInfo('writemsg', $msg['content'], $msg);
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $usernames = $msg['toUser'] ? $msg['toUser'] : $userService->getUserNameByUserId($msg['toUid']);
    $usernames = is_array($usernames) ? $usernames : array($usernames);
    if (!$msg['fromUid'] || !$msg['fromUser']) {
        M::sendNotice($usernames, array('title' => $msg['subject'], 'content' => $msg['content']));
    } else {
        M::sendMessage($msg['fromUid'], $usernames, array('create_uid' => $msg['fromUid'], 'create_username' => $msg['fromUser'], 'title' => $msg['subject'], 'content' => $msg['content']));
    }
    return true;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:34,代码来源:msg.php


示例18: getActmidSelectHtml

 /**
  * 返回活动子分类select的HTML
  * @param int $selectedActmid 选中的活动分类
  * @param bool $withEmptySelection 是否包含“所有分类”选项
  * @param string $selectName select的name的值,如无,返回的HTML不包含select这个Tag
  * @return HTML
  */
 function getActmidSelectHtml($selectedActmid = 0, $withEmptySelection = 1, $selectTagName = 'actmid')
 {
     $options = array();
     if ($withEmptySelection) {
         $options['0'] = getLangInfo('other', 'act_activity_class');
     }
     $activityCateDb = $this->getActivityCateDb();
     $activityModelDb = $this->getActivityModelDb();
     $newModelDb = array();
     foreach ($activityModelDb as $value) {
         $newModelDb[$value['actid']][] = $value;
     }
     foreach ($activityCateDb as $value) {
         foreach ($newModelDb[$value['actid']] as $val) {
             $options[$value['name']][$val['actmid']] = $val['name'];
         }
     }
     $return = getSelectHtml($options, $selectedActmid, $selectTagName);
     return $return;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:27,代码来源:activity.class.php


示例19: pwSendMsg

/**
 * 发送社区短消息或系统通知
 *
 * @param array $msg 信息格式如下:
 * 	$msg = array(
 *		'toUser'	=> 'admin', //接收者用户名,可为数组群发:array('admin','abc')
 *		'toUid'		=> 1,		//接收者uid,可为数组群发:array(1,2),当与 toUser 同时存在时,自然失效
 *		'fromUid'	=> 2,		//发送者UID,与fromUser同时存在才有效 (可选,默认为'0')
 *		'fromUser'	=> 'pwtest',//发送者用户名,与fromUid同时存在才有效(可选,默认为'SYSTEM')
 *		'subject'	=> 'Test',	//消息标题
 *		'content'	=> '~KO~',	//消息内容
 *		'other'		=> array()	//其他信息变量
 *	);
 * @return boolean 返回消息发送是否完成
 */
function pwSendMsg($msg)
{
    global $db, $timestamp;
    if (!$msg['toUser'] && !$msg['toUid'] || !$msg['subject'] || !$msg['content']) {
        return false;
    }
    $toType = 'username';
    if (empty($msg['toUser'])) {
        $msg['toUser'] = $msg['toUid'];
        $toType = 'uid';
    }
    $msg['subject'] = getLangInfo('writemsg', $msg['subject'], $msg);
    $msg['content'] = getLangInfo('writemsg', $msg['content'], $msg);
    if (!$msg['fromUid'] || !$msg['fromUser']) {
        $msg['fromUid'] = 0;
        $msg['fromUser'] = 'SYSTEM';
    }
    if (is_array($msg['toUser'])) {
        //group send message
        $msgdb = array();
        $query = $db->query("SELECT uid FROM pw_members WHERE {$toType} IN (" . pwImplode($msg['toUser'], false) . ')');
        while ($rt = $db->fetch_array($query)) {
            $msgdb[] = array($rt['uid'], $msg['fromUid'], $msg['fromUser'], 'rebox', 1, $timestamp, $msg['subject'], $msg['content']);
        }
        $msgdb && send_msgc($msgdb, false);
    } else {
        $rt = $db->get_one("SELECT uid FROM pw_members WHERE {$toType}=" . pwEscape($msg['toUser'], false));
        if (empty($rt)) {
            return false;
        }
        $db->update('INSERT INTO pw_msg SET ' . pwSqlSingle(array('touid' => $rt['uid'], 'fromuid' => $msg['fromUid'], 'username' => $msg['fromUser'], 'type' => 'rebox', 'ifnew' => 1, 'mdate' => $timestamp), false));
        $mid = $db->insert_id();
        $db->update('REPLACE INTO pw_msgc SET ' . pwSqlSingle(array('mid' => $mid, 'title' => $msg['subject'], 'content' => $msg['content']), false));
        $db->update("UPDATE pw_members SET newpm=newpm+1 WHERE uid=" . pwEscape($rt['uid'], false));
    }
    return true;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:52,代码来源:msg.php


示例20: sendemail

function sendemail($toemail, $subject, $message, $additional = null)
{
    global $M_db, $db_bbsname, $regname, $db_bbsurl, $windid, $winduid, $timestamp, $regpwd, $manager, $db_ceoemail, $fromemail, $pwd_user, $submit, $receiver, $old_title, $fid, $tid, $pwuser, $db_charset, $sendtoname, $db_registerfile;
    !$fromemail && ($fromemail = $db_ceoemail);
    !$sendtoname && ($sendtoname = $toemail);
    !$windid && ($windid = $db_bbsname);
    $subject = stripslashes(getLangInfo('email', $subject));
    $message = stripslashes(getLangInfo('email', $message));
    $additional = getLangInfo('email', $additional);
    $send_subject = "=?{$db_charset}?B?" . base64_encode(str_replace(array("\r", "\n"), array('', ' '), $subject)) . '?=';
    $send_message = chunk_split(base64_encode(str_replace("\r\n.", " \r\n..", str_replace("\n", "\r\n", str_replace("\r", "\n", str_replace("\r\n", "\n", str_replace("\n\r", "\r", $message)))))));
    $send_from = "=?{$db_charset}?B?" . base64_encode($db_bbsname) . "?= <{$fromemail}>";
    $send_to = "=?{$db_charset}?B?" . base64_encode($sendtoname) . "?= <{$toemail}>";
    !empty($additional) && $additional && substr(str_replace(array("\r", "\n"), array('', '<rn>'), $additional), -4) != '<rn>' && ($additional .= "\r\n");
    $additional = "To: {$send_to}\r\nFrom: {$send_from}\r\nMIME-Version: 1.0\r\nContent-type: text/html; charset={$db_charset}\r\n{$additional}Content-Transfer-Encoding: base64\r\n";
    if ($M_db->S_method == 1) {
        if (@mail($toemail, $send_subject, $send_message, $additional)) {
            return true;
        } else {
            return false;
        }
    } elseif ($M_db->S_method == 2) {
        if (!($fp = fsockopen($M_db->smtp['host'], $M_db->smtp['port'], $errno, $errstr))) {
            Showmsg('email_connect_failed');
        }
        if (strncmp(fgets($fp, 512), '220', 3) != 0) {
            Showmsg('email_connect_failed');
        }
        if ($M_db->smtp['auth']) {
            fwrite($fp, "EHLO phpwind\r\n");
            while ($rt = strtolower(fgets($fp, 512))) {
                if (strpos($rt, "-") !== 3 || empty($rt)) {
                    break;
                } elseif (strpos($rt, "2") !== 0) {
                    return false;
                }
            }
            fwrite($fp, "AUTH LOGIN\r\n");
            if (strncmp(fgets($fp, 512), '334', 3) != 0) {
                return false;
            }
            fwrite($fp, base64_encode($M_db->smtp['user']) . "\r\n");
            if (strncmp(fgets($fp, 512), '334', 3) != 0) {
                return 'email_user_failed';
            }
            fwrite($fp, base64_encode($M_db->smtp['pass']) . "\r\n");
            if (strncmp(fgets($fp, 512), '235', 3) != 0) {
                return 'email_pass_failed';
            }
        } else {
            fwrite($fp, "HELO phpwind\r\n");
        }
        $from = $M_db->smtp['from'];
        $from = preg_replace("/.*\\<(.+?)\\>.*/", "\\1", $from);
        fwrite($fp, "MAIL FROM: <{$from}>\r\n");
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            return 'email_from_failed';
        }
        fwrite($fp, "RCPT TO: <{$toemail}>\r\n");
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            return 'email_toemail_failed';
        }
        fwrite($fp, "DATA\r\n");
        if (strncmp(fgets($fp, 512), '354', 3) != 0) {
            return 'email_data_failed';
        }
        $msg = "Date: " . Date("r") . "\r\n";
        $msg .= "Subject: {$send_subject}\r\n";
        $msg .= "{$additional}\r\n";
        $msg .= "{$send_message}\r\n.\r\n";
        fwrite($fp, $msg);
        $lastmessage = fgets($fp, 512);
        if (substr($lastmessage, 0, 3) != 250) {
            Showmsg('email_connect_failed');
        }
        fwrite($fp, "QUIT\r\n");
        fclose($fp);
        return true;
    } elseif ($M_db->S_method == 3) {
        if (!$M_db->mailmx($toemail)) {
            return false;
        }
        foreach ($M_db->smtp['tomx'] as $server) {
            if (($fp = fsockopen($server, 25, $errno, $errstr)) && strncmp(fgets($fp, 512), '220', 3) == 0) {
                break;
            }
        }
        fwrite($fp, "HELO " . $M_db->smtp['smtphelo'] . "\r\n");
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            fwrite($fp, "EHLO " . $M_db->smtp['smtphelo'] . "\r\n");
            while ($rt = strtolower(fgets($fp, 512))) {
                if (strpos($rt, "-") !== 3 || empty($rt)) {
                    break;
                } elseif (strpos($rt, "2") !== 0) {
                    return false;
                }
            }
            fwrite($fp, "AUTH LOGIN\r\n");
            if (strncmp(fgets($fp, 512), '334', 3) != 0) {
                return false;
//.........这里部分代码省略.........
开发者ID:jechiy,项目名称:PHPWind,代码行数:101,代码来源:sendemail.php



注:本文中的getLangInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getLanguage函数代码示例发布时间:2022-05-15
下一篇:
PHP getLangFileName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap