Example #1
0
function getGoods($id)
{
    $json = file_get_contents_curl("https://hws.alicdn.com/cache/mtop.wdetail.getItemDescx/4.1/?data=%7B%22item_num_id%22%3A%22{$id}%22%7D");
    $data = json_decode($json, 1);
    if ($data['data']['pages']) {
        $content = "";
        foreach ($data['data']['pages'] as $p) {
            $content .= $p;
        }
        $content = str_replace("<img>", "<img src=", $content);
        $content = str_replace("</img>", ">", $content);
        $content = str_replace("txt", "p", $content);
    }
    if ($content) {
        $json = file_get_contents_curl("https://hws.alicdn.com/cache/wdetail/5.0/?id={$id}");
        $data = json_decode($json, 1);
        $goods_name = $data['data']['itemInfoModel']['title'];
        $props = $data['data']['props'];
        if ($props) {
            $goods_props = '';
            foreach ($props as $p) {
                $goods_props .= "<p>{$p['name']}:{$p['value']}</p>";
            }
            $content = $goods_props . $content;
        }
        if ($data['data']['itemInfoModel']['picsPath']) {
            $imgArr = array();
            foreach ($data['data']['itemInfoModel']['picsPath'] as $k => $img) {
                if ($k >= $num) {
                    break;
                }
                //$imgArr[$k] = str_replace("../",ROOT_PATH,getImg($img));
                $imgArr[$k] = getImg($img);
            }
        }
        if ($_GET['do'] == 1) {
            if ($istitle == 1) {
                $uptitle = ",goods_name='{$goods_name}'";
            }
            $db->query("update {$ecs->table('goods')} set \n\t\t\t\tgoods_desc='{$content}',goods_thumb='{$imgArr[0]['thumb']}',goods_img='{$imgArr[0]['goods']}',original_img='{$imgArr[0]['source']}'{$uptitle} \n\t\t\t\twhere goods_id={$gid}");
            foreach ($imgArr as $v) {
                $db->query("insert into {$ecs->table('goods_gallery')} (goods_id,img_url,thumb_url,img_original) value ({$gid},'{$v[goods]}','{$v[thumb]}','{$v[source]}')");
            }
        } else {
            include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
            $smarty->assign('content', $content);
            $smarty->assign('img_list', $imgArr);
            $smarty->assign('id', $id);
            $smarty->assign('gid', $gid);
            $smarty->assign('istitle', $istitle);
            $smarty->assign('iscomment', $iscomment);
            $smarty->assign('goods_name', $goods_name);
            $smarty->assign('comment_list', $comment_list);
            $smarty->display('gettaobaoview.html');
        }
    } else {
        sys_msg('提取失败', 0, $link);
    }
}
Example #2
0
 public function checkUname()
 {
     $uname = $this->input->post('username');
     $result = $this->users->checkUsername($uname);
     if ($result) {
         echo '<img src="' . getImg('not-available.png') . '" />';
     } else {
         echo '<img src="' . getImg('available.png') . '" />';
     }
 }
Example #3
0
function fetch_by_category($url = "", $page = "")
{
    $product = array();
    if (empty($url)) {
        $url = 'http://www.chemistwarehouse.com.au/Shop-Online/506/Bio-Organics';
    }
    echo $url;
    // Create DOM from URL or file
    $url = $url . "?page=" . $page;
    echo "<h3>begin to fetch:[" . $url . "]</h3>";
    $html = file_get_html($url);
    //$product = array();
    foreach ($html->find('.Product') as $element) {
        //$element
        // echo $element->plaintext."</br><br>";
        //$product = array();
        foreach ($element->find('img') as $element3) {
            //echo "product id:".substr($element3->src, 63,5). '<br>';
            //echo "Product Name: ".$element3->alt . '<br>';
            //echo "Small img: ".$element3->src . '<br>';
            //echo "Big img: ".substr_replace($element3->src,'original.jpg',-7 ). '<br>';
            //save product images
            getImg($element3->src, substr($element3->src, 63, 5));
            getImg(substr_replace($element3->src, 'original.jpg', -7), substr($element3->src, 63, 5));
            foreach ($element->find('.Price') as $element2) {
                //echo "Chemist price: ".$element2->plaintext."</br>";
                //echo "Chemist price: ".ltrim(rtrim($element2->plaintext," "), "$")."</br>";
                //array_push($product_item,"chemist_price"=>$element2->plaintext);
            }
            //save product into array
            $product_item = array("chemist_product_id" => substr($element3->src, 63, 5), "product_name" => $element3->alt, "small_img_src" => $element3->src, "big_img_src" => substr_replace($element3->src, 'original.jpg', -7), "chemist_price" => ltrim(rtrim($element2->plaintext, " "), "\$"));
            //print_r($product_item);
        }
        array_push($product, $product_item);
        //echo "----------------------------------------------------</br>";
    }
    echo json_encode($product);
    return $product;
}
Example #4
0
function wapRender($data, $modId)
{
    if (array_key_exists($modId, $data)) {
        $arrMod = $data[$modId];
        ksort($arrMod);
        //var_dump($arrMod);
        $ret = array();
        $from = 'wap';
        if ($modId == '_1') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<div class="swiper-slide"><a onclick="_gaq.push([\'_trackEvent\', \'wap_banner\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><div><p>' . getTitle($v, 12) . '</p></div></a></div>';
            }
        } elseif ($modId == '_2') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap今日热点\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_3') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap政策解读\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_4') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<div class="clearfix"><a class="left" onclick="_gaq.push([\'_trackEvent\', \'wap健康萌宝贝\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"></a><a class="right" onclick="_gaq.push([\'_trackEvent\', \'wap健康萌宝贝\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><h5>' . getTitle($v, 18) . '</h5></a></div>';
            }
        } elseif ($modId == '_5') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap专家在线\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><div><p>' . getTitle($v, 14) . '</p></div></a>';
            }
        } elseif ($modId == '_6') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap讲座精选\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_7') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap帮你帮我\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_8') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap宝宝看世界\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><p>' . getTitle($v, 6) . '</p></a>';
            }
        } elseif ($modId == '_9') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap成长不烦恼\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><p>' . getTitle($v, 6) . '</p></a>';
            }
        } elseif ($modId == '_10') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap论坛热议\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_11') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<p class="p' . substr($k, 1) . '"><i></i><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 16) . '</a></p>';
            }
        } elseif ($modId == '_12') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="40" height="40"></a><span><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 6) . '</a></span></li>';
            }
        } elseif ($modId == '_13') {
            foreach ($arrMod as $k => $v) {
                if ($k == '_1') {
                    $ret[] = '<li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="170" height="170"></a><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 6) . '</a></p></li>';
                } else {
                    $ret[] = '<li class="m_r1"><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="170" height="170"></a><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 6) . '</a></p></li>';
                }
            }
        } elseif ($modId == '_14') {
            $top3 = array_slice($arrMod, 0, 3);
            foreach ($top3 as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap成长俱乐部\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"></a>';
            }
        } elseif ($modId == '_15') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap大手拉小手\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><div><p>' . getTitle($v, 14) . '</p></div></a>';
            }
        } elseif ($modId == '_16') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap时尚辣妈圈\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '"><p>' . getTitle($v, 6) . '</p></a>';
            }
        } elseif ($modId == '_17') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap摩登风尚\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_18') {
            foreach ($arrMod as $k => $v) {
                $ret[] = '<a onclick="_gaq.push([\'_trackEvent\', \'wap辣妈推荐\', \'action\', \'label\', \'value\', \'true\']);" href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><p>' . getTitle($v, 14) . '</p></a>';
            }
        } elseif ($modId == '_19') {
            foreach ($arrMod as $k => $v) {
                if ($k == '_1') {
                    $ret[] = '<div class="show_t"><ul class="clearfix"><li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="225" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li>';
                } elseif ($k == '_2' || $k == '_3' || $k == '_7') {
                    $ret[] = '<li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="225" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li>';
                } elseif ($k == '_4') {
                    $ret[] = '<li class="m_r1"><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="265" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li></ul></div>';
                } elseif ($k == '_5') {
                    $ret[] = '<div class="show_b"><ul class="clearfix"><li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="225" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li>';
                } elseif ($k == '_6') {
                    $ret[] = '<li><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="265" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li></ul></div>';
                } elseif ($k == '_8') {
                    $ret[] = '<li class="m_r1"><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '"><img src="' . getImg($v) . '" width="225" height="300"><p><a href="' . getUrl($v) . '" babyinfo="' . getInfo($v, $from) . '">' . getTitle($v, 10) . '</a></p></a></li></ul></div>';
                }
            }
        }
        return implode('', $ret);
    } else {
        return '';
    }
}
Example #5
0
<?php

function getImg($postUrl)
{
    $url = explode("/", $postUrl);
    $myfile = file_put_contents('logs.txt', "link:", FILE_APPEND);
    $myfile = file_put_contents('logs.txt', $postUrl, FILE_APPEND);
    $data = file_get_contents("htt" . "p://" . $url[2] . "/mobile/post/" . $url[4]);
    preg_match_all('<a href="(.*?)">', $data, $matches, PREG_PATTERN_ORDER);
    $myfile = file_put_contents('logs.txt', "array:", FILE_APPEND);
    $myfile = file_put_contents('logs.txt', print_r($matches, true), FILE_APPEND);
    if (file_get_contents(str_replace("_500", "_1280", $matches[1][0]))) {
        return str_replace("_500", "_1280", $matches[1][0]);
    } else {
        return $matches[1][0];
    }
}
$imgUrl = getImg($_GET['u']);
header("Location:" . $imgUrl);
Example #6
0
 $result = $db->get_one($sql);
 if (!$result && !$email_result) {
     // echo '用户还没入库';
     $arr_in = array();
     $arr_in['username'] = mysql_real_escape_string(stripslashes($uinfo['nickname']));
     $arr_in['nickname'] = mysql_real_escape_string(stripslashes($uinfo['nickname']));
     $arr_in['gender'] = mysql_real_escape_string(stripslashes($uinfo['gender'] == '男' ? 'male' : 'female'));
     $arr_in['usertype'] = mysql_real_escape_string(stripslashes(2));
     $arr_in['password'] = md5(mysql_real_escape_string(stripslashes($_POST['password'])));
     $arr_in['email'] = mysql_real_escape_string(stripslashes($_POST['email']));
     $arr_in['openid'] = mysql_real_escape_string(stripslashes($openid));
     $arr_in['birthday'] = mysql_real_escape_string(stripslashes('1900-01-01'));
     $img_name = 'qqhead' . time() . rand(0, 100) . '.jpg';
     $filename = '../../images/profile_pics/' . $img_name;
     $url = $uinfo['figureurl_1'];
     $result_get_img = getImg($url, $filename);
     if ($result_get_img) {
         $arr_in['profile_pic'] = mysql_real_escape_string(stripslashes('images/profile_pics/' . $img_name));
     }
     $result = $db->insert('users', $arr_in);
     if ($result) {
         header("Location: control.php");
     }
 }
 //有email and password
 if ($email_result && isset($_POST['password'])) {
     $email = mysql_real_escape_string(stripslashes($_POST['email']));
     $password = md5(mysql_real_escape_string(stripslashes($_POST['password'])));
     $sql = $sql = "SELECT `id`  FROM `users` WHERE `password` = '" . $password . "' AND `email` = '" . $email . "'";
     $email_password_result = $db->get_one($sql);
     //邮件密码正确
function handleRead($id)
{
    $remoteImage = getImg($id) == '' ? "../images/anno.png" : getImg($id);
    //$img_file = file_get_contents(html_entity_decode($remoteImage));
    return html_entity_decode($remoteImage);
}
Example #8
0
<?php

function getImg($url = "", $filename = "")
{
    //去除URL连接上面可能的引号
    //$url = preg_replace( '/(?:^['"]+|['"/]+$)/', '', $url );
    $hander = curl_init();
    $fp = fopen($filename, 'wb');
    curl_setopt($hander, CURLOPT_URL, $url);
    curl_setopt($hander, CURLOPT_FILE, $fp);
    //绕过证书
    curl_setopt($hander, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($hander, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($hander, CURLOPT_HEADER, 0);
    curl_setopt($hander, CURLOPT_FOLLOWLOCATION, 1);
    //curl_setopt($hander,CURLOPT_RETURNTRANSFER,false);//以数据流的方式返回数据,当为false是直接显示出来
    curl_setopt($hander, CURLOPT_TIMEOUT, 60);
    curl_exec($hander);
    curl_close($hander);
    fclose($fp);
    return true;
}
getImg("https://1.jpg", "image.jpg");
Example #9
0
<?php

include 'include/config.php';
include 'include/db.php';
dbconnect();
include 'include/checklogin.php';
$id = $_GET['id'];
$shell = getImg($_COOKIE['user_id'], $id);
$json = json_decode($shell);
echo '<b>OUTPUT</b><p>';
echo '<pre>' . $json->{'output'} . '</pre>';
echo '<p><b>ERROR</b><p>';
echo '<pre>' . $json->{'error'} . '</pre>';
dbclose();
Example #10
0
  <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  <script src=
    'bower_components/jakobmattsson-jquery-elastic/jquery.elastic.source.js'>
  </script>

  <!--Store some js global var -->
  <script>
    /* GLOBAL VARIABLES */
    firstname = "<?php 
echo $_SESSION['name'];
?>
";
    lastname =  "<?php 
echo $_SESSION['surname'];
?>
";
    userId = "<?php 
echo $_SESSION['id'];
?>
";
    img = "<?php 
echo getImg();
?>
";
  </script>

  <script src="js/myjs.js"></script>
</body>
</html> 

Example #11
0
        $ret = $value->nodeValue;
    }
    return $ret;
}
function getDetails($result)
{
    $html = new DOMDocument();
    $html->loadHTML($result);
    $xpath = new DOMXPath($html);
    $details = $xpath->query("//div[@class='detailssubbox']");
    $i = 0;
    $ret = "";
    foreach ($details as $value) {
        $i++;
        if ($i == 3) {
            $ret = $value->nodeValue;
        }
    }
    return $ret;
}
$title = getTitle($result);
$img = getImg($result, $title[0]);
$MRP = getMRP($result);
$offer = getOfferPrice($result);
$features = getFeatures($result);
$details = getDetails($result);
$myfile = fopen("results.txt", "w") or die("Unable to open file!");
$write = $img . "~" . $title . "~" . $MRP . "~" . $offer . "~" . $features . "~" . $details;
echo $write;
fwrite($myfile, $write);
fclose($myfile);
Example #12
0
<?php 
genSelect('State', 'state', 'state', $stateOptions, 'SelectEllipsis', true);
?>

<div class="form-group" id="countyWrapper">
        <label class="col-sm-2 control-label"><?php 
echo getTxt('County');
?>
</label>
        <div class="col-sm-10">
        <div id="county_drop_down"><select class="form-control" id="county" name="county"><option value=""><?php 
echo getTxt('CountyEllipsis');
?>
</option></select>*</div>
	 <span id="loading_county_drop_down"><img src="<?php 
echo getImg('loader.gif');
?>
" width="16" height="16" align="absmiddle">&nbsp;<?php 
echo getTxt('SelectstateElipsis');
?>
</span>
	 <div id="no_county_drop_down"><?php 
echo getTxt('StateNoCounties');
?>
</div>
        </div> 
</div> 
<?php 
genSelectH('VerticalDatum', 'VerticalDatum', 'VerticalDatum', $vdOptions, getTxt('VerticalDatumInfo'), 'SelectEllipsis', true);
genSelectH('SpatialReference', 'LatLongDatumID', 'LatLongDatumID', $srOptions, getTxt('SpatialReferenceInfo'), 'SelectEllipsis', true);
genInputT('Comments', 'com', 'value', false, $extra = "", 'Optional');
Example #13
0
echo 'phpVars.SelectSite="' . getTxt('SelectSite2') . '";';
?>
</script>
<?php 
echo $JS_JQuery;
echo $JS_JQueryUI;
echo $JS_FormValidation;
echo $CSS_JQuery_UI;
echo $JS_Forms;
echo $CSS_JQStyles;
echo $CSS_Main;
?>
<script type="text/javascript">
$(function() {
	$( "#datepicker" ).datepicker({ dateFormat: "yy-mm-dd", constrainInput: false, showOn: "button", buttonImage: "<?php 
echo getImg('calendar.gif');
?>
", buttonImageOnly: true, monthNames: [<?php 
echo "'" . getTxt('Jan') . "'";
?>
, <?php 
echo "'" . getTxt('Feb') . "'";
?>
, <?php 
echo "'" . getTxt('Mar') . "'";
?>
, <?php 
echo "'" . getTxt('Apr') . "'";
?>
, <?php 
echo "'" . getTxt('May') . "'";
Example #14
0
<?php

include "InsCrawl.php";
$t = array("1.jpg");
//$t = array();
for ($i = 0; $i < count($t); $i++) {
    getImg($t[$i], "Dff/imageDff" . $i . ".jpg");
    echo $t[$i];
    echo "<br/>";
}
Example #15
0
function getAllImg($argv, $c)
{
    $tmp = array();
    $allimgtmp = array();
    $j = 0;
    while ($c < count($argv) - 1) {
        if (preg_match("/^https?:\\/\\//", $argv[$c], $k) == FALSE) {
            if (!file_exists($argv[$c])) {
                echo "imagepanel: {$argv[$c]} No such file or directory\n";
            } else {
                if (is_dir($argv[$c])) {
                    echo "imagepanel: {$argv[$c]}: Is a directory\n";
                } else {
                    if (!is_readable($argv[$c])) {
                        echo "imagepanel: {$argv[$c]}: Permission denied\n";
                    } else {
                        if (($file = fopen($argv[$c], "r")) === FALSE) {
                            echo "imagepanel: {$argv[$c]}: Cannot open file\n";
                        } else {
                            $tmp = getImg($argv[$c], 0);
                        }
                    }
                }
            }
            $i = 0;
            while (isset($tmp[$i])) {
                $allimgtmp[$j] = $tmp[$i];
                $j++;
                $i++;
            }
        } else {
            if (verif_url($argv[$c]) == false) {
                echo "imagepanel: {$argv[$c]}: An error occured.\n";
            } else {
                $tmp = getImg($argv[$c], 1);
                $i = 0;
                while (isset($tmp[$i])) {
                    $allimgtmp[$j] = $tmp[$i];
                    $j++;
                    $i++;
                }
            }
        }
        $c++;
    }
    return $allimgtmp;
}
Example #16
0
<?php

include 'include/config.php';
include 'include/db.php';
dbconnect();
include 'include/checklogin.php';
$id = $_GET['id'];
$data = $_GET['data'];
$image = getImg($_COOKIE['user_id'], $id);
$filename = getFilename($_COOKIE['user_id'], $id);
$file_extension = strtolower(substr(strrchr($filename, "."), 1));
$ctype = "";
switch ($file_extension) {
    case "gif":
        $ctype = "image/gif";
        break;
    case "png":
        $ctype = "image/png";
        break;
    case "jpeg":
    case "jpg":
        $ctype = "image/jpg";
        break;
    case "GIF":
        $ctype = "image/gif";
        break;
    case "PNG":
        $ctype = "image/png";
        break;
    case "JPEG":
    case "JPG":
Example #17
0
 $prefix = $cg->dbprefix;
 $query = "SELECT * FROM " . $cg->dbprefix . "k2_categories WHERE alias='" . $folder . "'";
 //   var_dump($query);
 $category = mysqli_fetch_assoc(mysqli_query($con, $query));
 $id = $category["id"];
 $name = $category["name"];
 var_dump($id);
 $date = date("Y-m-d H:i");
 $createTagQuery = createTag($prefix, $folder);
 var_dump(mysqli_query($con, $createTagQuery));
 $src = $imgDir . $folder;
 foreach ($images as $key => $value) {
     $img = $src . '/' . $value;
     echo "{$img}";
     echo "<p>";
     $image = getImg($img);
     $rgbs = rgb($image);
     $avgRgbs = averageRgb($image, $rgbs);
     $hue = getHSL($avgRgbs);
     var_dump($hue);
     $color = markColor($hue);
     echo "{$color}";
     echo '<div style="width:300px; height:300px; background-color: ' . $color . ';"></div>';
     echo '<img src="../../images/fabrics/' . $folder . '/' . $value . '">';
     var_dump($value);
     echo "</p>";
     # code...
     $itemTitle = $name . "-" . $key;
     $itemAlias = $folder . "-" . $key;
     $extraField = '[{"id":"4","value":"\\/images\\/fabrics\\/' . $folder . '\\/' . $value . '"}, {"id":"9","value":"' . $color . '"}]';
     $query = "  INSERT INTO " . $cg->dbprefix . "k2_items (`title`, `alias`, `catid`, `published`, `created`, `extra_fields`, `access`, `publish_up`)\n                  VALUES ('" . $itemTitle . "', '" . $itemAlias . "', '" . $id . "', '1', '" . $date . "', '" . $extraField . "', '1', '" . $date . "')";
Example #18
0
?>
" />'){
		$("#checkStatus").html(1);
	}
	else
	{
		$("#checkStatus").html(0);
	}
    });
});
$("#lastname").blur(function (e){
	var username = $("#username").val();
    $.post(base_url+"user/checkUname",{ username :username}, function(data){
    $("#user-result").html(data);
	if(data == '<img src="<?php 
echo getImg('not-available.png');
?>
" />'){
	$("#checkStatus").html(1);
	}
	else
	{
		$("#checkStatus").html(0);
	}
    });
});
$("#newuser").submit(function(e){ //NEED TO FIX TO ACCESS ONLY THE MAIN FORM.
if(($("#firstname").val())==""){
		alert("Please enter your First Name");
		return false;
	}
Example #19
0
function getTopBanner()
{
    if (!defined('BASEURL2')) {
        define('BASEURL2', "");
    }
    $name = 'topBanner' . substr(BASEURL2, 0, -1);
    //Check uploads directory for topBanner
    $topBanner = "";
    $extensions = array('.gif', '.jpg', '.png', '.jpeg');
    foreach ($extensions as $extension) {
        if (file_exists(FCPATH . "uploads/" . $name . $extension)) {
            $topBanner = base_url() . "uploads/" . $name . $extension;
        }
    }
    if ($topBanner == "") {
        $topBanner = getImg("WebClientBanner.png");
    }
    return '<img src="' . $topBanner . '" alt="logo" class="img"  style="max-width:auto; max-height:120px;"/>';
}
Example #20
0
 * Create Date:2015-8-23
 */
function getImg($content)
{
    include './simple_html_dom.php';
    $html = new simple_html_dom();
    $html->load($content);
    foreach ($html->find('.ide_code_image') as $img) {
        $img->src = "http://cas.nwpu.edu.cn/cas/" . $img->src;
        return $img->src;
    }
}
//构造HTTP请求头
$n2 = rand(202, 239);
$n3 = rand(1, 254);
$n4 = rand(1, 254);
$ip = "42." . $n2 . "." . $n3 . "." . $n4;
$header = array("Host:cas.nwpu.edu.cn", "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Encoding:gzip, deflate, sdch", "Accept-Language:zh-CN,zh;q=0.8,en;q=0.6", "Connection:keep-alive", "User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36", "CLIENT-IP:{$ip}", "X-FORWARDED-FOR:{$ip}");
//获取Cookie
$cookie = tempnam("./temp", "cookie");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://cas.nwpu.edu.cn/cas/login?service=http%3A%2F%2Fportal.nwpu.edu.cn%2Fdcp%2Findex.jsp");
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$content = curl_exec($ch);
curl_close($ch);
$src = getImg($content);
$html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n\t<title>学分绩测试</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n\t<script src=\"js/js.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n</head>\n<body>\n\t<div id=\"main\">\n\t\t<p>学号:<input type=\"text\" name=\"user\" value=\"2013301930\" /></p>\n\t\t<p>密码:<input type=\"password\" name=\"pwd\" value=\"OIERZZ.\" /></p>\n\t\t<p>验证码:<input type=\"text\" name\"capt\" value=\"\"><img src=\"{$src}\" alt=\"卧槽没找到\" /></p>\n\t\t<input type=\"hidden\" value=\"{$cookie}\" />\n\t\t<button type=\"button\" onclick=\"getGrade()\" >\n\t\t获取学分绩</button>\n\t</div>\n</body>\n</html>";
echo $html;
Example #21
0
<?php

function getImg($url = "", $filename = "")
{
    $ch = curl_init();
    $fp = fopen($filename, 'wb');
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_exec($ch);
    curl_close($ch);
    fclose($fp);
    return $filename;
}
getImg("http://chart2.finance.china.cn/stock/kline_d.php?code=sz002134", "./img2.png");
Example #22
0
 $props = $data['data']['props'];
 if ($props) {
     $goods_props = '';
     foreach ($props as $p) {
         $goods_props .= "<p>{$p['name']}:{$p['value']}</p>";
     }
     $content = $goods_props . $content;
 }
 if ($data['data']['itemInfoModel']['picsPath']) {
     $imgArr = array();
     foreach ($data['data']['itemInfoModel']['picsPath'] as $k => $img) {
         if ($k >= $num) {
             break;
         }
         //$imgArr[$k] = str_replace("../",ROOT_PATH,getImg($img));
         $imgArr[$k] = getImg($img);
     }
 }
 if ($iscomment) {
     $userNumId = $data['data']['seller']['userNumId'];
     $comment_list = getEvalution($userNumId, $id, $cnum);
 }
 //}
 if ($_GET['do'] == 1) {
     if ($istitle == 1) {
         $uptitle = ",goods_name='{$goods_name}'";
     }
     $db->query("update {$ecs->table('goods')} set \r\n\t\t\t\tgoods_desc='{$content}',goods_thumb='{$imgArr[0]['thumb']}',goods_img='{$imgArr[0]['goods']}',original_img='{$imgArr[0]['source']}'{$uptitle} \r\n\t\t\t\twhere goods_id={$gid}");
     foreach ($imgArr as $v) {
         $db->query("insert into {$ecs->table('goods_gallery')} (goods_id,img_url,thumb_url,img_original) value ({$gid},'{$v[goods]}','{$v[thumb]}','{$v[source]}')");
     }
Example #23
0
<?php

include 'include/config.php';
include 'include/db.php';
dbconnect();
include 'include/checklogin.php';
$id = $_GET['id'];
$data = $_GET['data'];
$filename = $_GET['filename'];
$file = getImg($_COOKIE['user_id'], $id);
dbclose();
header('Content-Disposition: attachment;filename="' . $filename . '"');
header('Content-Type: application/force-download');
if ($data == 2) {
    echo $file;
} else {
    echo base64_decode($file);
}
Example #24
0
<?php

include 'getData.php';
$url = 'assets/data/pokedex.json';
$output = get($url);
decode_local_file($output);
$test = getImg("500");
echo $test;
?>

 
Example #25
0
     $hander = curl_init();
     $fp = fopen($filename, 'wb');
     curl_setopt($hander, CURLOPT_URL, $url);
     curl_setopt($hander, CURLOPT_FILE, $fp);
     curl_setopt($hander, CURLOPT_HEADER, 0);
     curl_setopt($hander, CURLOPT_FOLLOWLOCATION, 1);
     curl_setopt($hander, CURLOPT_TIMEOUT, 60);
     curl_exec($hander);
     curl_close($hander);
     fclose($fp);
     return true;
 }
 //下载图片
 $filename = 'qqhead.jpg';
 $url = $_POST['head'];
 getImg($url, $filename);
 if (file_exists('qqhead.jpg')) {
     //头像下载回来继续处理
     $b = imagettfbbox(14, 0, "upload/fangzheng.ttf", $_POST['nickname']);
     //文字宽度
     $w = abs($b[2] - $b[0]);
     $t = new ThumbHandler();
     $t->setSrcImg("images/show.jpg");
     $t->setDstImg("out.jpg");
     $t->setMaskImg("qqhead.jpg");
     $t->setMaskOffsetX(($t->src_w + $w) / 2 + 20);
     $t->setMaskOffsetY($t->src_h - 150);
     $t->setMaskImgPct(100);
     $t->createImg(100);
     // 指定缩放比例
     // 第二个水印 名字
Example #26
0
 * @package doo.diagnostic
 * @since 1.3
 */
/**
 * Provides the framework a debugging view functionalities for viewing errors, call stack, context and exceptions.
 *
 * @author Leng Sheng Hong <*****@*****.**>
 * @version $Id: debug.php 1000 2009-10-11 18:27:22
 * @package doo.diagnostic
 * @since 1.3
 */
ini_set('html_errors', 0);
set_error_handler('setErrorHandler');
set_exception_handler('setExceptionHandler');
register_shutdown_function('shutdown');
getImg();
function getImg()
{
    if (isset($_GET['doodiagnostic_pic']) && file_exists(Doo::conf()->BASE_PATH . 'diagnostic/assets/' . $_GET['doodiagnostic_pic'])) {
        header('Content-Type: image/png');
        header('Content-Length: ' . filesize(Doo::conf()->BASE_PATH . 'diagnostic/assets/' . $_GET['doodiagnostic_pic']));
        ob_clean();
        readfile(Doo::conf()->BASE_PATH . 'diagnostic/assets/' . $_GET['doodiagnostic_pic']);
        exit;
    }
}
function setExceptionHandler($e)
{
    //echo 'Uncaught '.get_class($e).', code: ' . $e->getCode() . "<br />Message: " . htmlentities($e->getMessage());
    Doo::loadHelper('DooTextHelper');
    $err = printVar($e);
Example #27
0
	<?php 
}
?>
    <?php 
if ($multi) {
    ?>
    <p><?php 
    echo getTxt('congratsMultiple') . "<a href='" . base_url('index.php/default/home/installation') . "'>Click Here</a>.";
    ?>
</p>
    <?php 
}
?>
</div>
<div class="col-md-3"><img src="<?php 
echo getImg('homepage_shot.jpg');
?>
" class="img-responsive" alt="site picture"/></div>
<?php 
HTML_Render_Body_End();
?>
<script type="text/javascript">

//Validate username and password
$("form").submit(function(){
	if(($("#username").val())==""){
	alert("Please enter a username!");
	return false;
	}

	if(($("#password").val())==""){