Skip to content

Commit

Permalink
some tiny bugfixes and changed is_active() a bit...
Browse files Browse the repository at this point in the history
git-svn-id: file:///svn/phpbb/trunk@7232 89ea8834-ac86-4346-8a33-228a782c2dd0
  • Loading branch information
acydburn committed Mar 26, 2007
1 parent b9d77ef commit 8ba8cae
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 33 deletions.
1 change: 1 addition & 0 deletions phpBB/develop/create_schema_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,7 @@ function get_schema_struct()
$schema_data['phpbb_smilies'] = array(
'COLUMNS' => array(
'smiley_id' => array('UINT', NULL, 'auto_increment'),
// We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
'code' => array('VCHAR_UNI:50', ''),
'emotion' => array('VCHAR_UNI:50', ''),
'smiley_url' => array('VCHAR:50', ''),
Expand Down
4 changes: 2 additions & 2 deletions phpBB/includes/acp/acp_board.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function main($id, $mode)
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),

'legend2' => 'GENERAL_OPTIONS',
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
Expand Down Expand Up @@ -147,7 +147,7 @@ function main($id, $mode)

'legend2' => 'POSTING',
'bump_type' => false,
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
Expand Down
2 changes: 1 addition & 1 deletion phpBB/includes/acp/acp_icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function main($id, $mode)
$image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array();
$image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array();
$image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array();
$image_emotion = request_var('emotion', array('' => ''));
$image_emotion = request_var('emotion', array('' => ''), true);
$image_code = request_var('code', array('' => ''));
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();

Expand Down
32 changes: 7 additions & 25 deletions phpBB/includes/functions_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,39 +467,21 @@ function load_active($mode = false, $module_url = false, $execute_module = true)
/**
* Check if a module is active
*/
function is_active($id = false)
function is_active($id, $mode = false)
{
$icat = false;

$category = false;
// If we find a name by this id and being enabled we have our active one...
foreach ($this->module_ary as $row_id => $item_ary)
{
// If this is a module and it's selected, active
// If this is a category and the module is the first within it, active
// If this is a module and no mode selected, select first mode
// If no category or module selected, go active for first module in first category
if (
(($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == false && !$item_ary['cat']) || ($icat && $item_ary['cat']))) ||
($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) ||
(($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$item_ary['cat']) ||
(!$id && !$item_ary['cat'] && $item_ary['display'])
)
if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display'])
{
if ($item_ary['cat'])
if ($mode === false || $mode === $item_ary['mode'])
{
$id = $icat;
$icat = false;

continue;
return true;
}

return $item_ary['id'];
}
else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat']))
{
$category = $item_ary['id'];
}
}

return false;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion phpBB/styles/subSilver/template/overall_footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{RUN_CRON_TASK}
<!-- {RUN_CRON_TASK} -->
</div>

<!--
Expand Down
2 changes: 1 addition & 1 deletion phpBB/styles/subSilver/template/ucp_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<div style="padding: 2px;"></div>
<!-- ENDIF -->

<!-- IF S_ZEBRA_ENABLED -->
<!-- IF S_ZEBRA_ENABLED and S_ZEBRA_FRIENDS_ENABLED -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th>{L_FRIENDS}</th>
Expand Down
14 changes: 11 additions & 3 deletions phpBB/ucp.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@
$module->list_modules('ucp');

// Check if the zebra module is set
$zebra_enabled = $module->is_active('zebra') ? true : false;

if ($zebra_enabled)
if ($module->is_active('zebra', 'friends'))
{
// Output listing of friends online
$update_time = $config['load_online_time'] * 60;
Expand Down Expand Up @@ -314,6 +312,16 @@ function _module_zebra($mode, &$module_row)
global $template;

$template->assign_var('S_ZEBRA_ENABLED', true);

if ($mode == 'friends')
{
$template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true);
}

if ($mode == 'foes')
{
$template->assign_var('S_ZEBRA_FOES_ENABLED', true);
}
}

?>

0 comments on commit 8ba8cae

Please sign in to comment.