[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/poll_class.php,v $ 14 | $Revision: 1.49 $ 15 | $Date: 2007/01/07 15:24:49 $ 16 | $Author: e107steved $ 17 +----------------------------------------------------------------------------+ 18 */ 19 if (!defined('e107_INIT')) { exit; } 20 21 @include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php"); 22 @include_once(e_PLUGIN."poll/languages/English.php"); 23 define("POLLCLASS", TRUE); 24 define("POLL_MODE_COOKIE", 0); 25 define("POLL_MODE_IP", 1); 26 define("POLL_MODE_USERID", 2); 27 28 class poll 29 { 30 31 var $pollRow; 32 var $pollmode; 33 34 function delete_poll($existing) 35 { 36 global $sql; 37 if ($sql -> db_Delete("polls", " poll_id='".intval($existing)."' ")) 38 { 39 if(function_exists("admin_purge_related")) 40 { 41 admin_purge_related("poll", $existing); 42 } 43 return "Poll deleted."; 44 } 45 } 46 47 function submit_poll($mode=1) 48 { 49 50 /* 51 $mode = 1 :: poll is main poll 52 $mode = 2 :: poll is forum poll 53 */ 54 55 global $tp, $sql; 56 extract($_POST); 57 58 $poll_title = $tp->toDB($poll_title); 59 $active_start = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear'])); 60 $active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); 61 $poll_options = ""; 62 63 foreach($poll_option as $key => $value) 64 { 65 $poll_options .= $tp->toDB($poll_option[$key]).chr(1); 66 } 67 68 if(POLLACTION == "edit") 69 { 70 $sql -> db_Update("polls", "poll_title='$poll_title', poll_options='$poll_options', poll_type=$mode, poll_comment='".$tp -> toDB($poll_comment)."', poll_allow_multiple=".intval($multipleChoice).", poll_result_type=".intval($showResults).", poll_vote_userclass=".intval($pollUserclass).", poll_storage_method=".intval($storageMethod)." WHERE poll_id=".intval(POLLID)); 71 72 /* update poll results - bugtracker #1124 .... */ 73 $sql -> db_Select("polls", "poll_votes", "poll_id='".intval(POLLID)."' "); 74 $foo = $sql -> db_Fetch(); 75 $voteA = explode(chr(1), $foo['poll_votes']); 76 77 $opt = count($poll_option) - count($voteA); 78 79 if($opt) 80 { 81 for($a=0; $a<=$opt; $a++) 82 { 83 $foo['poll_votes'] .= "0".chr(1); 84 } 85 $sql -> db_Update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' "); 86 } 87 88 $message = POLLAN_45; 89 } else { 90 91 $votes = ""; 92 for($a=1; $a<=count($_POST['poll_option']); $a++) 93 { 94 $votes .= "0".chr(1); 95 } 96 97 if($mode == 1) 98 { 99 /* deactivate other polls */ 100 if($sql -> db_Select("polls", "*", "poll_type=1 AND poll_vote_userclass!=255")) 101 { 102 $deacArray = $sql -> db_getList(); 103 foreach($deacArray as $deacpoll) 104 { 105 $sql -> db_Update("polls", "poll_end_datestamp='".time()."', poll_vote_userclass='255' WHERE poll_id=".$deacpoll['poll_id']); 106 } 107 } 108 $sql -> db_Insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '$poll_title', '$poll_options', '$votes', '', '1', '".$tp -> toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'"); 109 } 110 else 111 { 112 $sql -> db_Insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '".intval($storageMethod)."'"); 113 } 114 } 115 return $message; 116 } 117 118 119 function get_poll($query) 120 { 121 global $sql, $e107; 122 if ($sql->db_Select_gen($query)) 123 { 124 $pollArray = $sql -> db_Fetch(); 125 126 if (!check_class($pollArray['poll_vote_userclass'])) 127 { 128 $POLLMODE = "disallowed"; 129 } 130 else 131 { 132 133 switch($pollArray['poll_storage_method']) 134 { 135 case POLL_MODE_COOKIE: 136 $userid = ""; 137 $cookiename = "poll_".$pollArray['poll_id']; 138 if(isset($_COOKIE[$cookiename])) 139 { 140 $POLLMODE = "voted"; 141 } 142 else 143 { 144 $POLLMODE = "notvoted"; 145 } 146 break; 147 148 case POLL_MODE_IP: 149 $userid = $e107->getip(); 150 $voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1)); 151 if (in_array($userid, $voted_ids)) 152 { 153 $POLLMODE = "voted"; 154 } 155 else 156 { 157 $POLLMODE = "notvoted"; 158 } 159 break; 160 161 case POLL_MODE_USERID: 162 if(!USER) 163 { 164 $POLLMODE = "disallowed"; 165 } 166 else 167 { 168 $userid = USERID; 169 $voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1)); 170 if (in_array($userid, $voted_ids)) 171 { 172 $POLLMODE = "voted"; 173 } 174 else 175 { 176 $POLLMODE = "notvoted"; 177 } 178 } 179 break; 180 } 181 } 182 } 183 if(isset($_POST['pollvote']) && $POLLMODE == "notvoted" && ($POLLMODE != "disallowed")) 184 { 185 if ($_POST['votea']) 186 { 187 // $sql -> db_Select("polls", "*", "poll_vote_userclass!=255 AND poll_type=1 ORDER BY poll_datestamp DESC LIMIT 0,1"); 188 $row = $pollArray; 189 extract($row); 190 $votes = explode(chr(1), $poll_votes); 191 if(is_array($_POST['votea'])) 192 { 193 /* multiple choice vote */ 194 foreach($_POST['votea'] as $vote) 195 { 196 $vote = intval($vote); 197 $votes[($vote-1)] ++; 198 } 199 } 200 else 201 { 202 $votes[($_POST['votea']-1)] ++; 203 } 204 $optionArray = explode(chr(1), $pollArray['poll_options']); 205 $optionArray = array_slice($optionArray, 0, -1); 206 foreach($optionArray as $k=>$v) 207 { 208 if(!$votes[$k]) 209 { 210 $votes[$k] = 0; 211 } 212 } 213 $votep = implode(chr(1), $votes); 214 $pollArray['poll_votes'] = $votep; 215 216 $sql->db_Update("polls", "poll_votes = '$votep', poll_ip='".$poll_ip.$userid."^' WHERE poll_id=".$poll_id); 217 echo " 218 <script type='text/javascript'> 219 <!-- 220 setcook({$poll_id}); 221 //--> 222 </script> 223 "; 224 $POLLMODE = "voted"; 225 226 } 227 } 228 $this->pollRow = $pollArray; 229 $this->pollmode = $POLLMODE; 230 } 231 232 233 function render_poll($pollArray = "", $type = "menu", $POLLMODE = "", $returnMethod=FALSE) 234 { 235 global $POLLSTYLE, $sql, $tp, $ns; 236 if($POLLMODE == "query") 237 { 238 $this->get_poll($pollArray); 239 $pollArray = $this->pollRow; 240 $POLLMODE = $this->pollmode; 241 } 242 243 $barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png"); 244 $barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png"); 245 $bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png"); 246 247 if($type == "preview") 248 { 249 /* load lan file */ 250 @include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php"); 251 @include_once(e_PLUGIN."poll/languages/English.php"); 252 $optionArray = $pollArray['poll_option']; 253 $voteArray = array(); 254 $voteArray = array_pad($voteArray, count($optionArray), 0); 255 $pollArray['poll_allow_multiple'] = $pollArray['multipleChoice']; 256 } 257 else if($type == "forum") 258 { 259 @include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php"); 260 @include_once(e_PLUGIN."poll/languages/English.php"); 261 if(isset($_POST['fpreview'])) 262 { 263 $pollArray['poll_allow_multiple'] = $pollArray['multipleChoice']; 264 $optionArray = $pollArray['poll_option']; 265 } 266 else 267 { 268 $optionArray = explode(chr(1), $pollArray['poll_options']); 269 $optionArray = array_slice($optionArray, 0, -1); 270 } 271 $voteArray = explode(chr(1), $pollArray['poll_votes']); 272 // $voteArray = array_slice($voteArray, 0, -1); 273 } 274 else 275 { 276 $optionArray = explode(chr(1), $pollArray['poll_options']); 277 $optionArray = array_slice($optionArray, 0, -1); 278 $voteArray = explode(chr(1), $pollArray['poll_votes']); 279 // $voteArray = array_slice($voteArray, 0, -1); 280 } 281 282 $voteTotal = array_sum($voteArray); 283 284 $percentage = array(); 285 286 287 if(count($voteArray)) 288 { 289 foreach($voteArray as $votes){ 290 $percentage[] = round(($votes/$voteTotal) * 100, 2); 291 } 292 } 293 /* get template */ 294 if (file_exists(THEME."poll_template.php")) 295 { 296 require(THEME."poll_template.php"); 297 } 298 else if(!isset($POLL_NOTVOTED_START)) 299 { 300 require(e_PLUGIN."poll/templates/poll_template.php"); 301 } 302 303 $preview = FALSE; 304 if ($type == "preview") 305 { 306 $POLLMODE = "notvoted"; 307 } 308 else if($type == "forum") { 309 $preview = TRUE; 310 } 311 312 $comment_total = $sql->db_Select("comments", "*", "comment_item_id='".intval($pollArray['poll_id'])."' AND comment_type=4"); 313 314 $QUESTION = $tp -> toHTML($pollArray['poll_title'], TRUE,"emotes_off, defs"); 315 $VOTE_TOTAL = POLLAN_31.": ".$voteTotal; 316 $COMMENTS = ($pollArray['poll_comment'] ? " <a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_27.": ".$comment_total."</a>" : ""); 317 $OLDPOLLS = ($type == "menu" ? "<a href='".e_PLUGIN."poll/oldpolls.php'>".POLLAN_28."</a>" : ""); 318 $AUTHOR = POLLAN_35." ".($type == "preview" || $type == "forum" ? USERNAME : "<a href='".e_BASE."user.php?id.".$pollArray['poll_admin_id']."'>".$pollArray['user_name']."</a>"); 319 320 switch ($POLLMODE) 321 { 322 case "notvoted": 323 $text = "<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_START : $POLL_NOTVOTED_START)); 324 $count = 1; 325 $alt = 0; // alternate style. 326 foreach($optionArray as $option) { 327 // $MODE = ($mode) ? $mode : ""; /* debug */ 328 $OPTIONBUTTON = ($pollArray['poll_allow_multiple'] ? "<input type='checkbox' name='votea[]' value='$count' />" : "<input type='radio' name='votea' value='$count' />"); 329 $OPTION = $tp->toHTML($option, TRUE); 330 if(isset($POLL_NOTVOTED_LOOP_ALT) && $POLL_NOTVOTED_LOOP_ALT && $type != "forum"){ // alternating style 331 $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($alt == 0 ? $POLL_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP_ALT)); 332 $alt = ($alt ==0) ? 1 : 0; 333 }else{ 334 $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP)); 335 } 336 $count ++; 337 } 338 $SUBMITBUTTON = "<input class='button' type='submit' name='pollvote' value='".POLLAN_30."' />"; 339 if(('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE) 340 { 341 $SUBMITBUTTON = "[".POLLAN_30."]"; 342 } 343 344 $text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n</form>"; 345 break; 346 347 case "voted": 348 349 if($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php")) 350 { 351 $text = "<div style='text-align: center;'><br /><br />".POLLAN_39."<br /><br /><a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />"; 352 353 } 354 else 355 { 356 357 358 $text = preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_START : $POLL_VOTED_START)); 359 $count = 0; 360 foreach($optionArray as $option) 361 { 362 $OPTION = $tp->toHTML($option, TRUE); 363 364 $BAR = ($percentage[$count] ? "<div style='width: 100%'><div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div><div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 90)."%; height: 14px; float: left;'></div><div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div></div>" : ""); 365 366 $PERCENTAGE = $percentage[$count]."%"; 367 $VOTES = POLLAN_31.": ".$voteArray[$count]; 368 $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_LOOP : $POLL_VOTED_LOOP)); 369 $count ++; 370 } 371 } 372 $text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_END : $POLL_VOTED_END)); 373 374 break; 375 376 case "disallowed": 377 $text = preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_START); 378 foreach($optionArray as $option) 379 { 380 $MODE = $mode; /* debug */ 381 $OPTION = $tp->toHTML($option, TRUE); 382 $text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_LOOP); 383 $count ++; 384 } 385 if($pollArray['poll_vote_userclass'] == 253) 386 { 387 $DISALLOWMESSAGE = POLLAN_41; 388 } 389 else if($pollArray['poll_vote_userclass'] == 254) 390 { 391 $DISALLOWMESSAGE = POLLAN_42; 392 } 393 else 394 { 395 $DISALLOWMESSAGE = POLLAN_43; 396 } 397 $text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_END); 398 break; 399 } 400 401 if(!defined("POLLRENDERED")) define("POLLRENDERED", TRUE); 402 $caption = (file_exists(THEME."images/poll_menu.png") ? "<img src='".THEME."images/poll_menu.png' alt='' /> ".POLLAN_MENU_CAPTION : POLLAN_MENU_CAPTION); 403 if($type == "preview") 404 { 405 $caption = POLLAN_23; 406 $text = "<div style='text-align:center; margin-left: auto; margin-right: auto;'>\n<table style='width:350px' class='fborder'>\n<tr>\n<td>\n$text\n</td></tr></table></div>"; 407 } 408 else if($type == "forum") 409 { 410 $caption = LAN_4; 411 } 412 413 414 415 if($returnMethod) 416 { 417 return $text; 418 } 419 else 420 { 421 $ns->tablerender($caption, $text, 'poll'); 422 } 423 } 424 425 426 function renderPollForm($mode="admin") 427 { 428 /* 429 $mode = "admin" :: called from admin_config.php 430 $mode = "forum" :: called from forum_post.php 431 */ 432 global $tp; 433 if($mode == "forum") 434 { 435 $text = "<tr> 436 <td colspan='2' class='nforumcaption2'>".LAN_4."</td> 437 </tr> 438 <tr> 439 <td colspan='2' class='forumheader3'> 440 <span class='smalltext'>".LAN_386."</span> 441 </td> 442 </tr> 443 <tr><td style='width:20%' class='forumheader3'><div class='normaltext'>".LAN_5."</div></td><td style='width:80%'class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm($_POST['poll_title'])."' maxlength='200' /></td></tr>"; 444 445 $option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1); 446 $text .= "<tr> 447 <td style='width:20%' class='forumheader3'>".LAN_391."</td> 448 <td style='width:80%' class='forumheader3'> 449 <div id='pollsection'>"; 450 451 for($count = 1; $count <= $option_count; $count++) 452 { 453 if($count != 1 && $_POST['poll_option'][($count-1)] =="") 454 { 455 break; 456 } 457 $opt = ($count==1) ? "id='pollopt'" : ""; 458 $text .="<span $opt><input class='tbox' type='text' name='poll_option[]' size='40' value=\"".$_POST['poll_option'][($count-1)]."\" maxlength='200' />"; 459 $text .= "</span><br />"; 460 } 461 462 $text .="</div><input class='button' type='button' name='addoption' value='".LAN_6."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br /> 463 </td></tr> 464 465 466 <tr> 467 <td style='width:20%' class='forumheader3'>".POLL_506."</td> 468 <td style='width:80%' class='forumheader3'> 469 <input type='radio' name='multipleChoice' value='1'".($_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLL_507." 470 <input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLL_508." 471 </td> 472 </tr> 473 474 <tr> 475 <td style='width:30%' class='forumheader3'>".POLLAN_16."</td> 476 <td class='forumheader3'> 477 <input type='radio' name='storageMethod' value='0'".(!$_POST['storageMethod'] ? " checked='checked'" : "")." /> ".POLLAN_17."<br /> 478 <input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br /> 479 <input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19." 480 </tr> 481 "; 482 483 484 return $text; 485 } 486 487 $formgo = e_SELF.(e_QUERY && !defined("RESET") && strpos(e_QUERY, 'delete') === FALSE ? "?".e_QUERY : ""); 488 489 $text = "<div style='text-align:center'> 490 <form method='post' action='$formgo'> 491 <table style='".ADMIN_WIDTH."' class='fborder'> 492 <tr> 493 <td style='width:30%' class='forumheader3'><div class='normaltext'>".POLLAN_3.":</div></td> 494 <td style='width:70%'class='forumheader3'> 495 <input class='tbox' type='text' name='poll_title' size='70' value='".$tp -> post_toForm($_POST['poll_title'])."' maxlength='200' />"; 496 497 $option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1); 498 499 $text .= "<tr> 500 <td style='width:30%;vertical-align:top' class='forumheader3'>".LAN_OPTIONS." :</td> 501 <td style='width:70%' class='forumheader3'> 502 <div id='pollsection'>"; 503 504 for($count = 1; $count <= $option_count; $count++) 505 { 506 if($count != 1 && $_POST['poll_option'][($count-1)] =="") 507 { 508 break; 509 } 510 $opt = ($count==1) ? "id='pollopt'" : ""; 511 $text .="<span $opt><input class='tbox' type='text' name='poll_option[]' size='40' value=\"".$tp -> post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; 512 $text .= "</span><br />"; 513 } 514 515 $text .="</div><input class='button' type='button' name='addoption' value='".POLLAN_8."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br /> 516 </td></tr> 517 518 <tr> 519 <td style='width:30%' class='forumheader3'>".POLLAN_9."</td> 520 <td style='width:70%' class='forumheader3'> 521 <input type='radio' name='multipleChoice' value='1'".($_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_10." 522 <input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_11." 523 </td> 524 </tr> 525 526 <tr> 527 <td style='width:30%' class='forumheader3'>".POLLAN_12."</td> 528 <td style='width:70%' class='forumheader3'> 529 <input type='radio' name='showResults' value='0'".(!$_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_13."<br /> 530 <input type='radio' name='showResults' value='1'".($_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_14." 531 </td> 532 </tr> 533 534 <tr> 535 <td style='width:30%' class='forumheader3'>".POLLAN_15."</td> 536 <td class='forumheader3'>".r_userclass("pollUserclass", $_POST['pollUserclass'], "admin")."</td> 537 </tr> 538 539 <tr> 540 <td style='width:30%' class='forumheader3'>".POLLAN_16."</td> 541 <td class='forumheader3'> 542 <input type='radio' name='storageMethod' value='0'".(!$_POST['storageMethod'] ? " checked='checked'" : "")." /> ".POLLAN_17."<br /> 543 <input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br /> 544 <input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19." 545 </tr> 546 547 548 549 550 <tr> 551 <td class='forumheader3'>".POLLAN_20.": </td><td class='forumheader3'> 552 <input type='radio' name='poll_comment' value='1'".($_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_10." 553 <input type='radio' name='poll_comment' value='0'".(!$_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_11." 554 </td> 555 </tr> 556 <tr style='vertical-align:top'> 557 <td colspan='2' style='text-align:center' class='forumheader'>"; 558 559 if (isset($_POST['preview'])) { 560 $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_21."' /> "; 561 if (POLLACTION == "edit") { 562 $text .= "<input class='button' type='submit' name='submit' value='".POLLAN_22."' /> "; 563 } else { 564 $text .= "<input class='button' type='submit' name='submit' value='".POLLAN_23."' /> "; 565 } 566 } else { 567 $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_24."' /> "; 568 } 569 if (POLLID) { 570 $text .= "<input class='button' type='submit' name='reset' value='".POLLAN_25."' /> "; 571 } 572 573 $text .= "</td></tr></table> 574 </form> 575 </div>"; 576 577 return $text; 578 } 579 } 580 581 echo '<script type="text/javascript"> 582 <!-- 583 function setcook(pollid){ 584 var name = "poll_"+pollid; 585 var date = new Date(); 586 var value = pollid; 587 date.setTime(date.getTime()+(365*24*60*60*1000)); 588 var expires = "; expires="+date.toGMTString(); 589 document.cookie = name+"="+value+expires+"; path=/"; 590 } 591 //--> 592 </script> 593 '; 594 595 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |