From 7cdfd4e99e942f664679fb58ba1d082a520d6409 Mon Sep 17 00:00:00 2001 From: daisuke Date: Tue, 7 Sep 2021 19:07:04 -0500 Subject: [PATCH] 070921 Sidebar Custom Hashtags --- README.md | 2 +- action.php | 17 +++++++++++++++-- array.txt | 3 --- include/init.php | 2 +- layout/sidebar.php | 12 ++++++++++++ modules/settings.php | 11 +++++++++++ pages/about.php | 2 +- settings.php | 4 ++-- 8 files changed, 43 insertions(+), 10 deletions(-) delete mode 100644 array.txt diff --git a/README.md b/README.md index 4fe6ad8..7c12f8c 100644 --- a/README.md +++ b/README.md @@ -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. -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 diff --git a/action.php b/action.php index b6701fa..dd8cf62 100644 --- a/action.php +++ b/action.php @@ -93,7 +93,15 @@ if (isset($_POST['action']) && $_POST['action'] == "settings"){ $user_settings['mtwords'] = array(); $mtwords = explode("\n",$value); 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; @@ -276,6 +284,7 @@ foreach($_GET as $key => $value){ case "userinfo": $info = api_get("accounts/".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"); $photo = array(); $c = 0; @@ -294,6 +303,7 @@ foreach($_GET as $key => $value){ } } } + */ echo "
@@ -307,12 +317,15 @@ foreach($_GET as $key => $value){ ".($logedin ? "".($rel[0]['following'] || $rel[0]['requested'] ? "Following" : "Follow" )."" : "")." ".(in_array($info['id'],$user_settings['nsfw']) ? "NSFW " : "NSFW " )." - ".($logedin ? "" . ($rel[0]['muting'] ? " Unmute" : " Mute") . "" : "")." + ".($logedin ? "" . ($rel[0]['muting'] ? " Unmute" : " Mute") . "" : "")."
+ " . ($rel[0]['followed_by'] ? " Follows You" : "") . "
"; + /* foreach ($photo as $elem){ echo "
"; } + */ echo "
"; diff --git a/array.txt b/array.txt deleted file mode 100644 index dcdaeab..0000000 --- a/array.txt +++ /dev/null @@ -1,3 +0,0 @@ -Array -( -) diff --git a/include/init.php b/include/init.php index 0a8182d..8ed0c52 100644 --- a/include/init.php +++ b/include/init.php @@ -11,7 +11,7 @@ } else { $user_settings['replies'] = "off"; $user_settings['attach'] = "on"; - $user_settings['instance'] = "mastodon.social"; + $user_settings['instance'] = "fedi.absturztau.be"; $user_settings['text'] = "off"; $user_settings['reblog'] = "off"; $user_settings['videoloop'] = "off"; diff --git a/layout/sidebar.php b/layout/sidebar.php index b3792c5..67e91e0 100644 --- a/layout/sidebar.php +++ b/layout/sidebar.php @@ -30,6 +30,18 @@ if ($logedin || $tl['mode'] == 'user') { } echo " + +
+ +
"; } if ($logedin) { diff --git a/modules/settings.php b/modules/settings.php index 8af6dcf..b137177 100644 --- a/modules/settings.php +++ b/modules/settings.php @@ -67,6 +67,7 @@ > +

Muted words

One per line @@ -77,6 +78,16 @@ } ?> + +

Followed hashtags

+ One per line +
+ +
diff --git a/pages/about.php b/pages/about.php index 18b223e..8b54ef1 100644 --- a/pages/about.php +++ b/pages/about.php @@ -7,7 +7,7 @@

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.

-

Currently a work in progress, #DashFE is being developed by Daisuke and it's in a constant state of change, so features present may change or improve over time.

+

Currently a work in progress, #DashFE is being developed by @hideki@gameliberty.club and it's in a constant state of change, so features present may change or improve over time.

The source code of the project is currently being hosted at https://notabug.org/daisuke/DashboardFE

diff --git a/settings.php b/settings.php index 10162f2..fadc568 100644 --- a/settings.php +++ b/settings.php @@ -7,9 +7,9 @@ $setting['appname'] = "Dashboard FE"; $setting['url'] = "https://your.url/dashboard"; //Short description -$setting['description'] = "

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

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 @daisuke@stereophonic.space via your favorite fediverse account.

Thank You

"; +$setting['description'] = "

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

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 @hideki@gameliberty.club via your favorite fediverse account.

Thank You

"; //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"; ?>