koblog/bl-kernel/social.class.php
2025-07-02 20:43:55 +02:00

22 lines
No EOL
543 B
PHP

<?php defined('KOBLOG') or die('Koblog CMS.');
class Social {
public $slug;
public $url;
public $emoji;
public $name;
function __construct($name, $url)
{
$this->name = $name;
$this->slug = Text::cleanUrl($name);
$this->emoji = $GLOBALS['SOCIAL_NETWORKS_EMOJI'][$this->slug];
$this->url = $url;
}
function getLink($useEmoji = false) {
return "<a href='". $this->url ."' rel='me'>".($useEmoji ? '<span aria-hidden="true">'.$this->emoji."</span>" : ""). " " . $this->name."</a>";
}
}