- if($special == 1) {
- $query_1 = $db['source']->query("SELECT * FROM {$source_tablepre}polls WHERE tid='$tid'");
- $pollresult = $db['source']->fetch_array($query_1);
- $tPolls = unserialize($pollresult['voteopts']);
- if(isset($tPolls['options'])) {
- $timelimit = $pollresult['timelimit'];
- $visible = $pollresult['previewable'];
- $multiple = $tPolls['multiple'][0]; //貌似这个地方有问题
- $maxchoices = $tPolls['multiple'][1];//貌似这个地方有问题
- $expiration = $timelimit ? ($timelimit * 86400 + $dateline) : 0;
- $db['discuz']->query("INSERT INTO {$discuz_tablepre}polls (tid, multiple, visible, maxchoices, expiration) VALUES('$tid', '$multiple', '$visible', '$maxchoices', '$expiration');");
- foreach ($tPolls['options'] AS $key => $pollopts) {
- $polloption = daddslashes($pollopts[0]);
- $voterids = $comma = '';
- if(is_array($pollopts[2])) {
- foreach($pollopts[2] AS $username) {
- $username = daddslashes($username);
- if($uid = getuid($username)) {
- $voterids .= $comma.$uid;
- $comma = "\t";
- }
- }
- }
- $votes = $pollopts[1];
- $db['discuz']->query("INSERT INTO {$discuz_tablepre}polloptions (tid, votes, polloption, voterids) VALUES('$tid', '$votes', '$polloption', '$voterids');");
- }
- } else {
- $special = 0;
- }
- }
复制代码 |