Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

[resources.invisionpower.com - pliki] IP.Downloads > IP.Downloads 2.0.0: Allow any url for url submissions


Rekomendowane odpowiedzi

  • Manager

By default, IP.Downloads 2.0.0 will check the submitted url and verify that the extension is allowed. Some users have expressed a desire to allow any urls (e.g. so that they can submit rapidshare or megaupload urls to the download manager), which isn't possible via any setting presently.

To do this, backup (important!), open admin/applications_addon/ips/downloads/modules_public/post/submit.php and find:

if( $this->registry->getClass('idmFunctions')->canSubmitLinks() )

{

require_once( IPSLib::getAppDir( 'downloads' ) . '/sources/storage/url.php' );

$urlStorageEngine = new urlStorageEngine( $this->registry, $category );

}

Add below:

$file['file_url'] = trim($this->request['file_url']);

$extension = explode( ".", $save_array['file_realname'] );

$filetype = strtolower( array_pop( $extension ) );

$file['file_size'] = $this->registry->getClass('idmFunctions')->obtainRemoteFileSize();

If you want to use the BLACKLIST feature of IP.Board 3.0.0, use this script intead:

if ( $this->settings['ipb_use_url_filter'] )

{

$list_type = $this->settings['ipb_url_filter_option'] == "black" ? "blacklist" : "whitelist";

if( $this->settings['ipb_url_' . $list_type ] )

{

$list_values = array();

$list_values = explode( "\n", str_replace( "\r", "", $this->settings['ipb_url_' . $list_type ] ) );

if ( $list_type == "whitelist" )

{

$list_values[] = "http://{$_SERVER['HTTP_HOST']}/*";

}

if ( count( $list_values ) )

{

$this->registry->class_localization->loadLanguageFile( 'public_post', 'forums' );

$good_url = 0;

foreach( $list_values as $my_url )

{

if( !trim($my_url) )

{

continue;

}

$my_url = preg_quote( $my_url, '/' );

$my_url = str_replace( "\*", "(.*?)", $my_url );

if ( $list_type == "blacklist" )

{

if( preg_match( '/' . $my_url . '/i', trim($this->request['file_url']) ) )

{

$this->registry->output->addContent( $this->registry->getClass('idmFunctions')->produceError( 'domain_not_allowed' ) );

$this->_continueForm( $type );

return;

}

}

else

{

if ( preg_match( '/' . $my_url . '/i', $option ) )

{

$good_url = 1;

}

}

}

if ( ! $good_url AND $list_type == "whitelist" )

{

$this->registry->output->addContent( $this->registry->getClass('idmFunctions')->produceError( 'domain_not_allowed' ) );

$this->_continueForm( $type );

return;

}

}

}

}

$file['file_url'] = trim($this->request['file_url']);

$extension = explode( ".", $save_array['file_realname'] );

$filetype = strtolower( array_pop( $extension ) );

$file['file_size'] = $this->registry->getClass('idmFunctions')->obtainRemoteFileSize();

This way, if you had blocked some URLs on blacklist (like megaupload, rapidshare, etc.), it won't be possible to post link to them!

In both cases, find:

else if( $error_number > 1 )

Change to:

else if( $error_number > 2 )

ps: the update of this tutorial was approved by bfarber, original author of this script for IP.Downloads 1.2.X. Wyświetl pełny artykuł

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.