Posted 6 апреляApr 6 comment_202136 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 = ' '; 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; } } Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/ Share on other sites Больше вариантов
6 апреляApr 6 comment_202140 не помогайте ему, хочет адблок юзеров поймать! ты что делаеш!! Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202140 Share on other sites Больше вариантов
6 апреляApr 6 comment_202142 2 часа назад, dfdgfgfsd сказал: не помогайте ему, хочет адблок юзеров поймать! ты что делаеш!! Монетизация вещь такая, что приходится делать все что угодно чтобы приносило прибыль 🤔 Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202142 Share on other sites Больше вариантов
6 апреляApr 6 Author comment_202146 3 hours ago, dfdgfgfsd said: не помогайте ему, хочет адблок юзеров поймать! ты что делаеш!! Please note that I'm not asking for opinions on adblock and anti-adblock, I'm asking for help on a plugin. Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202146 Share on other sites Больше вариантов
6 апреляApr 6 comment_202147 Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202147 Share on other sites Больше вариантов
6 апреляApr 6 Author comment_202148 25 minutes ago, Zero108 said: I already have it installed, it doesn't work Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202148 Share on other sites Больше вариантов
6 апреляApr 6 comment_202149 Попробуй активировать плагин в настройках плагина после установки. Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202149 Share on other sites Больше вариантов
6 апреляApr 6 Author comment_202150 50 minutes ago, Zero108 said: Попробуй активировать плагин в настройках плагина после установки. 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... Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202150 Share on other sites Больше вариантов
6 апреляApr 6 comment_202151 Твой код не будет работать на этом движке. Попробуй вот это: https://www.detectadblock.com/ Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202151 Share on other sites Больше вариантов
6 апреляApr 6 Author comment_202152 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... Link to comment https://ipbmafia.ru/topic/26885-pluginapplication-creation/?&do=findComment&comment=202152 Share on other sites Больше вариантов
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.