[Request] uploadapp for 09

Started by undertaker, February 08, 2013, 03:59:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rushed

Quote from: TwelveCharzz on June 16, 2013, 02:28:45 PM
Thanks, I'm new to this and im just learning as i go :)
I'll be sure to try to fix these things myself without rushing next time.

Thats not a problem like you have already said just take your timw learn things properly, back everything up and if your stuck ask for help the whole community is here to help each other

TwelveCharzz

Thanks, I'm new to this and im just learning as i go :)
I'll be sure to try to fix these things myself without rushing next time.

rushed

#9
look at the original sql statement posted

CREATE TABLE `uploadapp` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(10) NOT NULL default '0',
  `applied` int(11) NOT NULL default '0',
  `offer` longtext collate utf8_unicode_ci NOT NULL,
  `sites` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `sitenames` varchar(150) collate utf8_unicode_ci NOT NULL default '',
  `creating` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `seeding` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `status` enum('accepted','rejected','pending') collate utf8_unicode_ci NOT NULL default 'pending',
  `moderator` varchar(40) collate utf8_unicode_ci NOT NULL default '',
  `comment` varchar(200) collate utf8_unicode_ci NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `users` (`userid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


There was no connectable field hence the reason why the insert query field didnt work and why its spitting out that error is because you need to add the sqlf or the connectable field or drop it altogether

Heres mine from my V2 site which should work

-- phpMyAdmin SQL Dump
-- version 3.3.7deb7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 15, 2013 at 08:40 PM
-- Server version: 5.1.66
-- PHP Version: 5.3.3-7+squeeze14

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `admin_admin`
--

-- --------------------------------------------------------

--
-- Table structure for table `uploadapp`
--

CREATE TABLE IF NOT EXISTS `uploadapp` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `userid` int(10) NOT NULL DEFAULT '0',
  `applied` int(11) NOT NULL DEFAULT '0',
  `speed` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `offer` longtext COLLATE utf8_unicode_ci NOT NULL,
  `reason` longtext COLLATE utf8_unicode_ci NOT NULL,
  `sites` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `sitenames` varchar(150) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `scene` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `creating` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `seeding` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
  `connectable` enum('yes','no','pending') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `status` enum('accepted','rejected','pending') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `moderator` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `comment` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `users` (`userid`),
  KEY `status` (`status`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `uploadapp`
--


Please just take your time reading over everything and when it pops up mysql errors make sure the fields being selected or inserted to actually exist if I am reading the comparison right (I have had a few beers) theres about 4 fields missing those are the speed, reason, scene and connectable fields

TwelveCharzz

Thanks, but now i get this error:

Mindless

All that is required is or sqlerr(__FILE__, __LINE__); on the query,

Code (php) Select
$res = mysql_query("INSERT INTO uploadapp(userid,applied,connectable,speed,offer,reason,sites,sitenames,scene,creating,seeding) VALUES({$app['userid']}, ".implode(",", array_map("sqlesc", array(time(), $app['connectable'], $app['speed'], $app['offer'], $app['reason'], $app['sites'], $app['sitenames'], $app['scene'], $app['creating'], $app['seeding']))) .")") ;

To

Code (php) Select
$res = mysql_query("INSERT INTO uploadapp(userid,applied,connectable,speed,offer,reason,sites,sitenames,scene,creating,seeding) VALUES({$app['userid']}, ".implode(",", array_map("sqlesc", array(time(), $app['connectable'], $app['speed'], $app['offer'], $app['reason'], $app['sites'], $app['sitenames'], $app['scene'], $app['creating'], $app['seeding']))) .")") or sqlerr(__FILE__, __LINE__);

Simple as that, that's the failure point,

TwelveCharzz


Mindless

Somethings failing on the insert query on uploadapp.php, check whats failing using the mysql error logs

TwelveCharzz

I installed this and made a dummy account that's connectable and has positive ratio but i get this error when trying to submit an application:
QuoteIt appears something went wrong while sending your application. Please try again

What did i do wrong?


Diablo999

Think I got it all or else drop a comment. :P

First the sql's
CREATE TABLE `uploadapp` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(10) NOT NULL default '0',
  `applied` int(11) NOT NULL default '0',
  `offer` longtext collate utf8_unicode_ci NOT NULL,
  `sites` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `sitenames` varchar(150) collate utf8_unicode_ci NOT NULL default '',
  `creating` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `seeding` enum('yes','no') collate utf8_unicode_ci NOT NULL default 'no',
  `status` enum('accepted','rejected','pending') collate utf8_unicode_ci NOT NULL default 'pending',
  `moderator` varchar(40) collate utf8_unicode_ci NOT NULL default '',
  `comment` varchar(200) collate utf8_unicode_ci NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `users` (`userid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


/uploadapp.php
<?php
require_once("include/bittorrent.php");
require_once 
ROOT_PATH.'/include/user_functions.php';
require_once 
ROOT_PATH.'/include/pager_functions.php';
dbconn(false);
loggedinorreturn();
$lang array_mergeload_language('global'), load_language('uploadapp') );
$HTMLOUT '';

