Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12414
Latest: danilubrin
New This Month: 4
New This Week: 3
New Today: 0
Stats
Total Posts: 39956
Total Topics: 7034
Most Online Today: 42
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 25
Total: 25

Author Topic: Download System++ (php)  (Read 8167 times)

0 Members and 1 Guest are viewing this topic.

Offline rtyug

  • Newbie
  • *
  • Posts: 24
    • View Profile
Download System++ (php)
« on: December 21, 2007, 09:10:06 pm »
http://custom.simplemachines.org/mods/index.php?mod=992

very good system for files


It is needed to do determination of ip client which was connected and if this ip not included in the list of present networks that to forbid to begin to the swing and get files!!!
more detailed http://ua-ix.com/eng.phtml

I insert a code somewhere, but for me does not turn out to do!!
Code: [Select]
$ip = getenv('REMOTE_ADDR');                                                    


here code
Code: [Select]
<?
// wget http://www.colocall.net/ua/?list -O ua-list.txt

function parse_net($ip)
{
sscanf ($ip, "%d.%d.%d.%d/%d", $one, $two, $three, $four, $mask);
$addr = $one*pow(2,24) + $two*pow(2,16) + $three*pow(2,8) + $four;
for ($i = 0; $i < round($mask); $i++) $bitmask += 1 << (31 - $i);
return array($addr, $addr+abs($bitmask));
}

function parse_ip($ip)
{
sscanf ($ip, "%d.%d.%d.%d", $one, $two, $three, $four);
return $one*pow(2,24) + $two*pow(2,16) + $three*pow(2,8) + $four;
}
function check_ip($ip)
{
$f=file('ua-list.txt');
$IP=parse_ip($ip);
foreach ($f as $net)
{
list($min,$max)=parse_net(trim($net));
if ($IP>=$min && $IP<$max) return true;
}
return false;
}

$ip=$_SERVER["argv"][1];

if (check_ip($ip)) echo "OK - host '$ip' in UA-IX\n";
else echo "FALSE - host '$ip' NOT in UA-IX\n";

?>

вот код download.php

http://2info.dp.ua/403/download.txt


+ Downloads.english-utf8.php

« Last Edit: December 21, 2007, 09:17:38 pm by rtyug »

Offline rtyug

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Download System++ (php)
« Reply #1 on: December 22, 2007, 10:16:37 am »
???????????
Code: [Select]
$ip = getenv('REMOTE_ADDR');
??????????
Code: [Select]
// Check if downloads are auto approved
    $approved = (allowedTo('downloads_autoapprove') ? 1 : 0);

    // Allow comments on file if no setting set.
    if (empty($modSettings['down_commentchoice']))
        $allowcomments = 1;


    if ($title == '')
        fatal_error($txt['downloads_error_no_title'],false);
    if ($cat == '')
        fatal_error($txt['downloads_error_no_cat'],false);

    if ($modSettings['down_set_enable_multifolder'])
        CreateDownloadFolder();

Offline rtyug

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Download System++ (php)
« Reply #2 on: December 22, 2007, 12:36:04 pm »
if I got it right, a script is written very difficultly and done in order that did not break up a forum!!

he very needs me!
I thought that able to close access a method .htaccess, but did not turn out

it can be YOU something is not clear? and did I clear write as though...?

I wait an answer or will put to death itself at a wall  ;D
THANK YOU
« Last Edit: December 22, 2007, 01:33:10 pm by rtyug »

Offline rtyug

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Download System++ (php)
« Reply #3 on: December 23, 2007, 10:35:30 am »
help please
 ;)
« Last Edit: December 23, 2007, 05:07:41 pm by rtyug »

Offline rtyug

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Download System++ (php)
« Reply #4 on: December 23, 2007, 05:01:54 pm »
I did already! excuse me! I was nervous  :D
« Last Edit: December 23, 2007, 05:07:23 pm by rtyug »

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2654 Views
Last post December 06, 2007, 02:50:35 pm
by biggsy
3 Replies
4464 Views
Last post February 08, 2008, 01:39:16 am
by rtyug
5 Replies
6267 Views
Last post September 26, 2008, 09:23:21 pm
by SMFHacks
4 Replies
5771 Views
Last post January 11, 2008, 02:15:38 pm
by rtyug
1 Replies
3579 Views
Last post February 07, 2008, 09:59:50 pm
by rtyug

+- Recent Topics

hashTags only used by admins, but visible to everyone? by Dwev
Today at 07:59:19 am

Install ad seller pro problem. by SMFHacks
December 13, 2019, 05:56:56 am

Contact Page Problem by emmebroke
December 11, 2019, 04:19:25 pm

Responsive Layout by Matthias
November 30, 2019, 03:05:57 pm

Secure connection failed Pretty Url Pro by Rock Lee
November 26, 2019, 10:44:23 am

Black Friday Sale Week 2019 by SMFHacks
November 23, 2019, 04:47:56 pm

German Translation missing in SMF 2.1R1 by SMFHacks
November 19, 2019, 02:38:42 pm

Unread items issue by SMFHacks
November 19, 2019, 10:07:32 am

Update detect mobile mode PHP5 to PHP7 by Rock Lee
November 16, 2019, 07:18:13 pm

PHP error by davejo
November 12, 2019, 12:09:47 pm

Powered by EzPortal