Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Zero108

Как добавить кастомную иконку со ссылкой в Userbar?

Recommended Posts

Хочется добавить иконку, например, иконку Телеграм со ссылкой на свой канал в 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 by Zero108

Share this post


Link to post

Вышеприведенный код добавляет вот такую иконку со ссылкой на неодобренный контент. Хочется сделать что-то подобное, но со ссылкой на Телеграм-канал: иконка с url ссылкой.

hbWYCEl.png

 

Класс иконки такой:

 

<i class="fab fa-telegram-plane"></i>

 

Unicode: f3fe

 

Страница иконки

Edited by Zero108

Share this post


Link to post

Наваял как мог по аналогии. Кто шарит, помогите, пожалуйста, удалить лишнее и сделать, чтобы иконка отображалась. Сейчас не отображается.

 

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

Share this post


Link to post

То есть подключить это загрузкой шрифтов и командами в css никак? Параллельно не будет работать?

Share this post


Link to post

По идее должно работать.

Share this post


Link to post

Я часа 2 на это убил. fonts.css ковырял, добавлял ссылки на загруженные шрифты, у меня не получилось. 5 версию шрифтов скачивал с указанного выше сайта.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...