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
User Posts

Go to Profile

[php]

<?php
require_once("backend/functions.php");
dbconn();
loggedinonly(true);

$dt = get_date_time(gmtime() - 120);

$res = SQL_Query_exec("SELECT `users`.`id`, `users`.`username`, `users`.`class`, `users`.`last_access`, `users`.`country` FROM `users` INNER JOIN `groups` ON `users`.`class` = `groups`.`group_id` WHERE `users`.`enabled` = 'yes' AND `users`.`status` = 'confirmed' AND `groups`.`staff_page` = 'yes' ORDER BY `username`");
while ( $row = mysql_fetch_assoc( $res ) ) {
$flag = SQL_Query_exec("SELECT name,flagpic FROM countries WHERE id=$row[country]");
if ($row2 = mysql_fetch_assoc($flag)) {
$country = "<img src='".$site_config['SITEURL']."/images/countries/$row2[flagpic]' width='22' height='14' title='$row2[name]' />";
} else {
$country = "<img src='".$site_config['SITEURL']."/images/countries/unknown.gif' width='22' height='14' title='Homeless!' />";
}
   $table[$row["class"]] = $table[$row["class"]] .
       "<td style='padding-bottom:7px; padding-right:7px'><img src='images/button_o".($row["last_access"] > $dt ? "n" : "ff")."line.png' alt='' />&nbsp; ".
       "<a href='account-details.php?id=".$row["id"]."'><b>".class_user($row["username"])."</b></a>&nbsp; "."".$country."&nbsp; ".
       "<a href='mailbox.php?compose&amp;id=".$row["id"]."'><img src='images/button_pm.gif' border='0' alt='' /></a></td>";

       ++$col[$row["class"]];

if ($col[$row["class"]] <= 3)
$table[$row["class"]] = $table[$row["class"]] . "<td></td>";
else {
$table[$row["class"]] = $table[$row["class"]] . "</tr><tr>";
$col[$row["class"]] = 0;
}
}

$where = null;
if ($CURUSER["edit_users"] == "no")
$where = "AND `staff_public` = 'yes'";

$res = SQL_Query_exec("SELECT `group_id`, `level`, `staff_public` FROM `groups` WHERE `staff_page` = 'yes' $where ORDER BY `staff_sort`");

if (mysql_num_rows($res) == 0)
   show_error_msg(T_("ERROR"), T_("NO_STAFF_HERE"), 1);

stdhead(T_("STAFF"));
begin_frame(T_("STAFF"));
?>

<table cellpadding="0" width="100%" align="center">
<?php while ($row = mysql_fetch_assoc($res)): if ( !isset($table[$row["group_id"]]) ) continue; ?>
<tr>
<td colspan="14">&nbsp;</td>
</tr>

<tr>
<td colspan="14"><b><?php echo T_($row["level"]); ?></b> <?php if ($row["staff_public"] == "no") echo("<font color='#ff0000'>[".T_("HIDDEN FROM PUBLIC")."]</font>"); ?></td>
</tr>

<tr>
<td colspan="14"><hr color="#0FA3D5" size="1" /></td>
</tr>

<tr>
<?php echo $table[$row["group_id"]]; ?>
</tr>

<tr>
<td colspan="14"></td>
</tr>

<?php endwhile; ?>
</table>

<?php
end_frame();
stdfoot();
?>

[/php]
update invitetree.php small error

[php]
<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();


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

if (!is_valid_id($id))
   $id = $CURUSER["id"];
   
if ($id != $CURUSER["id"] && $CURUSER["control_panel"] != "yes")
   autolink("index.php", T_("NOT_ALLOW"));

$res = SQL_Query_exec("SELECT * FROM users WHERE status = 'confirmed' AND invited_by = $id ORDER by id DESC");
$res1 = SQL_Query_exec("SELECT email, added FROM users WHERE status = 'pending' AND invited_by = $id");
$num = mysql_num_rows($res);
$num1 = mysql_num_rows($res1);

if ($num + $num1 == 0) {
   $info = ( $id != $CURUSER["id"] ? T_("NO_INVITEES_FOUND") : T_("NO_INVITEES_CURUSER") );
   autolink("account-details.php?id=$id", $info);
}

if ($id != $CURUSER["id"]) {
   $ret = SQL_Query_exec("SELECT username FROM users WHERE id = $id");
   $row = mysql_fetch_assoc($ret);
   $username = $row["username"];
   
   stdhead(T_("INVITE_TREE_FOR").$username);
   
begin_frame(T_("INVITE_TREE_FOR")."<a href=account-details.php?id=$id>".class_user($username)."</a>");

} else {
   stdhead(T_("MY_INVITE_TREE"));

begin_frame(T_("MY_INVITE_TREE"));
}

//Pending invitees
if ($num1 > 0) {
?>

<table class='table_table' border='0' cellspacing='0' cellpadding='5' align='center' style='margin-top: 40px'>
<tr>
   <td align='left' colspan='4'><b><?php echo $num1 . P_("PENDING_ACCOUNT", $num1) . T_("WAIT_VALID"); ?></b></td>
</tr>

<tr>
   <td class='table_head'><b><?php echo T_("EMAIL_SENT_TO"); ?></b></td>
   <td class='table_head'><b><?php echo T_("INVITE_DATE"); ?></b></td>
   <td class='table_head'><b><?php echo T_("AVAILABLE_TO"); ?></b></td>
   <td class='table_head'><b><?php echo T_("TIME_REMAINDER"); ?></b></td>
</tr>

<?php
for ($i = 1; $i <= $num1; $i++) {
   $arr1 = mysql_fetch_assoc($res1);
   $date = utc_to_tz($arr1["added"]);
   $email = $arr1["email"];
   $end = utc_to_tz( get_date_time( strtotime( $arr1["added"] ) + (7*86400) ) );
   $time = mkprettytime( DateDiff ( gmtime(), strtotime( $arr1["added"] ) + (7*86400) ) );
?>

<tr>
   <td class='table_col2' align='left'><?php echo $email; ?></td>
   <td class='table_col1' align='left'><?php echo $date; ?></td>
   <td class='table_col2' align='left'><?php echo $end; ?></td>
   <td class='table_col1' align='center'><?php echo $time; ?></td>
</tr>
<?php } ?>
</table>

<?php
}

//Confirmed invitees
if ($num > 0) {
?>

<table class='table_table' border='0' cellspacing='0' cellpadding='5' align='center' style='margin-top: 40px'>
<tr>
   <?php $msg = ( $id != $CURUSER["id"] ? class_user($username) . T_("INVITED") . $num . P_("PERSON", $num) : T_("YOU_INVITE") . $num . P_("PERSON", $num) ); ?>
   <td align='left' colspan='8'><b><?php echo $msg; ?></b></td>
   
<tr>
   <td class='table_head'><b><?php echo T_("USERNAME"); ?></b></td>
   <td class='table_head'><b><?php echo T_("USERCLASS"); ?></b></td>
   <td class='table_head'><b><?php echo T_("INSCRIPTION"); ?></b></td>
   <td class='table_head'><b><?php echo T_("LAST_ACCESS"); ?></b></td>
   <td class='table_head'><b><?php echo T_("DOWNLOADED"); ?></b></td>
   <td class='table_head'><b><?php echo T_("UPLOADED"); ?></b></td>
   <td class='table_head'><b><?php echo T_("RATIO"); ?></b></td>
   <td class='table_head'><b><?php echo T_("WARNED"); ?></b></td>
</tr>
   
<?php
for ($i = 1; $i <= $num; $i++) {
   $arr = mysql_fetch_assoc($res);
       
if ($arr['added'] == '0000-00-00 00:00:00')
   $arr['added'] = '---';

if ($arr['last_access'] == '0000-00-00 00:00:00')
   $arr['last_access'] = '---';

if ($arr["downloaded"] > 0) {
   $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
   $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
} elseif ($arr["uploaded"] > 0) {
   $ratio = "<font color='green'>Inf.</font>";
} else {
   $ratio = "---";
}

   $warned = ($arr["warned"] != "yes") ? $warned = "<font color='green'><b>".T_("NO")."</b></font>" : $warned = "<font color='red'><b>".T_("YES")."</b></font>";
   $class = get_user_class_name($arr["class"]);
   $class = T_("$class");
   $added = substr(utc_to_tz($arr['added']),0,10);
   $last_access = substr(utc_to_tz($arr['last_access']),0,10);
   $downloaded = mksize($arr["downloaded"]);
   $uploaded = mksize($arr["uploaded"]);
?>
       
<tr>
   <td class='table_col1' align='left'><a href="account-details.php?id=<?php echo $arr["id"]; ?>"><b><?php echo class_user($arr["username"]); ?></b></a></td>
   <td class='table_col2' align='left'><?php echo $class; ?></td>
   <td class='table_col1' align='center'><?php echo $added; ?></td>
   <td class='table_col2' align='center'><?php echo $last_access; ?></td>
   <td class='table_col1' align='center'><font color='red'><?php echo $downloaded; ?></font></td>
   <td class='table_col2' align='center'><font color='green'><?php echo $uploaded; ?></font></td>
   <td class='table_col1' align='center'><?php echo $ratio; ?></td>
   <td class='table_col2' align='center'><?php echo $warned; ?></td>
</tr>
<?php } ?>
</table>

<?php
}

//if ($arr["invited_by"] != $CURUSER['id']) {
if ($arr["invited_by"] != $CURUSER['id'] && $CURUSER["class"] < 5) {
?>
   <div style='margin-top: 20px' align='center'>[<a href='account-details.php?id=<?php echo $id; ?>'><b><?php echo T_("BACK_TO_PROFIL"); ?></b></a>]</div>
   
<?php
}
end_frame();
stdfoot();
?>
[/php]
This hack will add the other torrent pages to index.php as it is in torrents.php

open index.php

find:

[php]
      begin_frame("Latest Torrents");
[/php]

add below:

[php]
      //Get Total For Pager
$res = SQL_Query_exec("SELECT COUNT(*) FROM torrents WHERE visible='yes'") ;
$row = mysql_fetch_array($res);
$count = $row[0];
[/php]

find:

[php]
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<br /><br /><b><center>You Are Not Logged In<br>Only Members Can View Torrents Please Login or Signup.</center><br /><br />";
} else {
[/php]

change to:

[php]
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<br /><br /><b><center>You Are Not Logged In<br>Only Members Can View Torrents Please Login or Signup.</center><br /><br />";
} elseif ( $count) {
list($pagertop, $pagerbottom, $limit) = pager(20, $count, "torrents.php?");
[/php]

find:

[php]
if (mysql_num_rows($res)) {
torrenttable($res);
[/php]

replace with:

[php]
if ($count) {
torrenttable($res);
print($pagerbottom);
[/php]
New login js — 2020-05-10 07:46:55 in M-BiTsy Support
hello spiritblue thank you
i found prefixfree.min.js into the site cdn 1.0.7
[URL unfurl="true"]https://cdnjs.com/libraries/prefixfree[/url]
New login js — 2020-05-09 05:43:55 in M-BiTsy Support
this is new login js

ps:hello spiritblue could you improve it ?
this correct

[php]
ALTER TABLE `torrents` ADD `sticky` enum('yes','no') NOT NULL default 'no';
[/php]

function
[php]
after:
if ($row["freeleech"] == 1)
   $dispname .= " <img src='images/free.gif' border='0' alt='' />";

if ($row["sticky"] == "yes")
   $dispname .= " <img src='images/sticky.gif' bored='0' alt='sticky' title='sticky'>";
[/php]
hello Bbam90 yes is correct
into file function.php
[php]
case "gb": // GigaByte
           return $num * 1073741824;
[/php]
1073741824 x 5
update now is correct


[php]
// Auto Uploader rank function (Author: ArcticWolf)
function auto_rank_icon($uploaded, $downloaded, $level) {
$tb = 1024 * 1024 * 1024 * 1024;
// Config
$minup0 = .05 * $tb;
$minup1 = .1 * $tb;
$minup2 = .2 * $tb;
$minup3 = .35 * $tb;
$minup4 = .55 * $tb;
$minup5 = .8 * $tb;
$minup6 = 1.5 * $tb;
$minup7 = 2.0 * $tb;
$minup8 = 2.5 * $tb;

// Config End
$icon1 = "legend_stjarna_brons.png";
$icon2 = "legend_stjarna_silver.png";
$icon3 = "legend_stjarna_guld.png";
$icon4 = "krona_brons.png";
$icon5 = "krona_silver.png";
$icon6 = "krona_guld.png";
$icon7 = "diamant.png";
$icon8 = "diamant.png";

if ($uploaded >= $minup8 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon8." alt='$icon8' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup6 && $uploaded < $minup7 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon7." alt='$icon7' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup5 && $uploaded < $minup6 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon6." alt='$icon6' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup4 && $uploaded < $minup5 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon5." alt='$icon5' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup3 && $uploaded < $minup4 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon4." alt='$icon4' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup2 && $uploaded < $minup3 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon3." alt='$icon3' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup1 && $uploaded < $minup2 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon2." alt='$icon2' border=\"0\" />";
return $uprankr;

} elseif ($uploaded >= $minup0 && $uploaded >= $downloaded) {
$uprankr = "<img src='".$site_config['SITEURL']."/images/icons/' ".$icon1." alt='$icon1' border=\"0\" />";
return $uprankr;
}
return "";
}
       // End Auto Uploader rank function (Author: ArcticWolf)
[/php]
update moresmiles.php

[php]
<?php
require_once("backend/smilies.php");
require_once("backend/functions.php");
require_once("backend/config.php");
dbconn();


//===| GET CURRENT USERS THEME AND LANGUAGE
if ($CURUSER) {
$ss_a = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = @mysql_fetch_array(@sql_query_exec("select uri from languages where id=" . $CURUSER["language"]));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
} else { //===| Not logged in so get default theme/language
$ss_a = mysql_fetch_array(sql_query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = mysql_fetch_array(sql_query_exec("select uri from languages where id='" . $site_config['default_language'] . "'"));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}

echo '<link rel="stylesheet" type="text/css" href="'.$site_config['SITEURL'].'/themes/'.$THEME.'/theme.css" />';

if (!isset($_GET["form"])||!isset($_GET["text"])) {
show_error_msg("Error!","Missing parameter!");
print("</body></html>");
die();
}

$parentform=htmlentities(urldecode($_GET["form"]));
$parentarea=htmlentities(urldecode($_GET["text"]));
?>

<script language="javascript">
function SmileIT(smile,textarea) {
//===| Attempt to create a text range (IE)
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange) {
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smile + ' ' : smile
caretPos.select();
}
//===| Mozilla text range replace
else
if (typeof(textarea.selectionStart) != "undefined") {
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;

textarea.value = begin + smile + end;

if (textarea.setSelectionRange) {
textarea.focus();
textarea.setSelectionRange(begin.length + smile.length, begin.length + smile.length);
}
textarea.scrollTop = scrollPos;
}
//===| Just put it on the end
else {
textarea.value += smile;
textarea.focus(textarea.value.length - 1);
}
}
</script>

<body class="shoutbox_body">
<table class="table_table" width="100%" cellpadding="1" cellspacing="1">
<tr>
<?php
global $count;
while ((list($code, $url) = each($smilies))) {
if ($count % 3==0)
print("<tr>\n");
print("<td class='table_table' align='center'><a href='javascript: SmileIT('".str_replace("'","'",$code)."',window.opener.document.forms.$parentform.$parentarea);'><img border='0' src='images/smilies/'".$url."></a></td>\n");
$count++;

if ($count % 3==0)
print("</tr>\n");
}
?>
</tr>
</table>

<div align="center">
<a href="javascript: window.close()"><?php echo CLOSE; ?></a>
</div>
<br />
</body>
[/php]
New mailbox.php — 2019-08-24 20:55:40 in v2.08 Mods Completed
update maibox bugfix

sorry it's not possible upload file error

[php]
<?php
//
//  TorrentTrader v2.x
//      $LastChangedDate: 2011-12-18 13:54:53 +0000 (Sun, 18 Dec 2011) $
//      $LastChangedBy: dj-howarth1 $
//
//      http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
require_once("mailbox-functions.php");
dbconn(false);
loggedinonly();

   $readme = add_get('read').'=';
   $unread = false;

if (isset($_REQUEST['compose'])); // This blocks everything until done...

if (isset($_GET['inbox'])) {
   $pagename = T_("INBOX");
   $tablefmt = "&nbsp;,Unread,Sender,Subject,Date";
   $where = "`receiver` = $CURUSER[id] AND `location` IN ('in','both')";
   $type = "Mail";
}
   elseif (isset($_GET['outbox']))
{
   $pagename = T_("OUTBOX");
   $tablefmt = "&nbsp;,Sent_to,Subject,Date";
   $where = "`sender` = $CURUSER[id] AND `location` IN ('out','both')";
   $type = "Mail";
}
   elseif (isset($_GET['draft']))
{
   $pagename = T_("DRAFT");
   $tablefmt = "&nbsp;,Sent_to,Subject,Date";
   $where = "`sender` = $CURUSER[id] AND `location` = 'draft'";
   $type = "Mail";
}
   elseif (isset($_GET['templates']))
{
   $pagename = T_("TEMPLATES");
   $tablefmt = "&nbsp;,Subject,Date";
   $where = "`sender` = $CURUSER[id] AND `location` = 'template'";
   $type = "Mail";
}
   else
{
   $pagename = T_("MAIL_OVERVIEW");
   $type = "Overview";
}

//****** Send a message, or save after editing ******
if (isset($_POST['send']) || isset($_POST['draft']) || isset($_POST['template'])) {
if (!isset($_POST['template']) && !isset($_POST['change']) && (!isset($_POST['userid']) || !is_valid_id($_POST['userid']))) $error = "Unknown recipient";
   else
{
   $sendto = (@$_POST['template'] ? $CURUSER['id'] : @$_REQUEST['userid']);

  if (isset($_POST['usetemplate']) && is_valid_id($_POST['usetemplate'])) {
$res = SQL_Query_exec("SELECT * FROM messages WHERE `id` = $_POST[usetemplate] AND `location` = 'template' LIMIT 1");
   $arr = mysql_fetch_array($res);
   $subject = $arr['subject'].(@$_POST['oldsubject'] ? " (was ".$_POST['oldsubject'].")" : "");
   $msg = sqlesc($arr['msg']);
} else {
   $subject = @$_POST['subject'];
   $msg = sqlesc(@$_POST['msg']);
}
 
if ($msg){
   $subject = sqlesc($subject);
if ((isset($_POST['draft']) || isset($_POST['template'])) && isset($_POST['msgid'])) SQL_Query_exec("UPDATE messages SET `subject` = $subject, `msg` = $msg WHERE `id` = $_POST[msgid] AND `sender` = $CURUSER[id]") or die("arghh");
   else
{
   $to = (@$_POST['draft'] ? 'draft' : (@$_POST['template'] ? 'template' : (@$_POST['save'] ? 'both' : 'in')));
   $status = (@$_POST['send'] ? 'yes' : 'no');
   
SQL_Query_exec("INSERT INTO `messages` (`sender`, `receiver`, `added`, `subject`, `msg`, `unread`, `location`) VALUES ('$CURUSER[id]', '$sendto', '".get_date_time()."', $subject, $msg, '$status', '$to')") or die("Aargh!");

  // email notif
   $res = SQL_Query_exec("SELECT id, acceptpms, notifs, email FROM users WHERE id='$sendto'");
   $user = mysql_fetch_assoc($res);

if (strpos($user['notifs'], '[pm]') !== false) {
   $cusername = $CURUSER["username"];
   $body = "You have received a PM from ".$cusername."\n\nYou can use the URL below to view the message (you may have to login).\n\n    ".$site_config['SITEURL']."/mailbox.php\n\n".$site_config['SITENAME']."";
   sendmail($user["email"], "You have received a PM from $cusername", $body, "From: $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
}
   //end email notif

if (isset($_POST['msgid'])) SQL_Query_exec("DELETE FROM messages WHERE `location` = 'draft' AND `sender` = $CURUSER[id] AND `id` = $_POST[msgid]") or die("arghh");
}

if (isset($_POST['send'])) $info = "Message sent successfully".(@$_POST['save'] ? ", a copy has been saved in your Outbox" : "");
   else $info = "Message saved successfully";
}
   else $error = "Unable to send message";
}
}

//****** Delete a message ******
if (isset($_POST['remove']) && (isset($_POST['msgs']) || is_array($_POST['remove']))) {
if (is_array($_POST['remove'])) $tmp[] = key($_POST['remove']);
   else foreach($_POST['msgs'] as $key => $value) if (is_valid_id($key)) $tmp[] = $key;
   $msgs = implode(', ', $tmp);

if ($msgs) {

if (isset($_GET['inbox'])) {
SQL_Query_exec("DELETE FROM messages WHERE `location` = 'in' AND `receiver` = $CURUSER[id] AND `id` IN ($msgs)");
SQL_Query_exec("UPDATE messages SET `location` = 'out' WHERE `location` = 'both' AND `receiver` = $CURUSER[id] AND `id` IN ($msgs)");
} else {
if (isset($_GET['outbox'])) SQL_Query_exec("UPDATE messages SET `location` = 'in' WHERE `location` = 'both' AND `sender` = $CURUSER[id] AND `id` IN ($msgs)");
SQL_Query_exec("DELETE FROM messages WHERE `location` IN ('out', 'draft', 'template') AND `sender` = $CURUSER[id] AND `id` IN ($msgs)");
}
   $info = count($tmp)." ".P_("message", count($tmp))." deleted";
}
   else $error = "No messages to delete";
}

//****** Mark a message as read - only if you're the recipient ******
if (isset($_POST['mark']) && (isset($_POST['msgs']) || is_array($_POST['mark'])))
{
if (is_array($_POST['mark'])) $tmp[] = key($_POST['mark']);
   else foreach($_POST['msgs'] as $key => $value) if (is_valid_id($key)) $tmp[] = $key;
   $msgs = implode(', ', $tmp);

if ($msgs) {
SQL_Query_exec("UPDATE messages SET `unread` = 'no' WHERE `id` IN ($msgs) AND `receiver` = $CURUSER[id]");
   $info = count($tmp)." ".P_("message",  count($tmp))." marked as read";
}
   else $error = "No messages marked as read";
}


stdhead($pagename, false);

function navmenu(){
?>  
   
       <table cellpadding='0' cellspacing='3' width='100%'>
     
       </table>
   
 
   <?php
}//end func

#################################################-CSS-MAILBOX-###################################################
#                                                                                                               #
# If you have more the one theme, you can copy the CSS-Code into each of theme.css files and do the adjustment  #
#                                                                                                                #
#################################################################################################################
?>
<style type="text/css">
<!--
#mpbox {
 
   align: center;
   //#width: 100%;
   border:1px solid #000000;
   border-radius:8px;
   box-shadow:0 0 10px #000000;
   padding-top:10px;
   padding: 10px;
   //background: rgb(207,207,207);
   -webkit-box-shadow: 0 5px 8px 0 rgba(100,100,100, 0.8);
   -moz-box-shadow: 0 5px 8px 0 rgba(100,100,100, 0.8);
   -o-box-shadow: 0 5px 8px 0 rgba(100,100,100, 0.8);
   box-shadow: 0 5px 8px 0 rgba(100,100,100, 0.8);
}
 
#tablebox {
 
   align: center;
   width: 80%;
   border:1px solid #000000;
   border-radius:8px;
   //box-shadow:0 0 50px #000000;
   padding-top:10px;
   padding: 10px;
   -webkit-box-shadow: 0 5px 15px 0 rgba(16,16,16, 0.8);
   -moz-box-shadow: 0 5px 15px 0 rgba(16,16,16, 0.8);
   -o-box-shadow: 0 5px 15px 0 rgba(16,16,16, 0.8);
   box-shadow: 0 5px 15px 0 rgba(16,16,16, 0.8);
}  

.table_mb {
     
   //width: 100%;
   /*font-size: 12px;*/
   /*color: #FFF;*/
   //background-image: url(images/alt_2.png);
   border-collapse: collapse;
   -webkit-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   -moz-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   -o-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   /*border-collapse: separate; color: 0 1px 1px 0 rgba(0,0,0, 0.8);*/
   margin-bottom: 2px;
}  

/*Background buttons*/
div.menu5 {

   width:80%;margin:0 auto;/*Uncomment this line to make the menu center-alignd.*/
   text-align:center;
   //background:#332E28;
   border-radius:8px;
   -webkit-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   -moz-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   -o-box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   box-shadow: 0 8px 10px 0 rgba(100,100,100, 0.8);
   border:1px solid black;
   font-size:0;
   padding:10px;
}


/*Buttons*/
div.menu5 a {

   display: inline-block;
   padding: 0 20px;
   //background:#3A332C;
   //background: url(themes/<?php echo $THEME; ?>/images/frame-top.gif);
   border:1px solid #5E544A;
   border-radius:8px;
   -webkit-box-shadow: 0 8px 5px 0 rgba(100,100,100, 0.6);
   -moz-box-shadow: 0 8px 5px 0 rgba(100,100,100, 0.6);
   -o-box-shadow: 0 8px 5px 0 rgba(100,100,100, 0.6);
   box-shadow: 0 8px 5px 0 rgba(100,100,100, 0.6);
   color:#000000;
   text-decoration:none;
   font: bold 12px Arial;
   line-height: 27px;
   margin-right:5px;
}

/*Buttons Mouseover*/
div.menu5 a:hover, div.menu5 a.current {
 
   background:#484037;
   //background: url(themes/<?php echo $THEME; ?>/images/f-title.gif);
   color:#E6D4C3;
}
--->  
</style>
<?php
#################################################-CSS-MAILBOX-END-###############################################

if (isset($_REQUEST['compose'])) {

begin_frame(T_("COMPOSE"));
navmenu();
   $userid = @$_REQUEST['id'];
   $subject = ''; $msg = ''; $to = ''; $hidden = ''; $output = ''; $reply = false;
   $sreplay = T_("REPLY");//fixbug

if (is_array($_REQUEST['compose'])) { // In reply or followup to another msg
   $msgid = key($_REQUEST['compose']);
if (is_valid_id($msgid)) {
$res = SQL_Query_exec("SELECT * FROM `messages` WHERE `id` = $msgid AND '$CURUSER[id]' IN (`sender`,`receiver`) LIMIT 1");

if ($arr = mysql_fetch_assoc($res)){
   $subject = htmlspecialchars($arr['subject']);
   $msg .= htmlspecialchars($arr['msg']);

//if (current($_REQUEST['compose']) == 'Reply') {//bug
if (current($_REQUEST['compose']) == $sreplay) { //fixbug
if ($arr['unread'] == 'yes' && $arr['receiver'] == $CURUSER['id']) SQL_Query_exec("UPDATE messages SET `unread` = 'no' WHERE `id` = $arr[id]");
   $reply = true;
   $userid = $arr['sender'];
if (substr($arr['subject'],0,4) != 'Re: ') $subject = "Re: $subject";
}
  else $userid = $arr['receiver'];
  $hidden .= "<input type=\"hidden\" name=\"msgid\" value=\"$msgid\" />";
}
}
}
if (isset($_GET['templates'])) $to = 'who cares';
elseif (is_valid_id($userid))
{
   $where = null;
if ($CURUSER["view_users"] == "no" && $userid != $CURUSER["id"])
   $where = "AND acceptpms = 'yes'";

   # Allow users to PM themself's, Privacy is determined on acceptpms - (From All or Staff Only).
   $res = SQL_Query_exec("SELECT username FROM users WHERE id = $userid AND status = 'confirmed' AND enabled = 'yes' $where");
   $row = mysql_fetch_assoc($res);

   if ( !$row ) {
   print("You either do not have permission to pm this user, or they don't exist.");

end_frame();
stdfoot();
die;
}

   $to = $row["username"];
   $hidden .= "<input type=\"hidden\" name=\"userid\" value=\"$userid\" />";
if ($to == $CURUSER["username"])
   $to = "".T_("YOURSELF")."";
   $to = "&nbsp;&nbsp;<b>$to</b>";
}
   else
{
   $where = null;
if ($CURUSER["view_users"] == "no")
   $where = "AND acceptpms = 'yes'";

   # Don't display yourself, Privacy is determined on acceptpms - (From All or Staff Only).
   $res = SQL_Query_exec("SELECT id, username FROM users WHERE id != $CURUSER[id] AND enabled = 'yes' AND status = 'confirmed' $where ORDER BY username");

if (mysql_num_rows($res)) {
   $to = "<select name=\"userid\">\n";
   while ($arr = mysql_fetch_assoc($res)) $to .= "<option value=\"$arr[id]\">$arr[username]</option>\n";
   $to .= "</select>\n";
}

}
if (isset($_GET['id']) && !$to) print T_("INVALID_USER_ID");
elseif (!isset($_GET['id']) && !$to) print T_("NO_FRIENDS");
else
{
    /******** compose frame ********/

begin_form(rem_get('compose'),'name="compose"');
?>
<br /><br />
<div class="menu5">
   <a href="mailbox.php"><?php echo T_("OVERVIEW"); ?></a>
   <a href="mailbox.php?inbox"><?php echo T_("INBOX"); ?></a>
   <a href="mailbox.php?outbox"><?php echo T_("OUTBOX"); ?></a>
   <a href="mailbox.php?draft"><?php echo T_("DRAFT"); ?></a>
   <a href="mailbox.php?templates"><?php echo T_("TEMPLATES"); ?></a>
   <a href="mailbox.php?compose"><?php echo T_("COMPOSE"); ?></a>
</div>  
<?php  
   /*-No bottons just links
   print ("<br /><br /><p align='center'><br />
   <a href=\"mailbox.php\">".T_("OVERVIEW")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?inbox\">".T_("INBOX")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?outbox\">".T_("OUTBOX")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?draft\">".T_("DRAFT")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?templates\">".T_("TEMPLATES")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?compose\">".T_("COMPOSE")."</a></p>");
   */
   //echo ("<br /><br /><hr />");
   echo "<br /><br />";

if ($subject) $hidden .= "<input type=\"hidden\" name=\"oldsubject\" value=\"$subject\" />";
if ($hidden) print($hidden);
 
##########################################################################-Compose START-###########################################################################  
   echo "<center><div id='tablebox'><br /><table class='table_mb' width='100%' border='1' align='center' cellpadding='0' cellspacing='0'></center>";
if (!isset($_GET['templates'])){
   echo "<tr><td align='right'><b>" . T_("TO") . "&nbsp;:&nbsp;</b></td><td> $to</td></tr>";
$res = SQL_Query_exec("SELECT * FROM `messages` WHERE `sender` = $CURUSER[id] AND `location` = 'template' ORDER BY `subject`");

if (mysql_num_rows($res)) {
   $tmp = "<select name=\"usetemplate\" onchange=\"toggleTemplate(this);\">\n<option name=\"0\">---</option>\n";
   while ($arr = mysql_fetch_assoc($res)) $tmp .= "<option value=\"$arr[id]\">$arr[subject]</option>\n";
   $tmp .= "</select><br />\n";
   echo "<tr><td align='right'><b>".T_("TEMPLATES")."&nbsp;:&nbsp;</b></td><td>$tmp</td></tr>";
}
}
   echo "<tr><td align='right'><b>".T_("SUBJECT")."&nbsp;:&nbsp;</b></td><td><input name=\"subject\" type=\"text\" size=\"40\" value=\"$subject\"></td></tr>";
 
require_once("backend/bbcode.php");
   echo "</table>";

#####-comment this row out if you have mode from (thib - bbcode with preview everywhere, users may change color of icon)-####
 
   print textbbcode("compose","msg","$msg");
 
#############################################################################################################################
 
#####-Uncomment this rows if you have mode from (thib - bbcode with preview everywhere, users may change color of icon)-#####

   //$dossier_pm = $CURUSER['bbcode'];
   //print ("<center>");
   //print ("".textbbcode("compose","msg",$dossier_pm,$msg)."");
   //print ("</center>");

#############################################################################################################################
 
   echo "<table class='table_mb' width='100%' border='1' align='center' cellpadding='4' cellspacing='0'>";
if (!isset($_GET['templates'])) $output .= "<input type=\"submit\" name=\"send\" value=\"".T_("SEND")."\" />&nbsp;<label><sub><input type=\"checkbox\" name=\"save\" checked='checked' /></sub>".T_("SAVE_COPY")."</label>&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"draft\" value=\"".T_("SAVE_DRAFT")."\" />&nbsp;";
   echo "<tr><td align='left'>$output<input type=\"submit\" name=\"template\" value=\"".T_("SAVE_TEMPLATE")."\" /></td></tr>";
   echo "</table><br /></div></center><br /><br />";

################################################################-Compose END-################################################

end_form();
end_frame();
stdfoot();
die;
}
end_frame();
}

begin_frame($pagename);
navmenu();
 
?>
<br /><br />
<div class="menu5">
   <a href="mailbox.php"><?php echo T_("OVERVIEW"); ?></a>
   <a href="mailbox.php?inbox"><?php echo T_("INBOX"); ?></a>
   <a href="mailbox.php?outbox"><?php echo T_("OUTBOX"); ?></a>
   <a href="mailbox.php?draft"><?php echo T_("DRAFT"); ?></a>
   <a href="mailbox.php?templates"><?php echo T_("TEMPLATES"); ?></a>
   <a href="mailbox.php?compose"><?php echo T_("COMPOSE"); ?></a>
</div>  
<?php  
 
   /*-No bottons just links
   print ("<br /><br /><p align='center'><br />
   <a href=\"mailbox.php\">".T_("OVERVIEW")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?inbox\">".T_("INBOX")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?outbox\">".T_("OUTBOX")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?draft\">".T_("DRAFT")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?templates\">".T_("TEMPLATES")."</a> &nbsp; | &nbsp;
   <a href=\"mailbox.php?compose\">".T_("COMPOSE")."</a></p>");
   */
   //echo ("<br /><br /><hr />");
   echo "<br />";

if ($type == "Overview") {
   $res = SQL_Query_exec("SELECT COUNT(*), COUNT(`unread` = 'yes') FROM messages WHERE `receiver` = $CURUSER[id] AND `location` IN ('in','both')");
   $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND `location` IN ('in','both')");
   $inbox = mysql_result($res, 0);
   $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE `receiver` = " . $CURUSER["id"] . " AND `location` IN ('in','both') AND `unread` = 'yes'");
   $unread = mysql_result($res, 0);
   $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE `sender` = " . $CURUSER["id"] . " AND `location` IN ('out','both')");
   $outbox = mysql_result($res, 0);
   $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE `sender` = " . $CURUSER["id"] . " AND `location` = 'draft'");
   $draft = mysql_result($res, 0);
   $res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE `sender` = " . $CURUSER["id"] . " AND `location` = 'template'");
   $template = mysql_result($res, 0);

   echo"<br />";

   echo("<center><div id='tablebox'><table class='table_mb' align='center' border='1' width='40%' cellspacing='5' cellpadding='5'><br /></center>");
   echo('<tr><td class="table_head" align="center" colspan="2"><b><i>'.T_("OVERVIEW_INFO").'</i></b></td></tr>');
   echo('<tr><td align="right" width="25%"><!--<a href="mailbox.php?inbox">-->'.T_("INBOX").' :</a></td><td align="center" "width="25%" >'. " [<font color=green> $inbox </font>] ".P_("", $inbox)." (<font color=red>$unread ".T_("UNREAD")."</font>)</td></tr>");
   echo('<tr><td align="right" width="25%"><!--<a href="mailbox.php?outbox">-->'.T_("OUTBOX").' :</a></td><td align="center" width="25%">'. " [ $outbox ] ".P_("", $outbox)."</td></tr>");
   echo('<tr><td align="right" width="25%"><!--<a href="mailbox.php?draft">-->'.T_("DRAFT").' :</a></td><td align="center" width="25%">'. " [ $draft ] ".P_("", $draft)."</td></tr>");
   echo('<tr><td align="right" width="25%"><!--<a href="mailbox.php?templates">-->'.T_("TEMPLATES").' :</a></td><td align="center" width="25%">'. " [ $template ] ".P_("", $template)."</td></tr>");
   echo ('</table><br /></div>');
   echo"<br /><br />";
}
elseif ($type == "Mail")
{

begin_form();
   echo("<br /><center><div id='tablebox'>");
   $order = order("added,unread,sender,sendto,subject", "added", true);
$res = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE $where");
$count = mysql_result($res, 0);
   list($pagertop, $pagerbottom, $limit) = pager2(10, $count);
   print($pagertop);
 
   echo("<table class='table_mb' align='center' border='1' width='97%' cellspacing='5' cellpadding='5'><br /></center>\n");
   $table['&nbsp;']  = th_center("<input type=\"checkbox\" onclick=\"toggleChecked(this.checked);this.form.remove.disabled=true;\" />", 1);
   $table['Unread']  = th_center("".T_("READ")."",'unread');
   $table['Sender']  = th_left("".T_("SENDER")."",'sender');
   $table['Sent_to'] = th_left("".T_("SENT_TO")."",'receiver');
   $table['Subject'] = th_left("".T_("SUBJECT")."",'subject');
   $table['Date']    = th_center("".T_("DATE")."",'added');
   table($table, $tablefmt);

$res = SQL_Query_exec("SELECT * FROM messages WHERE $where $order $limit");
while ($arr = mysql_fetch_assoc($res)) {
   unset($table);
   $userid = 0;
   $format = '';
   $reading = false;

if ($arr["sender"] == $CURUSER['id']) $sender = "".T_("YOURSELF")."";
  elseif (is_valid_id($arr["sender"])) {
$res2 = SQL_Query_exec("SELECT username FROM users WHERE `id` = $arr[sender]");
$arr2 = mysql_fetch_assoc($res2);
   $sender = "<a href=\"account-details.php?id=$arr[sender]\">".($arr2["username"] ? $arr2["username"] : "[Deleted]")."</a>";
} else
   $sender = "".T_("SYSTEM")."";

if ($arr["receiver"] == $CURUSER['id']) $sentto = "".T_("YOURSELF")."";
   elseif (is_valid_id($arr["receiver"])) {
   $res2 = SQL_Query_exec("SELECT username FROM users WHERE `id` = $arr[receiver]");
   $arr2 = mysql_fetch_assoc($res2);
   $sentto = "<a href=\"account-details.php?id=$arr[receiver]\">".($arr2["username"] ? $arr2["username"] : "[Deleted]")."</a>";
} else
   $sentto = "".T_("SYSTEM")."";
   $subject = ($arr['subject'] ? htmlspecialchars($arr['subject']) : "".T_("NO_SUBJECT")."");

if (@$_GET['read'] == $arr['id']) {
   $reading = true;
   
if (isset($_GET['inbox']) && $arr["unread"] == "yes") SQL_Query_exec("UPDATE messages SET `unread` = 'no' WHERE `id` = $arr[id] AND `receiver` = $CURUSER[id]");
}

if ($arr["unread"] == "yes") {
   $format = "font-weight:bold;";
   $unread = true;
   $unread = "<font color=red>".T_("NO")."</font>";
} else
   $unread = "<font color=green>".T_("YES")."</font>";
   $table['&nbsp;']  = th_center("<input type=\"checkbox\" name=\"msgs[$arr[id]]\" ".($reading ? "checked='checked'" : "")." onclick=\"this.form.remove.disabled=true;\" />", 1);
   $table['Unread']  = th_center("$unread");
   $table['Sender']  = th_left("$sender", 1, $format);
   $table['Sent_to'] = th_left("$sentto", 1, $format);
   $table['Subject'] = th_left("<a href=\"javascript:read($arr[id]);\"><img src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"img_$arr[id]\" class=\"read\" border=\"0\" alt='' /></a>&nbsp;<a href=\"javascript:read($arr[id]);\">&nbsp;$subject</a>", 1, $format);
   $table['Date']    = th_center(utc_to_tz($arr['added']), 1, $format);
   table($table, $tablefmt);

   $display = "<div id='mpbox'>".format_comment($arr['msg'])."<br /><br />";
   $display .= "</div><br />";

if (isset($_GET['inbox']) && is_valid_id($arr["sender"]))   $display .= "<input type=\"submit\" name=\"compose[$arr[id]]\" value=\"".T_("REPLY")."\" />&nbsp;\n";
elseif (isset($_GET['draft']) || isset($_GET['templates'])) $display .= "<input type=\"submit\" name=\"compose[$arr[id]]\" value=\"".T_("EDIT_PM")."\" />&nbsp;\n";
if (isset($_GET['inbox']) && $arr['unread'] == 'yes') $display .= "<input type=\"submit\" name=\"mark[$arr[id]]\" value=\"".T_("MARK_AS_READ")."\" />&nbsp;\n";
   $display .= "<input type=\"submit\" name=\"remove[$arr[id]]\" value=\"".T_("DELETE_PM")."\" />&nbsp;\n";
   table(td_left($display, 1, "padding:6px 6px 6px 6px"), $tablefmt, "id=\"msg_$arr[id]\" style=\"display:none;\"");
}
   print("</table><br />");
   print($pagerbottom);
   print("</div><br /><br />");

   print("<center><div id='tablebox'><table align='center' border='0' width='98%' cellspacing='1' cellpadding='1'></center>\n");
   $buttons = "<input type=\"button\" value=\"".T_("DELETE_SELECTED")."\" onclick=\"this.form.remove.disabled=!this.form.remove.disabled;\" />";
   $buttons .= "<input type=\"submit\" name=\"remove\" value=\"".T_("DEL_CONFIRM")."\" disabled=\"disabled\" />";
   if (isset($_GET['inbox']) && $unread) $buttons .= "&nbsp;<input type=\"button\" value=\"".T_("MARK_SELECTED_AS_READ")."\" onclick=\"this.form.mark.disabled=!this.form.mark.disabled;\" /><input type=\"submit\" name=\"mark\" value=\"".T_("DEL_CONFIRM")."\" disabled=\"disabled\" />";
   if (isset($_GET['templates'])) $buttons .= "&nbsp;<input type=\"submit\" name=\"compose\" value=\"".T_("CREATE_NEW_TEMPLATE")."\" />";
   table(td_left($buttons, 1, "border:0"), $tablefmt);
   print("</table></div>");
   print("<br />");
   print("<br />");
}

end_frame();
stdfoot();
?>
[/php]
original file moresmiles bigmax1

[php]
<?php
require_once("backend/smilies.php");
require_once("backend/functions.php");
require_once("backend/config.php");
dbconn();

//===| GET CURRENT USERS THEME AND LANGUAGE
if ($CURUSER) {
$ss_a = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = @mysql_fetch_array(@sql_query_exec("select uri from languages where id=" . $CURUSER["language"]));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
} else { //===| Not logged in so get default theme/language
$ss_a = mysql_fetch_array(sql_query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = mysql_fetch_array(sql_query_exec("select uri from languages where id='" . $site_config['default_language'] . "'"));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}

echo'<link rel="stylesheet" type="text/css" href="'.$site_config['SITEURL'].'/themes/'.$THEME.'/theme.css" />';

if (!isset($_GET["form"])||!isset($_GET["text"])) {
err_msg("Error!","Missing parameter!");
print("</body></html>");
die();
}
$parentform=htmlentities(urldecode($_GET["form"]));
$parentarea=htmlentities(urldecode($_GET["text"]));
?>

<script language="javascript">
function SmileIT(smile,textarea) {
//===| Attempt to create a text range (IE)
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange) {
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smile + ' ' : smile
caretPos.select();
}
//===| Mozilla text range replace
else
if (typeof(textarea.selectionStart) != "undefined") {
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;

textarea.value = begin + smile + end;

if (textarea.setSelectionRange) {
textarea.focus();
textarea.setSelectionRange(begin.length + smile.length, begin.length + smile.length);
}
textarea.scrollTop = scrollPos;
}
//===| Just put it on the end
else {
textarea.value += smile;
textarea.focus(textarea.value.length - 1);
}
}
</script>

<body class="shoutbox_body">
<table class="table_table" width="100%" cellpadding="1" cellspacing="1">
<tr>
<?php
global $count;
while ((list($code, $url) = each($smilies))) {
if ($count % 3==0)
print("<tr>");
print("<td class=\"table_table\" align=\"center\"><a href=\"javascript: SmileIT('".str_replace("'","'",$code)."',window.opener.document.forms.$parentform.$parentarea);\"><img border=0 src=images/smilies/".$url."></a></td>");
$count++;
if ($count % 3==0)
print("</tr>");
}
?>
</tr>
</table>

<div align="center">
<a href="javascript: window.close()"><?php echo CLOSE; ?></a>
</div>
<br />
</body>
[/php]
update post bigmax1

and file footer.php theme


// Start Hit and Run Warning
$qry = SQL_Query_exec("SELECT COUNT(`hnr`) FROM `snatched` WHERE `uid` = '".$CURUSER["id"]."' AND `hnr` = 'yes'");
$res2 = mysql_fetch_row($qry);
$hnr = "<font style=background-color:#252525 color=#FEFEFE><b>&nbsp; ".$res2[0]." &nbsp;</font>";
$hnr2 = $res2[0];

if ($res2[0] > 0) {
   echo "<div style=margin-bottom:5px>
           <table align=center width=100% border=0 cellspacing=0 cellpadding=10>
       <tr>
           <td style='padding: 10px; background: #AB0000' align=center>
           <div style='font: bold 15px Times New Roman; color:#FFBF00'>
           Hey $CURUSER[username], you have ".$hnr." recording".($hnr2 > 1 ? "s" : "")." for Hit and Run!&nbsp; View the recordings into <a href=snatched.php><font size=3 color=#CBCBCB>Your Snatch List</font></a>
       </div>
           <div style='font: bold 15px Times New Roman; color:#FFBF00'>
           You must to keep seeding or you can <a href=required.php><font size=3 color=#CBCBCB>Trade to Delete</font></a> ".($hnr2 > 1 ? "these recordings" : "this recording")." with Seed Bonus or Upload
       </div>
       </td>
       </tr>
       </table>
       </div>\n";
}
// End Hit and Run Warning
"darknova, post: 30077, member: 18227":

OK and for announcements how to solve that  I add it to header.php but there I have slider and my announce comes underneath the slides



// Site Anouncements

if ($CURUSER && $CURUSER["announce_read"] == "no" && $arr = announcement()) {
?>

<script type="text/javascript" src="js/announcement.js"></script>

<script type="text/javascript" src="js/preview.js"></script>

<!-- annoucement start #<?php echo $arr["id"];?> -->

<div id="dropin" style="position:absolute; visibility:hidden; center;top:100px; width:800; height:100px">

<table border="0" cellpadding="0" cellspacing="0" width="100%" class="error" align="center">

<tbody>
<tr><td class="none" style="padding: 2px 0 0 10px; background: #FFBF00">
<font color=black><b>Title:</b> <?=$arr["subject"]?> -- <b>Created on"</b> <?php echo $arr["added"]?></font></td>
<td align="right" class="none" style="padding: 5px; background: #FFBF00"><a href="#" onclick="dismissbox();return false"><img src="images/close.jpg" border="0"></a></td>
</tr>

<tr><td colspan="2" class=none width="100%" style="padding: 0 0 0 10px;" bgcolor="#252525">
<div style="margin-bottom:5px"><font size=2 color=#CBCBCB><?php echo format_comment($arr["message"])?></font></div>
<img id="loading" style=" visibility: hidden" src="images/load.gif">
<span style="color:#CBCBCB" name="preview" id="previewr" align="left">

<center>[ <a href="#" onclick="javascript:clearannouncement(this.parentNode,'clear_ann.php')"><font color=#FFBF00><b>Delete Announcement</b></font></a> ]</center>
</span>

<br /><br />

</form>
</td>
</tr>
</tbody>
</table>
</div>

<!-- annoucement end #<?=$arr[id];?>-->

<span id="new_ann" style="visibility: visible"><table border=0 cellspacing=0 cellpadding=10 bgcolor=#AB0000 width=100% align=center><tr><td style='padding: 10px; background: #AB0000' align='center'>

<div style='font: bold 14px Times New Roman; color:#FFBF00'>There is a New Announcement! Please click <a href="javascript:show_announcement()"><font size=3 color=#CBCBCB>HERE</font></a> to read!</div></td></tr></table></span><br />

<?php
}

// End Site Announcements

update 0+ replace by (int)

SQL do not forget

[php]
CREATE TABLE IF NOT EXISTS `avps` (
`arg` varchar(20) character set utf8 collate utf8_unicode_ci NOT NULL default '',
`value_s` text character set utf8 collate utf8_unicode_ci NOT NULL,
`value_i` int(11) NOT NULL default '0',
`value_u` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`arg`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
[/php]


[php]
<?php
//-----------------------------------------------//
// Inactive Users Management                     //
//-----------------------------------------------//
// Modified for TorrentTrader v2.xx by BigMax //
//-----------------------------------------------//
require_once("backend/functions.php");
dbconn(true);
loggedinonly();


if ($CURUSER["class"] < 6)
   show_error_msg("Acces Denied", "I smelled a rat here!", 1);

// Config
$sitename = "" . $site_config['SITENAME'] . ""; // Sitename
$siteurl = "" . $site_config['SITEURL'] . ""; // Default site url
$replyto = "" . $site_config['SITEEMAIL'] . ""; // The Reply-to email
$record_mail = true; // Set this true or false . If you set this true every time whene you send a mail the time , userid , and the number of mail sent will be recorded
$days = 60; // Number of days of inactivite
// End config

if ($_SERVER["REQUEST_METHOD"] == "POST") {
   $action = $_POST["action"];
   $cday = (int) $_POST["cday"];
 
   if (!is_numeric($cday))
       show_error_msg("Err", "Smell rat !", 1);
 
   if (empty($_POST["userid"]) && (($action == "deluser") || ($action == "mail")))
       show_error_msg("Err", "For this to work you must select at least a user !", 1);
 
   if ($action == "deluser" && (!empty($_POST["userid"]))) {
       SQL_Query_exec("DELETE FROM users WHERE id IN (" . implode(", ", $_POST['userid']) . ") ");
       show_error_msg("Successfully", "You have successfully deleted the selected accounts! <a href=" . $BASEURL . "/inactiveusers.php>Go back</a>", 1);
   }
 
   if ($action == "cday" && ($cday > $days))
       $days = $cday;
 
   if ($action == "disable" && (!empty($_POST["userid"]))) {
       $res = SQL_Query_exec("SELECT id, modcomment FROM users WHERE id IN (" . implode(", ", $_POST['userid']) . ") ORDER BY id DESC ");
       while ($arr = mysql_fetch_array($res)) {
           $id = (int) $arr["id"];
           $cname = $CURUSER["username"];
           $modcomment = $arr["modcomment"];
           $modcomment = gmdate("Y-m-d") . " - Disabled for inactivity by $cname.n" . $modcomment;
         
           SQL_Query_exec("UPDATE users SET modcomment=" . sqlesc($modcomment) . ", enabled='no' WHERE id=$id ");
       }
       show_error_msg("Successfully", "You have successfully disabled the selected accounts! <a href=" . $BASEURL . "/inactiveusers.php>Go back</a>", 1);
   }
 
   if ($action == "mail" && (!empty($_POST["userid"]))) {
       $res = SQL_Query_exec("SELECT id, email , username, added, last_access FROM users WHERE id IN (" . implode(", ", $_POST['userid']) . ") ORDER BY last_access DESC ");
       $count = mysql_num_rows($res);
       while ($arr = mysql_fetch_array($res)) {
           $id = $arr["id"];
           $username = htmlspecialchars($arr["username"]);
           $email = htmlspecialchars($arr["email"]);
           $added = $arr["added"];
           $last_access = $arr["last_access"];
         
           $subject = "Warning for inactive account on $sitename";
         
$message = "
Your account on $sitename was marked as inactive and will be deleted within a few days.
If you want to remain member at $sitename you must just login and download something nice!

Your username it's:      $username
Account created on:      $added
Last visit on site:                      $last_access

You can login here:      $siteurl/account-login.php
Recovery password:       $siteurl/account-recover.php
";
         
   $headers = 'From: no-reply@' . $sitename . "rn" . 'Reply-To:' . $replyto . "rn" . 'X-Mailer: PHP/' . phpversion();
   $mail = @mail($email, $subject, $message, $headers);
}
     
if ($record_mail) {
           $date = time();
           $userid = (int) $CURUSER["id"];
if ($count > 0 && $mail)
   SQL_Query_exec("update avps set value_i='$date', value_u='$count', value_s='$userid' WHERE arg='inactivemail' ");
}
     
if ($mail)
   show_error_msg("Success", "Messages sent.", 1);
else
   show_error_msg("Error", "Try again.", 1);
}
}

   stdhead(T_("USURSINACTIVE"));

begin_frame(T_("USURSINACTIVE"));

$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));

$res = SQL_Query_exec("SELECT id,username,class,email,uploaded,downloaded,last_access,ip,added FROM users WHERE last_access<$dt AND status='confirmed' AND enabled='yes' ORDER BY last_access DESC ");
$count = mysql_num_rows($res);

if ($count > 0) {
?>

<script type="text/javascript" language="javascript">
<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "Uncheck All"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "Check All"; }
}
// End -->
</script>

<?php
   print("<form action='inactiveusers.php' method='post'>");
   print("<br /><table class=table_table align=center border=1 cellspacing=0 cellpadding=5><tr>\n");
   print("<td class=table_head>" . T_("NUMBER0FDAYS") . "</td><td class=table_head><input type='text' name='cday' size='10' value='" . ($cday > $days ? $cday : $days) . "' maxlength='3' /></td>");
   print("<td class='table_head'><input type='submit' value='Change' /><input type='hidden' name='action' value='cday' />");
   print("</td></tr></table></form><br/>");
   print("<h2 align=center>" . $count . " accounts inactive for longer than " . $days . " days.</h2>");
   print("<form action='inactiveusers.php' method='post'>");
   print("<table class=table_table align=center width=800 border=1 cellspacing=0 cellpadding=5><tr>\n");
   print("<td class=table_head>" . T_("USERNAME") . "</td>");
   print("<td class=table_head>" . T_("CLASS") . "</td>");
   print("<td class=table_head>" . T_("IP") . "</td>");
   print("<td class=table_head>" . T_("RATIO") . "</td>");
   print("<td class=table_head>" . T_("JOINDATE") . "</td>");
   print("<td class=table_head>" . T_("LAST_VISIT") . "</td>");
   print("<td class=table_head align='center'>x</td>");
 
while ($arr = mysql_fetch_assoc($res)) {
       $ratio = ($arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---"));
       $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
       $downloaded = mksize($arr["downloaded"]);
       $uploaded = mksize($arr["uploaded"]);
       $last_seen = (($arr["last_access"] == "0000-00-00 00:00:00") ? "never" : "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . "&nbsp;ago");
       $class = get_user_class_name($arr["class"]);
       $joindate = substr($arr['added'], 0, strpos($arr['added'], " "));
       print("<tr>");
     
       // Make a choise here:
       print("<td><a href='account-details.php?id=" . $arr["id"] . "'>" . htmlspecialchars($arr["username"]) . "</a></td>"); //=== Use this line if you did not have the function class_user ===//
     
       //print("<td><a href="account-details.php?id=".$arr["id"].""><b>".class_user($arr["username"])."</b></a></td>");         //=== Use this line if you have the function class_user ===//
     
       print("<td>" . $class . "</td>");
       print("<td>" . ($arr["ip"] == "" ? "----" : $arr["ip"]) . "</td>");
       print("<td><b>" . $ratio . "</b><font class='small'> | Dl:<font color=red><b>" . $downloaded . "</b></font> | Up:<font color=lime><b>" . $uploaded . "</b></font></font></td>");
       print("<td>" . $joindate . "</td>");
       print("<td>" . $last_seen . "</td>");
     
       print("<td align='center' bgcolor='#FF0000'><input type='checkbox' name='userid[]' value='" . $arr["id"] . "' /></td>");
       print("</tr>");
}
   print("<tr><td colspan=7 class='table_head' align='center'>
<select name='action'>
<option value=mail>" . T_("SENDMAIL") . "</option>
<option value='deluser'>" . T_("DELETEUSERS") . "</option>
<option value='disable'>" . T_("DISABLED_ACCOUNTS") . "</option>
</select>&nbsp;&nbsp;<input type='submit' name='submit' value='Apply Changes'/>&nbsp;&nbsp;<input type='button' value='Check all' onClick='this.value=check(form)' /></td></tr>");
 
if ($record_mail) {
   $ress = SQL_Query_exec("SELECT avps.value_s AS userid, avps.value_i AS last_mail, avps.value_u AS mails, users.username FROM avps LEFT JOIN users ON avps.value_s=users.id WHERE avps.arg='inactivemail' LIMIT 1");
   $date = mysql_fetch_assoc($ress);
if ($date["last_mail"] > 0)
   print("<tr><td colspan='7' class='table_head' align='center' style='color:red;'>" . T_("LASTMAILSENTBY") . " <a href='account-details.php?id=" . $date["userid"] . "'>" . $date["username"] . "</a> " . T_("ON") . " <b>" . gmdate("d M Y", $date["last_mail"]) . "</b> " . T_("_AND_") . " <b>" . $date["mails"] . "</b> mail" . ($date["mails"] > 1 ? "s" : "") . " " . T_("WASSENT") . "</td></tr>");
}
 
   print("</table></form>");
} else {
   print("<h2 align=center>" . T_("NOACOUNTINATIVE") . " " . $days . " " . T_("DAYS") . ".</h2>");
}

end_frame();
stdfoot();
die;
?>
[/php]
update rankimage

[php]
// Auto Uploader rank function (Author: ArcticWolf)
function auto_rank_icon($uploaded, $downloaded, $level) {
$tb = 1024 * 1024 * 1024 * 1024;
// Config
$minup0 = .5 * $tb;
$minup1 = 1 * $tb;
$minup2 = 2 * $tb;
$minup3 = 3.5 * $tb;
$minup4 = 5.5 * $tb;
$minup5 = 8 * $tb;
$minup6 = 16 * $tb;
// Config End
$icon1 = "legend_stjarna_brons.png";
$icon2 = "legend_stjarna_silver.png";
$icon3 = "legend_stjarna_guld.png";
$icon4 = "krona_brons.png";
$icon5 = "krona_silver.png";
$icon6 = "krona_guld.png";
$icon7 = "diamant.png";

if ($uploaded >= $minup6 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon7." alt='$icon7' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup5 && $uploaded < $minup6 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon6." alt='$icon6' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup4 && $uploaded < $minup5 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon5." alt='$icon5' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup3 && $uploaded < $minup4 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon4." alt='$icon4' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup2 && $uploaded < $minup3 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon3." alt='$icon3' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup1 && $uploaded < $minup2 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon2." alt='$icon2' border=\"0\" />";
return $uprankr;
} elseif ($uploaded >= $minup0 && $uploaded >= $downloaded) {
$uprankr = "<img src='/images/icons/' ".$icon1." alt='$icon1' border=\"0\" />";
return $uprankr;
}
return "";
}
[/php]
Class Change — 2019-07-15 19:17:27 in v2.08 Mods Completed
[php]
<?php
if ($CURUSER["changemode"]=="yes") {
   print("<center><form name='mod_form_1' method=post action=changemode.php>\n");
   $actualclass=$CURUSER['class'];
   $class = "<option value=0>---Sélectionnez ----</option>\n";
   $query = SQL_Query_exec("SELECT group_id,level FROM groups ORDER BY level") or die;

   while ($result = mysql_fetch_array($query))
$class .= "<option value=$result[group_id]" . ($actualclass == $result['group_id'] ? " selected" : "") . ">$result[level]</option>\n";

   print("<br /><font color='red'><b>Changer de Grade</b></font><br /><select name=class>\n$classn</select>");
   print("<br /><br/><center><input type=submit class=buton value='Envoyer'></center>");
   print("</form></center>");
} else
   print("<input type=hidden name=class value=$actualclass>");
   print("</form></center>");
?>
[/php]
replace <? by <?php and <br />
[php]
   // Auto Uploader rank function (Author: ArcticWolf)
function auto_rank_icon($uploaded, $downloaded, $level) {
   $tb = 1024 * 1024 * 1024 * 1024;
   // Config
   $minup0 = .25 * $tb;
   $minup1 = .5 * $tb;
   $minup2 = 1 * $tb;
   $minup3 = 2 * $tb;
   $minup4 = 4 * $tb;
   $minup5 = 8 * $tb;
   $minup6 = 16 * $tb;
   $minup7 = 32 * $tb;
   $minup8 = 64 * $tb;
   // Config End
       $icon1 = "legend_stjarna_brons.png";
   $icon2 = "legend_stjarna_silver.png";
   $icon3 = "legend_stjarna_guld.png";
   $icon4 = "krona_brons.png";
   $icon5 = "krona_silver.png";
   $icon6 = "krona_guld.png";
   $icon7 = "diamant.png";
   $icon8 = "diamant.png";
   //if ($uploaded >= $minup8 && $uploaded >= $downloaded) {
       //$uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon7 . "\" alt='$icon7' border=\"0\"/>";
       //return $uprankr;
   if ($uploaded >= $minup7 && $uploaded >= $downloaded) {
   $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon8 . "\" alt='$icon8' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup6 && $uploaded < $minup7 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon7 . "\" alt='$icon7' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup5 && $uploaded < $minup6 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon6 . "\" alt='$icon6' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup4 && $uploaded < $minup5 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon5 . "\" alt='$icon5' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup3 && $uploaded < $minup4 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon4 . "\" alt='$icon4' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup2 && $uploaded < $minup3 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon3 . "\" alt='$icon3' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup1 && $uploaded < $minup2 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon2 . "\" alt='$icon2' border=\"0\"/>";
       return $uprankr;
} elseif ($uploaded >= $minup0 && $uploaded >= $downloaded) {
       $uprankr = "<img src='" . $site_config['SITEURL'] . "/images/icons/' . $icon1 . "\" alt='$icon1' border=\"0\"/>";
       return $uprankr;
}
   return "";
}
   [/php]
Torrents images — 2017-04-28 11:22:56 in v2.08 Mods Completed
delete this line AND safe='yes'
Torrents images — 2017-04-21 03:14:22 in v2.08 Mods Completed
update

[ATTACH]2480._xfImport[/ATTACH]
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728