Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TimWolla/6293636 to your computer and use it in GitHub Desktop.
Save TimWolla/6293636 to your computer and use it in GitHub Desktop.
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputDeviantart is an implementation of UserOptionOutput for the output of a user deviantart account.
*
* @author Sascha Ehrler
* @copyright 2013 Sascha Ehrler
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf.page.user.profile
* @subpackage data.user.option
* @category Community Framework
*/
class UserOptionOutputDeviantart implements UserOptionOutput, UserOptionOutputContactInformation {
// UserOptionOutput implementation
/**
* @see UserOptionOutput::getShortOutput()
*/
public function getShortOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value, 'S');
}
/**
* @see UserOptionOutput::getMediumOutput()
*/
public function getMediumOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value);
}
/**
* @see UserOptionOutput::getOutput()
*/
public function getOutput(User $user, $optionData, $value) {
if (!$value == '') {
return '<a href="'.$value.'.deviantart.com">'.$value.'</a>';
}
else {
return '';
}
}
// UserOptionOutputContactInformation implementation
/**
* @see UserOptionOutputContactInformation::getOutput()
*/
public function getOutputData(User $user, $optionData, $value) {
if (!$value == '') {
return array(
'icon' => StyleManager::getStyle()->getIconPath('deviantartM.png'),
'title' => 'deviantART',
'value' => $value,
'url' => $value.'.deviantart.com'
);
}
else {
return null;
}
}
/**
* Generates an image button.
*
* @see UserOptionOutput::getShortOutput()
*/
protected function getImage(User $user, $value, $imageSize = 'M') {
if (!$value == '') {
$url = $value.'.deviantart.com';
}
else {
return '';
}
$username = StringUtil::encodeHTML($user->username);
$title = 'deviantART-Profil von '.$username.' aurufen';
return '<a href="'.$url.'"><img src="'.StyleManager::getStyle()->getIconPath('deviantart'.$imageSize.'.png').'" alt="" title="'.$title.'" /></a>';
}
}
?>
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputNNID is an implementation of UserOptionOutput for the output of a user Nintendo Network ID.
*
* @author Sascha Ehrler
* @copyright 2013 Sascha Ehrler
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf.page.user.profile
* @subpackage data.user.option
* @category Community Framework
*/
class UserOptionOutputNNID implements UserOptionOutput, UserOptionOutputContactInformation {
// UserOptionOutput implementation
/**
* @see UserOptionOutput::getShortOutput()
*/
public function getShortOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value, 'S');
}
/**
* @see UserOptionOutput::getMediumOutput()
*/
public function getMediumOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value);
}
/**
* @see UserOptionOutput::getOutput()
*/
public function getOutput(User $user, $optionData, $value) {
if (!$value == '') {
return '<a href="">'.$value.'</a>';
}
else {
return '';
}
}
// UserOptionOutputContactInformation implementation
/**
* @see UserOptionOutputContactInformation::getOutput()
*/
public function getOutputData(User $user, $optionData, $value) {
if (!$value == '') {
return array(
'icon' => StyleManager::getStyle()->getIconPath('nnidM.png'),
'title' => 'Nintendo Network ID',
'value' => $value,
'url' => ''
);
}
else {
return null;
}
}
/**
* Generates an image button.
*
* @see UserOptionOutput::getShortOutput()
*/
protected function getImage(User $user, $value, $imageSize = 'M') {
if (!$value == '') {
$url = '';
}
else {
return '';
}
$title = 'Nintendo Network ID';
return '<a href="'.$url.'"><img src="'.StyleManager::getStyle()->getIconPath('nnid'.$imageSize.'.png').'" alt="" title="'.$title.'" /></a>';
}
}
?>
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputPokeOn is an implementation of UserOptionOutput for the output of a user pokemon online account.
*
* @author Sascha Ehrler
* @copyright 2013 Sascha Ehrler
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf.page.user.profile
* @subpackage data.user.option
* @category Community Framework
*/
class UserOptionOutputPokeOn implements UserOptionOutput, UserOptionOutputContactInformation {
// UserOptionOutput implementation
/**
* @see UserOptionOutput::getShortOutput()
*/
public function getShortOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value, 'S');
}
/**
* @see UserOptionOutput::getMediumOutput()
*/
public function getMediumOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value);
}
/**
* @see UserOptionOutput::getOutput()
*/
public function getOutput(User $user, $optionData, $value) {
if (!$value == '') {
return '<a href="http://www.pokemon-online.eu/">'.$value.'</a>';
}
else {
return '';
}
}
// UserOptionOutputContactInformation implementation
/**
* @see UserOptionOutputContactInformation::getOutput()
*/
public function getOutputData(User $user, $optionData, $value) {
if (!$value == '') {
return array(
'icon' => StyleManager::getStyle()->getIconPath('pokeonM.png'),
'title' => 'Pokémon Online',
'value' => $value,
'url' => 'http://www.pokemon-online.eu/'
);
}
else {
return null;
}
}
/**
* Generates an image button.
*
* @see UserOptionOutput::getShortOutput()
*/
protected function getImage(User $user, $value, $imageSize = 'M') {
if (!$value == '') {
$url = 'http://www.pokemon-online.eu/';
}
else {
return '';
}
$title = 'Gehe zur "Pokémon Online"-Homepage';
return '<a href="'.$url.'"><img src="'.StyleManager::getStyle()->getIconPath('pokeon'.$imageSize.'.png').'" alt="" title="'.$title.'" /></a>';
}
}
?>
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputYoutube is an implementation of UserOptionOutput for the output of a user youtube account.
*
* @author Sascha Ehrler
* @copyright 2013 Sascha Ehrler
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf.page.user.profile
* @subpackage data.user.option
* @category Community Framework
*/
class UserOptionOutputYoutube implements UserOptionOutput, UserOptionOutputContactInformation {
// UserOptionOutput implementation
/**
* @see UserOptionOutput::getShortOutput()
*/
public function getShortOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value, 'S');
}
/**
* @see UserOptionOutput::getMediumOutput()
*/
public function getMediumOutput(User $user, $optionData, $value) {
return $this->getImage($user, $value);
}
/**
* @see UserOptionOutput::getOutput()
*/
public function getOutput(User $user, $optionData, $value) {
if (!$value == '') {
return '<a href="http://www.youtube.com/user/'.$value.'">'.$value.'</a>';
}
else {
return '';
}
}
// UserOptionOutputContactInformation implementation
/**
* @see UserOptionOutputContactInformation::getOutput()
*/
public function getOutputData(User $user, $optionData, $value) {
if (!$value == '') {
return array(
'icon' => StyleManager::getStyle()->getIconPath('youtubeM.png'),
'title' => 'YouTube',
'value' => $value,
'url' => 'http://www.youtube.com/user/'.$value
);
}
else {
return null;
}
}
/**
* Generates an image button.
*
* @see UserOptionOutput::getShortOutput()
*/
protected function getImage(User $user, $value, $imageSize = 'M') {
if (!$value == '') {
$url = 'http://www.youtube.com/user/'.$value;
}
else {
return '';
}
$username = StringUtil::encodeHTML($user->username);
$title = 'YouTube-Profil von '.$username.' aurufen';
return '<a href="'.$url.'"><img src="'.StyleManager::getStyle()->getIconPath('youtube'.$imageSize.'.png').'" alt="" title="'.$title.'" /></a>';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment