Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fixing the horribly fucked up blue thrust scripts
#11
adddownload.php:

PHP Code:
<?php


if(checkLogin(MEMBER_NAMEMEMBER_PASS) && checkRank(MEMBER_RANK$pid)) {
    if(
$submit) {
        
?>
        <table align='center' border='0' cellspacing='0' cellpadding='0' width='450'>
        <?PHP
        
        $fileurl 
$_REQUEST["fileurl"];
        
$downloadfile $_REQUEST["downloadfile"]
        
$name1 $_POST["name1"];
        
$type1 $_POST["type1"];
        
$desc $_POST["desc"];
        
        if(
$fileurl == "" && $downloadfile != "" && is_numeric($type1) && $name1 != "") {
            
$dlfilepath basename($_FILES['downloadfile']['name']);
            
            
$dlextensions getDownloadCatInfo("extension"$type1);
            
$totalextensions substr_count($dlextensions",");

            
$passtest 0;
            if(
$totalextensions 0) {
                
$dl_extensions str_replace(" """$dlextensions);
                
$dl_extensions explode(","$dl_extensions);

                foreach(
$dl_extensions as $ext) {
                    
$countext strlen($ext);
                    
$startpos 0-$countext;
                    
$testfile substr($dlfilepath$startpos);

                    if(
$testfile == $ext) {
                        
$passtest++;
                    }

                }
            }
            else {
                
$countext strlen($dlextensions);
                
$startpos 0-$countext;
                
$testfile substr($dlfilepath$startpos);

                if(
$textfile == $ext) {
                    
$passtest++;
                }
            }

            if(
$passtest == 0) {
                
$diemessage "The download could not be added.  The file must be of type: $dlextensions";
                die(
"<script language=\"Javascript\"> alert(\"$diemessage\"); window.location.href = 'console.php?pid=$pid'; </script>");
            }

            
$failed 0;
            if(@
move_uploaded_file($_FILES['downloadfile']['tmp_name'], "downloads/".$dlfilepath)) {
                
?>
                <tr>
                    <td class='main'>File Uploaded Successfully!</td>
                </tr>
                <?PHP
                $failed 
0;
            }
            else {
                
?>
                <tr>
                    <td class='main'>File Upload Failed!</td>
                </tr>
                <?PHP
                $failed 
1;
            }

            if(
$failed == 1) {
                
?>
                <tr>
                    <td class='main'>File Upload Failed: The file was unable to be uploaded!</td>
                </tr>
                <?PHP
            
}
            else {
                
$filenamepath "downloads/" $dlfilepath;
                
$outsidelink 0;
            }
        }
        elseif(
$fileurl != "") {
            
$filenamepath $fileurl;
            
$outsidelink 1;
            
$failed 0;
        }

        if(!
is_numeric($type1) OR $name1 == "") {
            
$failed 1;
        }

        if(
$failed == 0) {
            
$time time();
            
$query 
                
"INSERT INTO {$dbprefix}downloads (name, description, type, poster, filename, outsidelink, adderip, dateadded) " .
                
"VALUES ('$name1', '$desc', '$type1', '$memid', '$filenamepath', '$outsidelink', '$ip', '$time')";
            
$result mysql_query($query)
            or die(
mysql_error());

            
?>
        </table>
        <script language="Javascript">
            alert("Success!");
            window.location.href = 'console.php';
        </script>
            <?PHP
        
}
        else {
            
?>
            <tr>
                <td class='main'>The download was not added to the database.</td>
            </tr>
        </table>
            <?PHP
        
}
    }
    elseif(!
$submit) {
        
$maxuploadsize ini_get('upload_max_filesize')."B";
        
$downloadcats getDownloads();
        
$dispconsolename getConsoleInfoByID("displayname"$pid);
        
?>
        <form action='console.php?pid=<?PHP echo($pid); ?>' method='post' enctype='multipart/form-data'>
            <table align='center' border='1' cellspacing='0' cellpadding='3' width='500' bordercolor='<?PHP echo($bgcolor); ?>'>
                <tr>
                    <td bordercolor='<?PHP echo($bordercolor); ?>' background='themes/<?PHP echo($theme); ?>/<?PHP echo($bgimage); ?>' class='titles' align='center'>
                        <span style="font-weight: bold;"><?PHP echo($dispconsolename); ?></span>
                    </td>
                </tr>
                <tr>
                    <td bordercolor='<?PHP echo($bordercolor); ?>' style='border-top-width: 0px' class='main'>
                        <br />
                        <blockquote>
                            <span style="font-weight: bold;">NOTE:</span> 
                            If both the Upload File and File URL are used, the File URL will be added to the database.  
                            It will overwrite any file with the same name.<br/>
                            <span style="font-weight: bold;">MAX UPLOAD SIZE: <?PHP echo($maxuploadsize); ?></span><br/><br/>
                            <span style="text-align: center;">
                                <table align='center' border='0' cellspacing='0' cellpadding='0' width='450'>
                                    <tr>
                                        <td class='main' width='150'>
                                            <span style="font-weight: bold;">Upload File:</span>
                                        </td>
                                        <td class='main' width='300'>
                                            <input type='file' name='downloadfile' class='form'/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align='center' class='main'>
                                            <br/>
                                            <span style="font-style: italic;">OR</span>
                                            <br/><br/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class='main' width='150'>
                                            <span style="font-weight: bold;">File URL:</span>
                                        </td>
                                        <td class='main' width='300'>
                                            <input type='text' name='fileurl' class='form'/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class='main' width='150'>
                                            <span style="font-weight: bold;">Name:</span>
                                        </td>
                                        <td class='main' width='300'>
                                            <input type='text' name='name1' class='form'/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class='main' width='150'>
                                            <span style="font-weight: bold;">Type:</span>
                                        </td>
                                        <td class='main' width='300'>
                                            <select name='type1' class='form'>
                                                <?PHP
                                                
foreach($downloadcats as $download) {
                                                    
?>
                                                <option value="<?PHP echo($download[1]); ?>"><?PHP echo($download[0]) ?></option><?PHP
                                                
}
                                                
?>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class='main' width='150' valign='top'>
                                            <span style="font-weight: bold;">Description:</span>
                                        </td>
                                        <td class='main' width='300'>
                                            <textarea name='desc' rows='4' cols='40' class='form'></textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan='2' class='main' align='center'>
                                            <br/>
                                            <input type='submit' name='submit' value='Add Download'/>
                                        </td>
                                    </tr>
                                </table>
                            </span>
                        </blockquote>
                    </td>
                </tr>
            </table>
        </form>
        <?PHP
    
}

}
else {
    
?>
    <table align='center' border='0' cellspacing='0' cellpadding='0' width='400'>
        <tr>
            <td class='main' align='center'>Your rank is not high enough to view this page</td>
        </tr>
    </table>
    <?PHP
}

?>
#12
addcalendarevent.php:

PHP Code:
<?php


if(checkLogin(MEMBER_NAMEMEMBER_PASS) AND checkRank(MEMBER_RANK$pid)) {
    if(
$_POST["submit"]) {
        
        
$subject1 textFilter($_POST["subject1"]);
        
$message1 textFilter($_POST["message1"]);
        
$month1 textFilter($_POST["month1"]);
        
$day1 textFilter($_POST["day1"]);
        
$year1 textFilter($_POST["year1"]);
        
        
$time date("n/j/y");
        
$query 
            
"INSERT INTO {$dbprefix}news (dateposted, subject, poster, content, type, month, day, year) " .
            
"VALUES ('$time', '$subject1', '$memid', '$message1', 'calendar', '$month1', '$day1', '$year1')";
        
$result mysql_query($query)
                    or die(
mysql_error());
        
?>
        <script language="Javascript" type="text/javascript">
            alert("Success!");
            window.location.href = 'console.php';
        </script>
        <?PHP
    
}
    else {

        
$dispconsolename getConsoleInfoByID("displayname"$pid);
        
        
?>
        <form action='console.php?pid=<?PHP echo($pid); ?>' method='post'>
            <table align='center' border='1' cellspacing='0' cellpadding='3' width='500' bordercolor='<?PHP echo($bgcolor); ?>'>
                <tr>
                    <td bordercolor='<?PHP echo($bordercolor); ?>' background='themes/<?PHP echo($theme); ?>/<?PHP echo($bgimage); ?>' class='titles' align='center'>
                        <span style="font-weight: bold;"><?PHP echo($dispconsolename); ?></span>
                    </td>
                </tr>
                <tr>
                    <td bordercolor='<?PHP echo($bordercolor); ?>' style='border-top-width: 0px' align='center' class='main'>
                        <br />
                        <blockquote>
                            <table align='center' border='0' cellspacing='0' cellpadding='0' width='450'>
                                <tr>
                                    <td class='main' width='150'>
                                        <span style="font-weight: bold;">Date:</span>
                                    </td>
                                    <td class='main' width='300'>
                                        <select name='month1' class='form'>
                                            <?PHP
                                                
for($i 1$i <= 12$i++) {
                                                    
?>
                                                    <option value="<?PHP echo($i); ?>"><?PHP echo(date("F"mktime(0,0,0,$i,1,2007))); ?></option><?PHP
                                                
}
                                            
?>
                                        </select> 
                                        <select name='day1' class='form'>
                                            <?PHP
                                                
for($i 1$i <= 31$i++) {
                                                    
?>
                                                <option value="<?PHP echo($i); ?>"><?PHP echo($i); ?></option><?PHP
                                                
}
                                            
?>
                                        </select> 
                                        <select name='year1' class='form'>
                                            <?PHP
                                                
for($i=0$i<=4$i++) {
                                                    
$year = (date("Y")+$i);
                                                    
?>
                                            <option value="<?PHP echo($year); ?>"><?PHP echo($year); ?></option><?PHP
                                                
}
                                            
?>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='main' width='150'>
                                        <span style="font-weight: bold;">Subject:</span>
                                    </td>
                                    <td class='main' width='300'>
                                        <input type='text' name='subject1' class='form' />
                                    </td>
                                </tr>
                                <tr>
                                    <td class='main' width='150' valign='top'>
                                        <span style="font-weight: bold;">Message:</span>
                                    </td>
                                    <td class='main' width='300'>
                                        <textarea rows='4' cols='40' name='message1' class='form'>
                                        </textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='2' class='main' align='center'>
                                        <br/>
                                        <input type='submit' name='submit' value='Post' />
                                    </td>
                                </tr>    
                            </table>
                        </blockquote>
                    </td>
                </tr>
            </table>
        </form>
        <?PHP
    
}
}
else {
    
?>
    <table align='center' border='0' cellspacing='0' cellpadding='0' width='400'>
        <tr>
            <td class='main' align='center'>
                Your rank is not high enough to view this page
            </td>
        </tr>
    </table>
    <?PHP
}
?>
#13
Still cannot properly download files from BTCS3.

Code:
<br>
<center><h2>Downloads</h2></center>

<?php

$dlcat = textFilter(getDownloadCatInfo("name", $dl));

echo "
<table align='center' border='1' cellspacing='0' cellpadding='2' width='500' bordercolor='$bgcolor'>
<tr>
<td class='titles' background='themes/$theme/$bgimage' bordercolor='$bordercolor' align='center'><b>$dlcat</b></td>
</tr>
<tr>
<td class='main' bordercolor='$bordercolor' style='border-top-width: 0px'>
<br>
<blockquote>
";
$query = "SELECT * FROM {$dbprefix}downloads WHERE type = '$dl' ORDER BY name";
$result = mysql_query($query)
     or die(mysql_error());
while($row = mysql_fetch_array($result))
{
extract($row);
foreach($row AS $key => $value) { ${$key} = textFilter($value); }

$dispName = addslashes(textFilter(getMemberInfoByID("username", $poster)));
$dispRank = addslashes(textFilter(getRankInfo("name", getMemberInfoByID("rank", $poster))));
$dispDate = date("m/d/y", $dateadded);
echo "
<b>File Name:</b> $name<br>
<b>Posted By:</b> <a href='index.php?p=Profile&user=$dispName'>$dispRank $dispName</a><br>
<b>Date Posted:</b> $dispDate<br>
<b>Description:</b><br>
$description<br><br>
<b><a href="$filename">DOWNLOAD NOW!</a></b>
<hr size='1' width='500' color='$bordercolor'><br>
";
}

echo "
</blockquote>
</td>
</tr>
</table>
";

?>

