Esempio n. 1
0
 public function permission()
 {
     session_start();
     $infoarr = @$_SESSION['user'];
     $media_id = @$_GET['media_id'];
     $type = @$_GET['ask_method'];
     $sql = "select*from card where media_id='{$media_id}'";
     $result = new dbconnect();
     $row = $result->connect($sql);
     if ($infoarr['openid'] != "") {
         if ($row['from_openid'] == $infoarr['openid'] || $row['to_openid'] == $infoarr['openid']) {
             if ($media_id == "") {
                 $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token=";
             } else {
                 include "../cache/" . $media_id . ".php";
                 $Token = $Token['token'];
                 $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token={$Token}&ask_method=json";
             }
         } else {
             $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token=";
         }
         $code = new code();
         $code->code_make($url, $media_id);
         $this->show($row, $type);
     } else {
         $code = -1;
         $msg = "error:You have to use wechat app to open! ";
         $data = "null";
         api_response::api_method($type, $code, $msg, $data);
     }
 }
Esempio n. 2
0
 /**
  *  下订单
  */
 public function OrderService($data)
 {
     //转化地址,跨境快递使用
     $data['j_shippercode'] = code::get($data['j_province'], $data['j_city']);
     $data['d_deliverycode'] = code::get($data['d_province'], $data['d_city']);
     $model = new Model();
     $curl = new Curl();
     $xml = new Xml();
     //生成数据
     $data = $model->OrderService($data);
     //执行请求,解析数据
     $response_xml = $curl->post($data['url'], $data['data']);
     $response_arr = $xml->parse($response_xml);
     return $response_arr;
 }
Esempio n. 3
0
 public function cache($mediaID, $postObj)
 {
     session_start();
     define("STR_MD", "23nbhjfdb#%#^A!~");
     $token = md5($mediaID . STR_MD . time());
     $data = array('media_id' => "{$mediaID}", 'token' => "{$token}");
     $dir = dirname(__FILE__) . "/cache/";
     $filename = $mediaID . ".php";
     $data = "<?php\n  " . '$Token=' . var_export($data, true) . "\n?>";
     if (!is_dir($dir)) {
         mkdir($dir, 0777);
     }
     file_put_contents($dir . $filename, $data);
     $value = "http://card.sky31.com/player.html?ask_method=json&media_id={$mediaID}&Token={$token}";
     $qr_make = new code();
     $qr_make->code_make($value, $mediaID);
     $sql = "insert into card(media_id) values('{$mediaID}')";
     $conn = new mysqli(HOST, UserName, PassWord, DataBase);
     $conn->query("set names UTF8");
     $conn->query($sql);
     $this->card_make($postObj, $mediaID);
     //$this->downloadfile($mediaID);
 }
Esempio n. 4
0
 static function someinput_put($name, $value, $size = null)
 {
     $value = str_replace(array("\r\n", "\r"), "\n", $value);
     $set = self::$someinput_set;
     if ($size === null) {
         $size = $set['size'];
     }
     $len = mb_strlen($value, 'utf-8');
     $page = ceil($len / $set['mei']) + $set['add'];
     if ($page < $set['new']) {
         $page = $set['new'];
     }
     if ($set['istextarea'] && !self::$iswml) {
         $html1 = "<textarea name=\"{$name}[]\"";
         if (is_array($size)) {
             $html1 .= self::htmlarr(array('cols', 'rows'), $size, $size);
         } elseif ($size) {
             $html1 .= " cols=\"{$size}\"";
         }
         $html1 .= ">";
         $html2 = '</textarea><br/>';
     } else {
         $html1 = "<input name=\"{$name}[]\"";
         if (is_array($size)) {
             $size = $size[0];
         }
         if ($size) {
             $html1 .= " size=\"{$size}\"";
         }
         $html1 .= ' value="';
         $html2 = '"/><br/>';
     }
     $html = null;
     for ($i = 0; $i < $page; $i) {
         $off = $set['mei'] * $i;
         $text = code::html(mb_substr($value, $off, $set['mei'], 'utf-8'), true);
         if ($set['isuc'] && $text !== '') {
             $text = "{$text}";
         }
         if (self::$iswml) {
             $html .= str_replace('[]"', "0x{$i}\"", $html1) . $text . $html2;
             self::$oblink["{$name}[{$i}]"][] = "\$({$name}0x{$i})";
         } else {
             $html .= str_replace('[]', "[{$i}]", $html1) . $text . $html2;
         }
     }
     self::show($html);
 }
Esempio n. 5
0
<?php