// Fill in application
if (isset($_POST["form"]) != "1") {
    
$res mysql_query("SELECT status FROM uploadapp WHERE userid = $CURUSER[id]") or sqlerr(__FILE____LINE__);
    
$arr mysql_fetch_assoc($res);
    if (
$CURUSER['class'] >= UC_UPLOADER)
        
stderr($lang['uploadapp_user_error'], $lang['uploadapp_alreadyup']);
    elseif (
$arr['status'] == 'pending')
        
stderr($lang['uploadapp_user_error'], $lang['uploadapp_pending']);
    elseif (
$arr['status'] == 'rejected')
        
stderr($lang['uploadapp_user_error'], $lang['uploadapp_rejected']);
    else {

        
$HTMLOUT .="<h1 align='center'>{$lang['uploadapp_application']}</h1>
        <table width='750' border='1' cellspacing='0' cellpadding='10'><tr><td>
        <form action='
{$TBDEV['baseurl']}/uploadapp.php' method='post' enctype='multipart/form-data'>
        <table border='1' cellspacing='0' cellpadding='5' align='center'>"
;

        if (
$CURUSER['downloaded'] > 0)
            
$ratio $CURUSER['uploaded'] / $CURUSER['downloaded'];
        elseif (
$CURUSER['uploaded'] > 0)
            
$ratio 1;
        else
            
$ratio 0;

        
$res mysql_query("SELECT connectable FROM peers WHERE userid=$CURUSER[id]")or sqlerr(__FILE____LINE__);
        if (
$row mysql_fetch_row($res)) {
            
$connect $row[0];
            if (
$connect == 'yes')
                
$connectable 'Yes';
            else
                
$connectable 'No';
        } else
            
$connectable 'Pending';
                                                                                                
        
$HTMLOUT .="<tr>
        <td class='rowhead'>
{$lang['uploadapp_username']}</td>
        <td><input name='userid' type='hidden' value='"
.$CURUSER['id'] ."' />".$CURUSER['username'] ."</td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_joined']}</td><td>".get_date($CURUSER['added'], ''01) ."</td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_ratio']}</td><td>".($ratio >= 'Yes' 'No') ."</td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_connectable']}</td><td><input name='connectable' type='hidden' value='$connectable' />$connectable</td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_upspeed']}</td><td><input type='text' name='speed' size='19' /></td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_offer']}</td><td><textarea name='offer' cols='80' rows='1'></textarea></td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_why']}</td><td><textarea name='reason' cols='80' rows='2'></textarea></td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_uploader']}</td><td><input type='radio' name='sites' value='yes' />{$lang['uploadapp_yes']}
       <input name='sites' type='radio' value='no' checked='checked' />
{$lang['uploadapp_no']}</td>
       </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_sites']}</td><td><textarea name='sitenames' cols='80' rows='1'></textarea></td>
        </tr>
        <tr>
        <td class='rowhead'>
{$lang['uploadapp_scene']}</td><td><input type='radio' name='scene' value='yes' />{$lang['uploadapp_yes']}
   <input name='scene' type='radio' value='no' checked='checked' />
{$lang['uploadapp_no']}</td>
       </tr>
        <tr>
        <td colspan='2'>
        <br />
        &nbsp;&nbsp;
{$lang['uploadapp_create']}
        <br />
        <input type='radio' name='creating' value='yes' />
{$lang['uploadapp_yes']}
     <input name='creating' type='radio' value='no' checked='checked' />
{$lang['uploadapp_no']}
        <br /><br />
        &nbsp;&nbsp;
{$lang['uploadapp_seeding']}
        <br />
        <input type='radio' name='seeding' value='yes' />
{$lang['uploadapp_yes']}
      <input name='seeding' type='radio' value='no' checked='checked' />
{$lang['uploadapp_no']}
        <br /><br />
        <input name='form' type='hidden' value='1' />
        
                <p align='center'><input type='submit' name='Submit' value='
{$lang['uploadapp_send']}' /></p></td>
        </tr>
        </table></form>
        </td></tr></table>"
;
    }
    
    
// Process application
} else {
    
$app['userid'] = $_POST['userid'];
    
$app['connectable'] = $_POST['connectable'];
    
$app['speed'] = $_POST['speed'];
    
$app['offer'] = $_POST['offer'];
    
$app['reason'] = $_POST['reason'];
    
$app['sites'] = $_POST['sites'];
    
$app['sitenames'] = $_POST['sitenames'];
    
$app['scene'] = $_POST['scene'];
    
$app['creating'] = $_POST['creating'];
    
$app['seeding'] = $_POST['seeding'];

    if (!
is_valid_id($app['userid']))
        
stderr($lang['uploadapp_error'], $lang['uploadapp_tryagain']);
    if (!
$app['speed'])
        
stderr($lang['uploadapp_error'], $lang['uploadapp_speedblank']);
    if (!
$app['offer'])
        
stderr($lang['uploadapp_error'], $lang['uploadapp_offerblank']);
    if (!
$app['reason'])
    
stderr($lang['uploadapp_error'], $lang['uploadapp_reasonblank']);
    if (
$app['sites'] == 'yes' && !$app['sitenames'])
        
stderr($lang['uploadapp_error'], $lang['uploadapp_sitesblank']);
    
    
$res mysql_query("INSERT INTO uploadapp(userid,applied,connectable,speed,offer,reason,sites,sitenames,scene,creating,seeding) VALUES({$app['userid']}, ".implode(","array_map("sqlesc", array(time(), $app['connectable'], $app['speed'], $app['offer'], $app['reason'], $app['sites'], $app['sitenames'], $app['scene'], $app['creating'], $app['seeding']))) .")") ;
    if (!
$res) {
        if (
mysql_errno() == 1062)
            
stderr($lang['uploadapp_error'], $lang['uploadapp_twice']);
        else
            
stderr($lang['uploadapp_error'], $lang['uploadapp_tryagain']);
    } else {
        
$subject sqlesc("Uploader application");
        
$msg sqlesc("An uploader application has just been filled in by [url={$TBDEV['baseurl']}/userdetails.php?id=$CURUSER[id]][b]$CURUSER[username][/b][/url]. Click [url={$TBDEV['baseurl']}/uploadapps.php][b]Here[/b][/url] to go to the uploader applications page.");
        
$dt sqlesc(time());
        
$subres mysql_query('SELECT id FROM users WHERE class = 13') or sqlerr(__FILE____LINE__);
        while (
$arr mysql_fetch_assoc($subres))
        
mysql_query("INSERT INTO messages(sender, receiver, added, msg, subject, poster) VALUES(0, $arr[id]$dt$msg$subject, 0)") or sqlerr(__FILE____LINE__);
        
stderr('Application sent''Your application has succesfully been sent to the staff.');
        
stderr($lang['uploadapp_appsent'], $lang['uploadapp_success']);
    }
}
print 
stdhead('Uploader application page') . $HTMLOUT stdfoot();
?>


/uploadapps.php
<?php
require_once("include/bittorrent.php");
require_once 
ROOT_PATH.'/include/user_functions.php';
require_once 
ROOT_PATH.'/include/pager_functions.php';
dbconn(false);
loggedinorreturn();

$action = isset($_GET["action"]) ?$_GET["action"] : '';

$lang array_mergeload_language('global'), load_language('uploadapps') );

if (
$CURUSER["class"] < UC_MODERATOR)
stderr($lang['uploadapps_user_error'], $lang['uploadapps_notmod']);

$HTMLOUT ="";

// View applications
if (!$action || $action == "show") {
    if (
$action == "show")
        
$hide "[<a href='{$TBDEV['baseurl']}/uploadapps.php'>{$lang['uploadapps_hide']}</a>]";
    else {
        
$hide "[<a href='{$TBDEV['baseurl']}/uploadapps.php?action=show'>{$lang['uploadapps_show']}</a>]";        
        
$where "WHERE status = 'pending'";
        
$where1 "WHERE uploadapp.status = 'pending'";
    }
  
    
$where ="";
    
$res mysql_query("SELECT count(id) FROM uploadapp $where") or sqlerr(__FILE____LINE__);
    
$row mysql_fetch_array($res);
    
$url " .$_SERVER[PHP_SELF]?";
    
$count $row[0];
    
$perpage 25;   
    
$pager pager($perpage$count$url);
    
    
$HTMLOUT .="<h1 align='center'>{$lang['uploadapps_applications']}</h1>";
    if (
$count == 0) {
        
        
$HTMLOUT .="<table class='main' width='850' border='0' cellspacing='0' cellpadding='0'><tr><td class='embedded'>
        <div align='right'><font class='small'>
{$hide}</font></div></td></tr></table>
        <table width='100%' border='1' cellspacing='0' cellpadding='5'><tr><td>
        <div align='center'>
{$lang['uploadapps_noapps']}</div>
        
        </td></tr></table>"
;
    } else {
        
$HTMLOUT .="<form method='post' action='?action=takeappdelete'>";
        
$HTMLOUT .= $pager['pagertop'];
        
$HTMLOUT .="<table class='main' width='850' border='0' cellspacing='0' cellpadding='0'><tr><td class='embedded'>
        <div align='right'><font class='small'>
{$hide}</font></div>
        <table width='100%' border='1' cellspacing='0' cellpadding='5' align='center'>
        <tr>
        <td class='colhead' align='left'>
{$lang['uploadapps_applied']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_application']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_username']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_joined']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_class']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_upped']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_ratio']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_status']}</td>
        <td class='colhead' align='left'>
{$lang['uploadapps_delete']}</td>
        </tr>\n"
