Changeset 892 for trunk/Modules/User/Options.php
- Timestamp:
- Mar 3, 2023, 11:36:26 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Options.php
r888 r892 15 15 <tr><td>'.T('After save translation redirect to').': </td><td>'; 16 16 $Output .= '<select name="redirecting">'. 17 18 17 '<option value="0">'.T('Nowhere').'</option>'. 18 '<option value="1"'; 19 19 if ($this->System->User->Redirecting == '1') $Output .= ' selected="selected"'; 20 20 $Output .= '>'.T('To untranslated').'</option>'; … … 36 36 $DbResult = $this->Database->query($Query); 37 37 $Output .= T('User obey selected rules').':</td><td>'; 38 while ($UserTag = $DbResult->fetch_array()) { 39 $Query = 'SELECT * FROM `UserTag` '. 40 //'LEFT JOIN `UserTagType` ON `UserTagType`.`ID` = `UserTag`.`UserTagType` '. 41 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 38 while ($UserTag = $DbResult->fetch_array()) 39 { 40 $Query = 'SELECT * FROM `UserTag` '. 41 //'LEFT JOIN `UserTagType` ON `UserTagType`.`ID` = `UserTag`.`UserTagType` '. 42 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 42 43 $DbResult2 = $this->Database->query($Query); 43 44 if ($DbResult2->num_rows != 0) $checked = true; 44 else$checked = false;45 else $checked = false; 45 46 46 47 $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox'); … … 50 51 51 52 $Output .= '<tr><td colspan="2"><input type="submit" value="'.T('Save').'" /></td></tr>'. 52 53 53 '</table></fieldset>'. 54 '</form>'; 54 55 55 56 $Output .= '<fieldset><legend>'.T('Translation team').'</legend>'; 56 57 $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `Team`'); 57 58 $Output .= '<a href="'.$this->System->Link('/team/?action=create').'">'.T('Create team').'</a><br />'. 58 59 60 61 59 '<a href="'.$this->System->Link('/team/?action=leave').'">'.T('Leave team').'</a><br />'. 60 '<br /><form action="'.$this->System->Link('/team/').'" method="get">'. 61 '<input type="hidden" name="action" value="gointeam"/>'. 62 '<select name="id">'; 62 63 while ($LineTeam = $DbResult->fetch_assoc()) 63 64 { … … 107 108 $Query = 'SELECT * FROM UserTagType'; 108 109 $DbResult = $this->Database->query($Query); 109 while ($UserTag = $DbResult->fetch_array()) { 110 if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) { 111 $Query = 'SELECT * FROM `UserTag` '. 112 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 113 $DbResult2 = $this->Database->query($Query); 114 if ($DbResult2->num_rows == 0) { 115 $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '. 116 'VALUES (NULL, '.$UserTag['ID'].' , '.($this->System->User->Id * 1).')'; 117 $DbResult2 = $this->Database->query($Query); 118 } 119 } else { 120 $Query = 'DELETE FROM `UserTag` '. 121 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 122 $DbResult2 = $this->Database->query($Query); 123 } 110 while ($UserTag = $DbResult->fetch_array()) 111 { 112 if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) 113 { 114 $Query = 'SELECT * FROM `UserTag` '. 115 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 116 $DbResult2 = $this->Database->query($Query); 117 if ($DbResult2->num_rows == 0) 118 { 119 $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '. 120 'VALUES (NULL, '.$UserTag['ID'].' , '.($this->System->User->Id * 1).')'; 121 $DbResult2 = $this->Database->query($Query); 122 } 123 } else 124 { 125 $Query = 'DELETE FROM `UserTag` '. 126 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 127 $DbResult2 = $this->Database->query($Query); 128 } 124 129 } 125 130
Note:
See TracChangeset
for help on using the changeset viewer.