Hvem er her? 1 gæst(er)
User Gold
tedo
Lagt på d. 03-12-2006 11:43
Lidt øvet
Antal indlæg: 17
Tilmeldt: 28/10/2006 02:49
Hej
Den funkar inte som det ska.....User Gold/forum/viewthread,det är nåt fel på den,när man skriver i forum kommer inget fram sen...
viewthread.php
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_functions_include.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/main.php";
$posts_per_page = 20;
if (!FUSION_QUERY || !isset($forum_id) || !isNum($forum_id) || !isset($thread_id) || !isNum($thread_id)) fallback("index.php");
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_id='".$forum_id."'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) fallback("index.php");
} else {
fallback("index.php");
}
$can_post = checkgroup($fdata['forum_posting']);
$forum_mods = explode(".", $fdata['forum_moderators']);
if (iMEMBER && in_array($userdata['user_id'], $forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
$result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='".$thread_id."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $tdata = dbarray($result); } else { fallback("index.php"); }
$caption = $fdata['forum_cat_name']." | <a href='viewforum.php?forum_id=".$fdata['forum_id']."'>".$fdata['forum_name']."</a>";
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_views=thread_views+1 WHERE thread_id='$thread_id'");
if (iMEMBER && $can_post && isset($_POST['postquickreply'])) {
$flood = false;
$message = stripinput(censorwords($_POST['message']));
if ($message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$sig = ($userdata['user_sig'] ? '1' :'0');
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = "RE: ".$tdata['thread_subject'];
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".time()."', thread_lastuser='".$userdata['user_id']."' WHERE thread_id='$thread_id'");
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
//start gold addon
paygold($userdata['user_name'],$userdata['user_id'],USER_GOLD_REPLY);
//end gold addon
$newpost_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
redirect("postify.php?post=reply&error=0&forum_id=$forum_id&thread_id=$thread_id&post_id=$newpost_id");
}
}
}
opentable($locale['500']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='smallalt'><a href='index.php'>".$settings['sitename']."</a> | $caption</td>\n";
if (iMEMBER && $can_post) {
echo "<td align='right'>\n";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a></td>\n";
}
echo "</tr>
</table>\n";
$rows = dbcount("(thread_id)", "posts", "thread_id='$thread_id'");
if (isset($pid) && isNum($pid)) {
$reply_count = dbcount("(post_id)", "posts", "thread_id='".$tdata['thread_id']."' AND post_id<='".$pid."'");
if ($reply_count > $posts_per_page) $rowstart = ((ceil($reply_count / $posts_per_page)-1)*$posts_per_page);
}
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;margin-bottom:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
if ($rows != 0) {
$result = dbquery(
"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
);
$numrows = dbrows($result);
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_showsig']) { $message = $message."\n\n<hr>".$data['user_sig']; }
if ($data['post_smileys']) { $message = parsesmileys($message); }
$message = parseubb($message);
$message = nl2br($message);
if ($data['post_edittime'] != "0") {
$edituser = "<a href='../profile.php?lookup=".$data['post_edituser']."'>".$data['edit_name']."</a>";
$edittime = showdate("forumdate", $data['post_edittime']);
}
$is_mod = in_array($data['user_id'], $forum_mods) && $data['user_level'] < "102" ? true : false;
echo "<tr>
<td width='145' class='tbl2'>".$locale['501']."</td>
<td class='tbl2'><a name='post_".$data['post_id']."' id='post_".$data['post_id']."'></a>".$data['post_subject']."</td>
</tr>
<tr>
<td valign='top' rowspan='3' width='145' class='tbl1'>
<a href='../profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a><br>
<span class='alt'>".($is_mod ? $locale['userf1'] : getuserlevel($data['user_level']))."</span><br><br>\n";
if ($data['user_avatar'] != "") {
echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."'><br><br>\n";
$height = "185";
} else {
$height = "70";
}
if (file_exists(INFUSIONS."user_gold_panel/functions.php")) { include_once INFUSIONS."user_gold_panel/functions.php"; echo "<span class='alt'><img src='images/gold.gif'> </span> ".getallgold($data['user_id'])."<br>"; }
echo "<span class='alt'>".$locale['502']."</span> ".$data['user_posts']."<br>\n";
if ($data['user_location']) echo "<span class='alt'>".$locale['503']."</span> ".$data['user_location']."<br>\n";
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."</td>
<td>
<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='tbl1'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</td>
<td align='right' class='tbl1'>\n";
if (iMEMBER && $can_post) {
if (!$tdata['thread_locked']) {
if ($userdata['user_id'] == $data['post_author'] || iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id'].""e=".$data['post_id']."'><img src='".THEME."forum/quote.gif' alt='".$locale['569']."' style='border:0px;'></a>\n";
if (iMOD || iSUPERADMIN && $data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
} else {
if (iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
if ($data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
}
}
}
echo "</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' height='$height' class='tbl1'>
$message";
if ($data['attach_id']) {
if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$data['attach_name'])) {
echo "<hr>\n".$data['user_name'].$locale['506']."<br><br>\n<img src='".FORUM."attachments/".$data['attach_name']."'>";
} else {
echo "<hr>\n".$data['user_name'].$locale['507']."<br>\n<a href='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&getfile=".$data['post_id']."'>".$data['attach_name']."</a>";
}
}
if ($data['post_edittime'] != "0") {
echo "<hr>\n".$locale['508'].$edituser.$locale['509']."$edittime";
}
echo "</td>
</tr>
<tr>
<td class='tbl1'>\n";
if ($data['user_aim'] && file_exists(THEME."forum/aim.gif")) {
echo "<a href='aim:goim?screenname=".str_replace(" ", "+", $data['user_aim'])."' target='_blank'><img src='".THEME."forum/aim.gif' alt='".$data['user_aim']."' style='border:0px;'></a> ";
}
if ($data['user_icq']) {
echo "<a href='http://web.icq.com/wwp?Uin=".$data['user_icq']."' target='_blank'><img src='".THEME."forum/icq.gif' alt='".$data['user_icq']."' style='border:0px;'></a> ";
}
if ($data['user_msn']) {
echo "<a href='mailto:$data[user_msn]'><img src='".THEME."forum/msn.gif' alt='".$data['user_msn']."' style='border:0px;'></a> ";
}
if ($data['user_yahoo']) {
echo "<a href='http://uk.profiles.yahoo.com/$data[user_yahoo]' target='_blank'><img src='".THEME."forum/yahoo.gif' alt='".$data['user_yahoo']."' style='border:0px;'></a> ";
}
if ($data['user_web']) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".THEME."forum/web.gif' alt='".$data['user_web']."' style='border:0px;'></a> ";
}
echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".THEME."forum/pm.gif' alt='".$locale['571']."' style='border:0px;'></a>
</td>
</tr>\n";
}
}
echo "</table>\n";
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='0' width='100%' style='margin-top:5px;'>\n<tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' 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" : "");
$forum_list .= "<option value='".$data['forum_id']."'$sel>".$data['forum_name']."</option>\n";
}
$forum_list .= "</optgroup>\n";
echo "<td align='left' class='tbl'>".$locale['540']."<br>
<select name='jump_id' class='textbox' onChange=\"jumpForum(this.options[this.selectedIndex].value);\">
$forum_list</select></td>\n";
if (iMEMBER && $can_post) {
if (iMOD || iSUPERADMIN) {
echo "<td align='right' class='tbl'>
<form name='modopts' method='post' action='options.php?forum_id=$forum_id&thread_id=$thread_id'>
".$locale['520']."<br>
<select name='step' class='textbox'>
<option value='none'> </option>
<option value='renew'>".$locale['527']."</option>
<option value='delete'>".$locale['521']."</option>\n";
if (!$tdata['thread_locked']) {
echo "<option value='lock'>".$locale['522']."</option>\n";
} else {
echo "<option value='unlock'>".$locale['523']."</option>\n";
}
if (!$tdata['thread_sticky']) {
echo "<option value='sticky'>".$locale['524']."</option>\n";
} else {
echo "<option value='nonsticky'>".$locale['525']."</option>\n";
}
echo "<option value='move'>".$locale['526']."</option>\n";
echo "</select>
<input type='submit' name='go' value='".$locale['528']."' class='button'>
</form>
</td>
</tr>\n";
}
}
echo "</table>\n";
if (iMEMBER) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
if ($settings['thread_notify']) {
echo "<td valign='top' class='tbl'>";
if (dbcount("(thread_id)", "thread_notify", "thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'")) {
$result = dbquery("UPDATE ".$db_prefix."thread_notify SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'");
$notify_link = "<a href='postify.php?post=off&forum_id=$forum_id&thread_id=$thread_id'>".$locale['515']."</a>";
} else {
$notify_link = "<a href='postify.php?post=on&forum_id=$forum_id&thread_id=$thread_id'>".$locale['516']."</a>";
}
echo "$notify_link</td>\n";
}
if ($can_post) {
echo "<td align='right' class='tbl'>";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a>\n";
echo "</td>\n";
}
echo "</tr>\n</table>\n";
}
closetable();
tablebreak();
if (iMEMBER && $can_post && !$tdata['thread_locked']) {
opentable($locale['512']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id'>
<table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>
<tr>
<td align='center' class='tbl1'><textarea name='message' cols='80' rows='7' class='textbox'></textarea><br>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('message', '[b]', '[/b]');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('message', '[i]', '[/i]');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('message', '[u]', '[/u]');\">
<input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('message', '[url]', '[/url]');\">
<input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('message', '[mail]', '[/mail]');\">
<input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('message', '[img]', '[/img]');\">
<input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('message', '[center]', '[/center]');\">
<input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('message', '[small]', '[/small]');\">
<input type='button' value='code' class='button' style='width:40px;' onClick=\"addText('message', '[code]', '
');\">
<input type='button' value='quote' class='button' style='width:45px;' onClick=\"addText('message', '', '
');\"></td>
</tr>
<tr>
<td align='center' class='tbl2'>".displaysmileys("message")."<br>
<input type='checkbox' name='disable_smileys' value='1'>".$locale['513']."</td>
</tr>
<tr>
<td align='center' class='tbl1'><input type='submit' name='postquickreply' value='".$locale['514']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
}
echo "<script type='text/javascript'>
function jumpForum(forumid) {
document.location.href='".FORUM."viewforum.php?forum_id='+forumid;
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>[/code]
Redigeret af assensvej d. 03-12-2006 13:21
Skrevet d. 22-11-2024 19:33
Reklame Agent
Antal indlæg: n^x
Tilmeldt: Altid
IP : localhost
assensvej
Lagt på d. 03-12-2006 13:21
Superadministrator
Antal indlæg: 1735
Tilmeldt: 15/01/2006 11:36
Jamen det må jeg jo lige kigge på
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
assensvej
Lagt på d. 03-12-2006 13:28
Superadministrator
Antal indlæg: 1735
Tilmeldt: 15/01/2006 11:36
Så har jeg kigget på den så nu skulle den virke det gør den hos mig jeg fik 10 point for sidste indlæg
Redigeret af assensvej d. 03-12-2006 13:29
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
tedo
Lagt på d. 05-12-2006 03:30
Lidt øvet
Antal indlæg: 17
Tilmeldt: 28/10/2006 02:49
är den ok nu????
tedo
Lagt på d. 05-12-2006 03:42
Lidt øvet
Antal indlæg: 17
Tilmeldt: 28/10/2006 02:49
det är fel igen ,,,,,,
assensvej
Lagt på d. 05-12-2006 06:40
Superadministrator
Antal indlæg: 1735
Tilmeldt: 15/01/2006 11:36
Hvad er din fejl Tito
jeg få point hele tiden ved at skrive her
prøv at lægge marke til dine point ind du skriver
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
Gangsebangse
Lagt på d. 06-12-2006 23:40
Begynder
Antal indlæg: 4
Tilmeldt: 06/12/2006 22:53
,ljg
tedo
Lagt på d. 08-12-2006 18:18
Lidt øvet
Antal indlæg: 17
Tilmeldt: 28/10/2006 02:49
Det kommer inget fram när jag vill öppna ett inlägg i Forum tillexempel............vet ej varför jag behöver en hel ny User gold panel till min Fusion v6.01.6................Denna ikke funkar
Gangsebangse
Lagt på d. 12-12-2006 01:28
Begynder
Antal indlæg: 4
Tilmeldt: 06/12/2006 22:53
hej
Lagt på d. 13-12-2006 08:55
Begynder
Antal indlæg:
Tilmeldt: 01/01/1970 02:00
jeg står med samme problem...
http://www.gfocla...read_id=28
stopper min ved..
jeg lage den orginale postify.php ind igen og så dur det igen
men jeg kan ikke få donate frem eller at man kan se gold i forum
Redigeret af d. 13-12-2006 17:31
Thomas
Lagt på d. 19-12-2006 02:07
Administrator
Antal indlæg: 17
Tilmeldt: 15/08/2006 22:49
Her er min viewthread.php
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_functions_include.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/main.php";
$posts_per_page = 20;
if (!FUSION_QUERY || !isset($forum_id) || !isNum($forum_id) || !isset($thread_id) || !isNum($thread_id)) fallback("index.php");
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_id='".$forum_id."'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) fallback("index.php");
} else {
fallback("index.php");
}
$can_post = checkgroup($fdata['forum_posting']);
$forum_mods = explode(".", $fdata['forum_moderators']);
if (iMEMBER && in_array($userdata['user_id'], $forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
$result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='".$thread_id."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $tdata = dbarray($result); } else { fallback("index.php"); }
$caption = $fdata['forum_cat_name']." | <a href='viewforum.php?forum_id=".$fdata['forum_id']."'>".$fdata['forum_name']."</a>";
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_views=thread_views+1 WHERE thread_id='$thread_id'");
if (iMEMBER && $can_post && isset($_POST['postquickreply'])) {
$flood = false;
$message = stripinput(censorwords($_POST['message']));
if ($message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$sig = ($userdata['user_sig'] ? '1' :'0');
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = "RE: ".$tdata['thread_subject'];
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".time()."', thread_lastuser='".$userdata['user_id']."' WHERE thread_id='$thread_id'");
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
[color=lime]//start gold addon
paygold($userdata['user_name'],$userdata['user_id'],USER_GOLD_REPLY);
//end gold addon[/color]
$newpost_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
redirect("postify.php?post=reply&error=0&forum_id=$forum_id&thread_id=$thread_id&post_id=$newpost_id");
}
}
}
opentable($locale['500']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='smallalt'><a href='index.php'>".$settings['sitename']."</a> | $caption</td>\n";
if (iMEMBER && $can_post) {
echo "<td align='right'>\n";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a></td>\n";
}
echo "</tr>
</table>\n";
$rows = dbcount("(thread_id)", "posts", "thread_id='$thread_id'");
if (isset($pid) && isNum($pid)) {
$reply_count = dbcount("(post_id)", "posts", "thread_id='".$tdata['thread_id']."' AND post_id<='".$pid."'");
if ($reply_count > $posts_per_page) $rowstart = ((ceil($reply_count / $posts_per_page)-1)*$posts_per_page);
}
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;margin-bottom:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
if ($rows != 0) {
$result = dbquery(
"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
);
$numrows = dbrows($result);
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_showsig']) { $message = $message."\n\n<hr>".$data['user_sig']; }
if ($data['post_smileys']) { $message = parsesmileys($message); }
$message = parseubb($message);
$message = nl2br($message);
if ($data['post_edittime'] != "0") {
$edituser = "<a href='../profile.php?lookup=".$data['post_edituser']."'>".$data['edit_name']."</a>";
$edittime = showdate("forumdate", $data['post_edittime']);
}
$is_mod = in_array($data['user_id'], $forum_mods) && $data['user_level'] < "102" ? true : false;
echo "<tr>
<td width='145' class='tbl2'>".$locale['501']."</td>
<td class='tbl2'><a name='post_".$data['post_id']."' id='post_".$data['post_id']."'></a>".$data['post_subject']."</td>
</tr>
<tr>
<td valign='top' rowspan='3' width='145' class='tbl1'>
<a href='../profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a><br>
<span class='alt'>".($is_mod ? $locale['userf1'] : getuserlevel($data['user_level']))."</span><br><br>\n";
if ($data['user_avatar'] != "") {
echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."'><br><br>\n";
$height = "185";
} else {
$height = "70";
}
[color=lime]if (file_exists(INFUSIONS."user_gold_panel/functions.php")) { include_once INFUSIONS."user_gold_panel/functions.php"; echo "<span class='alt'><img src='images/gold.gif'> </span> ".getallgold($data['user_id'])."<br>"; }[/color]
echo "<span class='alt'>".$locale['502']."</span> ".$data['user_posts']."<br>\n";
if ($data['user_location']) echo "<span class='alt'>".$locale['503']."</span> ".$data['user_location']."<br>\n";
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."</td>
<td>
<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='tbl1'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</td>
<td align='right' class='tbl1'>\n";
if (iMEMBER && $can_post) {
if (!$tdata['thread_locked']) {
if ($userdata['user_id'] == $data['post_author'] || iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id'].""e=".$data['post_id']."'><img src='".THEME."forum/quote.gif' alt='".$locale['569']."' style='border:0px;'></a>\n";
if (iMOD || iSUPERADMIN && $data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
} else {
if (iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
if ($data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
}
}
}
echo "</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' height='$height' class='tbl1'>
$message";
if ($data['attach_id']) {
if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$data['attach_name'])) {
echo "<hr>\n".$data['user_name'].$locale['506']."<br><br>\n<img src='".FORUM."attachments/".$data['attach_name']."'>";
} else {
echo "<hr>\n".$data['user_name'].$locale['507']."<br>\n<a href='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&getfile=".$data['post_id']."'>".$data['attach_name']."</a>";
}
}
if ($data['post_edittime'] != "0") {
echo "<hr>\n".$locale['508'].$edituser.$locale['509']."$edittime";
}
echo "</td>
</tr>
<tr>
<td class='tbl1'>\n";
if ($data['user_aim'] && file_exists(THEME."forum/aim.gif")) {
echo "<a href='aim:goim?screenname=".str_replace(" ", "+", $data['user_aim'])."' target='_blank'><img src='".THEME."forum/aim.gif' alt='".$data['user_aim']."' style='border:0px;'></a> ";
}
if ($data['user_icq']) {
echo "<a href='http://web.icq.com/wwp?Uin=".$data['user_icq']."' target='_blank'><img src='".THEME."forum/icq.gif' alt='".$data['user_icq']."' style='border:0px;'></a> ";
}
if ($data['user_msn']) {
echo "<a href='mailto:$data[user_msn]'><img src='".THEME."forum/msn.gif' alt='".$data['user_msn']."' style='border:0px;'></a> ";
}
if ($data['user_yahoo']) {
echo "<a href='http://uk.profiles.yahoo.com/$data[user_yahoo]' target='_blank'><img src='".THEME."forum/yahoo.gif' alt='".$data['user_yahoo']."' style='border:0px;'></a> ";
}
if ($data['user_web']) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".THEME."forum/web.gif' alt='".$data['user_web']."' style='border:0px;'></a> ";
}
echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".THEME."forum/pm.gif' alt='".$locale['571']."' style='border:0px;'></a>
</td>
</tr>\n";
}
}
echo "</table>\n";
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='0' width='100%' style='margin-top:5px;'>\n<tr>\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' 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" : "");
$forum_list .= "<option value='".$data['forum_id']."'$sel>".$data['forum_name']."</option>\n";
}
$forum_list .= "</optgroup>\n";
echo "<td align='left' class='tbl'>".$locale['540']."<br>
<select name='jump_id' class='textbox' onChange=\"jumpForum(this.options[this.selectedIndex].value);\">
$forum_list</select></td>\n";
if (iMEMBER && $can_post) {
if (iMOD || iSUPERADMIN) {
echo "<td align='right' class='tbl'>
<form name='modopts' method='post' action='options.php?forum_id=$forum_id&thread_id=$thread_id'>
".$locale['520']."<br>
<select name='step' class='textbox'>
<option value='none'> </option>
<option value='renew'>".$locale['527']."</option>
<option value='delete'>".$locale['521']."</option>\n";
if (!$tdata['thread_locked']) {
echo "<option value='lock'>".$locale['522']."</option>\n";
} else {
echo "<option value='unlock'>".$locale['523']."</option>\n";
}
if (!$tdata['thread_sticky']) {
echo "<option value='sticky'>".$locale['524']."</option>\n";
} else {
echo "<option value='nonsticky'>".$locale['525']."</option>\n";
}
echo "<option value='move'>".$locale['526']."</option>\n";
echo "</select>
<input type='submit' name='go' value='".$locale['528']."' class='button'>
</form>
</td>
</tr>\n";
}
}
echo "</table>\n";
if (iMEMBER) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
if ($settings['thread_notify']) {
echo "<td valign='top' class='tbl'>";
if (dbcount("(thread_id)", "thread_notify", "thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'")) {
$result = dbquery("UPDATE ".$db_prefix."thread_notify SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'");
$notify_link = "<a href='postify.php?post=off&forum_id=$forum_id&thread_id=$thread_id'>".$locale['515']."</a>";
} else {
$notify_link = "<a href='postify.php?post=on&forum_id=$forum_id&thread_id=$thread_id'>".$locale['516']."</a>";
}
echo "$notify_link</td>\n";
}
if ($can_post) {
echo "<td align='right' class='tbl'>";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a>\n";
echo "</td>\n";
}
echo "</tr>\n</table>\n";
}
closetable();
tablebreak();
if (iMEMBER && $can_post && !$tdata['thread_locked']) {
opentable($locale['512']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id'>
<table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>
<tr>
<td align='center' class='tbl1'><textarea name='message' cols='80' rows='7' class='textbox'></textarea><br>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('message', '[b]', '[/b]');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('message', '[i]', '[/i]');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('message', '[u]', '[/u]');\">
<input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('message', '[url]', '[/url]');\">
<input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('message', '[mail]', '[/mail]');\">
<input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('message', '[img]', '[/img]');\">
<input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('message', '[center]', '[/center]');\">
<input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('message', '[small]', '[/small]');\">
<input type='button' value='code' class='button' style='width:40px;' onClick=\"addText('message', '[code]', '
');\">
<input type='button' value='quote' class='button' style='width:45px;' onClick=\"addText('message', '', '
');\"></td>
</tr>
<tr>
<td align='center' class='tbl2'>".displaysmileys("message")."<br>
<input type='checkbox' name='disable_smileys' value='1'>".$locale['513']."</td>
</tr>
<tr>
<td align='center' class='tbl1'><input type='submit' name='postquickreply' value='".$locale['514']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
}
echo "<script type='text/javascript'>
function jumpForum(forumid) {
document.location.href='".FORUM."viewforum.php?forum_id='+forumid;
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>[/code]
Her er min postify.php
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/post.php";
if (!FUSION_QUERY || !isset($forum_id) || !isNum($forum_id)) fallback("index.php");
if ($error == 0) { $errorb = ""; }
else if ($error == 1) { $errorb = $locale['440a']; }
else if ($error == 2) { $errorb = $locale['440b']; }
else if ($error == 3) { $errorb = $locale['441']; }
else if ($error == 4) { $errorb = $locale['450']; }
if ($post == "on" || $post == "off") {
if (!isset($thread_id) || !isNum($thread_id)) fallback("index.php");
opentable($locale['451']);
echo "<center><br>\n";
if ($post == "on") {
$result = dbquery("INSERT INTO ".$db_prefix."thread_notify (thread_id, notify_datestamp, notify_user, notify_status) VALUES('$thread_id', '".time()."', '".$userdata['user_id']."', '1')");
echo $locale['452']."<br><br>\n";
} else {
$result = dbquery("DELETE FROM ".$db_prefix."thread_notify WHERE thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'");
echo $locale['453']."<br><br>\n";
}
echo "<a href='viewthread.php?forum_id=$forum_id&thread_id=$thread_id'>".$locale['447']."</a> |
<a href='viewforum.php?forum_id=$forum_id'>".$locale['448']."</a> |
<a href='index.php'>".$locale['449']."</a><br><br>
</center>\n";
closetable();
} else if ($post == "new") {
opentable($locale['401']);
echo "<div align='center'>\n";
if ($errorb) {
echo "<br>$errorb<br><br>\n";
} else {
echo "<br>".$locale['442']."<br><br>\n";
}
if ($error < 3) {
if (!isset($thread_id) || !isNum($thread_id)) fallback("index.php");
echo "<a href='viewthread.php?forum_id=$forum_id&thread_id=$thread_id'>".$locale['447']."</a> |\n";
}
echo "<a href='viewforum.php?forum_id=$forum_id'>".$locale['448']."</a> |
<a href='index.php'>".$locale['449']."</a><br><br></div>\n";
[color=lime]//usergold addon
echo '<div align="center">you made '.USER_GOLD_NEW_THREAD.' gold coins for that post</div>';
//user gold addon[/color]
closetable();
} else if ($post == "reply") {
if (!isset($thread_id) || !isNum($thread_id)) fallback("index.php");
opentable($locale['403']);
echo "<center><br>\n";
if ($errorb) {
echo "$errorb<br><br>\n";
} else {
echo $locale['443']."<br><br>\n";
}
if ($error < "2") {
if (!isset($post_id) || !isNum($post_id)) fallback("index.php");
if ($settings['thread_notify']) {
$result = dbquery(
"SELECT tn.*, tu.user_id,user_name,user_email FROM ".$db_prefix."thread_notify tn
LEFT JOIN ".$db_prefix."users tu ON tn.notify_user=tu.user_id
WHERE thread_id='$thread_id' AND notify_user!='".$userdata['user_id']."' AND notify_status='1'
");
if (dbrows($result)) {
require_once INCLUDES."sendmail_include.php";
$data2 = dbarray(dbquery("SELECT thread_subject FROM ".$db_prefix."threads WHERE thread_id='$thread_id'"));
$link = $settings['siteurl']."forum/viewthread.php?forum_id=$forum_id&thread_id=$thread_id&pid=$post_id#post_$post_id";
while ($data = dbarray($result)) {
$message_el1 = array("{USERNAME}", "{THREAD_SUBJECT}", "{THREAD_URL}");
$message_el2 = array($data['user_name'], $data2['thread_subject'], $link);
$message_subject = str_replace("{THREAD_SUBJECT}", $data2['thread_subject'], $locale['550']);
$message_content = str_replace($message_el1, $message_el2, $locale['551']);
sendemail($data['user_name'],$data['user_email'],$settings['siteusername'],$settings['siteemail'],$message_subject,$message_content);
}
$result = dbquery("UPDATE ".$db_prefix."thread_notify SET notify_status='0' WHERE thread_id='$thread_id' AND notify_user!='".$userdata['user_id']."'");
}
}
echo "<a href='viewthread.php?forum_id=$forum_id&thread_id=$thread_id&pid=$post_id#post_$post_id'>".$locale['447']."</a> |\n";
} else {
$data = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC"));
echo "<a href='viewthread.php?forum_id=$forum_id&thread_id=$thread_id&pid=".$data['post_id']."#post_".$data['post_id']."'>".$locale['447']."</a> |\n";
}
echo "<a href='viewforum.php?forum_id=$forum_id'>".$locale['448']."</a> |
<a href='index.php'>".$locale['449']."</a><br><br>
</center>\n";
[color=lime]//usergold addon
echo '<div align="center">you made '.USER_GOLD_REPLY.' gold coins for that post</div>';
//user gold addon[/color]
closetable();
} else if ($post == "edit") {
if (!isset($thread_id) || !isNum($thread_id)) fallback("index.php");
opentable($locale['409']);
echo "<center><br>\n";
if ($errorb) {
echo "$errorb<br><br>\n";
} else {
echo $locale['446']."<br><br>\n";
}
echo "<a href='viewthread.php?forum_id=$forum_id&thread_id=$thread_id&pid=$post_id#post_$post_id'>".$locale['447']."</a> |
<a href='viewforum.php?forum_id=$forum_id'>".$locale['448']."</a> |
<a href='index.php'>".$locale['449']."</a><br><br>
</center>\n";
closetable();
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
Her en min postnewthread.php
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../index.php"); exit; }
if (isset($_POST['previewpost'])) {
$sticky_check = isset($_POST['sticky']) ? " checked" : "";
$sig_checked = isset($_POST['show_sig']) ? " checked" : "";
$disable_smileys_check = isset($_POST['disable_smileys']) ? " checked" : "";
if ($settings['thread_notify']) $notify_checked = isset($_POST['notify_me']) ? " checked" : "";
opentable($locale['400']);
$subject = trim(stripinput(censorwords($_POST['subject'])));
$message = trim(stripinput(censorwords($_POST['message'])));
if ($subject == "") $subject = $locale['420'];
if ($message == "") {
$previewmessage = $locale['421'];
} 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;
echo "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='tbl-border'>
<tr>
<td>
<table cellpadding='0' cellspacing='1' width='100%'>
<tr>
<td width='145' class='tbl2'>".$locale['422']."</td>
<td class='tbl2'>$subject</td>
</tr>
<tr>
<td valign='top' rowspan='2' width='145' class='tbl1'>".$userdata['user_name']."<br>
<span class='alt'>".($is_mod ? $locale['userf1'] : getuserlevel($userdata['user_level']))."</span><br><br>\n";
if ($userdata['user_avatar']) {
echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."'><br><br>\n";
$height = "200";
} else {
$height = "60";
}
echo "<span class='alt'>".$locale['423']."</span> ".$userdata['user_posts']."<br>\n";
if ($userdata['user_location']) echo "<span class='alt'>".$locale['424']."</span> ".$userdata['user_location']."<br>\n";
echo "<span class='alt'>".$locale['425']."</span> ".showdate("%d.%m.%y", $userdata['user_joined'])."</td>
<td class='tbl1'><span class='small'>".$locale['426'].showdate("forumdate", time())."</span></td>
</tr>
<tr>
<td height='$height' valign='top' class='tbl1'>$previewmessage</td>
</tr>
</table>
</tr>
</td>
</table>\n";
closetable();
tablebreak();
}
if (isset($_POST['postnewthread'])) {
$flood = false; $error = 0;
$sticky = isset($_POST['sticky']) ? "1" : "0";
$sig = isset($_POST['show_sig']) ? "1" : "0";
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = trim(stripinput(censorwords($_POST['subject'])));
$message = trim(stripinput(censorwords($_POST['message'])));
if (iMEMBER) {
if ($subject != "" && $message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (!iSUPERADMIN || dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("INSERT INTO ".$db_prefix."threads (forum_id, thread_subject, thread_author, thread_views, thread_lastpost, thread_lastuser, thread_sticky, thread_locked) VALUES('$forum_id', '$subject', '".$userdata['user_id']."', '0', '".time()."', '".$userdata['user_id']."', '$sticky', '0')");
$thread_id = mysql_insert_id();
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
$post_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
[color=lime]//start gold addon
paygold($userdata['user_name'],$userdata['user_id'],USER_GOLD_NEW_THREAD);
//end gold addon[/color]
if ($settings['thread_notify'] && isset($_POST['notify_me'])) $result = dbquery("INSERT INTO ".$db_prefix."thread_notify (thread_id, notify_datestamp, notify_user, notify_status) VALUES('$thread_id', '".time()."', '".$userdata['user_id']."', '1')");
$attach = $_FILES['attach'];
if ($attach['name'] != "" && !empty($attach['name']) && is_uploaded_file($attach['tmp_name'])) {
$attachname = 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 = attach_exists(strtolower($attach['name']));
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_prefix."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 {
$error = 3;
}
} else {
$error = 4;
}
if ($error > 2) { redirect("postify.php?post=new&error=$error&forum_id=$forum_id"); }
else { redirect("postify.php?post=new&error=$error&forum_id=$forum_id&thread_id=$thread_id"); }
} else {
if (!isset($_POST['previewpost'])) {
$subject = "";
$message = "";
$sticky_check = "";
$disable_smileys_check = "";
$sig_checked = " checked";
$notify_checked = "";
}
opentable($locale['401']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?action=newthread&forum_id=$forum_id' enctype='multipart/form-data'>
<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
<tr>
<td width='145' class='tbl2'>".$locale['460']."</td>
<td class='tbl2'><input type='text' name='subject' value='$subject' class='textbox' maxlength='255' style='width: 250px'></td>
</tr>
<tr>
<td valign='top' width='145' class='tbl2'>".$locale['461']."</td>
<td class='tbl1'><textarea name='message' cols='80' rows='15' class='textbox'>$message</textarea></td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl2'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('message', '[b]', '[/b]');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('message', '[i]', '[/i]');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('message', '[u]', '[/u]');\">
<input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('message', '[url]', '[/url]');\">
<input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('message', '[mail]', '[/mail]');\">
<input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('message', '[img]', '[/img]');\">
<input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('message', '[center]', '[/center]');\">
<input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('message', '[small]', '[/small]');\">
<input type='button' value='code' class='button' style='width:40px;' onClick=\"addText('message', '[code]', '
');\">
<input type='button' value='quote' class='button' style='width:45px;' onClick=\"addText('message', '', '
');\">
</td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl1'>
".$locale['462']."<select name='bbcolor' class='textbox' style='width:90px;' onChange=\"addText('message', '[color=' + this.options[this.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;\">
<option value=''>Default</option>
<option value='maroon' style='color:maroon;'>Maroon</option>
<option value='red' style='color:red;'>Red</option>
<option value='orange' style='color:orange;'>Orange</option>
<option value='brown' style='color:brown;'>Brown</option>
<option value='yellow' style='color:yellow;'>Yellow</option>
<option value='green' style='color:green;'>Green</option>
<option value='lime' style='color:lime;'>Lime</option>
<option value='olive' style='color:olive;'>Olive</option>
<option value='cyan' style='color:cyan;'>Cyan</option>
<option value='blue' style='color:blue;'>Blue</option>
<option value='navy' style='color:navy;'>Navy Blue</option>
<option value='purple' style='color:purple;'>Purple</option>
<option value='violet' style='color:violet;'>Violet</option>
<option value='black' style='color:black;'>Black</option>
<option value='gray' style='color:gray;'>Gray</option>
<option value='silver' style='color:silver;'>Silver</option>
<option value='white' style='color:white;'>White</option>
</select>
</td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl2'>
".displaysmileys("message")."
</td>
</tr>
<tr>
<td valign='top' width='145' class='tbl2'>".$locale['463']."</td>
<td class='tbl1'>\n";
if (iMOD || iSUPERADMIN) {
echo "<input type='checkbox' name='sticky' value='1'$sticky_check>".$locale['480']."<br>\n";
}
echo "<input type='checkbox' name='disable_smileys' value='1'$disable_smileys_check>".$locale['483'];
if ($userdata['user_sig']) {
echo "<br>\n<input type='checkbox' name='show_sig' value='1'$sig_checked>".$locale['481'];
}
if ($settings['thread_notify']) echo "<br>\n<input type='checkbox' name='notify_me' value='1'$notify_checked>".$locale['485'];
echo "</td>
</tr>\n";
if ($settings['attachments'] == "1") {
echo "<tr>
<td width='145' class='tbl2'>".$locale['464']."</td>
<td class='tbl1'><input type='file' name='attach' enctype='multipart/form-data' class='textbox' style='width:200px;'><br>
<span class='small2'>".sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes']))."</span></td>
</tr>\n";
}
echo "</table>
</td>
</tr>
</table>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td align='center' colspan='2' class='tbl1'>
<input type='submit' name='previewpost' value='".$locale['400']."' class='button'>
<input type='submit' name='postnewthread' value='".$locale['401']."' class='button'>
</td>
</tr>
</table>
</form>\n";
closetable();
}
?>[/code]
Her er min postreply.php
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../index.php"); exit; }
if (isset($_POST['previewreply'])) {
$sig_checked = isset($_POST['show_sig']) ? " checked" : "";
$disable_smileys_check = isset($_POST['disable_smileys']) ? " checked" : "";
if ($settings['thread_notify']) $notify_checked = isset($_POST['notify_me']) ? " checked" : "";
opentable($locale['402']);
$subject = trim(stripinput(censorwords($_POST['subject'])));
$message = trim(stripinput(censorwords($_POST['message'])));
if ($_POST['subject'] == "") {
$previewsubject = "RE: ".$tdata['thread_subject'];
} else {
$previewsubject = "RE: ".$subject;
}
if ($message == "") {
$previewmessage = $locale['421'];
} 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;
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table cellpadding='0' cellspacing='1' width='100%'>
<tr>
<td width='145' class='tbl2'>".$locale['422']."</td>
<td class='tbl2'>$previewsubject</td>
</tr>
<tr>
<td valign='top' rowspan='2' width='145' class='tbl1'>".$userdata['user_name']."<br>
<span class='alt'>".($is_mod ? $locale['userf1'] : getuserlevel($userdata['user_level']))."</span><br><br>\n";
if ($userdata['user_avatar']) {
echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."'><br><br>\n";
$height = "200";
} else {
$height = "60";
}
echo "<span class='alt'>".$locale['423']."</span> ".$userdata['user_posts']."<br>\n";
if ($userdata['user_location']) echo "<span class='alt'>".$locale['424']."</span> ".$userdata['user_location']."<br>\n";
echo "<span class='alt'>".$locale['425']."</span> ".showdate("%d.%m.%y", $userdata['user_joined'])."</td>
<td class='tbl1'><span class='small'>".$locale['426'].showdate("forumdate", time())."</span></td>
</tr>
<tr>
<td height='$height' valign='top' class='tbl1'>$previewmessage</td>
</tr>
</table>
</tr>
</td>
</table>\n";
closetable();
tablebreak();
}
if (isset($_POST['postreply'])) {
$flood = false; $error = 0;
$sig = isset($_POST['show_sig']) ? "1" : "0";
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = trim(stripinput(censorwords($_POST['subject'])));
if ($_POST['subject'] == "") {
$subject = "RE: ".$tdata['thread_subject'];
} else {
$subject = "RE: ".$subject;
}
$message = trim(stripinput(censorwords($_POST['message'])));
if (iMEMBER) {
if ($subject != "" && $message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (!iSUPERADMIN || dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".time()."', thread_lastuser='".$userdata['user_id']."'".$update_notify." WHERE thread_id='$thread_id'");
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
$newpost_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
[color=lime]//start gold addon
paygold($userdata['user_name'],$userdata['user_id'],USER_GOLD_REPLY);
//end gold addon[/color]
if ($settings['thread_notify'] && isset($_POST['notify_me'])) {
if (!dbcount("(thread_id)", "thread_notify", "thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'")) {
$result = dbquery("INSERT INTO ".$db_prefix."thread_notify (thread_id, notify_datestamp, notify_user, notify_status) VALUES('$thread_id', '".time()."', '".$userdata['user_id']."', '1')");
}
}
$attach = $_FILES['attach'];
if ($attach['name'] != "" && !empty($attach['name']) && is_uploaded_file($attach['tmp_name'])) {
$attachname = 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 = attach_exists(strtolower($attach['name']));
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_prefix."forum_attachments (thread_id, post_id, attach_name, attach_ext, attach_size) VALUES ('$thread_id', '$newpost_id', '$attachname', '$attachext', '".$attach['size']."')");
[color=lime]//start gold addon
paygold($userdata['user_name'],$userdata['user_id'],USER_GOLD_ATTACH);
//end gold addon[/color]
} else {
@unlink($attach['tmp_name']);
$error = 1;
}
} else {
@unlink($attach['tmp_name']);
$error = 2;
}
}
}
} else {
$error = 3;
}
} else {
$error = 4;
}
if ($error > 2) {
redirect("postify.php?post=reply&error=$error&forum_id=$forum_id&thread_id=$thread_id");
} else {
redirect("postify.php?post=reply&error=$error&forum_id=$forum_id&thread_id=$thread_id&post_id=$newpost_id");
}
} else {
if (!isset($_POST['previewreply'])) {
$subject = "";
$message = "";
$disable_smileys_check = "";
$sig_checked = " checked";
}
if (isset($quote) && isNum($quote)) {
$result = dbquery("SELECT * FROM ".$db_prefix."posts INNER JOIN ".$db_prefix."users ON ".$db_prefix."posts.post_author=".$db_prefix."users.user_id WHERE thread_id='$thread_id' and post_id='$quote'");
if (dbrows($result) != "0") {
$data = dbarray($result);
$message = "[quote][b]".$data['user_name'].$locale['429']."[/b]\n".$data['post_message']."[/quote]";
}
}
opentable($locale['403'].": $caption");
echo "<form name='inputform' method='post' action='".FUSION_SELF."?action=reply&forum_id=$forum_id&thread_id=$thread_id' enctype='multipart/form-data'>
<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
<tr>
<td width='145' class='tbl2'>".$locale['460']."</td>
<td class='tbl2'><input type='text' name='subject' value='$subject' class='textbox' maxlength='255' style='width:250px'>".$locale['465']."</td>
</tr>
<tr>
<td valign='top' width='145' class='tbl2'>".$locale['461']."</td>
<td class='tbl1'><textarea name='message' cols='80' rows='15' class='textbox'>$message</textarea></td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl2'>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('message', '[b]', '[/b]');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('message', '[i]', '[/i]');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('message', '[u]', '[/u]');\">
<input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('message', '[url]', '[/url]');\">
<input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('message', '[mail]', '[/mail]');\">
<input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('message', '[img]', '[/img]');\">
<input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('message', '[center]', '[/center]');\">
<input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('message', '[small]', '[/small]');\">
<input type='button' value='code' class='button' style='width:40px;' onClick=\"addText('message', '[code]', '
');\">
<input type='button' value='quote' class='button' style='width:45px;' onClick=\"addText('message', '', '
');\">
</td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl1'>
".$locale['462']."<select name='bbcolor' class='textbox' style='width:90px;' onChange=\"addText('message', '[color=' + this.options[this.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;\">
<option value=''>Default</option>
<option value='maroon' style='color:maroon;'>Maroon</option>
<option value='red' style='color:red;'>Red</option>
<option value='orange' style='color:orange;'>Orange</option>
<option value='brown' style='color:brown;'>Brown</option>
<option value='yellow' style='color:yellow;'>Yellow</option>
<option value='green' style='color:green;'>Green</option>
<option value='lime' style='color:lime;'>Lime</option>
<option value='olive' style='color:olive;'>Olive</option>
<option value='cyan' style='color:cyan;'>Cyan</option>
<option value='blue' style='color:blue;'>Blue</option>
<option value='navy' style='color:navy;'>Navy Blue</option>
<option value='purple' style='color:purple;'>Purple</option>
<option value='violet' style='color:violet;'>Violet</option>
<option value='black' style='color:black;'>Black</option>
<option value='gray' style='color:gray;'>Gray</option>
<option value='silver' style='color:silver;'>Silver</option>
<option value='white' style='color:white;'>White</option>
</select>
</td>
</tr>
<tr>
<td width='145' class='tbl2'> </td>
<td class='tbl2'>
[/code]
Redigeret af Thomas d. 19-12-2006 02:19
Spring til debat:
Kravlegården på Assensvej
Assensvej.dk
MOD's /7.02
Temaer /7.02
Generel debat - PHP-Fusion /7.02
Nye Themes fra Assensvej.dk
MOD's /7.01
Infusioner /7.01
Temaer /7.01
Tips og tricks,elementer mm /7.01
Generel debat - PHP-Fusion /7.01
MOD's v7
Infusioner v7
Temaer v7
Tips og tricks,elementer mm v7
Generel debat - PHP-Fusion v7
vise dine Temaer/show your Themes
Themes
Theme Requests
Showcase
Hvad sker der på Assensvej.dk
De løse debater
Fra Bruger til Bruger.
Lidt sjov
Jule vittigheder og historie
Facebook
YouTube