Avatar billede zidane5 Nybegynder
15. oktober 2011 - 22:35 Der er 1 løsning

Hjælp med modficing af følgende

Hej. Er det muligt at få modificeret nedenstående koder. Når man så skriver i felterne: Indskud, mulig gevinst og bookmaker på billede2, så ser de ud som på billede1 med den box i højre side.

Billede1: http://www.oddsportal.dk/billede1.png
Billede2: http://www.oddsportal.dk/billede2.png

I kan prøve at se billede2 på følgende link: http://oddsportal.dk/forum/post.php?action=newthread&forum_id=2

Brugernavn: test
Kode: test1234

Koden til billede2(hvor mange opretter):

<?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['Hjemmehold']))).' - '.trim(stripinput(censorwords($_POST['Udehold']))).' '.
trim(stripinput(censorwords($_POST['Tip']))).', '.trim(stripinput(censorwords($_POST['Odds'])));    $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 "<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'])) {
$subject = trim(stripinput(censorwords($_POST['Spilstop']))).': '.
trim(stripinput(censorwords($_POST['Hjemmehold']))).' - '.trim(stripinput(censorwords($_POST['Udehold']))).' '.
trim(stripinput(censorwords($_POST['Tip']))).', '.trim(stripinput(censorwords($_POST['Odds'])));    $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='145' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><input type='text' name='Spilstop' value='Spilstop' class='textbox' maxlength='5' style='width: 47px' /></td>\n";
echo "<td class='tbl1'><input type='text' name='Hjemmehold' value='Hjemmehold' class='textbox' maxlength='255' style='width: 120px' /></td>\n";
echo "<td>-</td>\n";echo "<td class='tbl1'><input type='text' name='Udehold' value='Udehold' class='textbox' maxlength='255' style='width: 120px' /></td>\n";
echo "<td class='tbl1'><input type='text' name='Tip' value='Tip' class='textbox' maxlength='2' style='width: 20px' /></td>\n";
echo "<td class='tbl1'><input type='text' name='Odds' value='Odds' 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 width='145' class='tbl2'>".$locale['461aa']."</td>\n";
echo "<td class='tbl1'><input type='text' name='Indskud' value='Indskud' class='textbox' maxlength='5' style='width: 47px' /></td>\n";
echo "<td class='tbl1'><input type='text' name='Mulig gevinst' value='Mulig gevinst' class='textbox' maxlength='255' style='width: 120px' /></td>\n";
echo "<td class='tbl1'><input type='text' name='Bookmaker' value='Bookmaker' class='textbox' maxlength='255' style='width: 120px' /></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='120' 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='120' 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='120' 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='145' 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['467']."</td>\n";
        echo "</tr>\n<tr>\n";
        echo "<td width='145' class='tbl2'>".$locale['469']."</td>\n";
        echo "<td class='tbl1'><input type='text' name='poll_title' value='".$poll_title."' 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='145' 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 " <input type='submit' name='add_poll_option' value='".$locale['471']."' class='button' />";
                }
                echo "</td>\n</tr>\n";
                $i++;
            }
        } else {
            echo "<tr>\n<td width='145' class='tbl2'>".$locale['470']." 1</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[1]' value='' class='textbox' maxlength='255' style='width:250px' /></td>\n</tr>\n";
            echo "<tr>\n<td width='145' class='tbl2'>".$locale['470']." 2</td>\n";
            echo "<td class='tbl1'><input type='text' name='poll_options[2]' value='' class='textbox' maxlength='255' style='width:250px' /> ";
            echo "<input type='submit' name='add_poll_option' value='".$locale['471']."' class='button' /></td>\n</tr>\n";
        }
    }
    echo "<tr>\n<td align='center' colspan='2' class='tbl1'>\n";
    echo "<input type='submit' name='previewpost' value='".$locale['400']."' class='button' />\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-->";
}
?>


Kode til billede1(Når man har oprettet det):


<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2009 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: viewthread.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).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_include.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";

$posts_per_page = 20;

add_to_title($locale['global_200'].$locale['400']);

add_to_head('<meta property="fb:admins" content="505635056" />');

add_to_head('<meta property="fb:app_id" content="211818402208881" />');

if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) { redirect("/brugerforslag.php"); }

if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }

$result = dbquery(
    "SELECT t.*, f.*, f2.forum_name AS forum_cat_name
    FROM ".DB_THREADS." t
    LEFT JOIN ".DB_FORUMS." f ON t.forum_id=f.forum_id
    LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
    WHERE t.thread_id='".$_GET['thread_id']."'"
);
if (dbrows($result)) {
    $fdata = dbarray($result);
    if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) { redirect("/brugerforslag.php"); }
} else {
    redirect("/brugerforslag.php");
}

if ($fdata['forum_post'] != 0 && checkgroup($fdata['forum_post'])) {
    $can_post = true;
} else {
    $can_post = false;
}

