Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] Contact staff
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2012-05-24 13:10:11
Hello : i have a problem with this mod, when i want to see mp sending by members, i have this

Quote:
Error

Permission denied.

and the page look like i'm not connected .

any solution ?
Unknown User
2012-05-25 09:07:56


if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}





Means you dont have permission, cp users only
Unknown User
2012-06-03 14:32:03
yep i know but i'm administrator on the site and the permission are correctly set.
Unknown User
2012-06-04 09:57:34
it's ok, i found the problem
Unknown User
2012-07-01 10:37:01
i have a problems.

i take a message from contact admin but when i click the message from Staff contacts nothing opening to read.

i attach my files to check anybody

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5817"]contactstaff.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5818"]takecontact.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5819"]staffbox.php[/url]
contactstaff.php
Download
takecontact.php
Download
staffbox.php
Download
2012-07-01 15:49:42
Same mistake ... Mythos solution!? LOL :rolleyes:
Unknown User
2012-07-01 16:22:25
Change



if ($HTTP_SERVER_VARS["REQUEST_METHOD"] != "POST")






to







if ($_SERVER["REQUEST_METHOD"] != "POST")






change







stderr("Error","You need to define subject!");






to







show_error_msg("Error","You need to define subject!", 1);






Put







dbconn();






Directly after backend/functions.php like







require "backend/functions.php";

dbconn();






Replace







or sqlerr(__FILE__, __LINE__);






with just







;

2012-07-01 16:40:10
mostvotedplaya, you can tell me if I did well ca please?

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5823"]contactstaff.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5824"]staffbox.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5825"]takecontact.php[/url]
contactstaff.php
Download
staffbox.php
Download
takecontact.php
Download

Unknown User
2012-07-01 17:05:28
takecontact.php



<?php



/**

* @package TorrentTrader

* @version v2.08

* @author  foz www.basslinebeats.co.uk foz@basslinebeats.co.uk

*/



require_once('backend/functions.php');

dbconn();



if ($_SERVER['REQUEST_METHOD'] != 'POST')

show_error_msg('Error', 'Invalid Request Method.', 1);



$err = false;

   

if ( empty( $_POST['msg'] ) )

{

 $err = 'Your message cannot be empty...';

}



if ( empty( $_POST['subject'] ) )

{

 $err = 'You must define a subject...';

}



if ( $err )

{

 autolink( 'contactstaff.php', $err );

}



SQL_Query_exec("INSERT INTO `staffmessages` (`sender`, `added`, `msg`, `subject`) VALUES ('". ( $CURUSER ? $CURUSER['id'] : 0 ) ."', '". get_date_time() ."', " . sqlesc($_POST['msg']) . ", " . sqlesc($_POST['subject']) . ")");



if ( ! empty( $_POST['returnto'] ) )

{

 autolink( $_POST['returnto'], 'Redirecting...' );

}



show_error_msg('Success', 'Message Sent...', 1);



?>

staffbox.php






<?

//===========================================================================

// DO NOT EDIT THIS OUT

//===========================================================================

//===========================================================================

// Created by foz  www.basslinebeats.co.uk foz@basslinebeats.co.uk

//===========================================================================

?>

<?

require "backend/functions.php";



dbconn(false);

loggedinonly();







if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.",1);





$action = $_GET["action"];



///////////////////////////

// SHOW PM'S //

/////////////////////////



if (!$action) {



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





stdhead("Staff PM's");



$res = SQL_Query_exec("SELECT count(id) FROM staffmessages");

$row = mysql_fetch_array($res);



$url = " .$_SERVER[php_SELF]?";

$count = $row[0];

$perpage = 20;

list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);



print("<h1 align=center>Staff PM's</h1>");



if ($count == 0) {

print("<h2>No messages yet!</h2>");

print ("<center>---<a href=http://basslinebeats.co.uk><font color=red><b>Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");

}

