Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 20, 20177 yr Hello, How to override / delete (using hook) USE operator in a third-party application?
December 20, 20177 yr you can't afaik (if you are talking about for traits) but if you are talking about for importing, the child class will not inherit them as they exist outside of the class.
December 20, 20177 yr Author 5 minutes ago, CodingJungle said: if you are talking about for traits I will say differently, I need to disable Reactions in Classifieds application (only), which uses USE in Advert.php file (use \IPS\Content\Reactable;), can this be done using a plugin / hook?
December 20, 20177 yr Just now, Cheshir said: I will say differently, I need to disable Reactions in Classifieds application (only), which uses USE in Advert.php file (use \IPS\Content\Reactable;), can this be done using a plugin / hook? no you can not.
December 20, 20177 yr You can probably extend \IPS\Content\Controller methods react() (for the advert) and _react() (for comments and reviews) to return FALSE. You just need to remember to check if you are in app Classifieds, module Adverts and controller view. That will make reactions to not appear there, which will probably do what you want. Not tested.
December 20, 20177 yr 20 minutes ago, Adriano Faria said: You can probably extend \IPS\Content\Controller methods react() (for the advert) and _react() (for comments and reviews) to return FALSE. You just need to remember to check if you are in app Classifieds, module Adverts and controller view. That will make reactions to not appear there, which will probably do what you want. Not tested. those are both return void methods, all that would do is prevent the react being record (at best). if the point is not to show the react/reputation, i would hook into the Adverts (and its Review and Comment, if it has them) class and override the canRate() method and just have it return false, that way the react widget wont even display. sorry, canReact() (not canRate())
December 20, 20177 yr Author 37 minutes ago, CodingJungle said: canReact () return FALSE; This solved the problem! Thank you so much!
Archived
This topic is now archived and is closed to further replies.