Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12356
Latest: how to logo design
New This Month: 7
New This Week: 0
New Today: 0
Stats
Total Posts: 40076
Total Topics: 7055
Most Online Today: 47
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 38
Total: 38

Author Topic: Download System++ (php)  (Read 8225 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
2728 Views
Last post December 06, 2007, 02:50:35 pm
by biggsy
3 Replies
4536 Views
Last post February 08, 2008, 01:39:16 am
by rtyug
5 Replies
6320 Views
Last post September 26, 2008, 09:23:21 pm
by SMFHacks
4 Replies
5825 Views
Last post January 11, 2008, 02:15:38 pm
by rtyug
1 Replies
3637 Views
Last post February 07, 2008, 09:59:50 pm
by rtyug

+- Recent Topics

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Cannot import by shawnb
March 02, 2020, 12:17:00 pm

Error message with latest SMF 2.1 Github build by Hatshepsut
March 01, 2020, 10:06:10 am

[Mod]Avatars Display Integration by SMFHacks
February 15, 2020, 07:30:47 pm

[Mod]BBC Message Boxes 1.0 by SMFHacks
February 15, 2020, 07:26:46 pm

[Mod]Stack Trace by live627 by SMFHacks
February 15, 2020, 07:21:33 pm

Powered by EzPortal