示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
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;
}
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;
}
示例#5
0
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'])));
}
示例#6
0
function createfail($checkpwd, $showinfo = '', $type = 'fail')
{
    if ($checkpwd) {
        $showinfo = 'fail' == $type && '' != $showinfo ? getLangInfo('msg', $showinfo) : $showinfo;
        echo "{$type}\t{$showinfo}";
        ajax_footer();
    }
    return false;
}
示例#7
0
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));
}
示例#8
0
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();
}
示例#9
0
 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;
 }
示例#10
0
 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;
 }
示例#11
0
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');
    }
}
示例#12
0
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);
}
示例#13
0
 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;
 }
示例#14
0
 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;
 }
示例#15
0
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;
}
示例#16
0
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;
}
示例#17
0
/**
 * 发送社区短消息或系统通知
 * 重构新消息中心 
 * @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;
}
示例#18
0
 /**
  * 返回活动子分类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;
 }
示例#19
0
文件: msg.php 项目: adi00/wumaproject
/**
 * 发送社区短消息或系统通知
 *
 * @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'] = '******';
    }
    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;
}
示例#20
0
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;
            }
            fwrite($fp, base64_encode($M_db->smtp['user']) . "\r\n");
            if (strncmp(fgets($fp, 512), '334', 3) != 0) {
                return false;
            }
            fwrite($fp, base64_encode($M_db->smtp['pass']) . "\r\n");
            if (strncmp(fgets($fp, 512), '235', 3) != 0) {
                return false;
            }
        }
        $from = $M_db->smtp['smtpmxmailname'];
        $reply = $M_db->smtp['from'];
        fwrite($fp, "MAIL FROM: <{$from}>\r\n");
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            return false;
        }
        fwrite($fp, "RCPT TO: <{$toemail}>\r\n");
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            return false;
        }
        fwrite($fp, "DATA\r\n");
        if (strncmp(fgets($fp, 512), '354', 3) != 0) {
            return false;
        }
        $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);
        if (strncmp(fgets($fp, 512), '250', 3) != 0) {
            return false;
        }
        fwrite($fp, "QUIT\r\n");
        fclose($fp);
        return true;
        //hacker
    } else {
        //hacker
    }
}
示例#21
0
        $order = $rewardtype != null ? "t.ifreward ASC,t.postdate {$orderby}" : "t.postdate {$orderby}";
    } else {
        $start_limit = ($page - 1) * $db_readperpage - 1;
        $order = $rewardtype != null ? "t.ifreward DESC,t.postdate {$orderby}" : "t.postdate {$orderby}";
    }
    if ($start_limit < 0) {
        $readnum += $start_limit;
        $start_limit = 0;
    }
    $start_limit = $pageinverse ? $start_limit + $topped_count : ($start_limit - $topped_count <= 0 ? 0 : $start_limit - $topped_count);
    $limit = S::sqlLimit(0, 1);
    $query = $db->query("SELECT t.* {$fieldadd} FROM {$pw_posts} t {$tablaadd} WHERE t.tid=" . S::sqlEscape($tid) . " AND t.pid=" . S::sqlEscape($pid) . " AND t.ifcheck='1' {$sqladd} ORDER BY {$order} {$limit}");
    while ($read = $db->fetch_array($query)) {
        $_uids[$read['authorid']] = 'UID_' . $read['authorid'];
        $read['aid'] && ($_pids[$read['pid']] = $read['pid']);
        $read['istop'] = strpos($read['remindinfo'], getLangInfo('bbscode', 'read_topped_tag')) !== false ? 'top' : '';
        $readdb[] = $read;
    }
    $db->free_result($query);
    $pageinverse && ($readdb = array_reverse($readdb));
    if ($isRobBuild) {
        $robFloors = $db->get_value("SELECT floor FROM pw_robbuildfloor WHERE tid = " . S::sqlEscape($tid) . " AND pid = " . S::sqlEscape($pid));
    }
    if ($isReplyReward) {
        $replyRewardRecordService = L::loadClass('ReplyRewardRecord', 'forum');
        $replyRewarRecord = $replyRewardRecordService->getRewardRecordByTidAndPid($tid, $pid);
        $readdb[0]['replyreward'] = $replyRewarRecord;
        unset($replyRewardRecordService, $replyRewarRecord);
    }
}
array_push($_pids, $pid);
示例#22
0
文件: my.php 项目: jechiy/PHPWind
    define('F_M', true);
    S::gp(array('aid'), null, 2);
    $album = $photoService->getAlbumInfo($aid, array('ownerid', 'photonum'));
    if (empty($album) || $album['ownerid'] != $winduid && !$photoService->isDelRight()) {
        Showmsg('data_error');
    }
    if (empty($_POST['step'])) {
        require_once PrintEot('m_ajax_photos');
        ajax_footer();
    } else {
        $photoService->delAlbum($aid);
        updateUserAppNum($album['ownerid'], 'photo', 'minus', $album['photonum']);
        if ($album['ownerid'] != $winduid) {
            echo getLangInfo('msg', 'operate_success') . "\tjump\t{$basename}a=friend";
        } else {
            echo getLangInfo('msg', 'operate_success') . "\tjump\t{$basename}a=own";
        }
        ajax_footer();
    }
} elseif ($a == 'editalbum') {
    define('AJAX', 1);
    define('F_M', true);
    banUser();
    S::gp(array('aid'));
    empty($aid) && Showmsg('data_error');
    $albumInfo = $photoService->getAlbumInfo($aid);
    if (empty($albumInfo) || $albumInfo['atype'] != 0 || $albumInfo['ownerid'] != $winduid && !$photoService->isPermission()) {
        Showmsg('data_error');
    }
    if (empty($_POST['step'])) {
        ${'select_' . $albumInfo['private']} = 'selected';
示例#23
0
文件: credit.php 项目: jechiy/PHPWind
 /**
  * 记录积分日志
  *
  * @param string	$logtype	日志类型
  * @param array		$setv		积分值 array('money' => ??, 'rvrc' => ??, ...)
  * @param array		$log		日志信息描述
  */
 function addLog($logtype, $setv, $log)
 {
     global $db_ifcredit, $timestamp;
     $credit_pop = '';
     $uid = $log['uid'];
     foreach ($setv as $key => $affect) {
         if (isset($this->cType[$key]) && $affect != 0 && $this->_checkLogSet($logtype, $key)) {
             $log['username'] = S::escapeChar($log['username']);
             $log['cname'] = $this->cType[$key];
             $log['affect'] = $affect;
             $log['affect'] > 0 && ($log['affect'] = '+' . $log['affect']);
             $log['descrip'] = S::escapeChar(strip_tags(getLangInfo('creditlog', $logtype, $log)));
             $credit_pop .= $key . ":" . $log['affect'] . '|';
             $this->cLog[] = array($log['uid'], $log['username'], $key, $affect, $timestamp, $logtype, $log['ip'], $log['descrip']);
         }
     }
     if ($db_ifcredit && $credit_pop) {
         //Credit Changes Tips
         $credit_pop = $logtype . '|' . $credit_pop;
         $userService = L::loadClass('UserService', 'user');
         /* @var $userService PW_UserService */
         $userService->update($uid, array(), array('creditpop' => $credit_pop));
     }
 }