else {



echo $pagertop;



begin_frame();



print("<table width=765 border=1 cellspacing=0 cellpadding=5 align=center>n");

print("

<tr>

<td class=colhead align=left>Subject</td>

<td class=colhead align=left>Sender</td>

<td class=colhead align=left>Added</td>

<td class=colhead align=left>Answered</td>

<td class=colhead align=center>Set Answered</td>

<td class=colhead align=left>Del</td>

</tr>

");

print("<form method=post action=?action=takecontactanswered>");



$res = SQL_Query_exec("SELECT staffmessages.id, staffmessages.added, staffmessages.subject, staffmessages.answered, staffmessages.answeredby, staffmessages.sender, staffmessages.answer, users.username FROM staffmessages INNER JOIN users on staffmessages.sender = users.id ORDER BY id desc $limit");



while ($arr = mysql_fetch_assoc($res))

{

if ($arr[answered])

{

$res3 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr[answeredby]");

$arr3 = mysql_fetch_assoc($res3);

$answered = "<font color=green><b>Yes - <a href=account-details.php?id=$arr[answeredby]><b>$arr3[username]</b></a> (<a href=staffbox.php?action=viewanswer&pmid=$arr[id]>View Answer</a>)</b></font>";

}

else

$answered = "<font color=red><b>No</b></font>";



$pmid = $arr["id"];



print("<tr>

<td><a href=".$site_config["SITEURL"]."/staffbox.php?action=viewpm&pmid=$pmid><b>$arr[subject]</b></td>

<td><a href=".$site_config["SITEURL"]."/account-details.php?id=$arr[sender]><b>$arr[username]</b></a></td>

<td>$arr[added]</td><td align=left>$answered</td>

<td><input type="checkbox" name="setanswered[]" value="" . $arr[id] . "" /></td>

<td><a href=".$site_config["SITEURL"]."/staffbox.php?action=deletestaffmessage&id=$arr[id]>Del</a></td>

</tr>n

");

}



print("</table>n");



print("<p align=right><input type=submit value=Confirm></p>");

print ("<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");

print("</form>");



echo $pagerbottom;



end_frame();

}

stdfoot();

}

//////////////////////////

// VIEW PM'S //

//////////////////////////



if ($action == "viewpm")

{



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





$pmid = (int)$_GET["pmid"];



$ress4 = SQL_Query_exec("SELECT id, subject, sender, added, msg, answeredby, answered FROM staffmessages WHERE id=$pmid");

$arr4 = mysql_fetch_assoc($ress4);



$answeredby = $arr4["answeredby"];



$rast = SQL_Query_exec("SELECT username FROM users WHERE id=$answeredby");

$arr5 = mysql_fetch_assoc($rast);



$senderr = "" . $arr4["sender"] . "";



if (is_valid_id($arr4["sender"]))

{

$res2 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr4["sender"]) ;

$arr2 = mysql_fetch_assoc($res2);

$sender = "<a href='account-details.php?id=$senderr'>" . ($arr2["username"] ? $arr2["username"]:"[Deleted]") . "</a>";

}

else

$sender = "System";



$subject = $arr4["subject"];



if ($arr4["answered"] == '0') {

$answered = "<font color=red><b>No</b></font>";

}

else {

$answered = "<font color=blue><b>Yes</b></font> by <a href=account-details.php?id=$answeredby>$arr5[username]</a> (<a href=".$site_config["SITEURL"]."/staffbox.php?action=viewanswer&pmid=$pmid>Show Answer</a>)";

}



if ($arr4["answered"] == '0') {

$setanswered = "[<a href=".$site_config["SITEURL"]."/staffbox.php?action=setanswered&id=$arr4[id]>Mark Answered</a>]";

}

else {

$setanswered = "";

}



$iidee = $arr4["id"];





stdhead("Staff PM's");

print("<table class=bottom width=730 border=0 cellspacing=0 cellpadding=10><tr><td class=embedded width=700>n");

print("<h1 align=center>Messages to staff</h1>n");



$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr4["added"]));



print("<table width=750 border=1 cellspacing=0 cellpadding=10 style='margin-bottom: 10px'><tr><td class=text>n");

print("From <b>$sender</b> atn" . $arr4["added"] . " ($elapsed ago) GMTn");

print("<br><br style='margin-bottom: -10px'><div align=left><b>Subject: <font color=darkred>$subject</b></font>

&nbsp;&nbsp;<br><b>Answered:</b> $answered&nbsp;&nbsp;$setanswered</div>

<br><table class=main width=730 border=1 cellspacing=0 cellpadding=10><tr><td class=staffpms>n");

print(format_comment($arr4["msg"]));

print("</td></tr></table>n");

print("<table width=730 border=0><tr><td class=embedded>n");

print(($arr4["sender"] ? "<a href=".$site_config["SITEURL"]."/staffbox.php?action=answermessage&receiver=" . $arr4["sender"] . "&answeringto=$iidee><b>Reply</b></a>" : "<font class=gray><b>Reply</b></font>") .

" | <a href=".$site_config["SITEURL"]."/staffbox.php?action=deletestaffmessage&id=" . $arr4["id"] . "><b>Delete</b></a></td>");

print ("<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");



print("</table></table>n");

print("</table>n");

stdfoot();

}



