コード例 #1
0
ファイル: video_youtube.php プロジェクト: robocon/iopr
     //echo "duration : ". $json->data->duration ."<br>";
     //echo "Author : ". $json->data->uploader ."<br>";
     //echo "description : ". utf8_to_tis620($json->data->description) ."<br>";
     //echo "published : ". $json->data->published."<br>";
     $x = preg_replace("/T/i", " ", $json->data->uploaded);
     $y = substr($x, 0, 19);
     $times = strtotime($y);
     //$date=date('Y-m-d H:i:s',$times);
     if (ISO == 'utf-8') {
         $title = $json->data->title;
         $detail = $json->data->description;
         $posted = $json->data->uploader;
     } else {
         $title = utf8_to_tis620($json->data->title);
         $detail = utf8_to_tis620($json->data->description);
         $posted = utf8_to_tis620($json->data->uploader);
     }
     $db->connectdb(DB_NAME, DB_USERNAME, DB_PASSWORD);
     $db->update_db(TB_VIDEO, array("category" => "" . $_POST['CATEGORY'] . "", "topic" => "" . $title . "", "detail" => "" . $detail . "", "posted" => "" . $posted . "", "post_date" => "" . $times . "", "pic" => "default.jpg", "video" => "" . $newtext . "", "enable_comment" => "" . $ENABLE_COMMENT . "", "youtube" => "1", "times" => "" . $json->data->duration . ""), " id=" . $_GET['id'] . "");
     $db->closedb();
     $ProcessOutput = "<BR><BR>";
     $ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
     $ProcessOutput .= "<FONT COLOR=\"#336600\"><B>" . _ADMIN_VIDEO_YOUTUBE_MESSAGE_EDIT . "</B></FONT><BR><BR>";
     $ProcessOutput .= "<A HREF=\"?name=admin&file=video_youtube\"><B>" . _ADMIN_VIDEO_YOUTUBE_MESSAGE_GOBACK . "</B></A>";
     $ProcessOutput .= "</CENTER>";
     $ProcessOutput .= "<BR><BR>";
 } else {
     //¡Ã³ÕäÁè¼èÒ¹
     $ProcessOutput = $PermissionFalse;
 }
 echo $ProcessOutput;
コード例 #2
0
ファイル: hotnews.php プロジェクト: robocon/iopr
    $titles = $item->getElementsByTagName("title");
    $dates = $item->getElementsByTagName("pubDate");
    $links = $item->getElementsByTagName("link");
    //               echo ($i+1).". ".utf8_to_tis620($titles->item(0)->nodeValue). "";
    //$datex=print "".$dates->item(0)->nodeValue."";
    $word = explode(" ", "" . $dates->item(0)->nodeValue . "");
    //echo "".$word[0]."" ;
    $ThaiTime = "" . $word[3] . "-" . $word[2] . "-" . $word[1] . " " . $word[4] . "";
    $ThaiDate = DateThai($ThaiTime);
    $Time = strtotime($ThaiTime);
    //echo TIMESTAMP."-".$Time;
    if (ISO == 'utf-8') {
        echo " <img src=images/a.gif> <a href='" . $links->item(0)->nodeValue . "' target='_blank' /><b>" . $titles->item(0)->nodeValue . "</b></a>(" . $ThaiDate . ")";
        echo " " . HotNewsIcon(TIMESTAMP, $Time, "images/icon_new.gif") . "";
    } else {
        echo " <img src=images/a.gif> <a href='" . utf8_to_tis620($links->item(0)->nodeValue) . "' target='_blank' /><b>" . utf8_to_tis620($titles->item(0)->nodeValue) . "</b></a>(" . $ThaiDate . ")";
        echo " " . HotNewsIcon(TIMESTAMP, $Time, "images/icon_new.gif") . "";
    }
}
echo "</marquee></TD></TR>";
echo "</table>";
//News Icon
function HotNewsIcon($Ntime = "", $Otime = "", $Icon = "")
{
    if (TIMESTAMP <= $Otime + 3600) {
        echo "<IMG SRC=\"" . $Icon . "\" BORDER=\"0\" ALIGN=\"absmiddle\"> ";
    }
}
function DateThai($strDate)
{
    $strYear = date("Y", strtotime($strDate)) + 543;
コード例 #3
0
ファイル: uploadify.php プロジェクト: robocon/iopr
THE SOFTWARE.
*/
require_once "../../../includes/class.resizepic.php";
require_once "../../../includes/config.in.php";
require_once "../../../includes/class.mysql.php";
require_once "../../../includes/array.in.php";
require_once "../../../includes/class.ban.php";
require_once "../../../includes/class.calendar.php";
require_once "../../../includes/function.in.php";
require_once "../../../setconf.php";
require_once "../../../includes/class.resizepic.php";
require_once 'getid3/getid3.php';
$db = new DB();
if (ISO == 'tis-620') {
    $topic = utf8_to_tis620($_POST['topic']);
    $detail = utf8_to_tis620($_POST['detail']);
} else {
    $topic = $_POST['topic'];
    $detail = $_POST['detail'];
}
if (!empty($_POST['id'])) {
    $res['video'] = $db->select_query("SELECT * FROM " . TB_VIDEO . " where id='" . $_POST['id'] . "' ");
    $arr['video'] = $db->fetch($res['video']);
} else {
    $res['video'] = $db->select_query("SELECT * FROM " . TB_VIDEO . " where topic='" . $topic . "' ");
    $arr['video'] = $db->fetch($res['video']);
}
if ($arr['video']['id']) {
    if (!empty($_FILES['Filedata']['tmp_name'])) {
        if (strchr($_FILES['Filedata']['name'], ".") == ".JPG" || strchr($_FILES['Filedata']['name'], ".") == ".jpg" || strchr($_FILES['Filedata']['name'], ".") == ".GIF" || strchr($_FILES['Filedata']['name'], ".") == ".gift" || strchr($_FILES['Filedata']['name'], ".") == ".PNG" || strchr($_FILES['Filedata']['name'], ".") == ".png") {
            $tempFile = $_FILES['Filedata']['tmp_name'];
コード例 #4
0
ファイル: val_img.php プロジェクト: robocon/iopr
//$targetPath="".WEB_PATH."";
//var $font = '/home/www/htdocs/capcha/monofont.ttf'; //╡├╟и╩═║ path р═з┴╥у╩ш╣╨д├╤║
$_SERVER['DOCUMENT_ROOT'] = dirname(dirname(__FILE__));
$targetPath = $_SERVER['DOCUMENT_ROOT'];
function generateCode($characters)
{
    $possible = '╝╗═╖┴┐╦б┤╩╟з╛├╣┬║┼└╢д╡ивк';
    //		$possible = _CAPTCHA_RAN;
    $code = '';
    $i = 0;
    while ($i < $characters) {
        $code .= substr($possible, mt_rand(0, strlen($possible) - 1), 1);
        $i++;
    }
    return $code;
}
$font = $targetPath . "/capcha/font/angsab.ttf";
$code = generateCode($_GET['characters']);
$im = imagecreate($_GET['width'], $_GET['height']);
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
$new_string = tis620_to_utf8($code);
imagefill($im, 0, 0, $black);
imageTTFText($im, 20, 0, 6, 18, $white, $font, $new_string);
if (ISO == 'utf-8') {
    $_SESSION["security_code"] = $new_string;
} else {
    $_SESSION["security_code"] = utf8_to_tis620($new_string);
}
imagepng($im);
imagedestroy($im);
コード例 #5
0
ファイル: video_youtube2.php プロジェクト: robocon/iopr
                    echo _JAVA_DATA_NULL;
                    ?>
');
													javascript:history.back();
												</script>
												<?php 
                    exit;
                }
                $api_key = 'AIzaSyBfLZQBnJqdgk7b1NsHQbKOA8Qc6q5zoUE';
                $url = "https://www.googleapis.com/youtube/v3/videos?part=snippet&id={$youtube_id}&key={$api_key}";
                $data = file_get_contents($url);
                $json = json_decode($data);
                $youtube = $json->items['0']->snippet;
                $title = utf8_to_tis620($youtube->title);
                $detail = utf8_to_tis620(htmlspecialchars($youtube->description, ENT_QUOTES));
                $posted = utf8_to_tis620($youtube->channelTitle);
                $times = strtotime($youtube->publishedAt);
                $duration = 0;
                $update = $db->update_db("web_video2", array("category" => $category, "topic" => $title, "detail" => $detail, "posted" => $posted, "post_date" => $times, "pic" => "http://img.youtube.com/vi/{$youtube_id}/mqdefault.jpg", "video" => $youtube_id, "enable_comment" => $comment, "youtube" => "1"), " id='{$id}'");
                $ProcessOutput = "<BR><BR>";
                $ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
                $ProcessOutput .= "<FONT COLOR=\"#336600\"><B>" . _ADMIN_VIDEO_YOUTUBE_MESSAGE_EDIT . "</B></FONT><BR><BR>";
                $ProcessOutput .= "<A HREF=\"?name=admin&file=video_youtube2\"><B>" . _ADMIN_VIDEO_YOUTUBE_MESSAGE_GOBACK . "</B></A>";
                $ProcessOutput .= "</CENTER>";
                $ProcessOutput .= "<BR><BR>";
            } else {
                //¡Ã³ÕäÁè¼èÒ¹
                $ProcessOutput = $PermissionFalse;
            }
            echo $ProcessOutput;
        } else {