示例#24
0
                $errorname = $sendtoname;
                Showmsg('user_not_exists');
            }
            $uids[] = $userId;
        }
        if (is_array($touid)) {
            foreach ($touid as $key => $value) {
                if (is_numeric($value)) {
                    $uids[] = $value;
                }
            }
        }
        !$uids && Showmsg('msg_empty');
        $toUsers = $userService->getUserNamesByUserIds($uids);
        $inColonyUsers = array();
        $query = $db->query("SELECT username FROM pw_cmembers WHERE uid IN(" . S::sqlImplode($uids) . ") AND colonyid=" . S::sqlEscape($cyid));
        while ($rt = $db->fetch_array($query)) {
            $inColonyUsers[] = $rt['username'];
        }
        $toUsers = array_diff($toUsers, $inColonyUsers);
        M::sendRequest($winduid, $toUsers, array('create_uid' => $winduid, 'create_username' => $windid, 'title' => getLangInfo('writemsg', 'email_' . $type . '_invite_subject'), 'content' => getLangInfo('writemsg', 'email_' . $type . '_invite_content'), 'extra' => serialize(array('cyid' => $id))), 'request_group', 'request_group');
        if ($inColonyUsers) {
            $inColonyUsers = implode(',', $inColonyUsers);
            Showmsg('colony_invite_message');
        } else {
            Showmsg('operate_success');
        }
    }
} else {
    Showmsg('undefined_action');
}
 /**
  * 获取模块头部html内容
  * 
  * @access protected
  * @param $html_id
  */
 function _getHeadData($html_id)
 {
     $temp = '';
     if (!$this->units[$html_id]['title'] && !$this->ifadmin) {
         return '';
     }
     $temp .= '<div class="' . $this->_htmlConfig['headclass'] . '"><span>';
     $temp .= $this->units[$html_id]['title'];
     $temp .= '</span>';
     if ($this->ifadmin) {
         $temp .= '<a href="javascript:void(0);" class="' . $this->_htmlConfig['editclass'] . '">' . getLangInfo('other', 'stopic_edit') . '</a>';
         $temp .= '<a href="javascript:void(0);" class="' . $this->_htmlConfig['closeclass'] . '">[x]</a>';
     }
     $temp .= '</div>';
     return $temp;
 }
示例#26
0
function wap_sms_msg($msg, $url = "")
{
    $ysmsg = is_array($msg) ? array_pop($msg) : $msg;
    $msg = getWapLang('wap', $ysmsg);
    if (!empty($msg) && $msg == $ysmsg) {
        $msg = getLangInfo('msg', $ysmsg);
        $msg = strip_tags($msg);
    }
    wap_header($url);
    if ($msg) {
        $str = '<br><div class="warning">' . $msg . '</div>';
        $str .= '<div>
				 <a href="index.php?a=ms_index&action=send">发新消息</a><br />
				 <a href="index.php?a=ms_index&action=all">返回所有消息</a><br />
				 <a href="index.php?a=ms_index&action=self">返回已发消息</a></div>';
        echo $str;
    } else {
        echo $ysmsg;
    }
    wap_footer();
}
示例#27
0
function payto($code)
{
    global $imgpath, $stylepath, $db_bbsurl, $db_charset, $pwServer, $timestamp, $winduid;
    $tmp = substr($code, strpos($code, '(seller)') + 8);
    $seller = str_replace(array('[email]', '[/email]'), '', substr($tmp, 0, strpos($tmp, '(/seller)')));
    $tmp = substr($code, strpos($code, '(subject)') + 9);
    $subject = substr($tmp, 0, strpos($tmp, '(/subject)'));
    $tmp = substr($code, strpos($code, '(body)') + 6);
    $body = substr($tmp, 0, strpos($tmp, '(/body)'));
    $tmp = substr($code, strpos($code, '(price)') + 7);
    $price = substr($tmp, 0, strpos($tmp, '(/price)'));
    $tmp = substr($code, strpos($code, '(ordinary_fee)') + 14);
    $ordinary_fee = substr($tmp, 0, strpos($tmp, '(/ordinary_fee)'));
    $tmp = substr($code, strpos($code, '(express_fee)') + 13);
    $express_fee = substr($tmp, 0, strpos($tmp, '(/express_fee)'));
    $tmp = substr($code, strpos($code, '(contact)') + 9);
    $contact = substr($tmp, 0, strpos($tmp, '(/contact)'));
    $tmp = substr($code, strpos($code, '(demo)') + 6);
    $demo = substr($tmp, 0, strpos($tmp, '(/demo)'));
    $tmp = substr($code, strpos($code, '(method)') + 8);
    $method = substr($tmp, 0, strpos($tmp, '(/method)'));
    $body = str_replace('\\"', '"', $body);
    $str = '<br>';
    $seller && ($str .= getLangInfo('bbscode', 'seller') . $seller . '<br><br>');
    $subject && ($str .= getLangInfo('bbscode', 'subject') . $subject . '<br><br>');
    $body && ($str .= getLangInfo('bbscode', 'body') . $body . '<br><br>');
    $price && ($str .= getLangInfo('bbscode', 'price') . $price . '<br><br>');
    if (($ordinary_fee || $express_fee) && $method == '2') {
        $str .= getLangInfo('bbscode', 'postage');
        $ordinary_fee && ($str .= getLangInfo('bbscode', 'ordinary_fee') . $ordinary_fee . '&nbsp; ');
        $express_fee && ($str .= getLangInfo('bbscode', 'express_fee') . $express_fee);
        $str .= '<br><br>';
    } else {
        $str .= getLangInfo('bbscode', 'postage_seller') . '<br><br>';
    }
    $contact && ($str .= getLangInfo('bbscode', 'contact') . $contact . '<br><br>');
    $demo && ($str .= getLangInfo('bbscode', 'demo') . $demo . '<br><br>');
    $body = substrs(str_replace('<br>', "\n", $body), 100);
    if ($method == 1) {
        $str .= "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" . rawurlencode(str_replace('&#46;', '.', $seller)) . "&item_name=" . rawurlencode($subject) . "&item_number=phpw*&amount={$price}&no_shipping=0&no_note=1&currency_code=CNY&notify_url=http://pay.phpwind.net/pay/stats.php?date=" . $pwServer['HTTP_HOST'] . get_date(time(), '-YmdHis') . "&bn=phpwind&charset={$db_charset}' target='_blank'><img src='{$imgpath}/post/paypal.gif'></a>";
    } elseif ($method == 2) {
        if ($ordinary_fee || $express_fee) {
            if ($ordinary_fee && $express_fee) {
                $urladd = "logistics_type=POST&logistics_fee={$ordinary_fee}&logistics_payment=BUYER_PAY&logistics_type_1=EXPRESS&logistics_fee_1={$express_fee}&logistics_payment_1=BUYER_PAY";
            } elseif ($ordinary_fee) {
                $urladd = "logistics_type=POST&logistics_fee={$ordinary_fee}&logistics_payment=BUYER_PAY";
            } else {
                $urladd = "logistics_type=EXPRESS&logistics_fee={$express_fee}&logistics_payment=BUYER_PAY";
            }
        } else {
            $urladd = "logistics_type=EXPRESS&logistics_fee=10&logistics_payment=SELLER_PAY";
        }
        $order_no = $method - 1 . str_pad($winduid, 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5);
        $str .= "<a href='http://pay.phpwind.net/pay/create_payurl.php?_input_charset={$db_charset}&service=trade_create_by_buyer&subject=" . rawurlencode($subject) . "&body=" . rawurlencode($body) . "&out_trade_no={$order_no}&price={$price}&quantity=1&payment_type=1&{$urladd}&seller_email={$seller}' target='_blank'><img src='{$imgpath}/post/alipay.gif'></a>";
    } elseif ($method == 3) {
        $str .= "<a href=\"https://www.99bill.com/website/paylink/pay.htm?payto=" . rawurlencode(str_replace('&#46;', '.', $seller)) . "\" target=\"_blank\"><img src=\"{$imgpath}/post/99bill.gif\"></a>";
    } elseif ($method == 4) {
        if ($ordinary_fee || $express_fee) {
            $urladd = "fee_payer=1&fee1={$ordinary_fee}&fee2={$express_fee}";
        } else {
            $urladd = 'fee_payer=0';
        }
        $str .= "<a href='http://pay.phpwind.net/pay/create_payurl.php?cmdno=11&seller={$seller}&mch_name=" . rawurlencode($subject) . "&mch_price={$price}&{$urladd}&mch_desc=" . rawurlencode($body) . "&mch_type=1' target='_blank'><img src='{$imgpath}/post/tenpay.gif' /></a>";
    }
    return $str;
}
示例#28
0
文件: pay_3.php 项目: jechiy/PHPWind
<?php

