Avatar billede zidane5 Nybegynder
25. november 2011 - 20:22 Der er 16 kommentarer og
1 løsning

Få html inpu

Hej. Når jeg indtaster noget i de 2 første markede html input, så kommer det der er skrevet rigtigt nok. Men når jeg indtaster noget i det tredje(under de 2 andre html input), kommer kun noget af indholdet.. Php dataen er også markeret med sort.

Kan det skyldes at det er et hack, at det sidste html input ikke virker? Men det mærkeligt de 2 første virker..

Et eksempel kan ses her: http://www.oddsportal.dk/forum/forslag_arc.php?forum_id=35&thread_id=563&pid=#post_


Filen er her:

<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: postnewthread.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

if (isset($_POST['previewpost']) || isset($_POST['add_poll_option'])) {
$subject = trim(stripinput(censorwords($_POST['Spilstop']))).':'.trim(stripinput(censorwords($_POST['Spilstop1']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold']))).' - '.trim(stripinput(censorwords($_POST['Udehold']))).' '.
trim(stripinput(censorwords($_POST['Tip']))).', '.trim(stripinput(censorwords($_POST['Odds']))).'
<br> '.trim(stripinput(censorwords($_POST['Spilstop2']))).':'.trim(stripinput(censorwords($_POST['Spilstop3']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold1']))).' - '.trim(stripinput(censorwords($_POST['Udehold1']))).' '.
trim(stripinput(censorwords($_POST['Tip1']))).', '.trim(stripinput(censorwords($_POST['Odds1']))).'
<br> '.trim(stripinput(censorwords($_POST['Spilstop4']))).':'.trim(stripinput(censorwords($_POST['Spilstop5']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold2']))).' - '.trim(stripinput(censorwords($_POST['Udehold2']))).' '.
trim(stripinput(censorwords($_POST['Tip2']))).', '.trim(stripinput(censorwords($_POST['Odds2'])));

       
$message = trim(stripinput(censorwords($_POST['message'])));
    $sticky_thread_check = isset($_POST['sticky_thread']) ? " checked='checked'" : "";
    $lock_thread_check = isset($_POST['lock_thread']) ? " checked='checked'" : "";
    $sig_checked = isset($_POST['show_sig']) ? " checked='checked'" : "";
    $disable_smileys_check = isset($_POST['disable_smileys']) || preg_match("#(\[code\](.*?)\[/code\]|\[geshi=(.*?)\](.*?)\[/geshi\]|\[php\](.*?)\[/php\])#si", $message) ? " checked='checked'" : "";
    if ($settings['thread_notify']) { $notify_checked = isset($_POST['notify_me']) ? " checked='checked'" : ""; }

    if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
        $poll_title = trim(stripinput(censorwords($_POST['poll_title'])));
        if (isset($_POST['poll_options']) && is_array($_POST['poll_options'])) {
            $poll_opts = array();
            foreach ($_POST['poll_options'] as $poll_option) {
                if ($poll_option) { $poll_opts[] = stripinput($poll_option); }
            }
        } else {
            $poll_opts = array();
        }
        if (isset($_POST['add_poll_option'])) {
            if (count($poll_opts)) { array_push($poll_opts, ""); }
        }
    }

    if (isset($_POST['previewpost'])) {
        if ($subject == "") { $subject = $locale['830']; }
        if ($message == "") {
            $previewmessage = $locale['831'];
        } else {
            $previewmessage = $message;
            if ($sig_checked) { $previewmessage = $previewmessage."\n\n".$userdata['user_sig']; }
            if (!$disable_smileys_check) { $previewmessage = parsesmileys($previewmessage); }
            $previewmessage = parseubb($previewmessage);
            $previewmessage = nl2br($previewmessage);
        }
        //$is_mod = iMOD && iUSER < "102" ? true : false;
        opentable($locale['400']);
        echo "<div class='tbl2 forum_breadcrumbs' style='margin-bottom:5px'><a href='generelt.php'>".$settings['sitename']."</a> &raquo; ".$caption."</div>\n";

        if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
            if ((isset($poll_title) && $poll_title) && (isset($poll_opts) && is_array($poll_opts))) {
                echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin-bottom:5px'>\n<tr>\n";
                echo "<td align='center' class='tbl2'><strong>".$poll_title."</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
                echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
                foreach ($poll_opts as $poll_option) {
                    echo "<tr>\n<td class='tbl1'><input type='radio' name='poll_option' value='$i' style='vertical-align:middle;' /> ".$poll_option."</td>\n</tr>\n";
                    $i++;
                }
                echo "</table>\n</td>\n</tr>\n</table>\n";
            }
        }
        echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n<tr>\n";
        echo "<td colspan='2' class='tbl2'><strong>".$subject."</strong></td>\n</tr>\n";
        echo "<td colspan='2' class='tbl2'><strong>".$subject1."</strong></td>\n</tr>\n";
        echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:140px;'>".profile_link($userdata['user_id'], $userdata['user_name'], $userdata['user_status'])."</td>\n";
        echo "<td class='tbl2 forum_thread_post_date'>".$locale['426'].showdate("forumdate", time())."</td>\n";
        echo "</tr>\n<tr>\n<td valign='top' width='140' class='tbl2 forum_thread_user_info'>\n";
        if ($userdata['user_avatar'] && file_exists(IMAGES."avatars/".$userdata['user_avatar'])) {
            echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."' alt='' /><br /><br />\n";
        }
        echo "<!--forum_thread_user_info--><span class='small'><strong>Antal forslag: </strong> ".score_account_stand($user_data['user_id'])."</span><br />\n";
        echo "<!--forum_thread_user_info--><span class='small'><strong>Antal vundne: </strong> ".number_format(dbcount("(post_solved)", DB_POSTS, "post_author='".$userdata['user_id']."' AND post_solved='1'"))."</span><br />\n";
        echo "<br /></td>\n<td valign='top' class='tbl1 forum_thread_user_post'>".$previewmessage."</td>\n";
        echo "</tr>\n</table>\n";
        closetable();
    }
}
if (isset($_POST['postnewthread'])) {



Her er php dataen, for de 3 html input:
$subject = trim(stripinput(censorwords($_POST['Spilstop']))).':'.trim(stripinput(censorwords($_POST['Spilstop1']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold']))).' - '.trim(stripinput(censorwords($_POST['Udehold']))).' '.
trim(stripinput(censorwords($_POST['Tip']))).', '.trim(stripinput(censorwords($_POST['Odds']))).'
<br> '.trim(stripinput(censorwords($_POST['Spilstop2']))).':'.trim(stripinput(censorwords($_POST['Spilstop3']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold1']))).' - '.trim(stripinput(censorwords($_POST['Udehold1']))).' '.
trim(stripinput(censorwords($_POST['Tip1']))).', '.trim(stripinput(censorwords($_POST['Odds1']))).'
<br> '.trim(stripinput(censorwords($_POST['Spilstop4']))).':'.trim(stripinput(censorwords($_POST['Spilstop5']))).' = '.
trim(stripinput(censorwords($_POST['Hjemmehold2']))).' - '.trim(stripinput(censorwords($_POST['Udehold2']))).' '.
trim(stripinput(censorwords($_POST['Tip2']))).', '.trim(stripinput(censorwords($_POST['Odds2'])));
           

$message = trim(stripinput(censorwords($_POST['message'])));
    $flood = false; $error = 0;
    $sticky_thread = isset($_POST['sticky_thread']) && (iMOD || iSUPERADMIN) ? 1 : 0;
    $lock_thread = isset($_POST['lock_thread']) && (iMOD || iSUPERADMIN) ? 1 : 0;
    $sig = isset($_POST['show_sig']) ? 1 : 0;
    $smileys = isset($_POST['disable_smileys']) || preg_match("#(\[code\](.*?)\[/code\]|\[geshi=(.*?)\](.*?)\[/geshi\]|\[php\](.*?)\[/php\])#si", $message) ? 0 : 1;
    $thread_poll = 0;

    if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
        if (isset($_POST['poll_options']) && is_array($_POST['poll_options'])) {
            foreach ($_POST['poll_options'] as $poll_option) {
                if (trim($poll_option)) { $poll_opts[] = trim(stripinput(censorwords($poll_option))); }
                unset($poll_option);
            }
        }
        $thread_poll = (trim($_POST['poll_title']) && (isset($poll_opts) && is_array($poll_opts)) ? 1 : 0);
    }

    if (iMEMBER) {
        if ($subject != "" && $message != "") {
            require_once INCLUDES."flood_include.php";
            if (!flood_control("post_datestamp", DB_POSTS, "post_author='".$userdata['user_id']."'")) {
                $result = dbquery("INSERT INTO ".DB_THREADS." (forum_id, thread_subject, thread_author, thread_views, thread_lastpost, thread_lastpostid, thread_lastuser, thread_postcount, thread_poll, thread_sticky, thread_locked) VALUES('".$_GET['forum_id']."', '$subject', '".$userdata['user_id']."', '0', '".time()."', '0', '".$userdata['user_id']."', '1', '".$thread_poll."', '".$sticky_thread."', '".$lock_thread."')");
                $thread_id = mysql_insert_id();
                $result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_ip_type, post_edituser, post_edittime) VALUES ('".$_GET['forum_id']."', '".$thread_id."', '".$message."', '".$sig."', '".$smileys."', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '".USER_IP_TYPE."', '0', '0')");
                $post_id = mysql_insert_id();
                $result = dbquery("UPDATE ".DB_FORUMS." SET forum_lastpost='".time()."', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+1, forum_lastuser='".$userdata['user_id']."' WHERE forum_id='".$_GET['forum_id']."'");
                $result = dbquery("UPDATE ".DB_THREADS." SET thread_lastpostid='".$post_id."' WHERE thread_id='".$thread_id."'");
                $result = dbquery("UPDATE ".DB_USERS." SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
                if ($settings['thread_notify'] && isset($_POST['notify_me'])) { $result = dbquery("INSERT INTO ".DB_THREAD_NOTIFY." (thread_id, notify_datestamp, notify_user, notify_status) VALUES('".$thread_id."', '".time()."', '".$userdata['user_id']."', '1')"); }

                if (($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) && $thread_poll) {
                    $poll_title = trim(stripinput(censorwords($_POST['poll_title'])));
                    if ($poll_title && (isset($poll_opts) && is_array($poll_opts))) {
                        $result = dbquery("INSERT INTO ".DB_FORUM_POLLS." (thread_id, forum_poll_title, forum_poll_start, forum_poll_length, forum_poll_votes) VALUES('".$thread_id."', '".$poll_title."', '".time()."', '0', '0')");
                        $forum_poll_id = mysql_insert_id();
                        $i = 1;
                        foreach ($poll_opts as $poll_option) {
                            $result = dbquery("INSERT INTO ".DB_FORUM_POLL_OPTIONS." (thread_id, forum_poll_option_id, forum_poll_option_text, forum_poll_option_votes) VALUES('".$thread_id."', '".$i."', '".$poll_option."', '0')");
                            $i++;
                        }
                    }
                }

                if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
                        // $attach = $_FILES['attach'];
                    foreach($_FILES as $attach){
                        if ($attach['name'] != "" && !empty($attach['name']) && is_uploaded_file($attach['tmp_name'])) {
                            $attachname = stripfilename(substr($attach['name'], 0, strrpos($attach['name'], ".")));
                            $attachext = strtolower(strrchr($attach['name'],"."));
                            if (preg_match("/^[-0-9A-Z_\[\]]+$/i", $attachname) && $attach['size'] <= $settings['attachmax']) {
                                $attachtypes = explode(",", $settings['attachtypes']);
                                if (in_array($attachext, $attachtypes)) {
                                    $attachname .= $attachext;
                                    $attachname = attach_exists(strtolower($attachname));
                                    move_uploaded_file($attach['tmp_name'], FORUM."attachments/".$attachname);
                                    chmod(FORUM."attachments/".$attachname,0644);
                                    if (in_array($attachext, $imagetypes) && (!@getimagesize(FORUM."attachments/".$attachname) || !@verify_image(FORUM."attachments/".$attachname))) {
                                        unlink(FORUM."attachments/".$attachname);
                                        $error = 1;
                                    }
                                    if (!$error) { $result = dbquery("INSERT INTO ".DB_FORUM_ATTACHMENTS." (thread_id, post_id, attach_name, attach_ext, attach_size) VALUES ('".$thread_id."', '".$post_id."', '".$attachname."', '".$attachext."', '".$attach['size']."')"); }
                                } else {
                                    @unlink($attach['tmp_name']);
                                    $error = 1;
                                }
                            } else {
                                @unlink($attach['tmp_name']);
                                $error = 2;
                            }
                        }
                    }
                }
            } else {
                    redirect("viewforum1.php?forum_id=".$_GET['forum_id']);
            }
        } else {
            $error = 3;
        }
    } else {
        $error = 4;
    }
    if ($error > 2) {
        redirect("postify.php?post=new&error=$error&forum_id=".$_GET['forum_id']);
    } else {
        redirect("postify.php?post=new&error=$error&forum_id=".$_GET['forum_id']."&thread_id=".$thread_id."");
    }
} else {
    if (!isset($_POST['previewpost']) && !isset($_POST['add_poll_option'])) {
        $subject = "";
        $message = "";
        $sticky_thread_check = "";
        $lock_thread_check = "";
        $disable_smileys_check = "";
        $sig_checked = " checked='checked'";
        if ($settings['thread_notify']) { $notify_checked = ""; }
        $poll_title = "";
        $poll_opts = array();
    }
    add_to_title($locale['global_201'].$locale['401']);
    echo "<!--pre_postnewthread-->";
    opentable($locale['401']);
    if (!isset($_POST['previewpost'])) { echo "<div class='tbl2 forum_breadcrumbs' style='margin-bottom:5px'><a href='generelt.php'>".$settings['sitename']."</a> &raquo; ".$caption."</div>\n"; }



Nummer 1, som virker:
    echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop1'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold){
if(!Hjemmehold._haschanged){
  Hjemmehold.value=\"\"
};
Hjemmehold._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold\" value=\"Hjemmehold\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold\" value=\"Udehold\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip\" value=\"Tip\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds\" value=\"Odds\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";



Nummer 2, som virker:
    echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop2'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop3'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold1){
if(!Hjemmehold1._haschanged){
  Hjemmehold1.value=\"\"
};
Hjemmehold1._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold1\" value=\"Hjemmehold1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold1\" value=\"Udehold1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip1\" value=\"Tip1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds1\" value=\"Odds1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";



Nummer 3, som ikke virker!:ø
echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop4'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop5'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold2){
if(!Hjemmehold2._haschanged){
  Hjemmehold2.value=\"\"
};
Hjemmehold2._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold2\" value=\"Hjemmehold2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold2\" value=\"Udehold2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip2\" value=\"Tip2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds2\" value=\"Odds2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";

    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
        echo "<td valign='top' width='72' class='tbl2'>".$locale['461a']."</td>\n";
    echo "<td class='tbl1'><textarea name='message' cols='60' rows='15' class='textbox' style='width:98%'>".$message."</textarea></td>\n";
echo "</tr>\n<tr>\n";
    echo "<td width='72' class='tbl2'>&nbsp;</td>\n";
    echo "<td class='tbl1'>".display_bbcodes("99%", "message")."</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td valign='top' width='72' class='tbl2'>".$locale['463']."</td>\n";
    echo "<td class='tbl1'>\n";
    if (iMOD || iSUPERADMIN) {
        echo "<label><input type='checkbox' name='sticky_thread' value='1'".$sticky_thread_check." /> ".$locale['480']."</label><br />\n";
        echo "<label><input type='checkbox' name='lock_thread' value='1'".$lock_thread_check." /> ".$locale['481']."</label><br />\n";
    }
    echo "<label><input type='checkbox' name='disable_smileys' value='1'".$disable_smileys_check." /> ".$locale['482']."</label>";
    if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
        echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'".$sig_checked." /> ".$locale['483']."</label>";
    }
    if ($settings['thread_notify']) { echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'".$notify_checked." /> ".$locale['486']."</label>"; }
    echo "</td>\n</tr>\n";
    if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
        add_to_head("<script type='text/javascript' src='".INCLUDES."multi_attachment.js'></script>\n");
        echo "<tr>\n<td width='72' class='tbl2'>".$locale['464']."</td>\n";
        echo "<td class='tbl1'><input id='my_file_element' type='file' name='file_1' class='textbox' style='width:200px;' /><br />\n";
        echo "<span class='small2'>".sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes']), $settings['attachmax_count'])."</span><br />\n";
        echo "<div id='files_list'></div>\n";
        echo "<script>\n";
        echo "/* <![CDATA[ */\n";
        echo "<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->\n";
        echo "var multi_selector = new MultiSelector( document.getElementById( \"files_list\" ), ".$settings['attachmax_count']." );\n";
        echo "<!-- Pass in the file element -->\n";
        echo "multi_selector.addElement( document.getElementById( \"my_file_element\" ) );\n";
        echo "/* ]]>*/\n";
        echo "</script>\n";
        echo "</td>\n";
        echo "</tr>\n";
    }
    if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
        echo "<tr>\n<td align='center' colspan='2' class='tbl2'>".$locale['467a']."</td>\n";
        echo "</tr>\n<tr>\n";
        echo "<td width='72' class='tbl2'>".$locale['469']."</td>\n";
        echo "<td class='tbl1'><input type='text' name='poll_title' value='Har du brugt dette forslag?' class='textbox' maxlength='255' style='width:250px' /></td>\n";
        echo "</tr>\n";
        $i = 1;
        if (isset($poll_opts) && is_array($poll_opts) && count($poll_opts)) {
            foreach ($poll_opts as $poll_option) {
                echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." ".$i."</td>\n";
                echo "<td class='tbl1'><input type='text' name='poll_options[$i]' value='".$poll_option."' class='textbox' maxlength='255' style='width:250px'>";
                if ($i == count($poll_opts)) {
                    echo "";
                }
                echo "</td>\n</tr>\n";
                $i++;
            }
        } else {
            echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." 1</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[1]' value='Ja' class='textbox' maxlength='255' style='width:250px' /></td>\n</tr>\n";
            echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." 2</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[2]' value='Nej' class='textbox' maxlength='255' style='width:250px' /> ";
            echo "</td>\n</tr>\n";
        }
    }
    echo "<tr>\n<td align='center' colspan='2' class='tbl1'>\n";
    echo "\n";
    echo "<input type='submit' name='postnewthread' value='".$locale['401']."' class='button' />\n";
    echo "</td>\n</tr>\n</table>\n</form>\n";
    closetable();
    echo "<!--sub_postnewthread-->";
}
?>
Avatar billede 01hjorth Nybegynder
25. november 2011 - 22:09 #1
730 points ude.... Har du overvejet at få lukket dine gamle tråde?
Avatar billede zidane5 Nybegynder
25. november 2011 - 22:19 #2
Hej, det har gjort. Så det ikke lige heh.

Men kender du løsningen?
Avatar billede 01hjorth Nybegynder
25. november 2011 - 22:28 #3
Nope.. Så bare lige det med points'ne.
Men tror tilgengæld ikke at din egen konklusion med hack, har noget med sagen at gøre.
Avatar billede zidane5 Nybegynder
26. november 2011 - 15:53 #4
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: postnewthread.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

if (isset($_POST['postnewthread'])) {

function clean_string($subject){
  return trim(stripinput(censorwords($subject)));
}
function odds_to_string($spilstop, $spilstop1, $hjemmehold, $udehold, $tip, $odds){
  return clean_string($_POST[$spilstop]).':'.clean_string($_POST[$spilstop1]).' = '.
clean_string($_POST[$hjemmehold]).' - '.clean_string($_POST[$udehold]).' '.
clean_string($_POST[$tip]).', '.clean_string($_POST[$odds]);
}

$subject = odds_to_string('Spilstop', 'Spilstop1', 'Hjemmehold', 'Udehold', 'Tip', 'Odds').'
<br> '.odds_to_string('Spilstop2', 'Spilstop3', 'Hjemmehold1', 'Udehold1', 'Tip1', 'Odds1').'
<br> '.odds_to_string('Spilstop4', 'Spilstop5', 'Hjemmehold2', 'Udehold2', 'Tip2', 'Odds2');

$message = trim(stripinput(censorwords($_POST['message'])));
    $flood = false; $error = 0;
    $sticky_thread = isset($_POST['sticky_thread']) && (iMOD || iSUPERADMIN) ? 1 : 0;
    $lock_thread = isset($_POST['lock_thread']) && (iMOD || iSUPERADMIN) ? 1 : 0;
    $sig = isset($_POST['show_sig']) ? 1 : 0;
    $smileys = isset($_POST['disable_smileys']) || preg_match("#(\[code\](.*?)\[/code\]|\[geshi=(.*?)\](.*?)\[/geshi\]|\[php\](.*?)\[/php\])#si", $message) ? 0 : 1;
    $thread_poll = 0;

    if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
        if (isset($_POST['poll_options']) && is_array($_POST['poll_options'])) {
            foreach ($_POST['poll_options'] as $poll_option) {
                if (trim($poll_option)) { $poll_opts[] = trim(stripinput(censorwords($poll_option))); }
                unset($poll_option);
            }
        }
        $thread_poll = (trim($_POST['poll_title']) && (isset($poll_opts) && is_array($poll_opts)) ? 1 : 0);
    }

    if (iMEMBER) {
        if ($subject != "" && $message != "") {
            require_once INCLUDES."flood_include.php";
            if (!flood_control("post_datestamp", DB_POSTS, "post_author='".$userdata['user_id']."'")) {
                $result = dbquery("INSERT INTO ".DB_THREADS." (forum_id, thread_subject, thread_author, thread_views, thread_lastpost, thread_lastpostid, thread_lastuser, thread_postcount, thread_poll, thread_sticky, thread_locked) VALUES('".$_GET['forum_id']."', '$subject', '".$userdata['user_id']."', '0', '".time()."', '0', '".$userdata['user_id']."', '1', '".$thread_poll."', '".$sticky_thread."', '".$lock_thread."')");
                $thread_id = mysql_insert_id();
                $result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_ip_type, post_edituser, post_edittime) VALUES ('".$_GET['forum_id']."', '".$thread_id."', '".$message."', '".$sig."', '".$smileys."', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '".USER_IP_TYPE."', '0', '0')");
                $post_id = mysql_insert_id();
                $result = dbquery("UPDATE ".DB_FORUMS." SET forum_lastpost='".time()."', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+1, forum_lastuser='".$userdata['user_id']."' WHERE forum_id='".$_GET['forum_id']."'");
                $result = dbquery("UPDATE ".DB_THREADS." SET thread_lastpostid='".$post_id."' WHERE thread_id='".$thread_id."'");
                $result = dbquery("UPDATE ".DB_USERS." SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
                if ($settings['thread_notify'] && isset($_POST['notify_me'])) { $result = dbquery("INSERT INTO ".DB_THREAD_NOTIFY." (thread_id, notify_datestamp, notify_user, notify_status) VALUES('".$thread_id."', '".time()."', '".$userdata['user_id']."', '1')"); }

                if (($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) && $thread_poll) {
                    $poll_title = trim(stripinput(censorwords($_POST['poll_title'])));
                    if ($poll_title && (isset($poll_opts) && is_array($poll_opts))) {
                        $result = dbquery("INSERT INTO ".DB_FORUM_POLLS." (thread_id, forum_poll_title, forum_poll_start, forum_poll_length, forum_poll_votes) VALUES('".$thread_id."', '".$poll_title."', '".time()."', '0', '0')");
                        $forum_poll_id = mysql_insert_id();
                        $i = 1;
                        foreach ($poll_opts as $poll_option) {
                            $result = dbquery("INSERT INTO ".DB_FORUM_POLL_OPTIONS." (thread_id, forum_poll_option_id, forum_poll_option_text, forum_poll_option_votes) VALUES('".$thread_id."', '".$i."', '".$poll_option."', '0')");
                            $i++;
                        }
                    }
                }

                if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
                        // $attach = $_FILES['attach'];
                    foreach($_FILES as $attach){
                        if ($attach['name'] != "" && !empty($attach['name']) && is_uploaded_file($attach['tmp_name'])) {
                            $attachname = stripfilename(substr($attach['name'], 0, strrpos($attach['name'], ".")));
                            $attachext = strtolower(strrchr($attach['name'],"."));
                            if (preg_match("/^[-0-9A-Z_\[\]]+$/i", $attachname) && $attach['size'] <= $settings['attachmax']) {
                                $attachtypes = explode(",", $settings['attachtypes']);
                                if (in_array($attachext, $attachtypes)) {
                                    $attachname .= $attachext;
                                    $attachname = attach_exists(strtolower($attachname));
                                    move_uploaded_file($attach['tmp_name'], FORUM."attachments/".$attachname);
                                    chmod(FORUM."attachments/".$attachname,0644);
                                    if (in_array($attachext, $imagetypes) && (!@getimagesize(FORUM."attachments/".$attachname) || !@verify_image(FORUM."attachments/".$attachname))) {
                                        unlink(FORUM."attachments/".$attachname);
                                        $error = 1;
                                    }
                                    if (!$error) { $result = dbquery("INSERT INTO ".DB_FORUM_ATTACHMENTS." (thread_id, post_id, attach_name, attach_ext, attach_size) VALUES ('".$thread_id."', '".$post_id."', '".$attachname."', '".$attachext."', '".$attach['size']."')"); }
                                } else {
                                    @unlink($attach['tmp_name']);
                                    $error = 1;
                                }
                            } else {
                                @unlink($attach['tmp_name']);
                                $error = 2;
                            }
                        }
                    }
                }
            } else {
                    redirect("viewforum1.php?forum_id=".$_GET['forum_id']);
            }
        } else {
            $error = 3;
        }
    } else {
        $error = 4;
    }
    if ($error > 2) {
        redirect("postify.php?post=new&error=$error&forum_id=".$_GET['forum_id']);
    } else {
        redirect("postify.php?post=new&error=$error&forum_id=".$_GET['forum_id']."&thread_id=".$thread_id."");
    }
} else {
    if (!isset($_POST['previewpost']) && !isset($_POST['add_poll_option'])) {
        $subject = "";
        $message = "";
        $sticky_thread_check = "";
        $lock_thread_check = "";
        $disable_smileys_check = "";
        $sig_checked = " checked='checked'";
        if ($settings['thread_notify']) { $notify_checked = ""; }
        $poll_title = "";
        $poll_opts = array();
    }
    add_to_title($locale['global_201'].$locale['401']);
    echo "<!--pre_postnewthread-->";
    opentable($locale['401']);
    if (!isset($_POST['previewpost'])) { echo "<div class='tbl2 forum_breadcrumbs' style='margin-bottom:5px'><a href='generelt.php'>".$settings['sitename']."</a> &raquo; ".$caption."</div>\n"; }

    echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop1'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold){
if(!Hjemmehold._haschanged){
  Hjemmehold.value=\"\"
};
Hjemmehold._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold\" value=\"Hjemmehold\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold\" value=\"Udehold\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip\" value=\"Tip\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds\" value=\"Odds\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";
    echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop2'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop3'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold1){
if(!Hjemmehold1._haschanged){
  Hjemmehold1.value=\"\"
};
Hjemmehold1._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold1\" value=\"Hjemmehold1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold1\" value=\"Udehold1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip1\" value=\"Tip1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds1\" value=\"Odds1\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";

echo "<form id='inputform' method='post' action='".FUSION_SELF."?action=newthread&amp;forum_id=".$_GET['forum_id']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='72' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><select name='Spilstop4'>
<option value='01'>01</option>
<option value='02'>02</option>
<option value='03'>03</option>
<option value='04'>04</option>
<option value='05'>05</option>
<option value='06'>06</option>
<option value='07'>07</option>
<option value='08'>08</option>
<option value='09'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
</select>:<select name='Spilstop5'>
<option value='00'>00</option>
<option value='05'>05</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
<option value='25'>25</option>
<option value='30'>30</option>
<option value='35'>35</option>
<option value='40'>40</option>
<option value='45'>45</option>
<option value='50'>50</option>
<option value='55'>55</option>
</select></td>\n";
echo "<script type=\"text/javascript\">
function fjernTXT(Hjemmehold2){
if(!Hjemmehold2._haschanged){
  Hjemmehold2.value=\"\"
};
Hjemmehold2._haschanged=true;
}
</script>";
echo "<td class='tbl1'><input type=\"text\" name=\"Hjemmehold2\" value=\"Hjemmehold2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td>-</td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Udehold2\" value=\"Udehold2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"255\" style=\"width: 120px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Tip2\" value=\"Tip2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"2\" style=\"width: 20px\" /></td>\n";
echo "<td class='tbl1'><input type=\"text\" name=\"Odds2\" value=\"Odds2\" onfocus=\"fjernTXT(this)\" class=\"textbox\" maxlength=\"10\" style=\"width: 30px\" /></td>\n";
echo "</tr>\n</table>\n";
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
        echo "<td valign='top' width='72' class='tbl2'>".$locale['461a']."</td>\n";
    echo "<td class='tbl1'><textarea name='message' cols='60' rows='15' class='textbox' style='width:98%'>".$message."</textarea></td>\n";
echo "</tr>\n<tr>\n";
    echo "<td width='72' class='tbl2'>&nbsp;</td>\n";
    echo "<td class='tbl1'>".display_bbcodes("99%", "message")."</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td valign='top' width='72' class='tbl2'>".$locale['463']."</td>\n";
    echo "<td class='tbl1'>\n";
    if (iMOD || iSUPERADMIN) {
        echo "<label><input type='checkbox' name='sticky_thread' value='1'".$sticky_thread_check." /> ".$locale['480']."</label><br />\n";
        echo "<label><input type='checkbox' name='lock_thread' value='1'".$lock_thread_check." /> ".$locale['481']."</label><br />\n";
    }
    echo "<label><input type='checkbox' name='disable_smileys' value='1'".$disable_smileys_check." /> ".$locale['482']."</label>";
    if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
        echo "<br />\n<label><input type='checkbox' name='show_sig' value='1'".$sig_checked." /> ".$locale['483']."</label>";
    }
    if ($settings['thread_notify']) { echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'".$notify_checked." /> ".$locale['486']."</label>"; }
    echo "</td>\n</tr>\n";
    if ($fdata['forum_attach'] && checkgroup($fdata['forum_attach'])) {
        add_to_head("<script type='text/javascript' src='".INCLUDES."multi_attachment.js'></script>\n");
        echo "<tr>\n<td width='72' class='tbl2'>".$locale['464']."</td>\n";
        echo "<td class='tbl1'><input id='my_file_element' type='file' name='file_1' class='textbox' style='width:200px;' /><br />\n";
        echo "<span class='small2'>".sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes']), $settings['attachmax_count'])."</span><br />\n";
        echo "<div id='files_list'></div>\n";
        echo "<script>\n";
        echo "/* <![CDATA[ */\n";
        echo "<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->\n";
        echo "var multi_selector = new MultiSelector( document.getElementById( \"files_list\" ), ".$settings['attachmax_count']." );\n";
        echo "<!-- Pass in the file element -->\n";
        echo "multi_selector.addElement( document.getElementById( \"my_file_element\" ) );\n";
        echo "/* ]]>*/\n";
        echo "</script>\n";
        echo "</td>\n";
        echo "</tr>\n";
    }
    if ($fdata['forum_poll'] && checkgroup($fdata['forum_poll'])) {
        echo "<tr>\n<td align='center' colspan='2' class='tbl2'>".$locale['467a']."</td>\n";
        echo "</tr>\n<tr>\n";
        echo "<td width='72' class='tbl2'>".$locale['469']."</td>\n";
        echo "<td class='tbl1'><input type='text' name='poll_title' value='Har du brugt dette forslag?' class='textbox' maxlength='255' style='width:250px' /></td>\n";
        echo "</tr>\n";
        $i = 1;
        if (isset($poll_opts) && is_array($poll_opts) && count($poll_opts)) {
            foreach ($poll_opts as $poll_option) {
                echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." ".$i."</td>\n";
                echo "<td class='tbl1'><input type='text' name='poll_options[$i]' value='".$poll_option."' class='textbox' maxlength='255' style='width:250px'>";
                if ($i == count($poll_opts)) {
                    echo "";
                }
                echo "</td>\n</tr>\n";
                $i++;
            }
        } else {
            echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." 1</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[1]' value='Ja' class='textbox' maxlength='255' style='width:250px' /></td>\n</tr>\n";
            echo "<tr>\n<td width='72' class='tbl2'>".$locale['470']." 2</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[2]' value='Nej' class='textbox' maxlength='255' style='width:250px' /> ";
            echo "</td>\n</tr>\n";
        }
    }
    echo "<tr>\n<td align='center' colspan='2' class='tbl1'>\n";
    echo "\n";
    echo "<input type='submit' name='postnewthread' value='".$locale['401']."' class='button' />\n";
    echo "</td>\n</tr>\n</table>\n</form>\n";
    closetable();
    echo "<!--sub_postnewthread-->";
}
?>
Avatar billede JensPeterSvensson Nybegynder
26. november 2011 - 18:46 #5
Avatar billede zidane5 Nybegynder
26. november 2011 - 19:22 #6
Hej. Mange tak, det virkede squ perfekt! Jeg kan se du har ændret og tilføjet utrolig mange ting. Jeg ville aldrig være kommet frem til det der!

Hvis jeg nu ønsker at tilføje endnu et html input, hvordan gøres dette så helt præcist?

Jeg ved godt jeg først skal tilføje det i $subject = odds_to_string('Spilstop0', 'Spilstop1', 'Hjemmehold0', 'Udehold0', 'Tip0', 'Odds0').'
, men hvordan tilføjer det html inputtet?
Avatar billede zidane5 Nybegynder
26. november 2011 - 19:28 #7
Eller jeg kan se med det du har skrevet, at det er nogle gange det virker efter flere forsøg :(

Det tager ikke alt dataen man indskriver i <br> '.odds_to_string('Spilstop4', 'Spilstop5', 'Hjemmehold4', 'Udehold4', 'Tip4', 'Odds4').'
Avatar billede JensPeterSvensson Nybegynder
26. november 2011 - 21:03 #8
Nu har jeg uploadet en ny version. Der burde gøre det klart, hvor du sætter antallet af kampe.

Hvis dette ikke virker må du lige smide et link til siden, så man kan se hvad HTML'en faktisk ser ud.

PS: Hvis det kræver medlem må du oprette et falsk medlem for mig :)
Avatar billede zidane5 Nybegynder
27. november 2011 - 16:07 #9
Jeg får en fejlmelding i den nye fil du har uploadet.

Får følgende fejl:

Parse error: syntax error, unexpected ')' in /var/www/oddsportal.dk/public_html/forum/postnewthread.php on line 39

Linie 39 er her, men kan ikke se nogen fejl:


39: for($i=0;$i < 2 * $kampe; $i+=){
40: $subject .= $sep.odds_to_string('Spilstop'.$i, 'Spilstop'.($i + 1), 'Hjemmehold'.$i, 'Udehold'.$i, 'Tip'.$i, 'Odds'.$i);
41:  $sep = '<br> ';
42: }
Avatar billede JensPeterSvensson Nybegynder
28. november 2011 - 08:09 #10
Der mangler et 2 tal efter +=
Avatar billede zidane5 Nybegynder
28. november 2011 - 14:23 #11
Det virker stadig ikke :(

Brugernavn: Jensen1
Kode: test1234

Opret et forslag på det her link, og efter du har trykket opret forslag, så venter du i 4 sek og bliver redirected. Så kan du se at der mangler data..

http://oddsportal.dk/forum/post.php?action=newthread&forum_id=2
Avatar billede JensPeterSvensson Nybegynder
28. november 2011 - 16:35 #12
Kom til at oprette 2 forslag:
Det her:
http://oddsportal.dk/forum/forslaget.php?thread_id=590

hvor du nok burde overveje at inddataet i det mindste ikke er standardværdierne.

Og det her:
http://oddsportal.dk/forum/forslaget.php?thread_id=591

Hvor jeg ikke kan se hvilke data du mener der mangler.
Avatar billede zidane5 Nybegynder
28. november 2011 - 16:43 #13
hmm jaa, jeg kan godt se de virker dem du har oprettet.

Men prøv f.eks se det jeg lige har oprettet:

http://oddsportal.dk/forum/forslaget.php?thread_id=592

Der mangler noget af det sidst efter 16:20 =
Avatar billede JensPeterSvensson Nybegynder
28. november 2011 - 16:55 #14
Ja. Min antagelse er at du gemmer det i et varchar felt i databasen.

Feltet er så sat til f.eks. 255 tegn og alt over det bliver bare cuttet.

Løsninger:
Den lette.
Ret felt typen til text, eller varchar længden.

Den svære og mere rigtige:
Ret din kode og database til ikke at gemme inddataet som tekst, men som rigtig information.

Den absurde:
Gem løsningsforslaget som en tekst fil og et link til det i databasen tabellen.
Avatar billede zidane5 Nybegynder
28. november 2011 - 17:16 #15
Hej. Ja jeg tænkte os det var det der var galt. Så jeg ændrede varchat længden.

Mange tak for det!

Lige en sidste forespørgsel, hvis det muligt.

Når man opretter et forslag, er det så muligt vha. javascript måske eller sådan noget, at der kun stå en box med en kamp, og lige under står der f.eks. "tilføj endnu en kamp" og så kommer der en ny kamp hvor man kan indtaste? Og så kan man samtidig indtaste "En kamp færre".

Håber du forstår hvad jeg mener?
Avatar billede zidane5 Nybegynder
30. november 2011 - 16:24 #16
Sender du lige et svar med pointgivning, JensPeterSvensson ?

http://www.eksperten.dk/spm/952322

Kan du evt også kigge på den her, hvis du har mod på lidt mere brugbar hjælp? :)
Avatar billede zidane5 Nybegynder
05. december 2011 - 17:40 #17
xcz
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester