Skip to content

Commit

Permalink
Restore support for IPS 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aXenDeveloper committed May 25, 2021
1 parent 83bf1da commit fd1a92d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin name="(aXen) Secondary Groups Indicator" version_long="22003" version_human="2.3.0" author="aXenDev" website="https://axendev.net/" update_check="https://files.axendev.net/projects/ips/plugins/secondarygroupsindicator/check.php"><hooks><hook type="C" class="\IPS\Member" filename="aXenSGISortedGroups"><![CDATA[//<?php
<plugin name="(aXen) Secondary Groups Indicator" version_long="22004" version_human="2.3.1" author="aXenDev" website="https://axendev.net/" update_check="https://files.axendev.net/projects/ips/plugins/secondarygroupsindicator/check.php"><hooks><hook type="C" class="\IPS\Member" filename="aXenSGISortedGroups"><![CDATA[//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if (!\defined('\IPS\SUITE_UNIQUE_KEY')) {
Expand Down Expand Up @@ -157,7 +157,7 @@ public static function hookData() {
array (
'selector' => 'div.cUserHovercard > div.ipsPadding.ipsFlex.ipsFlex-fd:column.ipsFlex-ai:center > dl.ipsMargin:none.ipsMargin_top.ipsAreaBackground_light.ipsRadius.ipsFlex.ipsFlex-ai:center.ipsFlex-jc:around.ipsFlex-as:stretch.ipsPadding:half',
'type' => 'add_after',
'content' => '{{if $member->aXenSGISortedGroups() && settings.aXenGroupHovercard}}
'content' => '{{if $member->aXenSGISortedGroups() && settings.aXenGroupHovercard && settings.aXenGroupVersion === \'ips46\'}}
<div class="ipsFlex ipsFlex-ai:center ipsFlex-jc:between ipsMargin_top ipsFlex-as:stretch">
<div class="ipsType_bold ipsFlex-flex:00 ipsMargin_right">
{lang="aXenGroup_other"}
Expand All @@ -169,14 +169,32 @@ public static function hookData() {
</ul>
</div>
{{endif}}
',
),
1 =>
array (
'selector' => 'div.cUserHovercard > div.cUserHovercard_data > ul.ipsDataList',
'type' => 'add_inside_start',
'content' => '{{if $member->aXenSGISortedGroups() && settings.aXenGroupHovercard && settings.aXenGroupVersion === \'ips45\'}}
<li class="ipsDataItem">
<span class="ipsDataItem_generic ipsDataItem_size3"><strong>{lang="aXenGroup_other"}</strong></span>
<span class="ipsDataItem_main">
{{$groups = [];}}
{{foreach $member->aXenSGISortedGroups() as $group}}
{{$groups[] = $group->formattedName;}}
{{endforeach}}
{expression="implode(\', \', $groups)" raw="true"}
</span>
</li>
{{endif}}
',
),
),
), parent::hookData() );
}
/* End Hook Data */
}
]]></hook></hooks><settings><setting><key>aXenGroupTopics</key><default>1</default></setting><setting><key>aXenGroupHovercard</key><default>1</default></setting><setting><key>aXenGroupProfile</key><default>1</default></setting><setting><key>aXenGroupSearch</key><default>1</default></setting><setting><key>aXenGroup</key><default/></setting><setting><key>aXenGroupExclude</key><default/></setting></settings><settingsCode><![CDATA[//<?php
]]></hook></hooks><settings><setting><key>aXenGroupTopics</key><default>1</default></setting><setting><key>aXenGroupHovercard</key><default>1</default></setting><setting><key>aXenGroupProfile</key><default>1</default></setting><setting><key>aXenGroupSearch</key><default>1</default></setting><setting><key>aXenGroup</key><default/></setting><setting><key>aXenGroupExclude</key><default/></setting><setting><key>aXenGroupVersion</key><default>ips46</default></setting></settings><settingsCode><![CDATA[//<?php
$groups = array();
foreach (\IPS\Member\Group::groups() as $k => $v) {
Expand All @@ -185,6 +203,9 @@ public static function hookData() {
}
}
$form->add(new \IPS\Helpers\Form\Select('aXenGroupVersion', \IPS\Settings::i()->aXenGroupVersion, TRUE, [
'options' => ['ips45' => 'IPS 4.5', 'ips46' => 'IPS 4.6']
]));
$form->add(new \IPS\Helpers\Form\YesNo('aXenGroupTopics', \IPS\Settings::i()->aXenGroupTopics));
$form->add(new \IPS\Helpers\Form\YesNo('aXenGroupHovercard', \IPS\Settings::i()->aXenGroupHovercard));
$form->add(new \IPS\Helpers\Form\YesNo('aXenGroupProfile', \IPS\Settings::i()->aXenGroupProfile));
Expand All @@ -197,7 +218,7 @@ public static function hookData() {
}
return $form;
]]></settingsCode><tasks/><widgets/><htmlFiles/><cssFiles/><jsFiles/><resourcesFiles/><lang><word key="aXenGroup" js="0">Choose sorting groups</word><word key="aXenGroupExclude" js="0">Exclude member groups from display</word><word key="aXenGroupSearch" js="0">Show in Search?</word><word key="aXenGroupProfile" js="0">Show in Profile?</word><word key="aXenGroupHovercard" js="0">Show in Hovercard?</word><word key="aXenGroupTopics" js="0">Show in Topics?</word><word key="aXenGroup_other" js="0">Other groups</word></lang><versions><version long="10000" human="1.0.0"/><version long="11000" human="1.1.0"><![CDATA[//<?php
]]></settingsCode><tasks/><widgets/><htmlFiles/><cssFiles/><jsFiles/><resourcesFiles/><lang><word key="aXenGroup" js="0">Choose sorting groups</word><word key="aXenGroupExclude" js="0">Exclude member groups from display</word><word key="aXenGroupSearch" js="0">Show in Search?</word><word key="aXenGroupProfile" js="0">Show in Profile?</word><word key="aXenGroupHovercard" js="0">Show in Hovercard?</word><word key="aXenGroupTopics" js="0">Show in Topics?</word><word key="aXenGroup_other" js="0">Other groups</word><word key="aXenGroupVersion" js="0">Select your IPS version</word></lang><versions><version long="10000" human="1.0.0"/><version long="11000" human="1.1.0"><![CDATA[//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
Expand Down Expand Up @@ -485,6 +506,35 @@ class ips_plugins_setup_upg_22003
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><version long="22004" human="2.3.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;
}
/**
* 2.3.1 Upgrade Code
*/
class ips_plugins_setup_upg_22004
{
/**
* ...
*
* @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>
Binary file modified 5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@ The plugin show secondary groups on website in:

## 🏷️ Requirements

- [IPS Community Suite: 4.6 version](https://invisioncommunity.com/)
- [IPS Community Suite: 4.5, 4.6 version](https://invisioncommunity.com/)

## 🧰 Install

Expand Down

0 comments on commit fd1a92d

Please sign in to comment.