!function_exists('readover') && exit('Forbidden');
$g = $db->get_one("SELECT p.gid,p.rvalue AS allowbuy,u.grouptitle FROM pw_permission p LEFT JOIN pw_usergroups u ON p.gid=u.gid WHERE p.uid='0' AND p.fid='0' AND p.gid=" . S::sqlEscape($rt['paycredit']) . " AND p.rkey='allowbuy' AND u.gptype='special'");
if ($g && $g['allowbuy']) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    if ($rt['extra_1'] == 1) {
        if ($rt['groupid'] == '-1') {
            $userService->update($rt['uid'], array('groupid' => $g['gid']));
        } else {
            $groups = $rt['groups'] ? $rt['groups'] . $rt['groupid'] . ',' : ",{$rt['groupid']},";
            $userService->update($rt['uid'], array('groupid' => $g['gid'], 'groups' => $groups));
        }
    } else {
        $groups = $rt['groups'] ? $rt['groups'] . $g['gid'] . ',' : ",{$g['gid']},";
        $userService->update($rt['uid'], array('groups' => $groups));
    }
    $db->pw_update("SELECT uid FROM pw_extragroups WHERE uid=" . S::sqlEscape($rt['uid']) . " AND gid=" . S::sqlEscape($g['gid']), "UPDATE pw_extragroups SET " . S::sqlSingle(array('togid' => $rt['groupid'], 'startdate' => $timestamp, 'days' => $rt['number'])) . " WHERE uid=" . S::sqlEscape($rt['uid']) . " AND gid=" . S::sqlEscape($g['gid']), "INSERT INTO pw_extragroups SET " . S::sqlSingle(array('uid' => $rt['uid'], 'togid' => $rt['groupid'], 'gid' => $g['gid'], 'startdate' => $timestamp, 'days' => $rt['number'])));
    M::sendNotice(array($rt['username']), array('title' => getLangInfo('writemsg', 'groupbuy_title'), 'content' => getLangInfo('writemsg', 'groupbuy_content', array('fee' => $fee, 'gname' => $g['grouptitle'], 'number' => $rt['number']))));
    $ret_url = 'profile.php?action=buy';
}
示例#29
0
    $isAtcEmail = (int) $atc_email;
    $isAtcNewrp = (int) $atc_newrp;
    $userService = L::loadClass('UserService', 'user');
    $userService->setUserStatus($winduid, PW_USERSTATUS_REPLYEMAIL, $isAtcEmail);
    $userService->setUserStatus($winduid, PW_USERSTATUS_REPLYSITEEMAIL, $isAtcNewrp);
    $j_p = "read.php?tid={$tid}&ds=1";
    if ($db_htmifopen) {
        $j_p = urlRewrite($j_p);
    }
    if (empty($j_p) || $pwforum->foruminfo['cms']) {
        $j_p = "read.php?tid={$tid}&ds=1";
    }
    $pinfo = defined('AJAX') ? "success\t" . $j_p : "";
    if (!$iscontinue) {
        if ($postdata->getIfcheck()) {
            if ($prompts = $pwpost->getprompt()) {
                isset($prompts['allowhide']) && ($pinfo = getLangInfo('refreshto', "post_limit_hide"));
                isset($prompts['allowsell']) && ($pinfo = getLangInfo('refreshto', "post_limit_sell"));
                isset($prompts['allowencode']) && ($pinfo = getLangInfo('refreshto', "post_limit_encode"));
            }
        }
    }
    //defend start
    CloudWind::YunPostDefend($winduid, $windid, $groupid, $tid, $atc_title, $atc_content, 'thread', array('fid' => $fid, 'tid' => $tid, 'forumname' => $pwforum->foruminfo['name']));
    //defend end
    //job sign
    //require_once(R_P.'require/functions.php');
    //initJob($winduid,"doPost",array('fid'=>$fid));
    pwHook::runHook('after_post');
    refreshto($j_p, $pinfo);
}
示例#30
0
function initGroupOptions()
{
    global $db, $groupselect, $groupselect_add, $g_sel;
    //for template file
    $groupselect = "<option value='-1'>" . getLangInfo('all', 'reg_member') . "</option>";
    $groupselect_add = "<option value='-1'>" . getLangInfo('all', 'reg_member') . "</option>";
    $g_sel = '';
    $query = $db->query("SELECT gid,gptype,grouptitle FROM pw_usergroups WHERE gid>2 AND gptype<>'member' ORDER BY gid");
    while ($group = $db->fetch_array($query)) {
        $groupselect .= "<option value=\"{$group['gid']}\">{$group['grouptitle']}</option>";
        if ($group['gid'] != 5) {
            $groupselect_add .= "<option value=\"{$group['gid']}\">{$group['grouptitle']}</option>";
        }
        if ($group['gptype'] != 'default') {
            $g_sel .= "<option value=\"{$group['gid']}\">{$group['grouptitle']}</option>";
        }
    }
}