Jump to content

gutierry

Пользователи
  • В сети

  • Количество сообщений

    8
  • Reputation

    0 gutierry's Reputation
  1. gutierry posted пост в теме in Invision Community 4 Support
    I accidentally activated this option and now I click on deactivate and it doesn't deactivate, I've already tried clearing the cache, logging out and logging back in to the admin panel, but it doesn't work.
  2. Someone should really create a plugin to detect members who are using adblock and show it on the admin panel, in addition to showing a message on the frontend to all members and visitors who are also using adblock, I tried, but unfortunately as I don't have much knowledge, this project will die here...
  3. I know how to activate it, but the plugin doesn't work, wouldn't I be able to use what I posted above generated by GPT? because I want to see which members use adblok too...
  4. I already have it installed, it doesn't work
  5. gutierry changed their profile photo
  6. Please note that I'm not asking for opinions on adblock and anti-adblock, I'm asking for help on a plugin.
  7. Hello, how are you ? As I have no knowledge of programming, I asked ChatGPT to create a plugin for ip.board 4 for me, which would detect members who were using adblock and take this to the admin panel, and also display a message to subscribers and members who were using it, so chatgpt provided me with the following 3 files below, however, I don't know how to implement them, could anyone help me?: Plugin XML: <plugin> <title>Detect AdBlock Member and Visitant</title> <version>1.0.0</version> <author>Fantasma Verde</author> <url>https://steamverde.net</url> <description>Detecta se um membro está usando AdBlock e exibe esta informação no painel de administração. Além disso, exibe uma mensagem no frontend para visitantes e usuários cadastrados que estiverem usando AdBlock, avisando para desativá-lo.</description> <hooks> <templateHooks> <templateHook> <hookClass>ips_adblockdetector_hook_FrontEnd</hookClass> <position>footer</position> </templateHook> </templateHooks> <frontEndHooks> <frontEndHook> <hookClass>ips_adblockdetector_hook_FrontEnd</hookClass> <method>detectAdBlock</method> <location>global</location> <runOrder>0</runOrder> </frontEndHook> </frontEndHooks> <adminHooks> <adminHook> <hookClass>ips_adblockdetector_hook_AdminDashboard</hookClass> <method>widgets</method> <location>dashboard</location> <runOrder>0</runOrder> </adminHook> </adminHooks> </hooks> <fileHooks> <fileHook> <class>ips_adblockdetector_hook_FrontEnd</class> <method>detectAdBlock</method> <file>front/front.php</file> </fileHook> <fileHook> <class>ips_adblockdetector_hook_AdminDashboard</class> <method>widgets</method> <file>admin/dashboard.php</file> </fileHook> </fileHooks> </plugin> Frontend File (front/front.php): <?php class ips_adblockdetector_hook_FrontEnd extends _HOOK_CLASS_ { public function detectAdBlock() { ?> <script> // Função para detectar AdBlock function checkAdBlock() { var adBlockEnabled = false; var testAd = document.createElement('div'); testAd.innerHTML = '&nbsp;'; testAd.className = 'adblock-test'; document.body.appendChild(testAd); window.setTimeout(function() { if (!testAd.offsetHeight) { adBlockEnabled = true; // Exiba uma mensagem de aviso para os usuários alert("Você está usando um bloqueador de anúncios. Por favor, desative-o para acessar o conteúdo."); } document.body.removeChild(testAd); }, 100); } // Chamada à função de verificação quando a página é carregada window.onload = function() { checkAdBlock(); }; </script> <?php } } Admin File (admin/dashboard.php): <?php use IPS\Db; class ips_adblockdetector_hook_AdminDashboard extends _HOOK_CLASS_ { public function widgets() { $widgets = parent::widgets(); // Adicione um novo widget ao painel de administração $widgets['adblock_users'] = [ 'title' => 'Usuários com AdBlock', 'content' => $this->getAdblockUsers() ]; return $widgets; } // Função para obter usuários com AdBlock protected function getAdblockUsers() { $db = Db::i(); // Execute a consulta para obter usuários com AdBlock ativado $adblockUsers = $db->select('*', 'core_members', ['adblock' => 1]); $output = '<ul>'; foreach ($adblockUsers as $user) { $output .= '<li>' . $user['name'] . '</li>'; } $output .= '</ul>'; return $output; } }