mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Compare commits
4 commits
4f6cded8de
...
e96f15db99
Author | SHA1 | Date | |
---|---|---|---|
|
e96f15db99 | ||
|
61bede748a | ||
|
0562984999 | ||
|
50cf4892ea |
3 changed files with 68 additions and 2 deletions
|
@ -475,6 +475,41 @@ class acp_profile
|
||||||
$cp->vars[$key] = $var;
|
$cp->vars[$key] = $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// step 3 - all arrays
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
// Get language entries
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||||
|
WHERE lang_id <> ' . $this->edit_lang_id . "
|
||||||
|
AND field_id = $field_id
|
||||||
|
ORDER BY option_id ASC";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$l_lang_options = [];
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$l_lang_options[$row['lang_id']][$row['option_id']] = $row['lang_value'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
|
||||||
|
FROM ' . PROFILE_LANG_TABLE . '
|
||||||
|
WHERE lang_id <> ' . $this->edit_lang_id . "
|
||||||
|
AND field_id = $field_id
|
||||||
|
ORDER BY lang_id ASC";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$l_lang_name = $l_lang_explain = $l_lang_default_value = [];
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$l_lang_name[$row['lang_id']] = $row['lang_name'];
|
||||||
|
$l_lang_explain[$row['lang_id']] = $row['lang_explain'];
|
||||||
|
$l_lang_default_value[$row['lang_id']] = $row['lang_default_value'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($exclude[3] as $key)
|
foreach ($exclude[3] as $key)
|
||||||
{
|
{
|
||||||
$cp->vars[$key] = $request->variable($key, array(0 => ''), true);
|
$cp->vars[$key] = $request->variable($key, array(0 => ''), true);
|
||||||
|
|
|
@ -441,12 +441,15 @@ class content_visibility
|
||||||
{
|
{
|
||||||
$post_ids[] = (int) $row['post_id'];
|
$post_ids[] = (int) $row['post_id'];
|
||||||
|
|
||||||
if ($row['post_visibility'] != $visibility)
|
if ($row['post_visibility'] != $visibility )
|
||||||
{
|
{
|
||||||
if ($row['post_postcount'] && !isset($poster_postcounts[(int) $row['poster_id']]))
|
if ($row['post_postcount'] && !isset($poster_postcounts[(int) $row['poster_id']]))
|
||||||
{
|
{
|
||||||
$poster_postcounts[(int) $row['poster_id']] = 1;
|
if($row['post_visibility'] != 0 || $visibility != ITEM_DELETED ){
|
||||||
|
$poster_postcounts[(int) $row['poster_id']] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($row['post_postcount'])
|
else if ($row['post_postcount'])
|
||||||
{
|
{
|
||||||
$poster_postcounts[(int) $row['poster_id']]++;
|
$poster_postcounts[(int) $row['poster_id']]++;
|
||||||
|
|
|
@ -69,4 +69,32 @@ class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case
|
||||||
|
|
||||||
$this->assertContainsLang('ADDED_PROFILE_FIELD', $crawler->text());
|
$this->assertContainsLang('ADDED_PROFILE_FIELD', $crawler->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_edit_profile_fields()
|
||||||
|
{
|
||||||
|
// Custom profile fields page
|
||||||
|
$crawler = self::request('GET', 'adm/index.php?i=acp_profile&mode=profile&sid=' . $this->sid);
|
||||||
|
|
||||||
|
// Get all profile fields edit URLs
|
||||||
|
$edits = $crawler->filter('td.actions a')
|
||||||
|
->reduce(
|
||||||
|
function ($node, $i) {
|
||||||
|
$url = $node->attr('href');
|
||||||
|
return ((bool) strpos($url, 'action=edit'));
|
||||||
|
})
|
||||||
|
->each(
|
||||||
|
function ($node, $i) {
|
||||||
|
$url = $node->attr('href');
|
||||||
|
return ($url);
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach ($edits as $edit_url)
|
||||||
|
{
|
||||||
|
$crawler = self::request('GET', 'adm/' . $edit_url . '&sid=' . $this->sid);
|
||||||
|
$form = $crawler->selectButton('Save')->form();
|
||||||
|
$crawler= self::submit($form);
|
||||||
|
|
||||||
|
$this->assertContainsLang('CHANGED_PROFILE_FIELD', $crawler->text());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue