add telegram support #1565

This commit is contained in:
Diego Najar 2024-06-30 21:48:29 +02:00
parent 4bfa4a74a9
commit 437190fcbb
10 changed files with 331 additions and 235 deletions

View file

@ -268,6 +268,15 @@
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name' => 'telegram',
'label' => 'Telegram',
'value' => $user->telegram(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name' => 'mastodon',
'label' => 'Mastodon',

View file

@ -34,4 +34,4 @@ echo '
echo '</form>';
echo '<p class="mt-3 text-right">' . $L->g('Powered by Bludit') . ((defined('BLUDIT_PRO')) ? ' PRO' : '') . '</p>'
echo '<p class="mt-3 text-right">' . $L->g('Powered by Bludit') . ((defined('BLUDIT_PRO')) ? ' PRO' : '') . '</p>';

View file

@ -415,6 +415,15 @@ echo Bootstrap::formInputHidden(array(
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name' => 'telegram',
'label' => 'Telegram',
'value' => $site->telegram(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name' => 'mastodon',
'label' => 'Mastodon',

View file

@ -1,6 +1,7 @@
<?php
class Theme {
class Theme
{
public static function socialNetworks()
{
@ -14,6 +15,7 @@ class Theme {
'codepen' => 'Codepen',
'linkedin' => 'Linkedin',
'xing' => 'Xing',
'telegram' => 'Telegram',
'mastodon' => 'Mastodon',
'vk' => 'VK',
'dribbble' => 'Dribbble'
@ -120,7 +122,6 @@ class Theme {
} catch (Exception $e) {
// Tag doesn't exist
}
} elseif ($WHERE_AM_I == 'category') {
try {
$categoryKey = $url->slug();
@ -279,5 +280,4 @@ class Theme {
// https://github.com/psfpro/bootstrap-html5sortable
return '<script ' . $attributes . ' src="' . DOMAIN_CORE_JS . 'jquery.sortable.min.js?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
}
}

View file

@ -32,6 +32,7 @@ class Site extends dbJSON
'gitlab' => '',
'linkedin' => '',
'xing' => '',
'telegram' => '',
'mastodon' => '',
'dribbble' => '',
'vk' => '',
@ -193,6 +194,11 @@ class Site extends dbJSON
return $this->getField('xing');
}
public function telegram()
{
return $this->getField('telegram');
}
public function mastodon()
{
return $this->getField('mastodon');

View file

@ -1,6 +1,7 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class User {
class User
{
protected $vars;
function __construct($username)
@ -145,6 +146,11 @@ class User {
return $this->getValue('xing');
}
public function telegram()
{
return $this->getValue('xing');
}
public function mastodon()
{
return $this->getValue('mastodon');
@ -179,6 +185,7 @@ class User {
$tmp['gitlab'] = $this->gitlab();
$tmp['linkedin'] = $this->linkedin();
$tmp['xing'] = $this->xing();
$tmp['telegram'] = $this->telegram();
$tmp['mastodon'] = $this->mastodon();
$tmp['vk'] = $this->vk();
$tmp['profilePicture'] = $this->profilePicture();
@ -189,5 +196,4 @@ class User {
return json_encode($tmp);
}
}

View file

@ -0,0 +1,32 @@
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 512 512" xml:space="preserve">
<path style="fill:#E1E1E3;" d="M483.643,42.893L18.751,222.234c-11.472,4.424-11.372,20.667,0.133,24.978l113.278,42.279
l43.845,141.006c2.806,9.031,13.849,12.369,21.179,6.377l63.142-51.475c6.618-5.393,16.046-5.662,22.963-0.641l113.887,82.685
c7.841,5.699,18.949,1.402,20.917-8.072l83.428-401.305C503.668,47.715,493.499,39.082,483.643,42.893z M395.044,136.412
L221.27,297.943c-6.108,5.686-10.048,13.295-11.164,21.553l-5.92,43.868c-0.784,5.858-9.012,6.439-10.628,0.77l-22.766-79.994
c-2.608-9.124,1.192-18.87,9.263-23.851l210.561-129.684C394.4,128.281,398.293,133.398,395.044,136.412z"/>
<g>
<path style="fill:#A0A0A1;" d="M405.003,480.205c-4.892,0-9.726-1.533-13.823-4.511l-113.882-82.681
c-3.166-2.299-7.496-2.178-10.528,0.295l-63.14,51.473c-6.056,4.953-14.159,6.566-21.66,4.31
c-7.506-2.258-13.377-8.077-15.703-15.566l-42.359-136.225L15.317,256.77C6.056,253.299,0.048,244.678,0,234.804
c-0.047-9.865,5.873-18.534,15.08-22.085L479.972,33.377c8.041-3.106,17.12-1.571,23.698,4.005
c6.587,5.584,9.589,14.303,7.838,22.755L428.08,461.446c-1.63,7.85-7.073,14.268-14.56,17.163
C410.753,479.679,407.868,480.205,405.003,480.205z M272.231,370.973c5.976,0,11.962,1.835,17.052,5.531l113.887,82.685
c1.212,0.881,2.397,0.624,2.997,0.393c0.596-0.23,1.64-0.833,1.942-2.284L491.536,55.99c0.33-1.592-0.519-2.593-1.054-3.047
c-0.531-0.451-1.648-1.121-3.159-0.538c-0.003,0.001-0.006,0.002-0.008,0.003L22.423,231.751c-1.68,0.648-2.028,1.964-2.023,2.955
c0.005,0.999,0.366,2.321,2.062,2.957l113.265,42.275c2.956,1.104,5.235,3.514,6.173,6.527l43.845,141.006
c0.434,1.396,1.501,1.906,2.099,2.086c0.595,0.178,1.761,0.343,2.885-0.577l63.154-51.485
C259.204,373.158,265.712,370.973,272.231,370.973z M198.75,378.286c-6.985,0-13.054-4.534-14.999-11.355l-22.768-80
c-3.839-13.438,1.8-27.967,13.716-35.323l210.569-129.69c6.121-3.759,13.996-2.284,18.329,3.425
c4.328,5.702,3.633,13.675-1.618,18.545L228.214,305.413c-4.359,4.058-7.204,9.548-8.001,15.45l-5.92,43.866
c-0.992,7.412-6.901,12.974-14.367,13.515C199.532,378.272,199.139,378.286,198.75,378.286z M339.662,173.966l-154.258,95.007
c-4.17,2.573-6.148,7.661-4.805,12.365l16.527,58.072l2.871-21.278c1.428-10.566,6.515-20.387,14.323-27.655L339.662,173.966z"/>
<path style="fill:#A0A0A1;" d="M423.776,279.45c-0.717,0-1.444-0.075-2.174-0.234c-5.505-1.195-8.999-6.627-7.804-12.131l1.55-7.14
c1.195-5.505,6.626-9,12.131-7.804c5.505,1.195,8.999,6.627,7.804,12.131l-1.55,7.14
C432.697,276.188,428.471,279.45,423.776,279.45z"/>
<path style="fill:#A0A0A1;" d="M391.668,427.341c-0.717,0-1.444-0.075-2.174-0.234c-5.504-1.195-8.998-6.627-7.803-12.131
l23.459-108.051c1.194-5.505,6.62-8.999,12.132-7.804c5.504,1.195,8.998,6.627,7.803,12.131l-23.459,108.051
C400.588,424.08,396.363,427.341,391.668,427.341z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -0,0 +1,32 @@
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 512 512" xml:space="preserve">
<path style="fill:#E1E1E3;" d="M483.643,42.893L18.751,222.234c-11.472,4.424-11.372,20.667,0.133,24.978l113.278,42.279
l43.845,141.006c2.806,9.031,13.849,12.369,21.179,6.377l63.142-51.475c6.618-5.393,16.046-5.662,22.963-0.641l113.887,82.685
c7.841,5.699,18.949,1.402,20.917-8.072l83.428-401.305C503.668,47.715,493.499,39.082,483.643,42.893z M395.044,136.412
L221.27,297.943c-6.108,5.686-10.048,13.295-11.164,21.553l-5.92,43.868c-0.784,5.858-9.012,6.439-10.628,0.77l-22.766-79.994
c-2.608-9.124,1.192-18.87,9.263-23.851l210.561-129.684C394.4,128.281,398.293,133.398,395.044,136.412z"/>
<g>
<path style="fill:#A0A0A1;" d="M405.003,480.205c-4.892,0-9.726-1.533-13.823-4.511l-113.882-82.681
c-3.166-2.299-7.496-2.178-10.528,0.295l-63.14,51.473c-6.056,4.953-14.159,6.566-21.66,4.31
c-7.506-2.258-13.377-8.077-15.703-15.566l-42.359-136.225L15.317,256.77C6.056,253.299,0.048,244.678,0,234.804
c-0.047-9.865,5.873-18.534,15.08-22.085L479.972,33.377c8.041-3.106,17.12-1.571,23.698,4.005
c6.587,5.584,9.589,14.303,7.838,22.755L428.08,461.446c-1.63,7.85-7.073,14.268-14.56,17.163
C410.753,479.679,407.868,480.205,405.003,480.205z M272.231,370.973c5.976,0,11.962,1.835,17.052,5.531l113.887,82.685
c1.212,0.881,2.397,0.624,2.997,0.393c0.596-0.23,1.64-0.833,1.942-2.284L491.536,55.99c0.33-1.592-0.519-2.593-1.054-3.047
c-0.531-0.451-1.648-1.121-3.159-0.538c-0.003,0.001-0.006,0.002-0.008,0.003L22.423,231.751c-1.68,0.648-2.028,1.964-2.023,2.955
c0.005,0.999,0.366,2.321,2.062,2.957l113.265,42.275c2.956,1.104,5.235,3.514,6.173,6.527l43.845,141.006
c0.434,1.396,1.501,1.906,2.099,2.086c0.595,0.178,1.761,0.343,2.885-0.577l63.154-51.485
C259.204,373.158,265.712,370.973,272.231,370.973z M198.75,378.286c-6.985,0-13.054-4.534-14.999-11.355l-22.768-80
c-3.839-13.438,1.8-27.967,13.716-35.323l210.569-129.69c6.121-3.759,13.996-2.284,18.329,3.425
c4.328,5.702,3.633,13.675-1.618,18.545L228.214,305.413c-4.359,4.058-7.204,9.548-8.001,15.45l-5.92,43.866
c-0.992,7.412-6.901,12.974-14.367,13.515C199.532,378.272,199.139,378.286,198.75,378.286z M339.662,173.966l-154.258,95.007
c-4.17,2.573-6.148,7.661-4.805,12.365l16.527,58.072l2.871-21.278c1.428-10.566,6.515-20.387,14.323-27.655L339.662,173.966z"/>
<path style="fill:#A0A0A1;" d="M423.776,279.45c-0.717,0-1.444-0.075-2.174-0.234c-5.505-1.195-8.999-6.627-7.804-12.131l1.55-7.14
c1.195-5.505,6.626-9,12.131-7.804c5.505,1.195,8.999,6.627,7.804,12.131l-1.55,7.14
C432.697,276.188,428.471,279.45,423.776,279.45z"/>
<path style="fill:#A0A0A1;" d="M391.668,427.341c-0.717,0-1.444-0.075-2.174-0.234c-5.504-1.195-8.998-6.627-7.803-12.131
l23.459-108.051c1.194-5.505,6.62-8.999,12.132-7.804c5.504,1.195,8.998,6.627,7.803,12.131l-23.459,108.051
C400.588,424.08,396.363,427.341,391.668,427.341z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -396,6 +396,7 @@ function install($adminPassword, $timezone)
'gitlab' => '',
'linkedin' => '',
'xing' => '',
'telegram' => '',
'dateFormat' => 'F j, Y',
'extremeFriendly' => true,
'autosaveInterval' => 2,
@ -432,6 +433,7 @@ function install($adminPassword, $timezone)
'codepen' => '',
'linkedin' => '',
'xing' => '',
'telegram' => '',
'github' => '',
'gitlab' => ''
)