EDIT: Anleitung gelöscht (siehe Seite 3 für neue Anleitung)
Diese Methode behebet sowohl das mktime Problem in der editvote.php und nimmt einem zusätzlich noch ab ein Ablaufdatum in der Zukunft eintippen zu müssen.
mfg jerry
Diese Methode behebet sowohl das mktime Problem in der editvote.php und nimmt einem zusätzlich noch ab ein Ablaufdatum in der Zukunft eintippen zu müssen.
mfg jerry
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »jerryGFL« (14. Januar 2008, 22:42)
Parse error: syntax error, unexpected T_ELSE
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 |
//Ablaufdatum automatisch vorgeben
else {
$time=time()+(50*365*24*60*60);
$vote_expire_d=date("d",$time);
$vote_expire_m=date("m",$time);
$vote_expire_y=date("Y",$time);
$vote_expire_h=date("H",$time);
$vote_expire_mm=date("i",$time);
}
//Ablaudatum automatisch vorgeben
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
<?php
if (adminaccess('vote')) {
if ($_REQUEST['voteid']!='') $voteid=$_REQUEST['voteid'];
if (isset($_POST['action'])) $ACTION=$_POST['action'];
else $ACTION='view';
//Ablaufdatum in 50 Jahren vorgeben
$time=time()+(50*365*24*60*60);
$vote_expire_d=date("d",$time);
$vote_expire_m=date("m",$time);
$vote_expire_y=date("Y",$time);
$vote_expire_h=date("H",$time);
$vote_expire_mm=date("i",$time);
//Ablaufdatum vorgeben
if ($ACTION==$_POST['save'] || $ACTION==$_POST['next']) {
$votetheme_title=addslashes($_POST['votetheme_title']);
$votetheme_description=addslashes($_POST['votetheme_description']);
1
$votetheme_time=formattime(mktime((int)$_POST['vote_time_h'],(int)$_POST['vote_time_mm'],0,(int)$_POST['vote_time_m'],(int)$_POST['vote_time_d'],(int)$_POST['vote_time_y']),'','istamp'); $votetheme_expire=mktime((int)$_POST['vote_expire_h'],(int)$_POST['vote_expire_mm'],0,(int)$_POST['vote_expire_m'],(int)$_POST['vote_expire_d'],(int)$_POST['vote_expire_y']);
if ($votetheme_time<=0) $votetheme_time=$time_now;
if ($votetheme_expire<0) $votetheme_expire=0;
else $votetheme_expire=formattime($votetheme_expire,'','istamp');
if ($voteid=="") {
$DB->query("INSERT INTO ".$db_tab['votetheme']." (votetheme_status) VALUES (1)");
$voteid=$DB->insert_id();
}
$DB->query("UPDATE ".$db_tab['votetheme']." SET votetheme_title='".$votetheme_title."',votetheme_description='".$votetheme_description."',votetheme_rights='".$_POST['votetheme_rights']."',votetheme_maxvotes='".$_POST['votetheme_maxvotes']."',votetheme_comment='".$_POST['votetheme_comment']."',votetheme_status='".$_POST['votetheme_status']."',votetheme_time='".$votetheme_time."',votetheme_expire='".$votetheme_expire."',votetheme_multianswer='".$_POST['votetheme_multianswer']."',votetheme_hidderesult='".$_POST['votetheme_hidden']."' WHERE votetheme_id='".$voteid."'");
if ($ACTION==$_POST['next']) header ("location: admin.php?path=vote/editvote.php&step=2&voteid=".$voteid."&PHPKITSID=".session_id()."");
else header ("location: admin.php?path=vote/editvote.php&voteid=".$voteid."&PHPKITSID=".session_id()."");
exit();
}
elseif($_REQUEST['step']==2) {
if ($ACTION==$_POST['back']) {header("location: admin.php?path=vote/editvote.php&voteid=".$voteid."&PHPKITSID=".session_id().""); exit();}
elseif ($voteid!='' && $ACTION!='view' && $ACTION!=$_POST['edit']) {
if ($ACTION==$_POST['up']) $DB->query("UPDATE ".$db_tab['vote']." SET vote_order=vote_order-1 WHERE vote_id='".$_POST['id']."'");
elseif ($ACTION==$_POST['down']) $DB->query("UPDATE ".$db_tab['vote']." SET vote_order=vote_order+1 WHERE vote_id='".$_POST['id']."'");
elseif ($ACTION==$_POST['newanswer']) {
if ($_POST['delete_answer']==1 && isset($_POST['id'])) $DB->query("DELETE FROM ".$db_tab['vote']." WHERE vote_id='".$_POST['id']."'");
else {
if ($_POST['id']!="") $DB->query("UPDATE ".$db_tab['vote']." SET vote_text='".$_POST['vote_editanswer']."', vote_order='".$_POST['vote_order']."' WHERE vote_id='".$_POST['id']."'");
else $DB->query("INSERT INTO ".$db_tab['vote']." (vote_themeid,vote_text,vote_order) VALUES ('".$voteid."','".$_POST['vote_newanswer']."','".$_POST['vote_order']."')");
}
}
header("location: admin.php?path=vote/editvote.php&step=2&voteid=".$voteid."&PHPKITSID=".session_id().""); exit();
}
elseif ($voteid!="") {
unset($vote_row); unset($vote_form); $order=1;
$getvotes=$DB->query("SELECT * FROM ".$db_tab['vote']." WHERE vote_themeid='".$voteid."' ORDER by vote_order");
while($voteinfo=$DB->fetch_array($getvotes)) {
if ($voteinfo[vote_order]==$order) $order++;
$row=rowcolor($row);
if ($ACTION==$_POST['edit'] && $voteinfo[vote_id]==$_POST['id']) eval ("\$vote_form= \"".templateinclude("vote/editvote_editanswer")."\";");
eval ("\$vote_row.= \"".templateinclude("vote/editvote_row")."\";");
}
if ($vote_row=="") eval ("\$vote_row.= \"".templateinclude("vote/editvote_norow")."\";");
else eval ("\$vote_head= \"".templateinclude("vote/editvote_head")."\";");
if ($vote_form=="") {
eval ("\$vote_form= \"".templateinclude("vote/editvote_newanswer")."\";");
}
eval ("\$site_body.= \"".templateinclude("vote/editvote_answers")."\";");
}
else eval ("\$site_body.= \"".templateinclude("vote/editvote_novote")."\";");
}
else {
if ($voteid!='') {
$votetheme=$DB->fetch_array($DB->query("SELECT * FROM ".$db_tab['votetheme']." WHERE votetheme_id='".$voteid."' LIMIT 1"));
$votetheme_title=htmlspecialchars($votetheme['votetheme_title']);
$votetheme_description=stripslashes($votetheme['votetheme_description']);
$votetheme_maxvotes=$votetheme['votetheme_maxvotes'];
if ($votetheme['votetheme_rights']=="admin") $rights4='selected';
elseif ($votetheme['votetheme_rights']=="mod") $rights3='selected';
elseif ($votetheme['votetheme_rights']=="member") $rights2='selected';
elseif ($votetheme['votetheme_rights']=="user") $rights1='selected';
else $rights0='selected';
if ($votetheme['votetheme_comment']==1) $comment1='checked';
if ($votetheme['votetheme_multianswer']==1) $multi1='checked';
if ($votetheme['votetheme_hidderesult']==1) $hidden1='checked';
if ($votetheme['votetheme_status']==1) $status1='selected';
else $status0='selected';
if ($votetheme['votetheme_time']>0) {
$time=formattime($votetheme['votetheme_time'],'','stamp');
$vote_time_d=date("d",$time);
$vote_time_m=date("m",$time);
$vote_time_y=date("Y",$time);
$vote_time_h=date("H",$time);
$vote_time_mm=date("i",$time);
}
if ($votetheme['votetheme_expire']>0) {
$time=formattime($votetheme['votetheme_expire'],'','stamp');
$vote_expire_d=date("d",$time);
$vote_expire_m=date("m",$time);
$vote_expire_y=date("Y",$time);
$vote_expire_h=date("H",$time);
$vote_expire_mm=date("i",$time);
}
//Ablaufdatum automatisch vorgeben
else {
$time=time()+(50*365*24*60*60);
$vote_expire_d=date("d",$time);
$vote_expire_m=date("m",$time);
$vote_expire_y=date("Y",$time);
$vote_expire_h=date("H",$time);
$vote_expire_mm=date("i",$time);
}
//Ablaudatum automatisch vorgeben
}
else {
$rights0=" selected";
$votetheme_maxvotes="0";
$comment1=" checked";
$status1="selected";
}
eval ("\$site_body.= \"".templateinclude("vote/editvote")."\";");
}
}
else {header ("location: index.php?PHPKITSID=".session_id()); exit();}
?>
|
Ähnliche Themen
-
Web | Programmierung »-
PHP4 wird eingestellt, neuer PHP5.2
(27. Dezember 2007, 18:55)
-
alte Versionen [1.6.03|1.6.1|1.6.4] »-
Was ist mit der Laberecke??
(6. Januar 2008, 19:11)
-
alte Versionen [1.6.03|1.6.1|1.6.4] »-
Header ändern
(26. Dezember 2007, 02:16)
-
alte Versionen [1.6.03|1.6.1|1.6.4] »-
Großes Problem mit HackBlock2007 (lauter Fehlermeldungen)
(26. Dezember 2007, 07:19)
-
alte Versionen [1.6.03|1.6.1|1.6.4] »-
Forum. Anhang: Der Admin ist nicht verantwortlich.....
(28. Dezember 2007, 11:00)


