Skip to content

Commit

Permalink
Add social logos
Browse files Browse the repository at this point in the history
Add social logos and new social links.
  • Loading branch information
danpros committed Feb 26, 2024
1 parent 1c15ddd commit 04d306a
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 33 deletions.
34 changes: 18 additions & 16 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2023 Danang Probo Sayekti.
Copyright (c) 2014-2024 Danang Probo Sayekti.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -21,35 +21,37 @@ license, including:
Dispatch - (c) 2014 Jesus A. Domingo <[email protected]>

Composer - (c) 2011 Nils Adermann, Jordi Boggiano

PHP Markdown & Extra - (c) 2004-2009 Michel Fortin

Markdown - (c) 2003-2006 John Gruber

RSSWriter - (c) Suin <https://github.com/suin>

Showdown code - (c) 2007 John Fraser

Pagedown modifications and bugfixes - (c) 2009 Dana Robinson

Pagedown modifications and bugfixes - (c) 2009-2013 Stack Exchange Inc.

jQuery - (c) The jQuery Foundation

jQuery UI - (c) The jQuery Foundation

Hub Updater - (c) Kanti.de <https://github.com/Kanti>

Password Compat - (c) Anthony Ferrara <https://github.com/ircmaxell>

URLify for PHP by jbroadway <https://github.com/jbroadway> based on URLify.js - (c) Django Software Foundation and individual contributors

Twenty Fifteen & Twenty Sixteen theme - (c) WordPress.org & Automattic.com

Bootstrap - Copyright 2011-2019 The Bootstrap Authors <https://github.com/twbs/bootstrap/graphs/contributors>

AdminLTE - Copyright 2014-2020 Colorlib <http://colorlib.com>

Font Awesome - @davegandy <http://fontawesome.io>

Nestable jQuery Plugin - Copyright (c) 2012 David Bushell <http://dbushell.com>

Nestable jQuery Plugin - Copyright (c) 2012 David Bushell <http://dbushell.com>

