settings.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. if ($logedin){
  3. $info = api_get("accounts/verify_credentials");
  4. if($info['error']){
  5. header('Location: ./logout');
  6. }
  7. }
  8. ?>
  9. <div class='element'>
  10. <div class='avatar' style='height:0px;'></div>
  11. <div class='post' style='text-align:left;'>
  12. <div style='padding:15px; width:90%; text-align:left; display:inline-block;' id="settings">
  13. <h1><span class='fontello' style='font-size:inherit;'>&#xe82e;</span> Settings</h1>
  14. <form method='post' enctype="multipart/form-data">
  15. <input type='hidden' name='action' value='settings'>
  16. <br>
  17. <?php if ($logedin): ?>
  18. <hr>
  19. <h1><span class='fontello' style='font-size:inherit;'>&#xe806;</span> Account</h1>
  20. <h2>Username</h2>
  21. <div class='setting'>
  22. <input type='text' name='username' value='<?php echo $info['display_name']; ?>'>
  23. </div>
  24. <h2>Bio</h2>
  25. <div class='setting'>
  26. <textarea name='bio' style='width:90%; height:100px'><?php
  27. echo trim(strip_tags(str_replace(array("<br/>","<br />"),"\n",$info['note'])));
  28. ?></textarea>
  29. </div>
  30. <h2>Avatar</h2>
  31. <div class='setting'>
  32. <div class='avatar' style='height:80px; background-image:url("<?php echo $info['avatar']; ?>"); background-size:80px; margin-top:0px !important; margin-left:0px !important; display:block;'></div>
  33. <div style='display:block; clear:both; width:70%; overflow:hidden;'><input type='file' name='avatar'></div>
  34. </div>
  35. <div style='clear:both;'></div>
  36. <h2>Header</h2>
  37. <div class='setting' style='clear:both;'>
  38. <div style='height:150px; width:90%; background-image:url("<?php echo $info['header']; ?>"); background-size:cover; background-repeat: no-repeat; margin-top:0px !important; margin-left:0px !important;'></div>
  39. <div style='display:block; clear:both; width:70%; overflow:hidden;'><input type='file' name='header'></div>
  40. </div>
  41. <br>
  42. <?php endif; ?>
  43. <h1><span class='fontello' style='font-size:inherit;'>&#xf0e5;</span> Timeline</h1>
  44. <hr>
  45. <?php if ($logedin): ?>
  46. <h2>Default post vsibility</h2>
  47. <div class="setting">
  48. <select name='defscope' id='scope'>
  49. <option value="1" <?php echo ($user_settings['defscope'] == '1' ? "selected" : ""); ?>>&#xe83c; Public</option>
  50. <option value="2" <?php echo ($user_settings['defscope'] == '2' ? "selected" : ""); ?>>&#xe816; Unlisted</option>
  51. <option value="3" <?php echo ($user_settings['defscope'] == '3' ? "selected" : ""); ?>>&#xe819; Private</option>
  52. <option value="4" <?php echo ($user_settings['defscope'] == '4' ? "selected" : ""); ?>>&#xf0e0; Direct</option>
  53. </select>
  54. </div>
  55. <h2>Show replies</h2>
  56. <div class='setting'>
  57. <select name="replies">
  58. <option value="on" <?php echo ($user_settings['replies'] == 'on' ? "selected" : ""); ?>>All</option>
  59. <option value="off" <?php echo ($user_settings['replies'] == 'off' ? "selected" : ""); ?>>Only to people i follow</option>
  60. </select>
  61. </div>
  62. <?php endif; ?>
  63. <h2>Show text-only posts</h2>
  64. <div class='setting'>
  65. <input type='radio' name='text' id='textOn' value='on' style='display:none;' <?php echo ($user_settings['text'] == 'on' ? "checked" : ""); ?>>
  66. <label for='textOn'>Yes</label>
  67. <input type='radio' name='text' id='textOff' value='off' style='display:none;' <?php echo ($user_settings['text'] == 'off' ? "checked" : ""); ?>>
  68. <label for='textOff'>No</label>
  69. </div>
  70. <br><br>
  71. <h2>Show reblogs</h2>
  72. <div class='setting'>
  73. <input type='radio' name='reblog' id='reblogOn' value='on' style='display:none;' <?php echo ($user_settings['reblog'] == 'on' ? "checked" : ""); ?>>
  74. <label for='reblogOn'>Yes</label>
  75. <input type='radio' name='reblog' id='reblogOff' value='off' style='display:none;' <?php echo ($user_settings['reblog'] == 'off' ? "checked" : ""); ?>>
  76. <label for='reblogOff'>No</label>
  77. </div>
  78. <br><br>
  79. <h2>Unroll Content Warnings</h2>
  80. <div class='setting'>
  81. <input type='radio' name='unrollcw' id='cwshow' value='on' style='display:none;' <?php echo ($user_settings['unrollcw'] == 'on' ? "checked" : ""); ?>>
  82. <label for='cwshow'>True</label>
  83. <input type='radio' name='unrollcw' id='cwhide' value='off' style='display:none;' <?php echo ($user_settings['unrollcw'] == 'off' ? "checked" : ""); ?>>
  84. <label for='cwhide'>False</label>
  85. </div>
  86. <br><br>
  87. <?php if ($logedin): ?>
  88. <h2>Muted words</h2>
  89. <span>One per line</span>
  90. <div class='setting'>
  91. <textarea name='mtwords' style='width:85%;'><?php
  92. foreach($user_settings['mtwords'] as $word){
  93. echo (empty($word) ? "" : trim($word)."\n");
  94. }
  95. ?></textarea>
  96. </div>
  97. <h2>Followed hashtags</h2>
  98. <span>One per line</span>
  99. <div class='setting'>
  100. <textarea name='fhtags' style='width:85%;'><?php
  101. foreach($user_settings['fhtags'] as $word){
  102. echo (empty($word) ? "" : trim($word)."\n");
  103. }
  104. ?></textarea>
  105. </div>
  106. <?php endif; ?>
  107. <br>
  108. <h1><span class='fontello' style='font-size:inherit;'>&#xe818;</span> Attachments</h1>
  109. <hr>
  110. <h2>Hide Attachments, show a link instead.</h2>
  111. <div class='setting'>
  112. <input type='radio' name='attach' id='a_hide' value='off' style='display:none;' <?php echo ($user_settings['attach'] == 'off' ? "checked" : ""); ?>>
  113. <label for='a_hide'>Yes</label>
  114. <input type='radio' name='attach' id='a_show' value='on' style='display:none;' <?php echo ($user_settings['attach'] == 'on' ? "checked" : ""); ?>>
  115. <label for='a_show'>No</label>
  116. </div>
  117. <br><br>
  118. <h2>Sensitive Media</h2>
  119. <div class='setting'>
  120. <input type='radio' name='explicit' id='hide' value='hide' style='display:none;' <?php echo ($user_settings['explicit'] == 'hide' ? "checked" : ""); ?>>
  121. <label for='hide'>Hide</label>
  122. <input type='radio' name='explicit' id='blur' value='blur' style='display:none;' <?php echo ($user_settings['explicit'] == 'blur' ? "checked" : ""); ?>>
  123. <label for='blur'>Blur</label>
  124. <input type='radio' name='explicit' id='show' value='off' style='display:none;' <?php echo ($user_settings['explicit'] == 'off' ? "checked" : ""); ?>>
  125. <label for='show'>Show</label>
  126. </div>
  127. <br><br>
  128. <h2>Loop videos</h2>
  129. <div class='setting'>
  130. <input type='radio' name='videoloop' id='loopOn' value='on' style='display:none;' <?php echo ($user_settings['videoloop'] == 'on' ? "checked" : ""); ?>>
  131. <label for='loopOn'>Yes</label>
  132. <input type='radio' name='videoloop' id='loopOff' value='off' style='display:none;' <?php echo ($user_settings['videoloop'] == 'off' ? "checked" : ""); ?>>
  133. <label for='loopOff'>No</label>
  134. </div>
  135. <br><br>
  136. <br><br>
  137. <h1><span class='fontello' style='font-size:inherit;'>&#xf0f3;</span> Notifications</h1>
  138. <hr>
  139. <div class='setting'>
  140. <p>Select types of notifications you want to see:</p>
  141. <input type='checkbox' name='notif[fav]' id='fav' style='display:none;' <?php echo (str_split($user_settings['notif'])[0] == '1' ? "checked" : ""); ?>>
  142. <label for='fav'>Faves</label>
  143. <input type='checkbox' name='notif[rt]' id='rt' style='display:none;' <?php echo (str_split($user_settings['notif'])[1] == '1' ? "checked" : ""); ?>>
  144. <label for='rt'>Reblogs</label>
  145. <input type='checkbox' name='notif[mnt]' id='mnt' style='display:none;' <?php echo (str_split($user_settings['notif'])[2] == '1' ? "checked" : ""); ?>>
  146. <label for='mnt'>Mentions</label>
  147. <input type='checkbox' name='notif[follow]' id='follow' style='display:none;' <?php echo (str_split($user_settings['notif'])[3] == '1' ? "checked" : ""); ?>>
  148. <label for='follow'>Follow</label>
  149. </div>
  150. <br><br>
  151. <br><br>
  152. <h1><span class='fontello' style='font-size:inherit;'>&#xe809;</span> User Interface</h1>
  153. <hr>
  154. <h2>Theme.</h2>
  155. <select name='theme' onChange='themecheck(this)'>
  156. <?php
  157. echo "<option value='default' ".($user_settings['theme'] == "default" ? "selected" : "").">default</option>";
  158. foreach(themes("list") as $name){
  159. echo "<option value='$name' ".($user_settings['theme'] == $name ? "selected" : "").">$name</option>";
  160. }
  161. echo "<option value='custom' ".($user_settings['theme'] == "custom" ? "selected" : "").">custom</option>";
  162. ?>
  163. </select>
  164. <div id="customtheme"<?php echo ($user_settings['theme'] == "custom" ? "" : "style='display:none;'");?>>
  165. <fieldset>
  166. <legend>Custom Colors</legend>
  167. Foreground:<br>
  168. <input type="color" name="fg" value="#<?php echo (!empty($theme) ? $theme['fg'] : "#ffffff");?>"><br><br>
  169. Background:<br>
  170. <input type="color" name="bg" value="#<?php echo (!empty($theme) ? $theme['bg'] : "#2b475d");?>"><br><br>
  171. Text Color:<br>
  172. <input type="color" name="tx" value="#<?php echo (!empty($theme) ? $theme['tx'] : "#000000");?>"><br><br>
  173. Link Color:<br>
  174. <input type="color" name="lc" value="#<?php echo (!empty($theme) ? $theme['lc'] : "#4682b4");?>"><br><br>
  175. Border Color:<br>
  176. <input type="color" name="bc" value="#<?php echo (!empty($theme) ? $theme['bc'] : "#ffffff");?>"><br><br>
  177. Border Width:<br>
  178. <input type="text" name="bw" value="<?php echo (!empty($theme) ? $theme['bw'] : "0");?>"><br><br>
  179. Border Radius:<br>
  180. <input type="text" name="br" value="<?php echo (!empty($theme) ? $theme['br'] : "3");?>"><br><br>
  181. Drop Shadow Size:<br>
  182. <input type="text" name="dr" value="<?php echo (!empty($theme) ? $theme['dr'] : "0");?>"><br><br>
  183. </fieldset>
  184. </div>
  185. <br>
  186. <br><br>
  187. <br><br>
  188. <input type="submit" value="Save" id="send">
  189. </form>
  190. </div>
  191. </div>
  192. </div>
  193. <?php
  194. if ($logedin){
  195. include ("modules/lists.php");
  196. }
  197. ?>