//////////////////////////

// VIEW ANSWERS //

//////////////////////////



if ($action == "viewanswer")

{



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





$pmid = (int)$_GET["pmid"];



$ress4 = SQL_Query_exec("SELECT id, subject, sender, added, msg, answeredby, answered, answer FROM staffmessages WHERE id=$pmid");

$arr4 = mysql_fetch_assoc($ress4);



$answeredby = $arr4["answeredby"];



$rast = SQL_Query_exec("SELECT username FROM users WHERE id=$answeredby");

$arr5 = mysql_fetch_assoc($rast);



if (is_valid_id($arr4["sender"]))

{

$res2 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr4["sender"]) ;

$arr2 = mysql_fetch_assoc($res2);

$sender = "<a href=".$site_config["SITEURL"]."/account-details.php?id=" . $arr4["sender"] . ">" . ($arr2["username"]?$arr2["username"]:"[Deleted]") . "</a>";

}

else

$sender = "System";



if ($arr4['subject'] == "") {

$subject = "No subject";

}



else {

$subject = "<a style='color: darkred' href=staffbox.php?action=viewpm&pmid=$pmid>$arr4[subject]</a>";

}





$iidee = $arr4["id"];



if ($arr4[answer] == "") {



$answer = "This message has not been answered yet!";

}



else {



$answer = $arr4["answer"];

}



stdhead("Staff PM's");



print("<table class=bottom width=730 border=0 cellspacing=0 cellpadding=10><tr><td class=embedded width=700>n");

print("<h1 align=center>Viewing Answer</h1>n");



$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr4["added"]));



print("<table width=750 border=1 cellspacing=0 cellpadding=10 style='margin-bottom: 10px'><tr><td class=text>n");

print("<b><a href=account-details.php?id=$answeredby>$arr5[username]</a></b> answered this message sent by $sender");

print("<br><br style='margin-bottom: -10px'><div align=left><b>Subject: $subject</b>

&nbsp;&nbsp;<br><b>Answer:</b></div>

<br><table class=main width=730 border=1 cellspacing=0 cellpadding=10><tr><td class=staffpms>n");

print(format_comment($answer));



print("</td></tr></table>n");

print("</table>n");

print("</table>n");



stdfoot();

}





//////////////////////////

// ANSWER MESSAGE //

//////////////////////////



if ($action == "answermessage") {



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





$answeringto = $_GET["answeringto"];

$receiver = (int)$_GET["receiver"];



if (!is_valid_id($receiver))

die;



$res = SQL_Query_exec("SELECT * FROM users WHERE id=$receiver");

$user = mysql_fetch_assoc($res);



if (!$user)

stderr("Error", "No user with that ID.");



$res2 = SQL_Query_exec("SELECT * FROM staffmessages WHERE id=$answeringto");

$array = mysql_fetch_assoc($res2);



stdhead("Answer to Staff PM", false);

?>

<table class=main width=450 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>

<div align=center>

<h2>Answering to <a href=".$site_config["SITEURL"]."/staffbox.php?action=viewpm&pmid=<?=$array['id']?>><i><?=$array["subject"]?></i></a> sent by <i><?=$user["username"]?></i></h2>



<form method=post name=message action=?action=takeanswer>

<? if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"]) { ?>

<? } ?>

<table class=message cellspacing=0 cellpadding=5>

<tr><td colspan=2>

<b><font color=red><h1>Message:</h1></font></b>

<textarea name=msg cols=50 rows=5><?=htmlspecialchars($body)?></textarea>

<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>

</td></tr>

<tr><td<?=$replyto?" colspan=2":""?> align=center><input type=submit value="Send it!" class=btn></td></tr>



</table>

<input type=hidden name=receiver value=<?=$receiver?>>

<input type=hidden name=answeringto value=<?=$answeringto?>>

</form>

</div></td></tr></table>



<?

stdfoot();

}



//////////////////////////

// TAKE ANSWER //

//////////////////////////





if ($action == "takeanswer") {





if ($_SERVER["REQUEST_METHOD"] != "POST")

   show_error_msg("Error", "Method", 1);



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





$receiver = (int)$_POST["receiver"];

$answeringto = $_POST["answeringto"];



if (!is_valid_id($receiver))

show_error_msg("Error","Invalid ID");



$userid = $CURUSER["id"];



$msg = trim($_POST["msg"]);



$message = sqlesc($msg);



$added = "'" . get_date_time() . "'";



if (!$msg)

stderr("Error","Please enter something!");



SQL_Query_exec("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES($userid, $userid, $receiver, $added, $message)");



SQL_Query_exec("UPDATE staffmessages SET answer=$message WHERE id=$answeringto");



SQL_Query_exec("UPDATE staffmessages SET answered='1', answeredby='$userid' WHERE id=$answeringto");



header("Location: staffbox.php?action=viewpm&pmid=$answeringto");

die;

}

//////////////////////////

// DELETE STAFF MESSAGE //

//////////////////////////



if ($action == "deletestaffmessage") {



$id = (int)$_GET["id"];



if (!is_numeric($id) || $id < 1 || floor($id) != $id)

die;



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





SQL_Query_exec("DELETE FROM staffmessages WHERE id=" . sqlesc($id));



header("Location: ".$site_config["SITEURL"]."/staffbox.php");

}



//////////////////////////

// MARK AS ANSWERED //

//////////////////////////



if ($action == "setanswered") {



if ($CURUSER["class"] < "7")

show_error_msg("Error", "Permission denied.");





$id = (int)$_GET["id"];



SQL_Query_exec ("UPDATE staffmessages SET answered=1, answeredby = $CURUSER[id] WHERE id = $id") ;



header("Refresh: 0; url=staffbox.php?action=viewpm&pmid=$id");

}



//////////////////////////

// MARK AS ANSWERED #2 //

//////////////////////////



if ($action == "takecontactanswered") {



if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

show_error_msg("Error", "Permission denied.");

}



$res = SQL_Query_exec ("SELECT id FROM staffmessages WHERE answered=0 AND id IN (" . implode(", ", $_POST[setanswered]) . ")");



while ($arr = mysql_fetch_assoc($res))

SQL_Query_exec ("UPDATE staffmessages SET answered=1, answeredby = $CURUSER[id] WHERE id = $arr[id]") ;



header("Refresh: 0; url=staffbox.php");

}



?>

<?

//===========================================================================

// DO NOT EDIT THIS OUT

//===========================================================================

//===========================================================================

// Created by foz  www.basslinebeats.co.uk foz@basslinebeats.co.uk

//===========================================================================

?>





contactstaff.php looks ok...

Untested
2012-07-01 17:34:31
cool! #1 big thanks!!  :D  :D
Unknown User
2012-07-02 03:30:46
with this https://www.torrenttrader.org/topic/9584-mod-contact-staff/page__st__40#entry83880 all are ok.

Thanks  :)  :)
Unknown User
2012-07-24 10:13:47
CREATE TABLE `staffmessages` (

`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,

`sender` int( 10 ) unsigned NOT NULL default '0',

`added` datetime default NULL ,

`msg` text,

`subject` varchar( 100 ) NOT NULL default '',

`answeredby` int( 10 ) unsigned NOT NULL default '0',

`answered` tinyint( 1 ) NOT NULL default '0',

`answer` text,

PRIMARY KEY ( `id` )

) TYPE = MYISAM ;

gives error: [size=12px][font=sans-serif]#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE = MYISAM' at line 11[/font][/size]

Any solution?

I am using

  • Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1

  • MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

  • PHP extension: mysql

Unknown User
2012-07-24 11:53:23
replace TYPE with ENGINE
Unknown User
2012-07-27 14:34:45
Yes works now.thank you :)
Unknown User
2012-11-04 15:08:23
for some reason it isn't letting me check the msgs, set as answered or delete them on staffbox.php

here is my staffbox.php for 2.07



<?

//===========================================================================

// DO NOT EDIT THIS OUT

//===========================================================================

//===========================================================================

// Created by foz  www.basslinebeats.co.uk foz@basslinebeats.co.uk

//===========================================================================

?>

<?

require "backend/functions.php";

dbconn(false);

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$action = $HTTP_GET_VARS["action"];

///////////////////////////

// SHOW PM'S //

/////////////////////////

if (!$action) {

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

stdhead("Staff PM's");

$res = mysql_query("SELECT count(id) FROM staffmessages") or die(mysql_error());

$row = mysql_fetch_array($res);

$url = " .$_SERVER[php_SELF]?";

$count = $row[0];

$perpage = 20;

list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);

print("<h1 align=center>Staff PM's</h1>");

if ($count == 0) {

print("<h2>No messages yet!</h2>");

print ("<center>---<a href=http://basslinebeats.co.uk><font color=red><b>Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");

}

else {

echo $pagertop;

begin_frame();

print("<table width=765 border=1 cellspacing=0 cellpadding=5 align=center>n");

print("

<tr>

<td class=colhead align=left>Subject</td>

<td class=colhead align=left>Sender</td>

<td class=colhead align=left>Added</td>

<td class=colhead align=left>Answered</td>

<td class=colhead align=center>Set Answered</td>

<td class=colhead align=left>Del</td>

</tr>

");

print("<form method=post action=?action=takecontactanswered>");

$res = mysql_query("SELECT staffmessages.id, staffmessages.added, staffmessages.subject, staffmessages.answered, staffmessages.answeredby, staffmessages.sender, staffmessages.answer, users.username FROM staffmessages INNER JOIN users on staffmessages.sender = users.id ORDER BY id desc $limit");

while ($arr = mysql_fetch_assoc($res))

{

if ($arr[answered])

{

$res3 = mysql_query("SELECT username FROM users WHERE id=$arr[answeredby]");

$arr3 = mysql_fetch_assoc($res3);

$answered = "<font color=green><b>Yes - <a href=account-details.php?id=$arr[answeredby]><b>$arr3[username]</b></a> (<a href=staffbox.php?action=viewanswer&pmid=$arr[id]>View Answer</a>)</b></font>";

}

else

$answered = "<font color=red><b>No</b></font>";

$pmid = $arr["id"];

print("<tr>

<td><a href=".$site_config["SITEURL"]."/staffbox.php?action=viewpm&pmid=$pmid><b>$arr[subject]</b></td>

<td><a href=".$site_config["SITEURL"]."/account-details.php?id=$arr[sender]><b>$arr[username]</b></a></td>

<td>$arr[added]</td><td align=left>$answered</td>

<td><input type="checkbox" name="setanswered[]" value="" . $arr[id] . "" /></td>

<td><a href=".$site_config["SITEURL"]."staffbox.php?action=deletestaffmessage&id=$arr[id]>Del</a></td>

</tr>n

");

}

print("</table>n");

print("<p align=right><input type=submit value=Confirm></p>");

print ("<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");

print("</form>");

echo $pagerbottom;

end_frame();

}

stdfoot();

}

//////////////////////////

// VIEW PM'S //

//////////////////////////

if ($action == "viewpm")

{

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$pmid = 0 + $_GET["pmid"];

$ress4 = mysql_query("SELECT id, subject, sender, added, msg, answeredby, answered FROM staffmessages WHERE id=$pmid");

$arr4 = mysql_fetch_assoc($ress4);

$answeredby = $arr4["answeredby"];

$rast = mysql_query("SELECT username FROM users WHERE id=$answeredby");

$arr5 = mysql_fetch_assoc($rast);

$senderr = "" . $arr4["sender"] . "";

if (is_valid_id($arr4["sender"]))

{

$res2 = mysql_query("SELECT username FROM users WHERE id=" . $arr4["sender"]) or sqlerr();

$arr2 = mysql_fetch_assoc($res2);

$sender = "<a href='account-details.php?id=$senderr'>" . ($arr2["username"] ? $arr2["username"]:"[Deleted]") . "</a>";

}

else

$sender = "System";

$subject = $arr4["subject"];

if ($arr4["answered"] == '0') {

$answered = "<font color=red><b>No</b></font>";

}

else {

$answered = "<font color=blue><b>Yes</b></font> by <a href=account-details.php?id=$answeredby>$arr5[username]</a> (<a href=".$site_config["SITEURL"]."/staffbox.php?action=viewanswer&pmid=$pmid>Show Answer</a>)";

}

if ($arr4["answered"] == '0') {

$setanswered = "[<a href=".$site_config["SITEURL"]."/staffbox.php?action=setanswered&id=$arr4[id]>Mark Answered</a>]";

}

else {

$setanswered = "";

}

$iidee = $arr4["id"];



stdhead("Staff PM's");

print("<table class=bottom width=730 border=0 cellspacing=0 cellpadding=10><tr><td class=embedded width=700>n");

print("<h1 align=center>Messages to staff</h1>n");

$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr4["added"]));

print("<table width=750 border=1 cellspacing=0 cellpadding=10 style='margin-bottom: 10px'><tr><td class=text>n");

print("From <b>$sender</b> atn" . $arr4["added"] . " ($elapsed ago) GMTn");

print("<br><br style='margin-bottom: -10px'><div align=left><b>Subject: <font color=darkred>$subject</b></font>

&nbsp;&nbsp;<br><b>Answered:</b> $answered&nbsp;&nbsp;$setanswered</div>

<br><table class=main width=730 border=1 cellspacing=0 cellpadding=10><tr><td class=staffpms>n");

print(format_comment($arr4["msg"]));

print("</td></tr></table>n");

print("<table width=730 border=0><tr><td class=embedded>n");

print(($arr4["sender"] ? "<a href=".$site_config["SITEURL"]."/staffbox.php?action=answermessage&receiver=" . $arr4["sender"] . "&answeringto=$iidee><b>Reply</b></a>" : "<font class=gray><b>Reply</b></font>") .

" | <a href=".$site_config["SITEURL"]."staffbox.php?action=deletestaffmessage&id=" . $arr4["id"] . "><b>Delete</b></a></td>");

print ("<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>");

print("</table></table>n");

print("</table>n");

stdfoot();

}

//////////////////////////

// VIEW ANSWERS //

//////////////////////////

if ($action == "viewanswer")

{

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$pmid = 0 + $_GET["pmid"];

$ress4 = mysql_query("SELECT id, subject, sender, added, msg, answeredby, answered, answer FROM staffmessages WHERE id=$pmid");

$arr4 = mysql_fetch_assoc($ress4);

$answeredby = $arr4["answeredby"];

$rast = mysql_query("SELECT username FROM users WHERE id=$answeredby");

$arr5 = mysql_fetch_assoc($rast);

if (is_valid_id($arr4["sender"]))

{

$res2 = mysql_query("SELECT username FROM users WHERE id=" . $arr4["sender"]) or sqlerr();

$arr2 = mysql_fetch_assoc($res2);

$sender = "<a href=".$site_config["SITEURL"]."/account-details.php?id=" . $arr4["sender"] . ">" . ($arr2["username"]?$arr2["username"]:"[Deleted]") . "</a>";

}

else

$sender = "System";

if ($arr4['subject'] == "") {

$subject = "No subject";

}

else {

$subject = "<a style='color: darkred' href=staffbox.php?action=viewpm&pmid=$pmid>$arr4[subject]</a>";

}



$iidee = $arr4["id"];

if ($arr4[answer] == "") {

$answer = "This message has not been answered yet!";

}

else {

$answer = $arr4["answer"];

}

stdhead("Staff PM's");

print("<table class=bottom width=730 border=0 cellspacing=0 cellpadding=10><tr><td class=embedded width=700>n");

print("<h1 align=center>Viewing Answer</h1>n");

$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr4["added"]));

print("<table width=750 border=1 cellspacing=0 cellpadding=10 style='margin-bottom: 10px'><tr><td class=text>n");

print("<b><a href=account-details.php?id=$answeredby>$arr5[username]</a></b> answered this message sent by $sender");

print("<br><br style='margin-bottom: -10px'><div align=left><b>Subject: $subject</b>

&nbsp;&nbsp;<br><b>Answer:</b></div>

<br><table class=main width=730 border=1 cellspacing=0 cellpadding=10><tr><td class=staffpms>n");

print(format_comment($answer));

print("</td></tr></table>n");

print("</table>n");

print("</table>n");

stdfoot();

}



//////////////////////////

// ANSWER MESSAGE //

//////////////////////////

if ($action == "answermessage") {

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$answeringto = $_GET["answeringto"];

$receiver = 0 + $_GET["receiver"];

if (!is_valid_id($receiver))

die;

$res = mysql_query("SELECT * FROM users WHERE id=$receiver") or die(mysql_error());

$user = mysql_fetch_assoc($res);

if (!$user)

stderr("Error", "No user with that ID.");

$res2 = mysql_query("SELECT * FROM staffmessages WHERE id=$answeringto") or die(mysql_error());

$array = mysql_fetch_assoc($res2);

stdhead("Answer to Staff PM", false);

?>

<table class=main width=450 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>

<div align=center>

<h2>Answering to <a href=".$site_config["SITEURL"]."/staffbox.php?action=viewpm&pmid=<?=$array['id']?>><i><?=$array["subject"]?></i></a> sent by <i><?=$user["username"]?></i></h2>

<form method=post name=message action=?action=takeanswer>

<? if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"]) { ?>

<? } ?>

<table class=message cellspacing=0 cellpadding=5>

<tr><td colspan=2>

<b><font color=red><h1>Message:</h1></font></b>

<textarea name=msg cols=50 rows=5><?=htmlspecialchars($body)?></textarea>

<center><a href=http://basslinebeats.co.uk><font color=red><b>--- Code By foz @ Basslinebeats &copy 2008</a> ---</b></font color></center>

</td></tr>

<tr><td<?=$replyto?" colspan=2":""?> align=center><input type=submit value="Send it!" class=btn></td></tr>

</table>

<input type=hidden name=receiver value=<?=$receiver?>>

<input type=hidden name=answeringto value=<?=$answeringto?>>

</form>

</div></td></tr></table>

<?

stdfoot();

}

//////////////////////////

// TAKE ANSWER //

//////////////////////////



if ($action == "takeanswer") {



if ($HTTP_SERVER_VARS["REQUEST_METHOD"] != "POST")

stderr("Error", "Method");

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$receiver = 0 + $_POST["receiver"];

$answeringto = $_POST["answeringto"];

if (!is_valid_id($receiver))

Show_error_msg("Error","Invalid ID");

$userid = $CURUSER["id"];

$msg = trim($_POST["msg"]);

$message = sqlesc($msg);

$added = "'" . get_date_time() . "'";

if (!$msg)

stderr("Error","Please enter something!");

mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES($userid, $userid, $receiver, $added, $message)") or sqlerr(__FILE__, __LINE__);

mysql_query("UPDATE staffmessages SET answer=$message WHERE id=$answeringto") or sqlerr(__FILE__, __LINE__);

mysql_query("UPDATE staffmessages SET answered='1', answeredby='$userid' WHERE id=$answeringto") or sqlerr(__FILE__, __LINE__);

header("Location: staffbox.php?action=viewpm&pmid=$answeringto");

die;

}

//////////////////////////

// DELETE STAFF MESSAGE //

//////////////////////////

if ($action == "deletestaffmessage") {

$id = 0 + $_GET["id"];

if (!is_numeric($id) || $id < 1 || floor($id) != $id)

die;

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

mysql_query("DELETE FROM staffmessages WHERE id=" . sqlesc($id)) or die();

header("Location: ".$site_config["SITEURL"]."/staffbox.php");

}

//////////////////////////

// MARK AS ANSWERED //

//////////////////////////

if ($action == "setanswered") {

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$id = 0 + $_GET["id"];

mysql_query ("UPDATE staffmessages SET answered=1, answeredby = $CURUSER[id] WHERE id = $id") or sqlerr();

header("Refresh: 0; url=staffbox.php?action=viewpm&pmid=$id");

}

//////////////////////////

// MARK AS ANSWERED #2 //

//////////////////////////

if ($action == "takecontactanswered") {

if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

SHOW_ERROR_MSG("Error", "Permission denied.");

}

$res = mysql_query ("SELECT id FROM staffmessages WHERE answered=0 AND id IN (" . implode(", ", $_POST[setanswered]) . ")");

while ($arr = mysql_fetch_assoc($res))

mysql_query ("UPDATE staffmessages SET answered=1, answeredby = $CURUSER[id] WHERE id = $arr[id]") or sqlerr();

header("Refresh: 0; url=staffbox.php");

}

?>

<?

//===========================================================================

// DO NOT EDIT THIS OUT

//===========================================================================

//===========================================================================

// Created by foz  www.basslinebeats.co.uk foz@basslinebeats.co.uk

//===========================================================================

?>

Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 4
  • Members: 0
  • Guests online: 4
  • Comments: 3
  • Messages: 1,728