Social Logos - (c) Automattic
40 changes: 35 additions & 5 deletions system/admin/views/config-widget.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<div class="form-group row">
<label for="toc.label" class="col-sm-2 col-form-label">TOC label</label>
<div class="col-sm-10">
<input type="text" name="-config-toc.label" class="form-control" id="toc.label" value="<?php if(is_null(config('toc.label'))) {echo 'Table of Contents ';} else {echo config('toc.label');};?>" placeholder="Table of Contents">
<input type="text" name="-config-toc.label" class="form-control" id="toc.label" value="<?php if(is_null(config('toc.label'))) {echo 'Table of Contents';} else {echo config('toc.label');};?>" placeholder="Table of Contents">
</div>
</div>
<div class="form-group row">
Expand Down Expand Up @@ -233,15 +233,45 @@
<h4><?php echo i18n('Social_Media');?></h4>
<hr>
<div class="form-group row">
<label for="google.reCaptcha.private" class="col-sm-2 col-form-label"><?php echo i18n('Twitter_account');?></label>
<label for="social.twitter" class="col-sm-2 col-form-label">Twitter</label>
<div class="col-sm-10">
<input type="text" name="-config-social.twitter" class="form-control" id="social.twitter" value="<?php echo valueMaker(config('social.twitter'));?>" placeholder="https://twitter.com/gohtmly">
<input type="text" name="-config-social.twitter" class="form-control" id="social.twitter" value="<?php echo config('social.twitter');?>" placeholder="https://twitter.com/gohtmly">
</div>
</div>
<div class="form-group row">
<label for="google.reCaptcha.private" class="col-sm-2 col-form-label"><?php echo i18n('Facebook_page');?></label>
<label for="social.facebook" class="col-sm-2 col-form-label">Facebook</label>
<div class="col-sm-10">
<input type="text" name="-config-social.facebook" class="form-control" id="social.facebook" value="<?php echo valueMaker(config('social.facebook'));?>" placeholder="https://www.facebook.com/gohtmly">
<input type="text" name="-config-social.facebook" class="form-control" id="social.facebook" value="<?php echo config('social.facebook');?>" placeholder="https://www.facebook.com/gohtmly">
</div>
</div>
<div class="form-group row">
<label for="social.instagram" class="col-sm-2 col-form-label">Instagram</label>
<div class="col-sm-10">
<input type="text" name="-config-social.instagram" class="form-control" id="social.instagram" value="<?php echo config('social.instagram');?>" placeholder="https://www.instagram.com/username">
</div>
</div>
<div class="form-group row">
<label for="social.linkedin" class="col-sm-2 col-form-label">Linkedin</label>
<div class="col-sm-10">
<input type="text" name="-config-social.linkedin" class="form-control" id="social.linkedin" value="<?php echo config('social.linkedin');?>" placeholder="https://www.linkedin.com/in/username">
</div>
</div>
<div class="form-group row">
<label for="social.github" class="col-sm-2 col-form-label">Github</label>
<div class="col-sm-10">
<input type="text" name="-config-social.github" class="form-control" id="social.github" value="<?php echo config('social.github');?>" placeholder="https://github.com/username">
</div>
</div>
<div class="form-group row">
<label for="social.mastodon" class="col-sm-2 col-form-label">Mastodon</label>
<div class="col-sm-10">
<input type="text" name="-config-social.mastodon" class="form-control" id="social.mastodon" value="<?php echo config('social.mastodon');?>" placeholder="https://mastodon.social/@username">
</div>
</div>
<div class="form-group row">
<label for="social.tiktok" class="col-sm-2 col-form-label">TikTok</label>
<div class="col-sm-10">
<input type="text" name="-config-social.tiktok" class="form-control" id="social.tiktok" value="<?php echo config('social.tiktok');?>" placeholder="https://tiktok.com/@username">
</div>
</div>
<div class="form-group row">
Expand Down
6 changes: 6 additions & 0 deletions system/configList.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"blog.enable",
"social.twitter",
"social.facebook",
"social.instagram",
"social.linkedin",
"social.github",
"social.youtube",
"social.mastodon",
"social.tiktok",
"breadcrumb.home",
"comment.system",
"fb.appid",
Expand Down
6 changes: 6 additions & 0 deletions system/htmly.php
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,9 @@
}
save_config($new_config, $new_Keys);
$login = site_url() . 'admin/config';
foreach (glob('cache/widget/archive*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
header("location: $login");
} else {
$login = site_url() . 'login';
Expand Down Expand Up @@ -1539,6 +1542,9 @@
}
save_config($new_config, $new_Keys);
$login = site_url() . 'admin/config/widget';
foreach (glob('cache/widget/tags*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
header("location: $login");
} else {
$login = site_url() . 'login';
Expand Down
48 changes: 36 additions & 12 deletions system/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2321,32 +2321,56 @@ function tab($p)
return $tab;
}

// Social links. Deprecated
function social($imgDir = null)
// Social links
function social($class = null)
{
$twitter = config('social.twitter');
$facebook = config('social.facebook');
$tumblr = config('social.tumblr');
$instagram = config('social.instagram');
$linkedin = config('social.linkedin');
$github = config('social.github');
$youtube = config('social.youtube');
$mastodon = config('social.mastodon');
$tiktok = config('social.tiktok');
$rss = site_url() . 'feed/rss';
$social = '';

if ($imgDir === null) {
$imgDir = "readable/img/";
}

$social .= '<div class="social-logo ' . $class . '">';
$social .= '<link rel="stylesheet" id="social-logo-style" href="'. site_url() .'system/resources/css/social-logos.css" type="text/css" media="all">';
if (!empty($twitter)) {
$social .= '<a href="' . $twitter . '" target="_blank"><img src="' . site_url() . 'themes/' . $imgDir . 'twitter.png" width="32" height="32" alt="Twitter"/></a>';
$social .= '<a class="social-logo-twitter-alt" href="' . $twitter . '" target="_blank"><span class="screen-reader-text">Twitter</span></a>';
}

if (!empty($facebook)) {
$social .= '<a href="' . $facebook . '" target="_blank"><img src="' . site_url() . 'themes/' . $imgDir . 'facebook.png" width="32" height="32" alt="Facebook"/></a>';
$social .= '<a class="social-logo-facebook" href="' . $facebook . '" target="_blank"><span class="screen-reader-text">Facebook</span></a>';
}

if (!empty($instagram)) {
$social .= '<a class="social-logo-instagram" href="' . $instagram . '" target="_blank"><span class="screen-reader-text">Instagram</span></a>';
}

if (!empty($tumblr)) {
$social .= '<a href="' . $tumblr . '" target="_blank"><img src="' . site_url() . 'themes/' . $imgDir . 'tumblr.png" width="32" height="32" alt="Tumblr"/></a>';
if (!empty($linkedin)) {
$social .= '<a class="social-logo-linkedin" href="' . $linkedin . '" target="_blank"><span class="screen-reader-text">Linkedin</span></a>';
}

if (!empty($github)) {
$social .= '<a class="social-logo-github" href="' . $github . '" target="_blank"><span class="screen-reader-text">Github</span></a>';
}

if (!empty($youtube)) {
$social .= '<a class="social-logo-youtube" href="' . $youtube . '" target="_blank"><span class="screen-reader-text">Youtube</span></a>';
}

if (!empty($mastodon)) {
$social .= '<a class="social-logo-mastodon" href="' . $mastodon . '" target="_blank"><span class="screen-reader-text">Instagram</span></a>';
}

if (!empty($tiktok)) {
$social .= '<a class="social-logo-tiktok" href="' . $tiktok . '" target="_blank"><span class="screen-reader-text">Instagram</span></a>';
}

$social .= '<a href="' . $rss . '" target="_blank"><img src="' . site_url() . 'themes/' . $imgDir . 'rss.png" width="32" height="32" alt="RSS Feed"/></a>';
$social .= '<a class="social-logo-feed" href="' . $rss . '" target="_blank"><span class="screen-reader-text">RSS</span></a>';
$social .= '</div>';
return $social;
}

Expand Down
Loading

0 comments on commit 04d306a

Please sign in to comment.