;
        
        
$where1 ="";
        
$res mysql_query("SELECT uploadapp.*, users.id AS uid, users.username, users.class, users.added, users.uploaded, users.downloaded FROM uploadapp INNER JOIN users on uploadapp.userid = users.id $where1") or sqlerr(__FILE____LINE__);
        while (
$arr mysql_fetch_assoc($res)) {
            if (
$arr["status"] == "accepted")
                
$status "<font color='green'>{$lang['uploadapps_accepted']}</font>";
            elseif (
$arr["status"] == "rejected")
                
$status "<font color='red'>{$lang['uploadapps_rejected']}</font>";
            else
                
$status "<font color='blue'>{$lang['uploadapps_pending']}</font>";
            
            
$membertime get_date($arr['added'], ''01);
            
$elapsed get_date($arr['applied'], ''01);
            
            if (
$arr["downloaded"] == && $arr["uploaded"] == 0)
            
$ratio '---';
            else if (
$arr["downloaded"] == && $arr["uploaded"] != 0)
            
$ratio 'Inf.';
            else
            
$ratio number_format($arr["uploaded"] / $arr["downloaded"], 3);
            
            
$HTMLOUT .="<tr>
            <td>
{$elapsed}</td>
            <td><a href='?action=viewapp&amp;id=
$arr[id]'>{$lang['uploadapps_viewapp']}</a></td>
            <td><a href='
{$TBDEV['baseurl']}/userdetails.php?id=$arr[uid]'>$arr[username]</a></td>
            <td>
{$membertime}</td>
            <td>" 
get_user_class_name($arr["class"]) . "</td>
            <td>" 
mksize($arr["uploaded"]) . "</td>
            <td>
{$ratio}</td>
            <td>
{$status}</td>
            <td><input type=\"checkbox\" name=\"deleteapp[]\" value=\"" 
$arr['id'] . "\" /></td>
            </tr>\n"
;
        }
        
$HTMLOUT .="</table>
        <div align='right'><input type='submit' value='Delete' /></div>
        </td></tr></table></form>\n"
;
        
$HTMLOUT .= $pager['pagerbottom'];
}

}

