settings.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <?php
  2. if ($logedin){
  3. $info = api_get("accounts/verify_credentials");
  4. if($info['error']){
  5. die();
  6. }
  7. }
  8. ?>
  9. <?php if ($logedin): ?>
  10. <div class='element'>
  11. <div class='avatar' style='height:1px;'></div>
  12. <div class='profile'>
  13. <form method='post' enctype="multipart/form-data">
  14. <input type='hidden' name='action' value='account'>
  15. <?php
  16. $profile['mainColor'] = averageColor($info['avatar']);
  17. $profile['header'] = $info['header_static'];
  18. ?>
  19. <div id='profileheader' style='width: 100%; height:250px; background-color:#<?php echo $profile['mainColor']; ?>; background-size:cover; background-image:url(<?php echo $profile['header']; ?>); display:inline-block; position:relative;'>
  20. <span style='width:290; height:30px; display:block; margin-top:15px; margin-right:15px; float:right;'>
  21. <div class='profileButton cursor' style='width:100%; border-radius:0px; position:relative;'><span class='fontello' style='font-size:inherit;'>&#xe824;</span> Change Cover<input style='position:absolute; left:0px; top:5px; width:150px; opacity:0;' type='file' id='chooseheader' onChange="previewHeader();" accept="image/*" name='header'></div>
  22. </span>
  23. <span style='position:absolute; bottom:10px; left:10px;'>
  24. </span>
  25. </div>
  26. <div style='width: 100%; position:relative; text-align:center; padding-bottom:15px;'>
  27. <div id='profileavatar' class='avatar_header' style='position:relative; background-color:white; background-size: cover; background-image:url(<?php echo $info['avatar']; ?>); text-align:center; float:none; display:inline-block; border:3px solid white; margin-top:-50px; border-radius:5px; width:80px; height:80px;'>
  28. <span style='position:absolute; bottom:3px; left:3px;'>
  29. <div class='profileButton' style='width:100%; border-radius:0px; position:relative;'><span class='fontello' style='font-size:inherit;'>&#xe824;</span><input style='position:absolute; left:0px; top:5px; width:30px; opacity:0;' type='file' id='chooseavatar' onChange="previewAvatar();" accept="image/*" name='avatar'></div>
  30. </span>
  31. </div>
  32. <br><span><input style='width:80% !important; font-weight:bold; font-size:30px; text-align:center;' type='text' name='username' value='<?php echo $info['display_name']; ?>'></span>
  33. <br><span><textarea name='bio' style='width:80%; height:150px; text-align:center;'><?php echo $info['source']['note']; ?></textarea></span>
  34. <br><span><input style='margin:10px;' type="submit" value="Save Changes" id="send"></span>
  35. </form>
  36. </div>
  37. </div>
  38. </div>
  39. <?php endif; ?>
  40. <div class='element'>
  41. <div class='avatar' style='height:0px;'></div>
  42. <div class='post' style='text-align:left;'>
  43. <div style='padding:15px; width:90%; text-align:left; display:inline-block;' id="settings">
  44. <h1><span class='fontello' style='font-size:inherit;'>&#xe82e;</span> Settings</h1>
  45. <form method='post' enctype="multipart/form-data">
  46. <input type='hidden' name='action' value='settings'>
  47. <h1 style='font-size:1em;'><span class='fontello' style='font-size:1em;'>&#xe824;</span> Posting</h1>
  48. <hr>
  49. <?php if ($logedin): ?>
  50. <h2>Default post vsibility</h2>
  51. <div class="setting">
  52. <select name='defscope' id='scope'>
  53. <option value="1" <?php echo ($user_settings['defscope'] == '1' ? "selected" : ""); ?>>&#xe83c; Public</option>
  54. <option value="2" <?php echo ($user_settings['defscope'] == '2' ? "selected" : ""); ?>>&#xe816; Unlisted</option>
  55. <option value="3" <?php echo ($user_settings['defscope'] == '3' ? "selected" : ""); ?>>&#xe819; Private</option>
  56. <option value="4" <?php echo ($user_settings['defscope'] == '4' ? "selected" : ""); ?>>&#xf0e0; Direct</option>
  57. </select>
  58. </div>
  59. <br>
  60. <h1 style='font-size:1em;'><span class='fontello' style='font-size:1em;'>&#xf0e5;</span> Timeline</h1>
  61. <hr>
  62. <h2>Show replies</h2>
  63. <div class='setting'>
  64. <select name="replies">
  65. <option value="on" <?php echo ($user_settings['replies'] == 'on' ? "selected" : ""); ?>>All</option>
  66. <option value="off" <?php echo ($user_settings['replies'] == 'off' ? "selected" : ""); ?>>Only to people i follow</option>
  67. </select>
  68. </div>
  69. <?php endif; ?>
  70. <h2>Show text-only posts</h2>
  71. <div class='setting'>
  72. <input type='radio' name='text' id='textOn' value='on' style='display:none;' <?php echo ($user_settings['text'] == 'on' ? "checked" : ""); ?>>
  73. <label for='textOn'>Yes</label>
  74. <input type='radio' name='text' id='textOff' value='off' style='display:none;' <?php echo ($user_settings['text'] == 'off' ? "checked" : ""); ?>>
  75. <label for='textOff'>No</label>
  76. </div>
  77. <br><br>
  78. <h2>Show reblogs</h2>
  79. <div class='setting'>
  80. <input type='radio' name='reblog' id='reblogOn' value='on' style='display:none;' <?php echo ($user_settings['reblog'] == 'on' ? "checked" : ""); ?>>
  81. <label for='reblogOn'>Yes</label>
  82. <input type='radio' name='reblog' id='reblogOff' value='off' style='display:none;' <?php echo ($user_settings['reblog'] == 'off' ? "checked" : ""); ?>>
  83. <label for='reblogOff'>No</label>
  84. </div>
  85. <br><br>
  86. <h2>Unroll Content Warnings</h2>
  87. <div class='setting'>
  88. <input type='radio' name='unrollcw' id='cwshow' value='on' style='display:none;' <?php echo ($user_settings['unrollcw'] == 'on' ? "checked" : ""); ?>>
  89. <label for='cwshow'>True</label>
  90. <input type='radio' name='unrollcw' id='cwhide' value='off' style='display:none;' <?php echo ($user_settings['unrollcw'] == 'off' ? "checked" : ""); ?>>
  91. <label for='cwhide'>False</label>
  92. </div>
  93. <br><br>
  94. <?php if ($logedin): ?>
  95. <h2>Muted words</h2>
  96. <span>One per line</span>
  97. <div class='setting'>
  98. <textarea name='mtwords' style='width:85%;'><?php
  99. foreach($user_settings['mtwords'] as $word){
  100. echo (empty($word) ? "" : trim($word)."\n");
  101. }
  102. ?></textarea>
  103. </div>
  104. <br>
  105. <h1 style='font-size:1em;'><span class='fontello' style='font-size:1em;'>&#xf0c9;</span> Sidebar</h1>
  106. <hr>
  107. <h2>Featured hashtags</h2>
  108. <span>One per line, without the #</span>
  109. <div class='setting'>
  110. <textarea name='fhtags' style='width:85%;'><?php
  111. foreach($user_settings['fhtags'] as $word){
  112. echo (empty($word) ? "" : trim($word)."\n");
  113. }
  114. ?></textarea>
  115. </div>
  116. <br>
  117. <?php endif; ?>
  118. <h1 style='font-size:1em;'><span class='fontello' style='font-size:1em;'>&#xe81a;</span> Privacy</h1>
  119. <hr>
  120. <h2>Embed youtube videos</h2>
  121. <div class='setting'>
  122. <input type='radio' name='embyt' id='embYtOn' value='on' style='display:none;' <?php echo ($user_settings['embyt'] == 'on' ? "checked" : ""); ?>>
  123. <label for='embYtOn'>Yes</label>
  124. <input type='radio' name='embyt' id='embYtOff' value='off' style='display:none;' <?php echo ($user_settings['embyt'] == 'off' ? "checked" : ""); ?>>
  125. <label for='embYtOff'>No</label>
  126. </div>
  127. <br><br>
  128. <h2>Use Invidious instance</h2>
  129. <div class='setting''>
  130. <input type='text' name='invidious' value='<?php echo $user_settings['invidious']; ?>' placeholder='eg. yewtu.be'>(blank to disable)
  131. </div>
  132. <h2>Use nitter instance</h2>
  133. <div class='setting''>
  134. <input type='text' name='nitter' value='<?php echo $user_settings['nitter']; ?>' placeholder='eg. nitter.net'>(blank to disable)
  135. </div>
  136. <h2>Use teddit instance</h2>
  137. <div class='setting''>
  138. <input type='text' name='teddit' value='<?php echo $user_settings['teddit']; ?>' placeholder='eg. teddit.net'>(blank to disable)
  139. </div>
  140. <br><br><br>
  141. <h1><span class='fontello' style='font-size:inherit;'>&#xe818;</span> Attachments</h1>
  142. <hr>
  143. <h2>Hide Attachments, show a link instead.</h2>
  144. <div class='setting'>
  145. <input type='radio' name='attach' id='a_hide' value='off' style='display:none;' <?php echo ($user_settings['attach'] == 'off' ? "checked" : ""); ?>>
  146. <label for='a_hide'>Yes</label>
  147. <input type='radio' name='attach' id='a_show' value='on' style='display:none;' <?php echo ($user_settings['attach'] == 'on' ? "checked" : ""); ?>>
  148. <label for='a_show'>No</label>
  149. </div>
  150. <br><br>
  151. <h2>Sensitive Media</h2>
  152. <div class='setting'>
  153. <input type='radio' name='explicit' id='hide' value='hide' style='display:none;' <?php echo ($user_settings['explicit'] == 'hide' ? "checked" : ""); ?>>
  154. <label for='hide'>Hide</label>
  155. <input type='radio' name='explicit' id='blur' value='blur' style='display:none;' <?php echo ($user_settings['explicit'] == 'blur' ? "checked" : ""); ?>>
  156. <label for='blur'>Blur</label>
  157. <input type='radio' name='explicit' id='show' value='off' style='display:none;' <?php echo ($user_settings['explicit'] == 'off' ? "checked" : ""); ?>>
  158. <label for='show'>Show</label>
  159. </div>
  160. <br><br>
  161. <h2>Loop videos</h2>
  162. <div class='setting'>
  163. <input type='radio' name='videoloop' id='loopOn' value='on' style='display:none;' <?php echo ($user_settings['videoloop'] == 'on' ? "checked" : ""); ?>>
  164. <label for='loopOn'>Yes</label>
  165. <input type='radio' name='videoloop' id='loopOff' value='off' style='display:none;' <?php echo ($user_settings['videoloop'] == 'off' ? "checked" : ""); ?>>
  166. <label for='loopOff'>No</label>
  167. </div>
  168. <br><br>
  169. <h2>Mute videos</h2>
  170. <div class='setting'>
  171. <input type='radio' name='mute' id='muteon' value='on' style='display:none;' <?php echo ($user_settings['mute'] == 'on' ? "checked" : ""); ?>>
  172. <label for='muteon'>Yes</label>
  173. <input type='radio' name='mute' id='muteoff' value='off' style='display:none;' <?php echo ($user_settings['mute'] == 'off' ? "checked" : ""); ?>>
  174. <label for='muteoff'>No</label>
  175. </div>
  176. <br><br>
  177. <br><br>
  178. <?php if ($logedin): ?>
  179. <h1><span class='fontello' style='font-size:inherit;'>&#xf0f3;</span> Notifications</h1>
  180. <hr>
  181. <div class='setting'>
  182. <p>Select types of notifications you want to see:</p>
  183. <input type='checkbox' name='notif[fav]' id='fav' style='display:none;' <?php echo (str_split($user_settings['notif'])[0] == '1' ? "checked" : ""); ?>>
  184. <label for='fav'>Faves</label>
  185. <input type='checkbox' name='notif[rt]' id='rt' style='display:none;' <?php echo (str_split($user_settings['notif'])[1] == '1' ? "checked" : ""); ?>>
  186. <label for='rt'>Reblogs</label>
  187. <input type='checkbox' name='notif[mnt]' id='mnt' style='display:none;' <?php echo (str_split($user_settings['notif'])[2] == '1' ? "checked" : ""); ?>>
  188. <label for='mnt'>Mentions</label>
  189. <input type='checkbox' name='notif[follow]' id='follow' style='display:none;' <?php echo (str_split($user_settings['notif'])[3] == '1' ? "checked" : ""); ?>>
  190. <label for='follow'>Follow</label>
  191. </div>
  192. <br><br>
  193. <br><br>
  194. <?php endif; ?>
  195. <h1><span class='fontello' style='font-size:inherit;'>&#xe809;</span> User Interface</h1>
  196. <hr>
  197. <h2>Theme.</h2>
  198. <select name='theme' onChange='themecheck(this)'>
  199. <?php
  200. echo "<option value='default' ".($user_settings['theme'] == "default" ? "selected" : "").">default</option>";
  201. foreach(themes("list") as $name){
  202. echo "<option value='$name' ".($user_settings['theme'] == $name ? "selected" : "").">$name</option>";
  203. }
  204. echo "<option value='custom' ".($user_settings['theme'] == "custom" ? "selected" : "").">custom</option>";
  205. ?>
  206. </select>
  207. <div id="customtheme"<?php echo ($user_settings['theme'] == "custom" ? "" : "style='display:none;'");?>>
  208. <fieldset>
  209. <legend>Custom Colors</legend>
  210. Foreground:<br>
  211. <input type="color" name="fg" value="#<?php echo (!empty($theme) ? $theme['fg'] : "#ffffff");?>"><br><br>
  212. Background:<br>
  213. <input type="color" name="bg" value="#<?php echo (!empty($theme) ? $theme['bg'] : "#2b475d");?>"><br><br>
  214. Text Color:<br>
  215. <input type="color" name="tx" value="#<?php echo (!empty($theme) ? $theme['tx'] : "#000000");?>"><br><br>
  216. Link Color:<br>
  217. <input type="color" name="lc" value="#<?php echo (!empty($theme) ? $theme['lc'] : "#4682b4");?>"><br><br>
  218. Border Color:<br>
  219. <input type="color" name="bc" value="#<?php echo (!empty($theme) ? $theme['bc'] : "#ffffff");?>"><br><br>
  220. Border Width:<br>
  221. <input type="text" name="bw" value="<?php echo (!empty($theme) ? $theme['bw'] : "0");?>"><br><br>
  222. Border Radius:<br>
  223. <input type="text" name="br" value="<?php echo (!empty($theme) ? $theme['br'] : "3");?>"><br><br>
  224. Drop Shadow Size:<br>
  225. <input type="text" name="dr" value="<?php echo (!empty($theme) ? $theme['dr'] : "0");?>"><br><br>
  226. </fieldset>
  227. </div>
  228. <br>
  229. <br><br>
  230. <input type="submit" value="Save" id="send">
  231. </form>
  232. </div>
  233. </div>
  234. </div>
  235. <?php
  236. if ($logedin){
  237. include ("modules/lists.php");
  238. include ("modules/softmute.php");
  239. }
  240. ?>