403 - Forbiddeen Posted February 4, 2019 Share Posted February 4, 2019 It's possible to create a plugin which the member need to react, on Download App, to download the file? For example, the guests can download just ONE file without react, but when they register, they need to react the file to download it!. I suggest to create the permissions to select the group which need to react to download the file! Similar to hide link and codes (they need to react or reply to see the hidden content), on the Download App, but just react it! Thanks. ❤️ Link to comment
Ryan Ashbrook Posted February 4, 2019 Share Posted February 4, 2019 3 minutes ago, 403 - Forbideen said: It's possible to create a plugin which the member need to react, on Download App, to download the file? For example, the guests can download just ONE file without react, but when they register, they need to react the file to download it!. Similar to hide link and codes (they need to react or reply to see the hidden content), on the Download App, but just react it! Thanks. ❤️ Sure - it'd be a simple hook on \IPS\downloads\File: public function downloadCheck( array $record = NULL, \IPS\Member $member = NULL ) { $member = $member ?: \IPS\Member::loggedIn(); if ( $member->member_id AND !$this->reacted( $member ) ) { throw new \DomainException( 'download_no_react' ); } return parent::downloadCheck( $record, $member ); } For guests, you could either track if they've downloaded via cookie (which has limitations), or just use the built-in limit settings: Link to comment
403 - Forbiddeen Posted February 4, 2019 Author Share Posted February 4, 2019 13 minutes ago, Ryan Ashbrook said: Sure - it'd be a simple hook on \IPS\downloads\File: public function downloadCheck( array $record = NULL, \IPS\Member $member = NULL ) { $member = $member ?: \IPS\Member::loggedIn(); if ( $member->member_id AND !$this->reacted( $member ) ) { throw new \DomainException( 'download_no_react' ); } return parent::downloadCheck( $record, $member ); } thank you <3, but how can i select the group needs to react to download? Link to comment
403 - Forbiddeen Posted February 4, 2019 Author Share Posted February 4, 2019 if someone can help me, i don't know how to create a plugin, anyway, thanks for any help. Link to comment
Daniel F Posted February 4, 2019 Share Posted February 4, 2019 We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin Link to comment
403 - Forbiddeen Posted February 4, 2019 Author Share Posted February 4, 2019 37 minutes ago, Daniel F said: We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin wooah, thank you, try to make one ❤️ Link to comment
403 - Forbiddeen Posted February 5, 2019 Author Share Posted February 5, 2019 5 hours ago, Daniel F said: We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin i cant create, i really don't know how to do this, if anyone helps, but anyway, thanks for helping Daniel. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.