Jump to content

USE operator php


Cheshir

Recommended Posts

Posted
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?

Posted
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.

Posted

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.

Posted
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())

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...