// View application
if ($action == "viewapp") {
    
$id = (int) $_GET["id"];
    
$res mysql_query("SELECT uploadapp.*, users.id AS uid, users.username, users.class, users.added, users.uploaded, users.downloaded FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id=$id") or sqlerr(__FILE____LINE__);
    
$arr mysql_fetch_assoc($res);
    
$membertime get_date($arr['added'], ''01);
    
$elapsed get_date($arr['applied'], ''01);   
    if (
$arr["downloaded"] == && $arr["uploaded"] == 0)
    
$ratio '---';
    else if (
$arr["downloaded"] == && $arr["uploaded"] != 0)
    
$ratio 'Inf.';
    else
    
$ratio number_format($arr["uploaded"] / $arr["downloaded"], 3);
    
$HTMLOUT .="<h1 align='center'>Uploader application</h1>
    <table width='750' border='1' cellspacing='0' cellpadding='5'>
    <tr>
    <td class='rowhead' width='25%'>
{$lang['uploadapps_username1']} </td><td><a href='{$TBDEV['baseurl']}/userdetails.php?id=$arr[uid]'>$arr[username]</a></td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_joined']} </td><td>" htmlspecialchars($membertime)."</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_upped1']} </td><td>" htmlspecialcharsmksize($arr["uploaded"])) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_downed']} </td><td>" .htmlspecialcharsmksize($arr["downloaded"])) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_ratio1']} </td><td>"  htmlspecialchars($ratio) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_connectable']} </td><td>" htmlspecialchars($arr["connectable"])."</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_class1']} </td><td>" get_user_class_name($arr["class"]) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_applied1']} </td><td>" htmlspecialchars($elapsed)."</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_upspeed']} </td><td>" htmlspecialchars($arr["speed"]) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_offer']} </td><td>" htmlspecialchars($arr["offer"]) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_why']} </td><td>" htmlspecialchars($arr["reason"]) . "</td>
    </tr>
    <tr>
    <td class='rowhead'>
{$lang['uploadapps_uploader']} </td><td>" htmlspecialchars($arr["sites"])."</td>
    </tr>"
;
    
    
    
    if (
$arr["sitenames"] != "")
    
$HTMLOUT .="<tr><td class='rowhead'>{$lang['uploadapps_sites']} </td><td>" htmlspecialchars($arr["sitenames"]) . "</td></tr>
    <tr><td class='rowhead'>
{$lang['uploadapps_axx']} </td><td>" htmlspecialchars($arr["scene"])."</td></tr>
    <tr><td colspan='2'>
{$lang['uploadapps_create']} <b>" htmlspecialchars($arr["creating"])."</b><br />{$lang['uploadapps_seeding']} <b>" htmlspecialchars($arr["seeding"])."</b></td></tr>";
    if (
$arr["status"] == "pending")
    
$HTMLOUT .="<tr><td align='center' colspan='2'><form method='post' action='?action=acceptapp'><input name='id' type='hidden' value='".$arr["id"]."' /><b>Note: (optional)</b><br /><input type='text' name='note' size='40' /> <input type='submit' value='Accept' style='height: 20px' /></form><br /><form method='post' action='?action=rejectapp'><input name='id' type='hidden' value='".$arr["id"]."' /><b>Reason: (optional)</b><br /><input type='text' name='reason' size='40' /> <input type='submit' value='Reject' style='height: 20px' /></form></td></tr></table>"
    else
    
$HTMLOUT .="<tr><td colspan='2' align='center'>{$lang['uploadapps_application']} " . ($arr["status"] == "accepted" "accepted" "rejected") . " by <b>" htmlspecialchars($arr["moderator"])."</b><br />Comment: " htmlspecialchars$arr["comment"] ) . "</td></tr>
    </table><div align='center'><a href='
{$TBDEV['baseurl']}/uploadapps.php'>Return to uploader applications page</a></div>";
    }
    
