070921 Sidebar Custom Hashtags

This commit is contained in:
daisuke 2021-09-07 19:07:04 -05:00
parent ddff7399ad
commit 7cdfd4e99e
8 changed files with 43 additions and 10 deletions

View File

@ -6,7 +6,7 @@ DashboardFE should work on a standard LAMP stack with the most common php extens
While the project works with a decent amount of stability, please note that it is still a work in progress, it can contain several not yet detected bugs or missing some features. The project it's in a constant state of change and improvement. While the project works with a decent amount of stability, please note that it is still a work in progress, it can contain several not yet detected bugs or missing some features. The project it's in a constant state of change and improvement.
If you wanna test it first to see if you like it you can check the testing instance here: http://ayanami.ga/dashboard If you wanna test it first to see if you like it you can check the testing instance here: http://hiroyuki-wiki.ga/dashboard
# Installation # Installation

View File

@ -93,7 +93,15 @@ if (isset($_POST['action']) && $_POST['action'] == "settings"){
$user_settings['mtwords'] = array(); $user_settings['mtwords'] = array();
$mtwords = explode("\n",$value); $mtwords = explode("\n",$value);
foreach ($mtwords as $word){ foreach ($mtwords as $word){
$user_settings['mtwords'][] = $word; $user_settings['mtwords'][] = sanitize($word);
}
break;
case "fhtags":
$user_settings['fhtags'] = array();
$fhtags = explode("\n",$value);
foreach ($fhtags as $word){
$user_settings['fhtags'][] = sanitize($word);
} }
break; break;
@ -276,6 +284,7 @@ foreach($_GET as $key => $value){
case "userinfo": case "userinfo":
$info = api_get("accounts/".htmlentities($value)); $info = api_get("accounts/".htmlentities($value));
$rel = api_get("accounts/relationships?id=".htmlentities($value)); $rel = api_get("accounts/relationships?id=".htmlentities($value));
/*
$photos = api_get("accounts/".htmlentities($value)."/statuses?only_media=true&limit=5&exclude_reblogs=true"); $photos = api_get("accounts/".htmlentities($value)."/statuses?only_media=true&limit=5&exclude_reblogs=true");
$photo = array(); $photo = array();
$c = 0; $c = 0;
@ -294,6 +303,7 @@ foreach($_GET as $key => $value){
} }
} }
} }
*/
echo "<div class='userinfo_he' style='background-color:#".averageColor($info['avatar'])."; background-size:cover;" . (!empty($info['header']) ? "background-image:url(".$info['header'].");" : "") . "'> echo "<div class='userinfo_he' style='background-color:#".averageColor($info['avatar'])."; background-size:cover;" . (!empty($info['header']) ? "background-image:url(".$info['header'].");" : "") . "'>
<span style='margin:5px; display:inline-block;'> <span style='margin:5px; display:inline-block;'>
@ -307,12 +317,15 @@ foreach($_GET as $key => $value){
<span style='width:290; height:30px; display:block; margin-top:10px;'> <span style='width:290; height:30px; display:block; margin-top:10px;'>
".($logedin ? "<span id='".$info['id']."' class='profileButton ".(($rel[0]['following'] || $rel[0]['requested']) ? "unfollow" : "follow" )."'>".($rel[0]['following'] || $rel[0]['requested'] ? "Following" : "Follow" )."</span>" : "")." ".($logedin ? "<span id='".$info['id']."' class='profileButton ".(($rel[0]['following'] || $rel[0]['requested']) ? "unfollow" : "follow" )."'>".($rel[0]['following'] || $rel[0]['requested'] ? "Following" : "Follow" )."</span>" : "")."
<span id='".$info['id']."' class='profileButton ".(in_array($info['id'],$user_settings['nsfw']) ? "unnsfw" : "nsfw" )."'>".(in_array($info['id'],$user_settings['nsfw']) ? "NSFW <span class='fontello'>&#xf205;</span>" : "NSFW <span class='fontello'>&#xf204;</span>" )."</span> <span id='".$info['id']."' class='profileButton ".(in_array($info['id'],$user_settings['nsfw']) ? "unnsfw" : "nsfw" )."'>".(in_array($info['id'],$user_settings['nsfw']) ? "NSFW <span class='fontello'>&#xf205;</span>" : "NSFW <span class='fontello'>&#xf204;</span>" )."</span>
".($logedin ? "<span id='" . $info['id'] . "' class='profileButton " . ($rel[0]['muting'] ? "un" : "") . "mute'>" . ($rel[0]['muting'] ? "&#xe81a; Unmute" : "&#xe81b; Mute") . "</span>" : "")." ".($logedin ? "<span id='" . $info['id'] . "' class='profileButton " . ($rel[0]['muting'] ? "un" : "") . "mute'>" . ($rel[0]['muting'] ? "&#xe81a; Unmute" : "&#xe81b; Mute") . "</span>" : "")."<br>
</span> </span>
" . ($rel[0]['followed_by'] ? "<span class='profileButton' width:290; height:25px; display:inline-block; margin-top:5px; style='background-color: rgba(255,255,255,.5);'>&#xe80c; Follows You</span>" : "") . "
<div style='display:flex; width:280px'>"; <div style='display:flex; width:280px'>";
/*
foreach ($photo as $elem){ foreach ($photo as $elem){
echo "<div style='overflow:hidden; display:block; height:90px; flex:1; background-image:url(\"".$elem['url']."\"); ".(isset($elem['s']) ? "filter: blur(5px);" : "")." background-size:cover; margin:2px;'></div>"; echo "<div style='overflow:hidden; display:block; height:90px; flex:1; background-image:url(\"".$elem['url']."\"); ".(isset($elem['s']) ? "filter: blur(5px);" : "")." background-size:cover; margin:2px;'></div>";
} }
*/
echo "</div> echo "</div>
</div> </div>
"; ";

View File

@ -1,3 +0,0 @@
Array
(
)

View File

@ -11,7 +11,7 @@
} else { } else {
$user_settings['replies'] = "off"; $user_settings['replies'] = "off";
$user_settings['attach'] = "on"; $user_settings['attach'] = "on";
$user_settings['instance'] = "mastodon.social"; $user_settings['instance'] = "fedi.absturztau.be";
$user_settings['text'] = "off"; $user_settings['text'] = "off";
$user_settings['reblog'] = "off"; $user_settings['reblog'] = "off";
$user_settings['videoloop'] = "off"; $user_settings['videoloop'] = "off";

View File

@ -30,6 +30,18 @@ if ($logedin || $tl['mode'] == 'user') {
} }
echo "</ul> echo "</ul>
</div> </div>
<div class='side_element' style='margin-top:20px; margin-left:0px; width:100%;'>
<ul>
";
foreach($user_settings['fhtags'] as $word){
if ($word != ""){
echo "<a href='?tag=" . $word . "' class='ldr'><li><b>#</b> " . $word . "</li></a>";
}
}
echo "
</ul>
</div>
"; ";
} }
if ($logedin) { if ($logedin) {

View File

@ -67,6 +67,7 @@
<input type='radio' name='reblog' id='reblogOff' value='off' style='display:none;' <?php echo ($user_settings['reblog'] == 'off' ? "checked" : ""); ?>> <input type='radio' name='reblog' id='reblogOff' value='off' style='display:none;' <?php echo ($user_settings['reblog'] == 'off' ? "checked" : ""); ?>>
<label for='reblogOff'>No</label> <label for='reblogOff'>No</label>
</div> </div>
<br><br> <br><br>
<h2>Muted words</h2> <h2>Muted words</h2>
<span>One per line</span> <span>One per line</span>
@ -77,6 +78,16 @@
} }
?></textarea> ?></textarea>
</div> </div>
<h2>Followed hashtags</h2>
<span>One per line</span>
<div class='setting'>
<textarea name='fhtags' style='width:85%;'><?php
foreach($user_settings['fhtags'] as $word){
echo (empty($word) ? "" : trim($word)."\n");
}
?></textarea>
</div>
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@ -7,7 +7,7 @@
<br> <br>
<p>Dashboard FE (#DashFE for short) is a third-party client or fronted for Pleroma and Mastodon servers, writen in PHP, which design inspires on the look and feel of the Tumblr user dashboard. This frontend puts special emphasis on displaying posts with attached media, being images, video or music.</p> <p>Dashboard FE (#DashFE for short) is a third-party client or fronted for Pleroma and Mastodon servers, writen in PHP, which design inspires on the look and feel of the Tumblr user dashboard. This frontend puts special emphasis on displaying posts with attached media, being images, video or music.</p>
<p>Currently a work in progress, #DashFE is being developed by <a href='https://stereophonic.space/daisuke' target='_blank' class='link' style='font-weight:bold;'>Daisuke</a> and it's in a constant state of change, so features present may change or improve over time.</p> <p>Currently a work in progress, #DashFE is being developed by <a href='https://gameliberty.club/@hideki' target='_blank' class='link' style='font-weight:bold;'>@hideki@gameliberty.club</a> and it's in a constant state of change, so features present may change or improve over time.</p>
<p>The source code of the project is currently being hosted at https://notabug.org/daisuke/DashboardFE</p> <p>The source code of the project is currently being hosted at https://notabug.org/daisuke/DashboardFE</p>

View File

@ -7,9 +7,9 @@ $setting['appname'] = "Dashboard FE";
$setting['url'] = "https://your.url/dashboard"; $setting['url'] = "https://your.url/dashboard";
//Short description //Short description
$setting['description'] = "<p>Dashboard FE (or DashFE if you like it) it's a third party client/frontend for Pleroma and Mastodon that tries to mimic the look and feel of the Tumblr user dashboard, putting big emphasis in a timeline filled by media of all types</p> <p>Currently a Work in Progress, DashFE can actually be used but it's very possible that there are still rough edges, missing features and stuff that needs to be corrected and/or optimized. Issues, suggestion or sugerences please contact <b>@daisuke@stereophonic.space</b> via your favorite fediverse account.</p><p>Thank You</p>"; $setting['description'] = "<p>Dashboard FE (or DashFE if you like it) it's a third party client/frontend for Pleroma and Mastodon that tries to mimic the look and feel of the Tumblr user dashboard, putting big emphasis in a timeline filled by media of all types</p> <p>Currently a Work in Progress, DashFE can actually be used but it's very possible that there are still rough edges, missing features and stuff that needs to be corrected and/or optimized. Issues, suggestion or sugerences please contact <b>@hideki@gameliberty.club</b> via your favorite fediverse account.</p><p>Thank You</p>";
//Locked Instance //Locked Instance
//If you prefer your instance of DashboardFE to be locked to a certain fediverse server (your own server, for example) and prevent it's use on another sites, just uncomment the following line and put the url of the desired server //If you prefer your instance of DashboardFE to be locked to a certain fediverse server (your own server, for example) and prevent it's use on another fediverse server, just uncomment the following line and put the url of the desired server
//$setting['lockedto'] = "your.url/dir"; //$setting['lockedto'] = "your.url/dir";
?> ?>