Click on a category where there is a file uploaded, and nothing displays.  Went to FTP to make sure file was uploaded correctly, it was and file is viewable.  What do?
Game, The
#14
I know i got a fixed version of this that i did. Not sure where it i have it. Sad
[Image: 5lv58m.gif]
му ηαмє ιѕ ¢αяℓσѕ
#15
how the hell do you know all this shit? i mean really i just Get the jift of Java
~The lonely Stoner seems to free his mind at night~
#16
Dre@m$ Wrote:how the hell do you know all this shit? i mean really i just Get the jift of Java


it's not java it's PHP




also, i'll have to take a look at the file to figure out what's wrong with it, i haven't looked at this shit in a long time
#17
I was testing out the deborked version of the scripts, and when I 'recruit' someone it does not remember who recruited the person.  You lost a part of the 'addmember.php' somewhere in translation. (#4 from below)

Code:
btcs_members STRUCTURE

    1     id     smallint(255)             No     None     AUTO_INCREMENT     Change Change     Drop Drop     More Show more actions
    2     username     varchar(20)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    3     password     varchar(20)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    4     recruitedby     varchar(255)     latin1_swedish_ci         No     Admin Account         Change Change     Drop Drop     More Show more actions
    5     recruits     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    6     aim     varchar(25)     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    7     loggedin     int(11)             No     0         Change Change     Drop Drop     More Show more actions
    8     remember     int(1)             No     0         Change Change     Drop Drop     More Show more actions
    9     medals     text     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    10     gamesplayed     text     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    11     rank     int(11)             No     0         Change Change     Drop Drop     More Show more actions
    12     email     varchar(255)     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    13     lastlogin     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    14     datejoined     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    15     lastpromotion     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    16     lastdemotion     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    17     ipnum     varchar(255)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    18     maingame     varchar(255)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    19     realname     varchar(255)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    20     country     varchar(255)     latin1_swedish_ci         No             Change Change     Drop Drop     More Show more actions
    21     bday     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    22     age     smallint(2)             No     0         Change Change     Drop Drop     More Show more actions
    23     pic     varchar(255)     latin1_swedish_ci         No     http://         Change Change     Drop Drop     More Show more actions
    24     disable     smallint(1)             No     0         Change Change     Drop Drop     More Show more actions
    25     inactive     int(1)             No     0         Change Change     Drop Drop     More Show more actions
    26     inactivedate     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    27     inactivedays     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    28     gender     varchar(255)     latin1_swedish_ci         No     Male         Change Change     Drop Drop     More Show more actions
    29     timesloggedin     int(255)             No     0         Change Change     Drop Drop     More Show more actions
    30     yahoo     varchar(255)     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    31     msn     varchar(255)     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    32     quote     text     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    33     smurfnames     text     latin1_swedish_ci         No     None         Change Change     Drop Drop     More Show more actions
    34     motmvotes     int(225)             No     0         Change Change     Drop Drop     More Show more actions
    35     motmvoted     varchar(255)     latin1_swedish_ci         No     0         Change Change     Drop Drop     More Show more actions
    36     tourneystaff     int(1)             No     0         Change Change     Drop Drop     More Show more actions
Game, The
#18
nothing was deleted in translation, just de-base64ed.


the scripts are just crap. at the moment i'm wayyy too busy to continue working on these but some day...
#19
The adddownload.php still doesn't work. Everytime i tried to add a download it falis. Big Grin
[Image: 5lv58m.gif]
му ηαмє ιѕ ¢αяℓσѕ
#20
Leaky Wrote:the scripts are just crap. at the moment i'm wayyy too busy lazy to continue working on these but some day...
corrected.


I may take a look at it when I've got time.
Steam Wrote: 4:02 PM - George, of the jungle: was out
4:02 PM - George, of the jungle: bison, dude
4:02 PM - Brawl Bashin’ Bison: ???
4:02 PM - George, of the jungle: you're very rude towards alina
4:02 PM - George, of the jungle: how about unbanning her friend?
4:02 PM - George, of the jungle: I mean
4:02 PM - George, of the jungle: it's only gamebanana skins
4:02 PM - Brawl Bashin’ Bison: LOL
4:02 PM - George, of the jungle: ^^
4:02 PM - Brawl Bashin’ Bison: LOLOL
4:02 PM - George, of the jungle: lol

Users browsing this thread: 1 Guest(s)