亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? class_poll.php

?? 具有多種面版可以選擇的"投票程式" 多國語言版
?? PHP
?? 第 1 頁 / 共 2 頁
字號:
<?php
/**
 * ----------------------------------------------
 * Advanced Poll 2.0.3 (PHP)
 * Copyright (c)2001 Chi Kien Uong
 * URL: http://www.proxy2.de
 * ----------------------------------------------
 */

class poll {

    var $pollvars;
    var $poll_view_html;
    var $poll_result_html;
    var $include_path;
    var $form_forward;
    var $template_set;
    var $poll_array;
    var $color_array;
    var $total_votes;
    var $question;
    var $poll_question; 
    var $comments;
    var $ip;

    function poll() {
        global $pollvars, $HTTP_SERVER_VARS;
        
        $this->poll_view_html = array();
    	$this->poll_result_html = array();
    	$this->poll_array = array();
    	$this->color_array = array();
    	$this->total_votes = '';
    	$this->question = '';
    	$this->poll_question = array(); 
    	$this->comments = '';
    
        if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']) && eregi("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$",$HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
            $this->ip = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'];
        } else {
            $this->ip = getenv("REMOTE_ADDR");
        }
        $this->pollvars = $pollvars;
        $this->template_set = "default";
        $this->form_forward = basename($HTTP_SERVER_VARS['PHP_SELF']);
        $this->include_path = dirname(dirname(__FILE__));
    }

    function set_template_set($template_set='') {
        if (empty($template_set) || !file_exists("$this->include_path/templates/$template_set/display_foot.html")) {
            $this->template_set = "default";
        } else {
            $this->template_set = $template_set;
        }
        return $this->template_set;
    }
    
    function set_include_path($path) {
        if (!@is_dir($path)) {
            return false;
        }
        $this->include_path = $path;
        return true;
    }

    function set_display_order($order='') {
        switch ($order) {
            case "asc":
                $this->pollvars['result_order'] = "asc";
                break;
            case "desc":
                $this->pollvars['result_order'] = "desc";
                break;
            default:
                $this->pollvars['result_order'] = "";
                return false;
        }
        return true;
    }

    function set_display_result($result='') {
        switch ($result) {
            case "votes":
                $this->pollvars['type'] = "votes";
                break;
            case "percent":
                $this->pollvars['type'] = "percent";
                break;
            default:
                return false;
        }
        return true;
    }

    function set_max_bar_length($max_bar_length='') {
        if ($max_bar_length && $max_bar_length>0) {
            $this->pollvars['img_length'] = $max_bar_length;
            return true;
        } else {
            return false;
        }
    }

    function set_max_bar_height($max_bar_height='') {
        if ($max_bar_height && $max_bar_height>0) {
            $this->pollvars['img_height'] = $max_bar_height;
            return true;
        } else {
            return false;
        }
    }
    
    function get_poll_tpl($tpl) {
        $filename = "$this->include_path/templates/$this->template_set/$tpl.html";
        if (file_exists("$filename")) {
            $fd = fopen ($filename, "r");
            $template = fread ($fd, filesize ($filename));
            fclose ($fd);
            $template = ereg_replace("\"", "\\\"", $template);
            return $template;
        } else {
            return false;
        }
    }

    function lock_poll_ip($poll_id) {
        $this_time = time();
        if (file_exists("$this->include_path/polldata/$poll_id.ip")) {
            $ip_array = file("$this->include_path/polldata/$poll_id.ip");
            $ip_table = fopen("$this->include_path/polldata/$poll_id.ip","wb");
            flock($ip_table, 2);
            for ($i=0; $i<sizeof($ip_array); $i++) {
                list ($ip_addr, $time_stamp) = split("\\|",$ip_array[$i]);
                if ($this_time < ($time_stamp+3600*$this->pollvars['lock_timeout'])) {
                    if ($ip_addr == $this->ip) {
                        continue;
                    }
                    fwrite($ip_table,"$ip_addr|$time_stamp");
                }
            }
            fwrite($ip_table,"$this->ip|$this_time\n");
            flock($ip_table, 3);
            fclose($ip_table);
        } else {
            $ip_table = fopen("$this->include_path/polldata/$poll_id.ip","wb");
            fwrite($ip_table,"$this->ip|$this_time\n");
            fclose($ip_table);
        }
    }

    function log_vote($poll_id) {
        $this_time = date("j-M-Y H:i",time());
        $host = @gethostbyaddr($this->ip);
        $agent = @getenv("HTTP_USER_AGENT");
        $log_table = fopen("$this->include_path/polldata/$poll_id.log","a");
        flock($log_table, 2);
        fwrite($log_table,"$this_time|$this->ip|$host|$agent\n");
        flock($log_table, 3);
        fclose($log_table);
    }

    function get_poll_data($poll_id) {
        $this->total_votes=0;
        if (file_exists("$this->include_path/polldata/$poll_id")) {
            $line = file("$this->include_path/polldata/$poll_id");
            if (ereg(".*\\|[0-9]+\\|[0-9]+\\|[0-9]{1}\\|[0-9]{1}\\|[0-9]{1}\\|[0-9]{1}",$line[0])) {
                list($question,$timestamp,$exp_time,$expire,$logging,$status,$comments) = split("\\|",$line[0]);
                $this->question = $question;
                $this->comments = chop($comments);
                $this->poll_array = '';
                $this->color_array = '';
                for ($i=1; $i<sizeof($line); $i++) {
                    list($name,$vote,$gif_color) = split("\\|",$line[$i]);
                    $this->poll_array[$name] = $vote;
                    $this->color_array[$name] = chop($gif_color);
                    $this->total_votes += $vote;
                }
                for (reset($this->poll_array),$this->maxvote=0; $key=key($this->poll_array); next($this->poll_array)) {
                    $this->maxvote = ($this->poll_array[$key]>$this->maxvote) ? $this->poll_array[$key] : $this->maxvote;
                }
                return true;
            }
        } else {
            return false;
        }
    }

    function get_poll_stat($poll_id) {
        $line = file("$this->include_path/polldata/$poll_id");
        list($question,$timestamp,$exp_time,$expire,$logging,$status,$comments) = split("\\|",$line[0]);
        $comments = chop($comments);
        return (sizeof($line)>0) ? array(
            "question"  => "$question",
            "timestamp" => "$timestamp",
            "exp_time"  => "$exp_time",
            "expire"    => "$expire",
            "logging"   => "$logging",
            "status"    => "$status",
            "comments"  => "$comments"
        ) : false;
    }

    function get_poll_list() {
        $hnd = opendir("$this->include_path/polldata");
        while ($file = readdir($hnd)) {
            if (eregi("([0-9]+$)", $file)) {
                $poll_list[] = $file;
            }
        }
        closedir($hnd);
        if (isset($poll_list)) {
            usort($poll_list,"rsort_poll");
            for ($i=0; $i<sizeof($poll_list); $i++) {
                $line = file("$this->include_path/polldata/$poll_list[$i]");
                list($question,$timestamp,$exp_time,$expire,$logging,$status,$comments) = split("\\|",$line[0]);
                if ($status==0 || $status==1) {
                    if (eregi("([0-9]+$)", $poll_list[$i], $regs)) {
                        $available_polls[] = $regs[1];
                    }
                }
            }
        }
        return (isset($available_polls)) ? $available_polls : false ;
    }

    function update_poll($poll_id,$option_id) {
        if (get_magic_quotes_gpc()) {
            $option_id = stripslashes($option_id);
        }
        if ($this->pollvars['check_ip'] == 2) {
            $this->lock_poll_ip($poll_id);
        }
        $stat_array = $this->get_poll_stat($poll_id);
        if ($stat_array['logging'] == 1) {
            $this->log_vote($poll_id);
        }
        $line = file("$this->include_path/polldata/$poll_id");
        $count_dat = fopen("$this->include_path/polldata/$poll_id","w");
        flock($count_dat, 2);
        $line[0] = chop($line[0]);
        fwrite($count_dat,"$line[0]\n");
        for ($i=1; $i<sizeof($line); $i++) {
            list($name,$vote,$gif_color) = split("\\|",$line[$i]);
            if ($name == $option_id) {
                $vote += 1;
            }
            $gif_color = chop($gif_color);
            fwrite($count_dat,"$name|$vote|$gif_color\n");
        }
        flock($count_dat, 3);
        fclose($count_dat);
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费看黄色91| 欧美色手机在线观看| 色综合av在线| 日韩精品一区二区三区在线播放| 国产精品你懂的| 免费在线看一区| 在线一区二区观看| 国产欧美精品一区| 蜜桃久久精品一区二区| 91美女在线视频| 国产午夜精品福利| 久久精品99久久久| 在线电影欧美成精品| 一区二区三区高清不卡| 成人av在线网| 国产丝袜美腿一区二区三区| 日本亚洲一区二区| 欧美日韩一区二区在线观看视频| 国产精品视频看| 国产乱子伦视频一区二区三区| 91精品国产入口在线| 亚洲一区二区三区小说| 色噜噜狠狠成人中文综合| 国产亚洲一区二区三区| 国产在线看一区| 日韩精品一区二区在线| 久久精品99国产精品| 91精品国产综合久久久久| 亚洲第一av色| 欧美撒尿777hd撒尿| 亚洲精品欧美综合四区| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品久久二区二区| 99精品视频在线播放观看| 中文字幕日韩欧美一区二区三区| 成人高清视频在线观看| 国产精品美女久久久久久久久 | 91国产免费看| 一区二区三区中文字幕| 欧美亚洲动漫制服丝袜| 亚洲国产va精品久久久不卡综合| 在线精品国精品国产尤物884a | www国产精品av| 九一九一国产精品| 亚洲视频资源在线| 97久久精品人人澡人人爽| 亚洲欧美一区二区三区国产精品 | 成人国产精品视频| 亚洲少妇中出一区| 欧美性videosxxxxx| 午夜在线成人av| 欧美成人一级视频| 国产成人在线观看| 亚洲美女在线一区| 欧美久久一二三四区| 美女视频第一区二区三区免费观看网站| 日韩一级二级三级| 国产毛片精品视频| 亚洲精品视频免费看| 在线91免费看| 国产一区二区电影| 一区二区三区日韩精品视频| 在线成人午夜影院| 国产乱码字幕精品高清av| 自拍av一区二区三区| 8v天堂国产在线一区二区| 国产成人综合亚洲91猫咪| 亚洲日本在线a| 日韩一区二区三区视频| 成人av资源在线| 男人的天堂亚洲一区| 国产精品私人自拍| 4438x成人网最大色成网站| 高清日韩电视剧大全免费| 亚洲大尺度视频在线观看| 国产色爱av资源综合区| 精品污污网站免费看| 国产99久久精品| 午夜精品福利久久久| 国产女同互慰高潮91漫画| 欧美区一区二区三区| 成人免费黄色大片| 久久99精品久久久久久动态图| 中文字幕日韩一区| 日韩欧美二区三区| 在线视频观看一区| 国产不卡在线播放| 天天色天天操综合| 亚洲欧美综合色| 国产夜色精品一区二区av| 欧美嫩在线观看| 色一情一乱一乱一91av| 国产成人在线网站| 久久av资源站| 亚洲国产精品一区二区www在线| 久久久久久久久伊人| 欧美精品免费视频| 在线视频你懂得一区二区三区| 成人精品视频一区| 国产精品一区久久久久| 蜜臀精品久久久久久蜜臀| 亚洲午夜久久久久| 一区二区在线电影| 亚洲色图色小说| 亚洲品质自拍视频网站| 国产精品色呦呦| 亚洲国产精品久久久久秋霞影院| 国产精品午夜免费| 中文字幕欧美区| 国产日本亚洲高清| 久久精品一二三| 久久这里都是精品| 久久综合九色综合欧美98| 精品日韩欧美一区二区| 91精品国产色综合久久不卡电影| 欧美日本一区二区| 在线成人免费观看| 欧美一区二区三区在线| 日韩一级免费一区| 精品国产三级电影在线观看| 欧美xfplay| 久久久国产综合精品女国产盗摄| 久久综合国产精品| 国产精品无人区| 伊人开心综合网| 午夜av一区二区| 蜜桃av噜噜一区二区三区小说| 免播放器亚洲一区| 国产一区二区日韩精品| 高清av一区二区| 972aa.com艺术欧美| 欧洲中文字幕精品| 7777精品伊人久久久大香线蕉的 | 国产精品一色哟哟哟| 成人午夜电影久久影院| jlzzjlzz国产精品久久| 91国产福利在线| 精品区一区二区| 国产亚洲精品久| 一区二区三区国产精华| 青青国产91久久久久久| 国产suv精品一区二区三区| 99久久精品一区二区| 日本一区二区视频在线观看| 亚洲人成伊人成综合网小说| 亚洲成人av一区| 精品无码三级在线观看视频| www.欧美日韩| 欧美精品久久99久久在免费线| 久久伊99综合婷婷久久伊| 一区视频在线播放| 日日噜噜夜夜狠狠视频欧美人| 九九九久久久精品| 色噜噜狠狠成人中文综合| 日韩欧美视频在线| 亚洲欧美另类在线| 久久成人久久鬼色| 91欧美一区二区| 亚洲精品在线三区| 亚洲自拍偷拍图区| 国产福利精品一区| 884aa四虎影成人精品一区| 欧美激情一区二区在线| 日韩在线一二三区| 91首页免费视频| 久久久久亚洲综合| 无吗不卡中文字幕| 91网址在线看| 久久新电视剧免费观看| 天堂久久一区二区三区| 99久久精品久久久久久清纯| 欧美一区二区三区在线电影 | 亚洲精品伦理在线| 国产一区二区三区四| 欧美日本在线视频| 亚洲人妖av一区二区| 国产综合色精品一区二区三区| 欧美日本乱大交xxxxx| ●精品国产综合乱码久久久久 | 欧美电视剧免费全集观看| 亚洲卡通动漫在线| www.亚洲在线| 久久综合久久综合九色| 日本午夜精品视频在线观看 | 日本不卡在线视频| 在线亚洲+欧美+日本专区| 中文字幕在线免费不卡| 国产高清精品网站| 亚洲精品一区二区在线观看| 日韩制服丝袜先锋影音| 欧美久久久久久蜜桃| 一区二区国产盗摄色噜噜| 91麻豆免费观看| 136国产福利精品导航| av在线播放成人| 国产精品美日韩| 9色porny自拍视频一区二区| 欧美激情一区二区三区| 成人网在线播放| 日本一区二区电影|