Author Topic: [GUIDE] Add option to hide certain Access Levels from Comparison Chart  (Read 1080 times)


  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 518
  • Karma: +45/-2
  • Etano Contributor (Skins & Mods)
For those who want to hide selected Access Levels (NOT MEMBERSHIP LEVELS) Heres a quick guide on how to add that option into your admin panel :)

Access your database and go to the table dsb_access_levels
Then add a new column named is_visible with these values:
- type = TINYINT
- length/values = 1
- default = as defined then enter 0
- attributes = UNSIGNED
and save

Now, in admin/access_levels_addedit.php find
Code: [Select]

/*************** FIND THIS ON LINE 34 ***************/

if (!empty($access_levels['allow_na'])) {

/************** ADD THIS BELOW IT ****************/
if (!empty($access_levels['is_visible'])) {

Now in admin/skin/access_levels_addedit.html
Code: [Select]
/***************** FIND THIS ***************/
<td class="label"><label for="allow_na">Allow not-approved?</label></td>
<td class="field {access_levels.error_allow_na}"><input type="checkbox" name="allow_na" id="allow_na" value="1" {access_levels.allow_na} tabindex="3" /><br /><p class="comment">Check this box if you want to allow not-approved members to access this feature.</p></td>

/***************** ADD THIS BELOW IT ***************/
<td class="label"><label for="is_visible">Hide in comparison chart?</label></td>
<td class="field {access_levels.error_is_visible}"><input type="checkbox" name="is_visible" id="is_visible" value="1" {access_levels.is_visible} tabindex="4" /><br /><p class="comment">Check this box if you want to hide it from the comparison chart</p></td>


Now in includes/tables/ Replace the 2 lines that are in this file with
Code: [Select]

Now in plan-comparision-chart.php
Code: [Select]
/************** FIND THIS ON LINE 34 ************/

$query="SELECT `level_diz`,`level` FROM `{$dbtable_prefix}access_levels` WHERE `level_code`<>'login' ";

/************* CHANGE IT TO ********************/
$query="SELECT `level_diz`,`level` FROM `{$dbtable_prefix}access_levels` WHERE `level_code`<>'login' AND `is_visible`='0'";

And thats it! :)

Now when you create or edit a Access Level you will have the option to hide it from the comparison chart :)