Zero108 Posted March 27, 2018 Share Posted March 27, 2018 (edited) Хочется добавить иконку, например, иконку Телеграм со ссылкой на свой канал в Userbar. Есть пара образцов, как добавляются такие иконки для разных плагинов. Например, плагин добавления уведомлений о неодобренном контенте: <?xml version="1.0" encoding="UTF-8"?> <plugin name="Approval Queue on UserBar" version_long="10000" version_human="1.0.0" author="Bruno Carvalho" website="http://tibiaking.com" update_check=""><hooks><hook type="S" class="\IPS\Theme\class_core_front_global" filename="18f11b87cf4b1096e1bc4f373d59db82"><![CDATA[//<?php class hook27 extends _HOOK_CLASS_ { /* !Hook Data - DO NOT REMOVE */ public static function hookData() { return array_merge_recursive( array ( 'userBar' => array ( 0 => array ( 'selector' => '#elUserNav > li.cReports.cUserNav_icon', 'type' => 'add_after', 'content' => '<li class=\'cApproval cUserNav_icon\'> <a href=\'{url="app=core&module=modcp&controller=modcp&tab=approval" seoTemplate="modcp_approval"}\' id=\'elModCPApprovalCount\' data-ipsTooltip title=\'{lang="modcp_approval"}\'> {{$approvalQueueCount = \IPS\Content\Search\Query::init()->setHiddenFilter( \IPS\Content\Search\Query::HIDDEN_UNAPPROVED )->count();}} <i class=\'fa fa-hourglass-half\'></i> {{if $approvalQueueCount}}<span class=\'ipsNotificationCount\' data-notificationType=\'approvals\'>{$approvalQueueCount}</span>{{endif}} </a> </li>', ), ), 'mobileNavigation' => array ( 0 => array ( 'selector' => '#elUserNav_mobile > li.cReports.cUserNav_icon', 'type' => 'add_after', 'content' => '<li class=\'cApproval cUserNav_icon\'> <a href=\'{url="app=core&module=modcp&controller=modcp&tab=approval" seoTemplate="modcp_approval"}\' id=\'elFullReports\' data-ipsTooltip title=\'{lang="modcp_approval"}\'> {{$approvalQueueCount = \IPS\Content\Search\Query::init()->setHiddenFilter( \IPS\Content\Search\Query::HIDDEN_UNAPPROVED )->count();}} <i class=\'fa fa-hourglass-half\'></i> {{if $approvalQueueCount}}<span class=\'ipsNotificationCount\' data-notificationType=\'approvals\'>{$approvalQueueCount}</span>{{endif}} </a> </li>', ), ), ), parent::hookData() ); } /* End Hook Data */ }]]></hook></hooks><widgets/><htmlFiles/><cssFiles/><jsFiles/><resourcesFiles/><lang/><versions><version long="10000" human="1.0.0"><![CDATA[//<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * Install Code */ class ips_plugins_setup_install { /** * ... * * @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops) */ public function step1() { return TRUE; } // You can create as many additional methods (step2, step3, etc.) as is necessary. // Each step will be executed in a new HTTP request }]]></version></versions></plugin> Помогите убрать все лишнее, и добавить сюда иконку Телеграм со ссылкой или просто ссылку на картинку со ссылкой, чтобы можно было устанавливать в виде плагина. Edited March 27, 2018 by Zero108 Link to comment Share on other sites More sharing options...
Zero108 Posted March 27, 2018 Author Share Posted March 27, 2018 (edited) Вышеприведенный код добавляет вот такую иконку со ссылкой на неодобренный контент. Хочется сделать что-то подобное, но со ссылкой на Телеграм-канал: иконка с url ссылкой. Класс иконки такой: <i class="fab fa-telegram-plane"></i> Unicode: f3fe Страница иконки Edited March 27, 2018 by Zero108 Link to comment Share on other sites More sharing options...
Zero108 Posted March 27, 2018 Author Share Posted March 27, 2018 Наваял как мог по аналогии. Кто шарит, помогите, пожалуйста, удалить лишнее и сделать, чтобы иконка отображалась. Сейчас не отображается. <?xml version="1.0" encoding="UTF-8"?> <plugin name="Telegram on top" version_long="10001" version_human="1.0.1" author="Zero108" website="www.a108.net" update_check=""><hooks><hook type="S" class="\IPS\Theme\class_core_front_global" filename="Telegram108"><![CDATA[//<?php class hook777 extends _HOOK_CLASS_ { /* !Hook Data - DO NOT REMOVE */ public static function hookData() { return array_merge_recursive( array ( 'userBar' => array ( 0 => array ( 'selector' => '#elUserNav > li.cReports.cUserNav_icon', 'type' => 'add_after', 'content' => '<li class=\'cApproval cUserNav_icon\'> <a href=\'https://t.me/A108_net\' id=\'telegram\' data-ipsTooltip title=\'Telegram channel\'> 1<i class=\'fab fa-telegram-plane\'></i>2 </a> </li>', ), ), 'mobileNavigation' => array ( 0 => array ( 'selector' => '#elUserNav > li.cReports.cUserNav_icon', 'type' => 'add_after', 'content' => '<li class=\'cApproval cUserNav_icon\'> <a href=\'https://t.me/A108_net\' id=\'telegram\' data-ipsTooltip title=\'Telegram channel\'> <i class=\'fab fa-telegram-plane\'></i> </a> </li>', ), ), ), parent::hookData() ); } /* End Hook Data */ }]]></hook></hooks><widgets/><htmlFiles/><cssFiles/><jsFiles/><resourcesFiles/><lang/><versions><version long="10001" human="1.0.1"><![CDATA[//<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * Install Code */ class ips_plugins_setup_install { /** * ... * * @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops) */ public function step1() { return TRUE; } // You can create as many additional methods (step2, step3, etc.) as is necessary. // Each step will be executed in a new HTTP request }]]></version></versions></plugin> Link to comment Share on other sites More sharing options...
newbie Posted March 28, 2018 Share Posted March 28, 2018 Вы дали ссылку на иконку, добавленную в версию 5.0.0.IPS использует версию 4.7.0.https://fontawesome.com/v4.7.0/icon/telegram/ Link to comment Share on other sites More sharing options...
Zero108 Posted March 28, 2018 Author Share Posted March 28, 2018 То есть подключить это загрузкой шрифтов и командами в css никак? Параллельно не будет работать? Link to comment Share on other sites More sharing options...
newbie Posted March 28, 2018 Share Posted March 28, 2018 По идее должно работать. Link to comment Share on other sites More sharing options...
Zero108 Posted March 28, 2018 Author Share Posted March 28, 2018 Я часа 2 на это убил. fonts.css ковырял, добавлял ссылки на загруженные шрифты, у меня не получилось. 5 версию шрифтов скачивал с указанного выше сайта. Link to comment Share on other sites More sharing options...
Zero108 Posted March 29, 2018 Author Share Posted March 29, 2018 Выкрутился, как мог. Сильно не ругать, а помогать! Ссылка на плагин Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now