Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Привет,

Кто-нибудь знает плагин, который разрешает загрузку только в том случае, если пользователю нравится сообщение о загрузке или он реагирует на него?

  • Replies 54
  • Просмотров 12,9k
  • Created
  • Последний ответ

Лучшие авторы в теме

Most Popular Posts

  • BlackShot downloads > front > view > downloadButton заменить всё на это:  

  • Во первых, расширять надо тот класс, который нужно изменить, а не тот, что нравится IPS\downloads\modules\front\downloads\view - вот правильный класс, если вы хотите изменить функцию download()

  • BlackShot не в курсе.

Posted Images

  • Author
11 hours ago, M4FIA_RaGE said:

Something similar, but for downloads, not for links and codes. So, if you head to the Downloads section, find a file and click Download, you'll see a pop-up message telling you to react to the post/file first.

Что-то похожее, но для загрузок, а не для ссылок и кодов. Итак, если вы перейдете в раздел «Загрузки», найдете файл и нажмете «Загрузить», вы увидите всплывающее сообщение, в котором вам будет предложено сначала отреагировать на сообщение / файл.

  • 2 месяца спустя...
  • Author
4 minutes ago, Desti said:

Actually, the opposite order is more logical :)

I think it's possible, but I don't have time right now.

How about adapting? Would it take too long? 😬

The plugin I attached already hides links, images, codes, and attachments, but it doesn't affect the Downloads module.

(BIM) Hide Link And Code 3.1.0.zip

BlackShot downloads > front > view > downloadButton заменить всё на это:

Спойлер
<li>
	{{if !$file->canDownload() AND !( !$file->container()->can( 'download' ) AND $file->container()->message('npd') )}}
		{{if !\IPS\Member::loggedIn()->member_id}}
			<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> {lang="download_no_permission_guest"}</span>
			<a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class='ipsButton ipsButton_light ipsButton_medium ipsButton_fullWidth ipsSpacer_top'>{lang="sign_in_short"}</a>
		{{else}}
			<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> {lang="download_no_permission"}</span>
		{{endif}}
	{{else}}
		{{if $file->reacted()}}
			<a href='{{if settings.idm_antileech AND !$file->requiresDownloadConfirmation()}}{$file->url('download')->csrf()}{{else}}{$file->url('download')}{{endif}}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' {{if $file->requiresDownloadConfirmation()}}data-ipsDialog{{endif}}>{lang="download_now"}</a>
		{{else}}
			<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> Sorry, you need to react to download this file.</span>
		{{endif}}
	{{endif}}
</li>

 

  • Author
11 minutes ago, by_ix said:

BlackShot downloads > front > view > downloadButton заменить всё на это:

Это потрясающе, @by_ix!! Я не думал, что это можно сделать, изменив файл темы. Работает как шарм! Однако два коротких вопроса:

Вместо того, чтобы заменять кнопку сообщением, можно ли сохранить кнопку загрузки, но показывать всплывающее окно с предупреждением?

Можно ли добавить возможность отвечать на контент, чтобы разрешить скачивание, как в плагине, который я отправил?

35 минут назад, BlackShot сказал:

Вместо того, чтобы заменять кнопку сообщением, можно ли сохранить кнопку загрузки, но показывать всплывающее окно с предупреждением?