/**
 * $Author: BEESCMS $
 * ============================================================================
 * 网站地址: http://www.beescms.com
 * 您只能在不用于商业目的的前提下对程序代码进行修改和使用;
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
include '../includes/code.class.php';
$code = new code(80, 23);
$code->out_img();
Esempio n. 6
0
 public function thumb($data)
 {
     $src = code::html($data['src']);
     return '<a href="' . $src . '"><img src="http://s.image.wap.soso.com/img/' . floor($data['w']) . '_' . floor($data['h']) . '_0_0_' . $src . '" alt="点击查看大图"/></a>';
 }
Esempio n. 7
0
 public function __construct($id)
 {
     parent::__construct($id);
     $this->setConfig('regenerateview', 0);
 }
Esempio n. 8
0
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Web manage publishing-<?php 
echo $m_sitename;
?>
</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CFAFCE" leftmargin="0" topmargin="0">
	<br>
<?php 
if (empty($_POST['action'])) {
    include 'include/code.php';
    $s = new code();
    $s->genimg();
    ?>
<script language="javascript">
function chkform() {
	if (myform.userr.value == ""){
		alert("Username:Empty!");
		document.myform.userr.focus();
		return false;
	}
	if (myform.pwd.value == ""){
		alert("Password:Empty!");
		document.myform.pwd.focus();
		return false;
	}
	if (myform.verifycode.value == ""){
 /**
  * 验证码
  */
 public function code()
 {
     $code = new code(200, 30, '#dddddd', '#000', 4, 22);
     $code->show();
 }
Esempio n. 10
0
        $black = imagecolorallocate($this->img, 255, 225, 255);
        $gray = imagecolorallocate($this->img, 36, 36, 35);
        $red = imagecolorallocate($this->img, 140, 149, 140);
        if ($this->gaorao == "1") {
            for ($i = 0; $i < 10; $i++) {
                imageline($this->img, 0, 0, rand(0, $this->width), rand(0, $this->height), $red);
                imagesetpixel($this->img, rand(0, $this->width), rand(0, $this->height), $gray);
            }
        }
    }
    private function codeput()
    {
        $codestry = "";
        $code = "1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,j,k,l,o,m,n";
        $codearr = explode(",", $code);
        for ($i = 0; $i < $this->codenum; $i++) {
            $codestry .= $codearr[rand(0, count($codearr) - 1)];
        }
        $_SESSION['code'] = $codestry;
        $this->code = $codestry;
        $black = imagecolorallocate($this->img, 25, 8, 228);
        imagestring($this->img, 3, 10, ceil($this->height / 2) - 5, $codestry, $black);
    }
    private function outimg()
    {
        header("Content-type:image/png");
        imagepng($this->img);
    }
}
$code = new code(60, 34, 4, 0);
$code->createcode();
Esempio n. 11
0
 /**
  * 验证码
  */
 public function code()
 {
     $code = new code();
     $code->show();
 }
Esempio n. 12
0
 public function display()
 {
     /* todo: make wysiwygplugins configurable  */
     $this->setConfig('attributes', 'data-wysiwygplugins="savewysiwygblock,cancelwysiwygblock,bold,underline,italic,justifyLeft,justifyCenter,justifyRight,strikeThrough,subscript,superscript,orderedList,unOrderedList,undo,redo,outdent,indent,removeFormat,createLink,unlink,formatBlock,foreColor,hiliteColor,code"');
     return parent::display();
 }
Esempio n. 13
0
if (!$iFound) {
    foreach ($database->Query("SELECT * FROM dl_user;") as $user) {
        if (trim($user['username']) == trim($_POST['user'])) {
            $data['euser'] = 2;
        } else {
            $data['euser'] = "";
        }
    }
}
if (!$data['euser'] && !$data['epass'] && !$data['email']) {
    $grplist = array(7, 3, 5, 4, 5, 6, 2);
    $password = md5($_POST['pass']);
    $signup = time();
    $ipaddress = $_SERVER['REMOTE_ADDR'];
    $preCode = strrev(md5(trim($_POST['user']) . '|DL' . $signup . 'FS|' . trim($_POST['pass'])));
    $i = 0;
    $c = 0;
    $data['code'] = "";
    while ($c < strlen($preCode)) {
        $data['code'] .= substr($preCode, $c, $grplist[$i]);
        if (count($grplist) > $i + 1) {
            $data['code'] .= "-";
        }
        $c += $grplist[$i];
        $i++;
    }
    $data['code'] = strtoupper($data['code']);
    $sql = "INSERT INTO dl_user (level_id, rank_id, username, password, email, nickname, sex, birthday, location, interests, signup, address_ip)\n\t\t\tVALUES (7,0,'{$_POST['user']}','{$password}','{$_POST['mail']}','{$_POST['nickname']}',{$_POST['sex']},{$_POST['birthday']},'{$_POST['location']}','{$_POST['interests']}',{$signup},'{$ipaddress}');";
    $data['acc'] = code::encrypt($sql, $_POST['pass']);
}
echo json_encode($data);
Esempio n. 14
0
 /**
  *  验证码 
  */
 function validateCode()
 {
     $code = new code();
     $code->show();
 }