Changeset 787 for trunk/Modules
- Timestamp:
- Feb 7, 2014, 5:14:20 PM (11 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Options.php
r636 r787 30 30 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection($this->System->User->PreferredVersion).'</td></tr>'. 31 31 '<tr><td>Veřejný text profilu:</td><td>'. 32 '<textarea name="info" cols="60" rows="10">'.$this->System->User->Info.'</textarea></td></tr>'. 33 '<tr><td colspan="2"><input type="submit" value="Uložit" /></td></tr>'. 32 '<textarea name="info" cols="60" rows="10">'.$this->System->User->Info.'</textarea></td></tr>'; 33 34 35 $Output .= '<tr><td>'; 36 $Query = 'SELECT * FROM UserTagType'; 37 $DbResult = $this->Database->query($Query); 38 $Output .= 'Překladatel se řídí zaškrtnutými pravidly:</td><td>'; 39 while ($UserTag = $DbResult->fetch_array()) { 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); 43 $DbResult2 = $this->Database->query($Query); 44 if ($DbResult2->num_rows != 0) $checked = true; 45 else $checked = false; 46 47 $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox'); 48 $Output .= ''.$UserTag['Text'].'<br />'; 49 } 50 $Output .= '</td></tr>'; 51 52 $Output .= '<tr><td colspan="2"><input type="submit" value="Uložit" /></td></tr>'. 34 53 '</table></fieldset>'. 35 54 '</form>'; … … 85 104 } else $Output .= ShowMessage('Hesla se neshodují.', MESSAGE_CRITICAL); 86 105 } 106 //tag 107 $Query = 'SELECT * FROM UserTagType'; 108 $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 } 124 } 125 87 126 $this->Database->update('User', '`ID` = '.$this->System->User->Id, array('Email' => $Email, 88 127 'Language' => $Language, 'Redirecting' => $Redirecting, 'Info' => $Info, -
trunk/Modules/User/Profile.php
r769 r787 157 157 if($UserLine['TeamName'] != '') 158 158 $Output .= 'Člen týmu: <a href="team/?action=team&id='.$UserLine['Team'].'"><strong>'.$UserLine['TeamName'].'</strong></a><br />'; 159 $Output .= '<fieldset><legend>Text profilu:</legend>'.str_replace("\n", '<br/>', $UserLine['Info']).'</fieldset><br/>'; 159 //user tags 160 $Query = 'SELECT * FROM `UserTag` '. 161 'LEFT JOIN `UserTagType` ON `UserTagType`.`ID` = `UserTag`.`UserTagType` '. 162 'WHERE `User` = '.($_GET['user'] * 1); 163 $DbResult = $this->Database->query($Query); 164 if ($DbResult->num_rows != 0) { 165 $Output .= 'Překladatel se řídí těmito pravidly:<br />'; 166 while ($UserTag = $DbResult->fetch_array()) { 167 $Output .= ' <li>'.$UserTag['Text'].'</li>'; 168 } 169 } 170 171 172 $Output .= '<br /><fieldset><legend>Text profilu:</legend>'.str_replace("\n", '<br/>', $UserLine['Info']).'</fieldset><br/>'; 160 173 161 174 $Output .= '<table class="Home"><tr>'. … … 165 178 $Output .= '<br />'.$this->ShowLastForum().'<br />'; 166 179 if($this->System->User->Licence(LICENCE_MODERATOR)) 167 { 168 $Output .= '<fieldset><legend>Moderování</legend>'; 169 $Output .= 'Poslední IP: <strong>'.$UserLine['LastIP'].'</strong><br />'. 180 { 181 $Output .= '<fieldset><legend>Moderování</legend>'; 182 183 $Output .= '<form action="?user='.($_GET['user'] * 1).'" method="post">Přidání tagu uživateli:<br />'; 184 $Query = 'SELECT * FROM UserTagType'; 185 $DbResult = $this->Database->query($Query); 186 while ($UserTag = $DbResult->fetch_array()) { 187 //save: 188 if (array_key_exists('save', $_POST)) { 189 if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) { 190 $Query = 'SELECT * FROM `UserTag` '. 191 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 192 $DbResult2 = $this->Database->query($Query); 193 if ($DbResult2->num_rows == 0) { 194 $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '. 195 'VALUES (NULL, '.$UserTag['ID'].' , '.($_GET['user']*1).')'; 196 $DbResult2 = $this->Database->query($Query); 197 } 198 } else { 199 $Query = 'DELETE FROM `UserTag` '. 200 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($_GET['user'] * 1); 201 $DbResult2 = $this->Database->query($Query); 202 } 203 } 204 205 $Query = 'SELECT * FROM `UserTag` '. 206 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($_GET['user'] * 1); 207 $DbResult2 = $this->Database->query($Query); 208 if ($DbResult2->num_rows != 0) $checked = true; 209 else $checked = false; 210 211 $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox'); 212 $Output .= ''.$UserTag['Text'].'<br />'; 213 } 214 $Output .= '<input name="save" type="submit" value="Uložit" /></form>'; 215 216 $Output .= ' PosledníIP: <strong>'.$UserLine['LastIP'].'</strong><br />'. 170 217 'Prohlížeč: <strong>'.$UserLine['UserAgent'].'</strong><br />'. 171 218 'Email: <strong>'.$UserLine['Email'].'</strong><br />'; -
trunk/Modules/User/Registration.php
r636 r787 64 64 </tr>'; 65 65 $Output .= '</td></tr>'. 66 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection('').'</td></tr>'; 67 $Output .= '<tr> 66 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection('').'</td></tr>'; 67 68 $Output .= '<tr><td>'; 69 $Query = 'SELECT * FROM UserTagType'; 70 $DbResult = $this->Database->query($Query); 71 $Output .= 'Vyberte pravidla, kterými se při překladu chcete řídit:</td><td>'; 72 while ($UserTag = $DbResult->fetch_array()) { 73 $checked = false; 74 75 $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox'); 76 $Output .= ''.$UserTag['Text'].'<br />'; 77 } 78 $Output .= '</td></tr>'; 79 80 $Output .= '<tr> 68 81 <th><input type="submit" value="Registrovat" /></th> 69 82 </tr> … … 112 125 $this->System->ModuleManager->Modules['Log']->WriteLog('Uživatel se zaregistroval: '.$UserName, LOG_TYPE_USER); 113 126 $ShowForm = false; 127 128 //tag 129 $Query = 'SELECT * FROM UserTagType'; 130 $DbResult = $this->Database->query($Query); 131 while ($UserTag = $DbResult->fetch_array()) { 132 if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) { 133 $Query = 'SELECT * FROM `UserTag` '. 134 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 135 $DbResult2 = $this->Database->query($Query); 136 if ($DbResult2->num_rows == 0) { 137 $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '. 138 'VALUES (NULL, '.$UserTag['ID'].' , '.($this->System->User->Id * 1).')'; 139 $DbResult2 = $this->Database->query($Query); 140 } 141 } else { 142 $Query = 'DELETE FROM `UserTag` '. 143 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 144 $DbResult2 = $this->Database->query($Query); 145 } 146 } 147 148 149 114 150 } else $Output = ShowMessage('Uživatel se zadanou přezdívkou již existuje.', MESSAGE_CRITICAL); 115 151 } else $Output = ShowMessage('Hesla se neshodují.', MESSAGE_CRITICAL);
Note:
See TracChangeset
for help on using the changeset viewer.