Спойлер
<li>
	{{if !$file->canDownload() AND !( !$file->container()->can( 'download' ) AND $file->container()->message('npd') )}}
		{{if !\IPS\Member::loggedIn()->member_id}}
			<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> {lang="download_no_permission_guest"}</span>
			<a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class='ipsButton ipsButton_light ipsButton_medium ipsButton_fullWidth ipsSpacer_top'>{lang="sign_in_short"}</a>
		{{else}}
			<span class="ipsType_light ipsType_blendLinks ipsResponsive_hidePhone ipsResponsive_inline"><i class="fa fa-info-circle"></i> {lang="download_no_permission"}</span>
		{{endif}}
	{{else}}
		{{if $file->reacted()}}
			<a href='{{if settings.idm_antileech AND !$file->requiresDownloadConfirmation()}}{$file->url('download')->csrf()}{{else}}{$file->url('download')}{{endif}}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' {{if $file->requiresDownloadConfirmation()}}data-ipsDialog{{endif}}>{lang="download_now"}</a>
		{{else}}
			<div id='DownloadReact' class='ipsHide'><div class='ipsPad'><h3><i class="fa fa-info-circle"></i> Sorry, you need to react to download this file.</h3></div></div>
			<a href='#DownloadReact' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' data-ipsdialog data-ipsDialog-content='#DownloadReact' data-ipsdialog-title='Attention'>{lang="download_now"}</a>
		{{endif}}
	{{endif}}
</li>

 

насчёт второго не знаю, возможно и можно, но лучше всё это делать плагином.

BlackShot 
можно добавить ещё это для отзывов:

		{{$reviews = \IPS\Db::i()->Select( 'COUNT(*)', 'downloads_reviews', array( array( 'review_mid=?', \IPS\Member::loggedIn()->member_id ), array( 'review_fid=?', $file->id ) ) )->first();}}
		{{if $file->reacted() OR $reviews > 0 OR \IPS\Member::loggedIn()->isAdmin() OR \IPS\Member::loggedIn()->modPermission()}}

но @Desti будет ругаться снова на селект. :al:
поэтому, лучше дождись его.

  • Author
7 minutes ago, by_ix said:

BlackShot 
можно добавить ещё это для отзывов:

но @Desti будет ругаться снова на селект. :al:
поэтому, лучше дождись его.

😂

Я также добавил еще одну вещь:

		{{$reviews = \IPS\Db::i()->Select( 'COUNT(*)', 'downloads_reviews', array( array( 'review_mid=?', \IPS\Member::loggedIn()->member_id ), array( 'review_fid=?', $file->id ) ) )->first();}}
		{{if $file->reacted() OR $reviews > 0 OR \IPS\Member::loggedIn()->isAdmin() OR \IPS\Member::loggedIn()->modPermission() OR member.member_id and $file->author()->member_id == \IPS\Member::loggedIn()->member_id}}}}

 

  • Author

@by_ix _

Это почти идеально! Я просто хочу уменьшить диалог и удалить текст «Предупреждение», но сохранить кнопку «X».

Это то, что у меня есть для отладки:

		{{if $file->reacted() OR member.member_id and $file->author()->member_id == \IPS\Member::loggedIn()->member_id}}
		<a href='{{if settings.idm_antileech AND !$file->requiresDownloadConfirmation()}}{$file->url('download')->csrf()}{{else}}{$file->url('download')}{{endif}}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' {{if $file->requiresDownloadConfirmation()}}data-ipsDialog{{endif}}>{lang="download_now"}</a>
		{{else}}
			<div id='downloadReact' class='ipsHide ipsType_center'><i class='fa fa-exclamation-circle ipsType_huge'></i><div id='elDownloadReact' class='ipsPadding:half ipsPos_center'>You need to react to the file before downloading it.<p><a href='{$file->url()}' class='ipsButton ipsButton_large ipsButton_important ipsButton_important' data-action='dialogClose'>Got it</a></p></div></div>
			<a href='#downloadReact' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' data-ipsdialog data-ipsDialog-content='#downloadReact'>{lang="download_now"}</a>
		{{endif}}

image.thumb.png.3aecb0c80d8bea4d0701698bff09d9af.png

Я бы хотел что-то такого размера (но кнопка "Х" пропала):

image.thumb.png.e10be2653427ed758047f48c224c20fc.png

Edited by BlackShot

  • Author
12 minutes ago, by_ix said:

data-ipsdialog-title=''

Я пробовал это раньше, но вместо того, чтобы быть пустым, сверху написано «true».

Я обнаружил, что ipsAlert  делает его меньше, и на самом деле есть «X», но он плавает на экране за пределами диалогового окна. 😓

Edited by BlackShot

  • Author
		{{if $file->reacted() OR \IPS\Member::loggedIn()->isAdmin() OR \IPS\Member::loggedIn()->modPermission() OR member.member_id and $file->author()->member_id == \IPS\Member::loggedIn()->member_id}}
		<a href='{{if settings.idm_antileech AND !$file->requiresDownloadConfirmation()}}{$file->url('download')->csrf()}{{else}}{$file->url('download')}{{endif}}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' {{if $file->requiresDownloadConfirmation()}}data-ipsDialog{{endif}}>{lang="download_now"}</a>
		{{else}}
			<div id='downloadReact' class='ipsHide ipsType_center'><i class='fa fa-exclamation-circle ipsType_huge'></i><p class='ipsType_reset ipsType_light ipsType_large'>{lang="downloadreact_attention"}</p><div id='elDownloadReact' class='ipsPadding:half ipsPos_center'>{lang="downloadreact_warning"}<p>{lang="downloadreact_refresh"}</p><p><a href='{$file->url()}' class='ipsButton ipsButton_large ipsButton_important' data-action='dialogClose'>{lang="downloadreact_ok"}</a></p></div></div>
			<a href='#downloadReact' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-content='#downloadReact'>{lang="download_now"}</a>
		{{endif}}

Кажется, я наконец понял это! СПАСИБО БОЛЬШОЕ, @by_ix! Всегда поможет и хочет научить нас чему-то! 💛

Было бы неплохо, если бы вы превратили все это в плагин и добавили возможность обнаружения ответов/ответов! Держу пари, это будет популярный плагин! 😄

BlackShot я мимолетно просмотрел код, а что будет если на странице файла просто добавить к ссылке /?do=download&confirm=1 , смогу ли я скачать так файл в обход вашего кода?

https://site.com/files/file/{my_file}/?do=download&confirm=1

 

Edited by ZIKURIK

  • Author
8 minutes ago, ZIKURIK said:

BlackShot я мимолетно просмотрел код, а что будет если на странице файла просто добавить к ссылке /?do=download&confirm=1 , смогу ли я скачать так файл в обход вашего кода?

https://site.com/files/file/{my_file}/?do=download&confirm=1

 

К сожалению, да, но я знаю только самые основы кодирования. Кто-то еще должен был бы изучить это или, предпочтительно, сделать плагин для такого рода функций.

Кстати, кредиты идут на @by_ix для этого кода.

2 minutes ago, by_ix said:

@ZIKURIKNothing happens. at least for me. 

В моем случае то, что он сказал, фактически обходит код. 😪

 

11 hours ago, BlackShot said:

How about adapting? Would it take too long? 😬

The plugin I attached already hides links, images, codes, and attachments, but it doesn't affect the Downloads module.

(BIM) Hide Link And Code 3.1.0.zip 13.98 kB · 3 downloads

Latest version

BIM_Hide_Link_And_Code_3.2.2.7z

  • Author
23 hours ago, ZIKURIK said:

BlackShot I briefly looked at the code, but what happens if I just add  /?do=download&confirm=1 to the link on the file page  , can I download the file in this way bypassing your code?



		

 

Вы знаете, как предотвратить или исправить это? @Desti

  • Author

Вообще-то я только сейчас заметил, что это баг не с кнопкой, а с самим IPS. Несмотря ни на что, он разрешает прямую загрузку, добавляя /?do=download&confirm=1 к URL-адресу.

Кто-нибудь знает, как исправить?

4.6.9

Edited by BlackShot

  • Author

Вот что я сделал, чтобы решить эту проблему:

applications\downloads\view.php

Заменять:

if ( \IPS\Settings::i()->idm_antileech AND !$this->file->requiresDownloadConfirmation() )

С участием:

if ( \IPS\Settings::i()->idm_antileech )

Кто-нибудь знает, не испортит ли это что-нибудь? Кажется, теперь это работает. Если бы не было подтверждений, платформа разрешила бы загрузку.

@by_ix ZIKURIK @Desti

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.