if ($fdata['forum_reply'] != 0 && checkgroup($fdata['forum_reply'])) {
    $can_reply = true;
} else {
    $can_reply = false;
}

if ($settings['forum_edit_lock'] == 1) {
    $lock_edit = true;
} else {
    $lock_edit = false;
}

if (iGUEST) {
if ($fdata['thread_author'] == $data['user_id']) {
    $can_solve = true;
} else {
    $can_solve = false;
}
}

if (iMEMBER) {
if ($fdata['thread_author'] == $userdata['user_id']) {
    $can_solve = true;
} else {
    $can_solve = false;
}
}

//locale dependent forum buttons
if (is_array($fusion_images)) {
    if ($settings['locale'] != "English") {
        $newpath = "";
        $oldpath = explode("/", $fusion_images['newthread']);
        for ($i = 0; $i < count($oldpath) - 1; $i++) {
            $newpath .= $oldpath[$i]."/";
        }
        if (is_dir($newpath.$settings['locale'])) {
            redirect_img_dir($newpath, $newpath.$settings['locale']."/");
        }
    }
}
//locale dependent forum buttons

$mod_groups = explode(".", $fdata['forum_moderators']);

if (iSUPERADMIN) { define("iMOD", true); }

if (!defined("iMOD") && iMEMBER && $fdata['forum_moderators']) {
    foreach ($mod_groups as $mod_group) {
        if (!defined("iMOD") && checkgroup($mod_group)) { define("iMOD", true); }
    }
}

if (!defined("iMOD")) { define("iMOD", false); }

if (iMEMBER) {
    $thread_match = $fdata['thread_id']."\|".$fdata['thread_lastpost']."\|".$fdata['forum_id'];
    if (($fdata['thread_lastpost'] > $lastvisited) && !preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads'])) {
        $result = dbquery("UPDATE ".DB_USERS." SET user_threads='".$userdata['user_threads'].".".stripslashes($thread_match)."' WHERE user_id='".$userdata['user_id']."'");
    }
}