// Accept application
if ($action == "acceptapp") {
    
$id $_POST["id"];
    if (!
is_valid_id($id))
    
stderr($lang['uploadapps_error'], $lang['uploadapps_noid']);
    
$res mysql_query("SELECT uploadapp.id, users.username, users.modcomment, users.id AS uid FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id = $id") or sqlerr(__FILE____LINE__);
    
$arr mysql_fetch_assoc($res);
    
$note $_POST["note"];
    
$subject sqlesc("Uploader Promotion");
    
$msg sqlesc("Congratulations, your uploader application has been accepted! You have been promoted to Uploader and you are now able to upload torrents. Please make sure you have read the [url={$TBDEV['baseurl']}/rules.php][b]GUIDELINE ON UPLOADING[/b][/url] before you do. And also read what kind of cstm releases that are allowed to upload on site [url={$TBDEV['baseurl']}/forums.php?action=viewtopic&topicid=58][b]ALLOWED CSTM RELEASES.[/b][/url] We have a [b] FREE AUTO UPLOAD TOOL [/b] you can find it in the [url={$TBDEV['baseurl']}/forums.php?action=viewforum&forumid=18][b]Uploaders Forum[/b][/url].\n\nNote: $note");
    
$msg1 sqlesc("User [url={$TBDEV['baseurl']}/userdetails.php?id=$arr[uid]][b]$arr[username][/b][/url] has been promoted to Uploader by $CURUSER[username].");
    
$modcomment get_datetime(), 'DATE') . " - Promoted to 'Uploader' by " $CURUSER["username"] . "." . ($arr["modcomment"] != "" "\n" "") . "$arr[modcomment]";
    
$dt sqlesc(time());
    
mysql_query("UPDATE uploadapp SET status = 'accepted', comment = " sqlesc($note) . ", moderator = " sqlesc($CURUSER["username"]) . " WHERE id=$id") or sqlerr(__FILE____LINE__);
    
mysql_query("UPDATE users SET class = 8, modcomment = " sqlesc($modcomment) . " WHERE id=$arr[uid]") or sqlerr(__FILE____LINE__);
    
mysql_query("INSERT INTO messages(sender, receiver, added, msg, subject, poster) VALUES(0, $arr[uid]$dt$msg$subject, 0)") or sqlerr(__FILE____LINE__);
    
$subres mysql_query("SELECT id FROM users WHERE class = 13") or sqlerr(__FILE____LINE__);
    while (
$subarr mysql_fetch_assoc($subres))
    
mysql_query("INSERT INTO messages(sender, receiver, added, msg, subject, poster) VALUES(0, $subarr[id]$dt$msg1$subject, 0)") or sqlerr(__FILE____LINE__);
    
stderr("Application accepted""The application was succesfully accepted. The user has been promoted and has been sent a PM notification. Click <a href='{$TBDEV['baseurl']}/uploadapps.php'><b>Here</b></a> to return to the upload applications page.");
   }

// Reject application
if ($action == "rejectapp") {
    
$id $_POST["id"];
    if (!
is_valid_id($id))
    
stderr("Error""It appears that there is no uploader application with that ID.");
    
$res mysql_query("SELECT uploadapp.id, users.id AS uid FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id=$id") or sqlerr(__FILE____LINE__);
    
$arr mysql_fetch_assoc($res);
    
$reason $_POST["reason"];
    
$subject sqlesc("Uploader Promotion");
    
$msg sqlesc("Sorry, your uploader application has been rejected. It appears that you are not qualified enough to become uploader.\n\nReason: $reason");
    
$dt sqlesc(time());
    
mysql_query("UPDATE uploadapp SET status = 'rejected', comment = " sqlesc($reason) . ", moderator = " sqlesc($CURUSER["username"]) . " WHERE id=$id") or sqlerr(__FILE____LINE__);
    
mysql_query("INSERT INTO messages(sender, receiver, added, msg, subject, poster) VALUES(0, $arr[uid]$dt$msg$subject, 0)") or sqlerr(__FILE____LINE__);
    
stderr("Application rejected""The application was succesfully rejected. The user has been sent a PM notification. Click <a href='{$TBDEV['baseurl']}/uploadapps.php'><b>Here</b></a> to return to the upload applications page.");
}

// Delete applications
    
if ($action == "takeappdelete"){
    if (empty(
$_POST['deleteapp']))
    
stderr('Silly Rabbit''Twix are for kids.. Check at least one application stupid...You cant delete nothing !');
    
$res mysql_query("SELECT id FROM uploadapp WHERE id IN (" implode(", "$_POST["deleteapp"]) . ")") or sqlerr(__FILE____LINE__);
    while (
$arr mysql_fetch_assoc($res))
    
mysql_query("DELETE FROM uploadapp WHERE id=$arr[id]") or sqlerr(__FILE____LINE__);
    
stderr("Deleted""The upload applications were succesfully deleted. Click <a href='{$TBDEV['baseurl']}/uploadapps.php'><b>Here</b></a> to return to the upload applications page.");
    }
print 
stdhead('Uploader application page') . $HTMLOUT stdfoot();
?>


/lang/lang_uploadapp.php
<?php

$lang 
= array(

#uploadapp errors
'uploadapp_error' => "Error",
'uploadapp_user_error' => "Access Denied",
'uploadapp_alreadyup' => "It appears you are already part of our uploading team.",
'uploadapp_pending' => "It appears you are currently pending confirmation of your uploader application.",
'uploadapp_rejected' => "It appears you have applied for uploader before and have been rejected. If you would like a second chance please contact an administrator.",
'uploadapp_tryagain' => "It appears something went wrong while sending your application. Please <a href=uploadapp.php>try again</a>",
'uploadapp_speedblank' => "It appears you have left the field with your upload speed blank.",
'uploadapp_offerblank' => "It appears you have left the field with the things you have to offer blank.",
'uploadapp_reasonblank' => "It appears you have left the field with the reason why we should promote you blank.",
'uploadapp_sitenames' => "It appears you have left the field with the sites you are uploader at blank.",
'uploadapp_twice' => "It appears you tried to send your application twice.",

#main body
'uploadapp_application' => "Uploader application",
'uploadapp_username' => "My username is",
'uploadapp_joined' => "I joined",
'uploadapp_ratio' => "I have a positive ratio",
'uploadapp_connectable' => "I am connectable",
'uploadapp_upspeed' => "My upload speed is",
'uploadapp_offer' => "What I have to offer",
'uploadapp_why' => "Why I should be promoted",
'uploadapp_uploader' => "I am an uploader at other sites",
'uploadapp_sites' => "Those sites are",
'uploadapp_scene' => "I have scene access",
'uploadapp_yes' => "Yes",
'uploadapp_no' => "No",
'uploadapp_create' => "I know how to create, upload and seed torrents",
'uploadapp_seeding' => "I understand that I have to keep seeding my torrents until there are at least two other seeders",
'uploadapp_send' => "Send",
'uploadapp_appsent' => "Application sent",
'uploadapp_success' => "Your application has succesfully been sent to the staff."
 
);
?>


/lang/lang_uploadapps.php
<?php

$lang 
= array(

#uploadapps errors
'uploadapps_error' => "Error",
'uploadapps_user_error' => "Access Denied",
'uploadapps_notmod' => "Your not a moderator",

#main body
'uploadapps_hide' => "Hide accepted/rejected",
'uploadapps_show' => "Show accepted/rejected",
'uploadapps_applications' => "Uploader applications",
'uploadapps_noapps' => "There are currently no uploader applications",
'uploadapps_applied' => "Applied",
'uploadapps_application' => "Application",
'uploadapps_username' => "Username",
'uploadapps_joined' => "Joined",
'uploadapps_class' => "Class",
'uploadapps_upped' => "Uploaded",
'uploadapps_ratio' => "Ratio",
'uploadapps_status' => "Status",
'uploadapps_delete' => "Delete",
'uploadapps_accepted' => "Accepted",
'uploadapps_rejected' => "Rejected",
'uploadapps_pending' => "Pending",
'uploadapps_viewapp' => "View application",
'uploadapps_username1' => "My username is",
'uploadapps_upped1' => "My upload amount is",
'uploadapps_downed' => "My download amount is",
'uploadapps_ratio1' => "My ratio is",
'uploadapps_connectable' => "I am connectable",
'uploadapps_class1' => "My current userclass is",
'uploadapps_applied1' => "I applied",
'uploadapps_upspeed' => "My upload speed is",
'uploadapps_offer' => "What I have to offer",
'uploadapps_why' => "Why I should be promoted",
'uploadapps_uploader' => "I am an uploader at other sites",
'uploadapps_sites' => "Those sites are",
'uploadapps_axx' => "I have scene access",
'uploadapps_create' => "I know how to create, upload and seed torrents",
'uploadapps_seeding' => "I understand that I have to keep seeding my torrents until there are at least two other seeders",
'uploadapps_noid' => "It appears that there is no uploader application with that ID."
 
);
?>

undertaker

i am after uploader application mod for 09