if ((iMOD || iSUPERADMIN) && isset($_POST['delete_posts']) && (isset($_POST['delete_post'])) && is_array($_POST['delete_post']) && count($_POST['delete_post'])) {
    $del_posts = ""; $i = 0; $post_count = 0;
    foreach ($_POST['delete_post'] as $del_post_id) {
        if (isnum($del_post_id)) { $del_posts .= ($del_posts ? "," : "").$del_post_id; $i++; }
    }
    if ($del_posts) {
        $result = dbquery("SELECT post_author, COUNT(post_id) as num_posts FROM ".DB_POSTS." WHERE post_id IN (".$del_posts.") GROUP BY post_author");
        if (dbrows($result)) {
            while ($pdata = dbarray($result)) {
                $result2 = dbquery("UPDATE ".DB_USERS." SET user_id=user_id-".$pdata['num_posts']." WHERE user_id='".$pdata['post_author']."'");
                $post_count = $post_count + $pdata['num_posts'];
            }
        }
        $result = dbquery("SELECT attach_name FROM ".DB_FORUM_ATTACHMENTS." WHERE post_id IN (".$del_posts.")");
        if (dbrows($result)) {
            while ($data = dbarray($result)) {
                unlink(FORUM."attachments/".$data['attach_name']);
            }
        }
        $result = dbquery("DELETE FROM ".DB_FORUM_ATTACHMENTS." WHERE thread_id='".$_GET['thread_id']."' AND post_id IN(".$del_posts.")");
        $result = dbquery("DELETE FROM ".DB_POSTS." WHERE thread_id='".$_GET['thread_id']."' AND post_id IN(".$del_posts.")");
    }
    if (!dbcount("(post_id)", DB_POSTS, "thread_id='".$_GET['thread_id']."'")) {
        $result = dbquery("DELETE FROM ".DB_THREADS." WHERE thread_id='".$_GET['thread_id']."'");
        $result = dbquery("DELETE FROM ".DB_THREAD_NOTIFY." WHERE thread_id='".$_GET['thread_id']."'");
        $result = dbquery("DELETE FROM ".DB_FORUM_POLL_VOTERS." WHERE thread_id='".$_GET['thread_id']."'");
        $result = dbquery("DELETE FROM ".DB_FORUM_POLL_OPTIONS." WHERE thread_id='".$_GET['thread_id']."'");
        $result = dbquery("DELETE FROM ".DB_FORUM_POLLS." WHERE thread_id='".$_GET['thread_id']."'");
        $thread_count = false;
    } else {
        $result = dbquery("SELECT post_datestamp, post_author, post_id FROM ".DB_POSTS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY post_datestamp DESC LIMIT 1");
        $ldata = dbarray($result);
        $result = dbquery("UPDATE ".DB_THREADS." SET thread_lastpost='".$ldata['post_datestamp']."', thread_lastpostid='".$ldata['post_id']."', thread_postcount=thread_postcount-1, thread_lastuser='".$ldata['post_author']."' WHERE thread_id='".$_GET['thread_id']."'");
        $thread_count = true; unset($ldata);
    }
    $result = dbquery("SELECT post_datestamp, post_author FROM ".DB_POSTS." WHERE forum_id='".$fdata['forum_id']."' ORDER BY post_datestamp DESC LIMIT 1");
    if (dbrows($result)) {
        $ldata = dbarray($result);
        $forum_lastpost = "forum_lastpost='".$ldata['post_datestamp']."', forum_lastuser='".$ldata['post_author']."'";
    } else {
        $forum_lastpost = "forum_lastpost='0', forum_lastuser='0'";
    }
    $result = dbquery("UPDATE ".DB_FORUMS." SET ".$forum_lastpost.(!$thread_count ? "forum_threadcount=forum_threadcount-1," : ",")." forum_postcount=forum_postcount-".$post_count." WHERE forum_id = '".$fdata['forum_id']."'");
    if (!$thread_count) { redirect("viewforum.php?forum_id=".$fdata['forum_id']); }
}

if (isset($_GET['pid']) && isnum($_GET['pid'])) {
    $reply_count = dbcount("(post_id)", DB_POSTS, "thread_id='".$fdata['thread_id']."' AND post_id<='".$_GET['pid']."'");
    if ($reply_count > $posts_per_page) { $_GET['rowstart'] = ((ceil($reply_count / $posts_per_page)-1) * $posts_per_page); }
}

$caption = $fdata['forum_cat_name']." :: <a href='viewforum.php?forum_id=".$fdata['forum_id']."'>".$fdata['forum_name']."</a>";

if (iMEMBER && isset($_POST['cast_vote']) && (isset($_POST['poll_option']) && isnum($_POST['poll_option']))) {
    $result = dbquery("SELECT * FROM ".DB_FORUM_POLL_VOTERS." WHERE forum_vote_user_id='".$userdata['user_id']."' AND thread_id='".$_GET['thread_id']."'");
    if (!dbrows($result)) {
        $result = dbquery("UPDATE ".DB_FORUM_POLL_OPTIONS." SET forum_poll_option_votes=forum_poll_option_votes+1 WHERE thread_id='".$_GET['thread_id']."' AND forum_poll_option_id='".$_POST['poll_option']."'");
        $result = dbquery("UPDATE ".DB_FORUM_POLLS." SET forum_poll_votes=forum_poll_votes+1 WHERE thread_id='".$_GET['thread_id']."'");
        $result = dbquery("INSERT INTO ".DB_FORUM_POLL_VOTERS." (thread_id, forum_vote_user_id, forum_vote_user_ip) VALUES ('".$_GET['thread_id']."', '".$userdata['user_id']."', '".USER_IP."')");
    }
    redirect(FUSION_SELF."?thread_id=".$_GET['thread_id']);
}

if (iMEMBER && $can_reply && !$fdata['thread_locked'] && isset($_POST['postquickreply'])) {
    $message = stripinput(censorwords($_POST['message']));
    if ($message != "") {
        require_once INCLUDES."flood_include.php";
        if (!flood_control("post_datestamp", DB_POSTS, "post_author='".$userdata['user_id']."'")) {
            $sig = ($userdata['user_sig'] ? '1' :'0');
            $smileys = isset($_POST['disable_smileys']) || preg_match("#\[code\](.*?)\[/code\]#si", $message) ? "0" : "1";
            $result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('".$fdata['forum_id']."', '".$_GET['thread_id']."', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
            $newpost_id = mysql_insert_id();
            $result = dbquery("UPDATE ".DB_FORUMS." SET forum_lastpost='".time()."', forum_postcount=forum_postcount+1, forum_lastuser='".$userdata['user_id']."' WHERE forum_id='".$fdata['forum_id']."'");
            $result = dbquery("UPDATE ".DB_THREADS." SET thread_lastpost='".time()."', thread_lastpostid='".$newpost_id."', thread_postcount=thread_postcount+1, thread_lastuser='".$userdata['user_id']."' WHERE thread_id='".$_GET['thread_id']."'");
            $result = dbquery("UPDATE ".DB_USERS." SET user_id=user_id+1 WHERE user_id='".$userdata['user_id']."'");
            redirect("postify.php?post=reply&error=0&forum_id=".$fdata['forum_id']."&thread_id=".$_GET['thread_id']."&post_id=$newpost_id");
        } else {
            redirect("forslaget.php?thread_id=".$_GET['thread_id']);
        }
    }
}

$rows = dbcount("(thread_id)", DB_POSTS, "thread_id='".$_GET['thread_id']."'");

$last_post = dbarray(dbquery("SELECT post_id FROM ".DB_POSTS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY post_datestamp DESC LIMIT 1"));

opentable($locale['500']);
echo "<a name='top'></a>\n";
echo "<!--pre_forum_thread--><div class='tbl2 forum_breadcrumbs' style='margin:0px 0px 4px 0px'><a href='brugerforslag.php'>".$settings['sitename']."</a> &raquo; ".$caption."</div>\n";

if (($rows > $posts_per_page) || ($can_post || $can_reply)) {
    echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n";
    if ($rows > $posts_per_page) { echo "<td style='padding:4px 0px 4px 0px'>".makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id']."&amp;")."</td>\n"; }
    if (iMEMBER && $can_post) {
        echo "<td align='right' style='padding:0px 0px 4px 0px'>\n<!--pre_forum_buttons-->\n";
        if ($can_post) {
            echo "<a href='post.php?action=newthread&amp;forum_id=".$fdata['forum_id']."'>";
            echo "<img src='".get_image("newthread")."' alt='".$locale['566']."' style='border:0px' /></a>\n";
        }
        if (!$fdata['thread_locked'] && $can_reply) {
            echo "<a href='post.php?action=reply&amp;forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>";
            echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
        }
        echo "</td>\n";
    }
    echo "</tr>\n</table>\n";
}

if ($rows != 0) {
    dbquery("UPDATE ".DB_THREADS." SET thread_postcount='$rows', thread_lastpostid='$last_post', thread_views=thread_views+1 WHERE thread_id='".$_GET['thread_id']."'");
    if ($_GET['rowstart'] == 0 && $fdata['thread_poll'] == "1") {
        if (iMEMBER) {
            $presult = dbquery(
                "SELECT tfp.forum_poll_title, tfp.forum_poll_votes, tfv.forum_vote_user_id FROM ".DB_FORUM_POLLS." tfp
                LEFT JOIN ".DB_FORUM_POLL_VOTERS." tfv
                ON tfp.thread_id=tfv.thread_id AND forum_vote_user_id='".$userdata['user_id']."'
                WHERE tfp.thread_id='".$_GET['thread_id']."'"
            );
        } else {
            $presult = dbquery(
                "SELECT tfp.forum_poll_title, tfp.forum_poll_votes FROM ".DB_FORUM_POLLS." tfp
                WHERE tfp.thread_id='".$_GET['thread_id']."'"
            );
        }
        if (dbrows($presult)) {
            $pdata = dbarray($presult); $i = 1;
            if (iMEMBER) { echo "<form name='voteform' method='post' action='".FUSION_SELF."?forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>\n"; }
            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>".$pdata['forum_poll_title']."</strong></td>\n</tr>\n<tr>\n<td class='tbl1'>\n";
            echo "<table align='center' cellpadding='0' cellspacing='0'>\n";
            $presult = dbquery("SELECT forum_poll_option_votes, forum_poll_option_text FROM ".DB_FORUM_POLL_OPTIONS." WHERE thread_id='".$_GET['thread_id']."' ORDER BY forum_poll_option_id ASC");
            $poll_options = dbrows($presult);
            while ($pvdata = dbarray($presult)) {
                if ((iMEMBER && isset($pdata['forum_vote_user_id']) || (!$fdata['forum_vote'] || !checkgroup($fdata['forum_vote'])))) {
                    $option_votes = ($pdata['forum_poll_votes'] ? number_format(100 / $pdata['forum_poll_votes'] * $pvdata['forum_poll_option_votes']) : 0);
                    echo "<tr>\n<td class='tbl1'>".$pvdata['forum_poll_option_text']."</td>\n";
                    echo "<td class='tbl1'><img src='".get_image("pollbar")."' alt='".$pvdata['forum_poll_option_text']."' height='12' width='".(200 / 100 * $option_votes)."' class='poll' /></td>\n";
                    echo "<td class='tbl1'>".$option_votes."%</td><td class='tbl1'>[".$pvdata['forum_poll_option_votes']." ".($pvdata['forum_poll_option_votes'] == 1 ? $locale['global_133'] : $locale['global_134'])."]</td>\n</tr>\n";
                } else {
                    echo "<tr>\n<td class='tbl1'><label><input type='radio' name='poll_option' value='".$i."' style='vertical-align:middle' /> ".$pvdata['forum_poll_option_text']."</label></td>\n</tr>\n";
                    $i++;
                }
            }
            if ((iMEMBER && isset($pdata['forum_vote_user_id']) || (!$fdata['forum_vote'] || !checkgroup($fdata['forum_vote'])))) {
                echo "<tr>\n<td align='center' colspan='4' class='tbl1'>".$locale['480']." : ".$pdata['forum_poll_votes']."</td>\n</tr>\n";
            } else {
                echo "<tr>\n<td class='tbl1'><input type='submit' name='cast_vote' value='".$locale['481']."' class='button' /></td>\n</tr>\n";
            }
            echo "</table>\n</td>\n</tr>\n</table>\n";
            if (iMEMBER) { echo "</form>\n"; }
        }
    }
    $result = dbquery(
        "SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
        p.post_datestamp, p.post_ip, p.post_ip_type, p.post_edituser, p.post_edittime, p.post_editreason,
        u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_id, u.user_groups, u.user_joined,
        ".($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : "")."
        u2.user_name AS edit_name, u2.user_status AS edit_status
        FROM ".DB_POSTS." p
        LEFT JOIN ".DB_USERS." u ON p.post_author = u.user_id
        LEFT JOIN ".DB_USERS." u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
        WHERE p.thread_id='".$_GET['thread_id']."' AND post_hidden='0'
        ORDER BY post_datestamp LIMIT ".$_GET['rowstart'].",$posts_per_page"
    );
    if (iMOD) { echo "<form name='mod_form' method='post' action='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&amp;rowstart=".$_GET['rowstart']."'>\n"; }
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n";
    $numrows = dbrows($result); $current_row = 1; $colorbox_rel = array(); $edit_reason = false;
    while ($data = dbarray($result)) {
        $message = $data['post_message'];
        if ($data['post_smileys']) { $message = parsesmileys($message); }
        if ($current_row == 1) {
            echo "<tr>\n<td colspan='2' class='tbl2 forum-caption'>\n<div style='float:right' class='small'>";
            if (iMEMBER && $settings['thread_notify']) {
                if (dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'")) {
                    $result2 = dbquery("UPDATE ".DB_THREAD_NOTIFY." SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'");
                    echo "<a href='/brugerforslag.php'>".$locale['516']."</a>";
                } else {
                    echo "<a href='/brugerforslag.php'>".$locale['516']."</a>";
                }
            }
            echo "&nbsp;<a href='".BASEDIR."print.php?type=F&amp;thread=".$_GET['thread_id']."&amp;rowstart=".$_GET['rowstart']."'><img src='".get_image("printer")."' alt='".$locale['519']."' title='".$locale['519']."' style='border:0;vertical-align:middle' /></a></div>\n";
            add_to_title($locale['global_201'].$fdata['thread_subject']);
            echo "<div style='position:absolute' class='forum_thread_title'><!--forum_thread_title--><strong>".$fdata['thread_subject']."</strong></div>\n</td>\n</tr>\n";
        }
        echo "<!--forum_thread_prepost_".$current_row."-->\n";
        if ($current_row > 1) { echo "<tr>\n<td colspan='2' class='tbl1 forum_thread_post_space' style='height:10px'></td>\n</tr>\n"; }
        echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:140px'><!--forum_thread_user_name-->".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</td>\n";
        echo "<td class='tbl2 forum_thread_post_date'>\n";
        echo "<div style='float:right' class='small'>";
        echo "\n";
        echo "&nbsp;<a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'></a>";
        echo "</div>\n";
        echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
        echo "</td>\n";
        echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:140px'>\n";
        if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
            echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."' /><br /><br />\n";
        } else {
            echo "<img src='".IMAGES."avatars/noavatar100.png' alt='".$locale['567']."' /><br /><br />\n";
        }
        echo "<span class='small'>";
        if ($data['user_level'] >= 102) {
            echo $settings['forum_ranks'] ? show_forum_rank($data['user_id'], $data['user_level'], $data['user_groups']) : getuserlevel($data['user_level']);
        } else {
            $is_mod = false;
            foreach ($mod_groups as $mod_group) {
                if (!$is_mod && preg_match("(^\.{$mod_group}$|\.{$mod_group}\.|\.{$mod_group}$)", $data['user_groups'])) {
                    $is_mod = true;
                }
            }
            if ($settings['forum_ranks']) {
                echo $is_mod ? show_forum_rank($data['user_id'], 104, $data['user_groups']) : show_forum_rank($data['user_id'], $data['user_level'], $data['user_groups']);
            } else {
                echo $is_mod ? $locale['userf1'] : getuserlevel($data['user_level']);
            }
        }

        echo "</span><br /><br />\n";
        echo "<!--forum_thread_user_info--><span class='small'><strong>".$locale['502']."</strong> ".score_account_stand($user_data['user_id'])."</span><br />\n";
        echo "<!--forum_thread_user_info--><span class='small'><strong>".$locale['502aa']."</strong> ".number_format(dbcount("(post_solved)", DB_POSTS, "post_author='".$userdata['user_id']."' AND post_solved='1'"))."</span><br />\n";
        echo "<!--forum_thread_user_info--><span class='small'><strong>".$locale['502aaa']."</strong> ".round($i_alt, 2)." %</span><br />\n";
        echo "<span class='small'><strong>".$locale['504']."</strong> ".showdate("shortdate", $data['user_joined'])."</span><br />\n";
        echo "<br /></td>\n<td valign='top' class='tbl1 forum_thread_user_post'>\n";
        if (iMOD) { echo "<div style='float:right'><input type='checkbox' name='delete_post[]' value='".$data['post_id']."' /></div>\n"; }
        $message = parseubb($message);
        $message = (isset($_GET['highlight'])) ? "<div class='search_result'>".$message."</div>\n" : $message;
        echo nl2br($message);
        echo "<!--sub_forum_post_message-->";
        $a_result = dbquery("SELECT * FROM ".DB_FORUM_ATTACHMENTS." WHERE post_id='".$data['post_id']."'");
        $a_files = ""; $a_images = ""; $i_files = 0; $i_images = 0;
        if(dbrows($a_result)){
            if (checkgroup($fdata['forum_attach_download'])) {
                while($a_data = dbarray($a_result)){
                    if (!file_exists(FORUM."attachments/".$a_data['attach_name'])) { break; }
                    if (in_array($a_data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$a_data['attach_name'])) {
                        $a_images .= display_image_attach($a_data['attach_name'], "100", "100", $data['post_id'])."\n";
                        $i_images++;
                    } else {
                        if($i_files > 0) $a_files .= "<br />\n";
                        $a_files .= "<a href='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&amp;getfile=".$a_data['attach_id']."'>".$a_data['attach_name']."</a>&nbsp;";
                        $a_files .= "[<span class='small'>".parsebytesize(filesize(FORUM."attachments/".$a_data['attach_name']))." / ".$a_data['attach_count'].$locale['507a']."</span>]\n";
                        $i_files++;
                    }
                }
            } else {
                $a_files = $locale['507b'];
            }
            if ($a_files) {
                echo "<div class='emulated-fieldset'>\n";
                echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_files > 1 ? $locale['506d'] : $locale['506c'])."</span>\n";
                echo "<div class='attachments-list'>".$a_files."</div>\n";
                echo "</div>\n";
            }
            if($a_images){
                $colorbox_rel[] = $data['post_id'];
                echo "<div class='emulated-fieldset'>\n";
                echo "<span class='emulated-legend'>".profile_link($data['user_id'], $data['user_name'], $data['user_status']).$locale['506'].($i_images > 1 ? $locale['506b'] : $locale['506a'])."</span>\n";
                echo "<div class='attachments-list'>".$a_images."</div>\n";
                echo "</div>\n";
            }
        }
        if ($data['post_edittime'] != "0") {
            echo "\n<hr />\n<span class='small'>".$locale['508'].profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']).$locale['509'].showdate("forumdate", $data['post_edittime'])."</span>\n";
            if ($data['post_editreason'] != "" && iMEMBER) {
                $edit_reason = true;
                echo "<br /><div class='edit_reason'><a id='reason_pid_".$data['post_id']."' rel='".$data['post_id']."' class='reason_button small' href='#reason_div_pid_".$data['post_id']."'>";
                echo "<strong>".$locale['508a']."</strong>";
                echo "</a>\n";
                echo "<div id='reason_div_pid_".$data['post_id']."' class='reason_div small'>".$data['post_editreason']."</div></div>\n";
            }
        }
        if ($data['post_showsig'] && isset($data['user_sig']) && $data['user_sig'] && $data['user_status']!=6 && $data['user_status']!=5) {
        }
        echo "<!--sub_forum_post--></td>\n</tr>\n";
        echo "<tr>\n<td class='tbl2 forum_thread_ip' style='width:140px;white-space:nowrap'>";
        if (($settings['forum_ips'] && iMEMBER) || iMOD) { echo "<strong>".$locale['571']."</strong>: ".$data['post_ip']; } else { echo "&nbsp;"; }
        echo "</td>\n<td class='tbl2 forum_thread_userbar'>\n<div style='float:left;white-space:nowrap' class='small'><!--forum_thread_userbar-->\n";
        if (isset($data['user_web']) && $data['user_web'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
            if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
            echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".get_image("web")."' alt='".$data['user_web']."' style='border:0;vertical-align:middle' /></a> ";
        }
        if (iMEMBER && $data['user_id']!=$userdata['user_id'] && (iADMIN || $data['user_status']!=6 && $data['user_status']!=5)) {
            echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".get_image("pm")."' alt='".$locale['572']."' style='border:0;vertical-align:middle' /></a>\n";
        }
        echo "</div>\n<div style='float:right' class='small'>\n";
        if (iMEMBER && ($can_post || $can_reply)) {
            if (!$fdata['thread_locked']) {
                echo "\n";
                if (iMOD || (($lock_edit && $last_post['post_id'] == $data['post_id'] || !$lock_edit)) && ($userdata['user_id'] == $data['post_author']) && ($settings['forum_edit_timelimit'] <= 0 || time() - $settings['forum_edit_timelimit']*60 < $data['post_datestamp'])) {
                    echo "<a href='post.php?action=edit&amp;forum_id=".$data['forum_id']."&amp;thread_id=".$data['thread_id']."&amp;post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' alt='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
                }
            } elseif (iMOD) {
                echo "<a href='post.php?action=edit&amp;forum_id=".$data['forum_id']."&amp;thread_id=".$data['thread_id']."&amp;post_id=".$data['post_id']."'><img src='".get_image("forum_edit")."' alt='".$locale['568']."' style='border:0px;vertical-align:middle' /></a>\n";
            }
        }
        echo "</div>\n</td>\n</tr>\n";
        $current_row++;
    }
    /** javascript **/
    // highlight jQuery plugin
    if (isset($_GET['highlight'])) {
        $words = explode(" ", urldecode($_GET['highlight']));
        $higlight = ""; $i = 1; $c_words = count($words);
        foreach ($words as $hlight) {
            $higlight .= "'".$hlight."'";
            $higlight .= ($i < $c_words ? "," : "");
            $i++;
        }
        add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/jquery.highlight.js'></script>");
        $highlight_js .=  "jQuery('.search_result').highlight([".$higlight."],{wordsOnly:true});";
        $highlight_js .=  "jQuery('.highlight').css({backgroundColor:'#FFFF88'});"; //better via theme or settings
    }
    // colourbox jQuery plugin
    if (count($colorbox_rel) > 0) {
        add_to_head("<link rel='stylesheet' href='".INCLUDES."jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
        add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/colorbox/jquery.colorbox.js'></script>");
        $colorbox_js .=    "jQuery('a[rel^=\"attach\"]').colorbox({";
        $colorbox_js .=      "current:'".$locale['506e']." {current} ".$locale['506f']." {total}',width:'80%',height:'80%'";
        $colorbox_js .=    "});";
    } unset($colorbox_rel);
    // edit reason
    if ($edit_reason) {
        $edit_reason_js .=    "jQuery('div[id^=\"reason_div_pid\"]').hide();";
        $edit_reason_js .=    "jQuery('div').find('a[id^=\"reason_pid\"]').css({cursor:'pointer'})";
        $edit_reason_js .=    ".removeAttr('href')";
        $edit_reason_js .=    ".attr('title','".str_replace("'","&#39;",$locale['508b'])."')";
        $edit_reason_js .=    ".bind('click',function(){";
        $edit_reason_js .=      "jQuery('#reason_div_pid_'+this.rel).slideToggle('slow');";
        $edit_reason_js .=    "});";
    }
}

echo "</table><!--sub_forum_thread_table-->\n";

if (iMOD) {
    echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n<td style='padding-top:5px'>";
    echo "<a href='#' onclick=\"java script:setChecked('mod_form','delete_post[]',1);return false;\">".$locale['460']."</a> ::\n";
    echo "<a href='#' onclick=\"java script:setChecked('mod_form','delete_post[]',0);return false;\">".$locale['461']."</a></td>\n";
    echo "<td align='right' style='padding-top:5px'><input type='submit' name='move_posts' value='".$locale['517a']."' class='button' onclick=\"return confirm('".$locale['518a']."');\" />\n<input type='submit' name='delete_posts' value='".$locale['517']."' class='button' onclick=\"return confirm('".$locale['518']."');\" /></td>\n";
    echo "</tr>\n</table>\n</form>\n";
}

if ($rows > $posts_per_page) {
    echo "<div align='center' style='padding-top:5px'>\n";
    echo makepagenav($_GET['rowstart'],$posts_per_page,$rows,3,FUSION_SELF."?thread_id=".$_GET['thread_id'].(isset($_GET['highlight']) ? "&amp;highlight=".urlencode($_GET['highlight']):"")."&amp;")."\n";
    echo "</div>\n";
}

$forum_list = ""; $current_cat = "";
$result = dbquery(
    "SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
    FROM ".DB_FORUMS." f
    INNER JOIN ".DB_FORUMS." f2 ON f.forum_cat=f2.forum_id
    WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' AND f.forum_cat IN (1)
    ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
while ($data = dbarray($result)) {
    if ($data['forum_cat_name'] != $current_cat) {
        if ($current_cat != "") { $forum_list .= "</optgroup>\n"; }
        $current_cat = $data['forum_cat_name'];
        $forum_list .= "<optgroup label='".$data['forum_cat_name']."'>\n";
    }
    $sel = ($data['forum_id'] == $fdata['forum_id'] ? " selected='selected'" : "");
    $forum_list .= "<option value='".$data['forum_id']."'$sel>".$data['forum_name']."</option>\n";
}
$forum_list .= "</optgroup>\n";
if (iMOD) {
    echo "<form name='modopts' method='post' action='options.php?forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>\n";
}

if (iMOD || $can_solve) { echo "<form name='modopts' method='post' action='options.php?forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>\n"; }
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td style='padding-top:5px'>".$locale['540']."<br />\n";
echo "<select name='jump_id' class='textbox' onchange=\"jumpforum(this.options[this.selectedIndex].value);\">\n";
echo $forum_list."</select></td>\n";

if (iMOD || $can_solve) {
    echo "<td align='right' style='padding-top:5px'>\n";
    echo "<img src='".INFUSIONS."forum_threads_list_panel/images/cmark.gif' alt='".$locale['531']."' border='0' />&nbsp; ".$locale['531'].": &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />\n<select name='step' class='textbox'>\n";
    echo "<option value='none'>&nbsp;</option>\n";
if (iMOD) {
    echo "<option value='renew'>".$locale['527']."</option>\n";
    echo "<option value='delete'>".$locale['521']."</option>\n";
}
    echo "<option value='solved'>".$locale['529']."</option>\n";
if (iMOD) {
    echo "<option value='unsolved'>".$locale['530']."</option>\n";
}
if (iMOD) {
    echo "<option value='".($fdata['thread_locked'] ? "unlock" : "lock")."'>".($fdata['thread_locked'] ? $locale['523'] : $locale['522'])."</option>\n";
    echo "<option value='".($fdata['thread_sticky'] ? "nonsticky" : "sticky")."'>".($fdata['thread_sticky'] ? $locale['525'] : $locale['524'])."</option>\n";
    echo "<option value='move'>".$locale['526']."</option>\n";
}
    echo "</select>\n<input type='submit' name='go' value='".$locale['528']."' class='button' />\n";
    echo "</td>\n";
}
echo "</tr>\n</table>\n"; if (iMOD || $can_solve) { echo "</form>\n"; }


if ($can_post || $can_reply) {
    echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
    echo "<td align='left' style='padding-top:15px'>\n<!--post_forum_buttons-->\n";
    if ($can_post) {
        echo "<b><font size='4'><font color='black'>Kommenter forslaget</font></font></font></br></br>";
    }

//facebook kommentar box ->
?>
<center>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://oddsportal.dk" num_posts="100" width="665">
</fb:comments>
</center>
<?
//Slut for facebook kommentar box.

echo "</body>\n</html>\n";


    if (!$fdata['thread_locked'] && $can_reply) {
        echo "<a href='post.php?action=reply&amp;forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>";
        echo "<img src='".get_image("reply")."' alt='".$locale['565']."' style='border:0px' /></a>\n";
    }
    echo "</td>\n</tr>\n</table>\n";

}
closetable();

if ($can_reply && !$fdata['thread_locked']) {
    require_once INCLUDES."bbcode_include.php";
    opentable($locale['512']);
    echo "<form name='inputform' method='post' action='".FORUM."post.php?action=reply&amp;forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>\n";
    echo "<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
    echo "<td align='center' class='tbl1'><textarea name='message' cols='70' rows='7' class='textbox' style='width:98%'></textarea><br />\n";
    echo display_bbcodes("360px", "message")."</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' class='tbl2'><label><input type='checkbox' name='disable_smileys' value='1' /> ".$locale['513']."</label>";
    if (array_key_exists("user_sig", $userdata) && $userdata['user_sig']) {
        echo "<br />\n<label><input type='checkbox' name='show_sig' value='1' checked='checked' /> ".$locale['513a']."</label>";
    }
    if ($settings['thread_notify']) {
        if (dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'")) {
            $notify_checked = " checked='checked'";
        } else {
            $notify_checked = "";
        }
        echo "<br />\n<label><input type='checkbox' name='notify_me' value='1'".$notify_checked." /> ".$locale['513b']."</label>";
    }
    echo "</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' class='tbl1'><input type='submit' name='postreply' value='".$locale['514']."' class='button' /></td>\n";
    echo "</tr>\n</table>\n</form><!--sub_forum_thread-->\n";
    closetable();
}

// viewthread javascript, moved to footer
$viewthread_js  = "<script type='text/javascript'>";
$viewthread_js .= "/*<![CDATA[*/";
$viewthread_js .= "jQuery(document).ready(function(){";
if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)){
    $viewthread_js .= $highlight_js.$colorbox_js.$edit_reason_js;
}
$viewthread_js .= "jQuery('a[href=#top]').click(function(){";
$viewthread_js .=    "jQuery('html, body').animate({scrollTop:0}, 'slow');";
$viewthread_js .=    "return false;";
$viewthread_js .= "});";
$viewthread_js .= "});";
// below functions could be made more unobtrusive thanks to jQuery, giving a more accessible cms
$viewthread_js .= "function jumpforum(forum_id){";
$viewthread_js .=    "document.location.href='".FORUM."viewforum.php?forum_id='+forum_id;";
$viewthread_js .= "}";
if (iMOD) { // only moderators need this javascript
    $viewthread_js .= "function setChecked(frmName,chkName,val){";
    $viewthread_js .=    "dml=document.forms[frmName];";
    $viewthread_js .=        "len=dml.elements.length;";
    $viewthread_js .=        "for(i=0;i<len;i++){";
    $viewthread_js .=            "if(dml.elements[i].name==chkName){";
    $viewthread_js .=                "dml.elements[i].checked=val;";
    $viewthread_js .=            "}";
    $viewthread_js .=        "}";
    $viewthread_js .= "}"; }
$viewthread_js .= "/*]]>*/";
$viewthread_js .= "</script>";

add_to_footer($viewthread_js); //unset($viewthread_js);

require_once THEMES."templates/footer.php";
?>
Avatar billede zidane5 Nybegynder
06. december 2011 - 23:29 #1
fd
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