Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move plus from svn to github

  • Loading branch information...
commit b720f73272e4c8c5910d56b66300cce31361ad7d 0 parents
@torbenbrodt authored
11 de-informal.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "http://www.woltlab.com/DTDs/language.dtd">
+<language languagecode="de-informal">
+ <category name="wcf.googleplus">
+ <item name="wcf.googleplus.add"><![CDATA[Folge mir bei]]></item>
+ </category>
+ <category name="wcf.user.option">
+ <item name="wcf.user.option.googleplus"><![CDATA[Google+]]></item>
+ <item name="wcf.user.option.googleplus.description"><![CDATA[Geben Sie ihre Google+ ID ein (URL zur Profilseite).]]></item>
+ </category>
+</language>
11 de.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "http://www.woltlab.com/DTDs/language.dtd">
+<language languagecode="de">
+ <category name="wcf.googleplus">
+ <item name="wcf.googleplus.add"><![CDATA[Folge mir bei]]></item>
+ </category>
+ <category name="wcf.user.option">
+ <item name="wcf.user.option.googleplus"><![CDATA[Google+]]></item>
+ <item name="wcf.user.option.googleplus.description"><![CDATA[Geben Sie ihre Google+ ID ein (URL zur Profilseite).]]></item>
+ </category>
+</language>
11 en.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "http://www.woltlab.com/DTDs/language.dtd">
+<language languagecode="en">
+ <category name="wcf.googleplus">
+ <item name="wcf.googleplus.add"><![CDATA[Add me on]]></item>
+ </category>
+ <category name="wcf.user.option">
+ <item name="wcf.user.option.googleplus"><![CDATA[Google+]]></item>
+ <item name="wcf.user.option.googleplus.description"><![CDATA[Enter your Google+ ID here (URL to profile page).]]></item>
+ </category>
+</language>
12 eventlistener.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE data SYSTEM "http://www.woltlab.com/DTDs/eventListeners.dtd">
+<data>
+ <import>
+ <eventlistener>
+ <eventclassname>UserPage</eventclassname>
+ <eventname>assignVariables</eventname>
+ <nice>1</nice>
+ <listenerclassfile>lib/system/event/listener/UserPagePlusListener.class.php</listenerclassfile>
+ </eventlistener>
+ </import>
+</data>
BIN  files/icon/googleplusL.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  files/icon/googleplusM.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  files/icon/googleplusS.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 files/lib/data/user/option/UserOptionOutputPlus.class.php
@@ -0,0 +1,100 @@
+<?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');
+
+/**
+ *
+ * @author Torben Brodt
+ * @copyright 2011 easy-coding.de
+ * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html>
+ * @package de.easy-coding.wcf.plus
+ */
+class UserOptionOutputPlus implements UserOptionOutput, UserOptionOutputContactInformation {
+ protected $type = 'googleplus';
+
+ // 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 (empty($value) || $value == 'http://') return '';
+
+ $value = self::getURL($value);
+ $value = StringUtil::encodeHTML($value);
+ return '<a href="'.$value.'">'.$value.'</a>';
+ }
+
+ // UserOptionOutputContactInformation implementation
+ /**
+ * @see UserOptionOutputContactInformation::getOutput()
+ */
+ public function getOutputData(User $user, $optionData, $value) {
+ if (empty($value) || $value == 'http://') return null;
+
+ $value = self::getURL($value);
+ $value = StringUtil::encodeHTML($value);
+
+ return array(
+ 'icon' => StyleManager::getStyle()->getIconPath($this->type.'M.png'),
+ 'title' => WCF::getLanguage()->get('wcf.user.option.'.$optionData['optionName']),
+ 'value' => $value,
+ 'url' => $value
+ );
+ }
+
+ /**
+ * Generates an image button.
+ *
+ * @see UserOptionOutput::getShortOutput()
+ */
+ protected function getImage(User $user, $value, $imageSize = 'M') {
+ if (empty($value) || $value == 'http://') return '';
+
+ $value = self::getURL($value);
+ if (empty($value)) return '';
+
+ $title = WCF::getLanguage()->get('wcf.user.profile.plus.title', array('$username' => StringUtil::encodeHTML($user->username)));
+ return '<a href="'.StringUtil::encodeHTML($value).'"><img src="'.StyleManager::getStyle()->getIconPath($this->type.$imageSize.'.png').'" alt="" title="'.$title.'" /></a>';
+ }
+
+ /**
+ * @return integer
+ */
+ public static function getID($url) {
+ if (is_numeric($url)) {
+ return $url;
+ } else if (preg_match('/^https?:\/\/plus\.google\.com.*(\/[0-9]+(?:\/|$))/', $url, $res)) {
+ return trim($res[count($res) - 1], '/');
+ }
+ return 0;
+ }
+
+ /**
+ * Formats the URL.
+ *
+ * @param string $url
+ * @return string
+ */
+ private static function getURL($url) {
+ $id = self::getID($url);
+ return 'https://plus.google.com/'.$id.'?rel=author';
+ }
+}
+?>
48 files/lib/system/event/listener/UserPagePlusListener.class.php
@@ -0,0 +1,48 @@
+<?php
+// wcf imports
+require_once(WCF_DIR.'lib/system/event/EventListener.class.php');
+
+/**
+ * extends the userpage with the plus widget
+ *
+ * @author Torben Brodt
+ * @copyright 2011 easy-coding.de
+ * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html>
+ * @package de.easy-coding.wcf.plus
+ */
+class UserPagePlusListener implements EventListener {
+
+ /**
+ * @see EventListener::execute()
+ */
+ public function execute($eventObj, $className, $eventName) {
+
+ $plus = $eventObj->frame->getUser()->getUserOption('googleplus');
+ if(empty($plus)) {
+ return;
+ }
+
+ require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputPlus.class.php');
+ $id = UserOptionOutputPlus::getID($plus);
+
+ if($id) {
+ $lang = WCF::getLanguage()->getLanguageCode();
+ if($lang == 'de') {
+ $lang = 'ge';
+ }
+
+ $title = WCF::getLanguage()->get('wcf.googleplus.add');
+ WCF::getTPL()->append('additionalBoxes1',
+ '<div class="border">
+ <div class="containerHead">
+ <h3>Google+</h3>
+ </div>
+ <div class="container-1">
+ <script type="text/javascript">ww="100%";bbc="3F79D5";bmobc="3b71c6";bbgc="4889F0";bmoc="3F79D5";bfc="FFFFFF";bmofc="ffffff";bc="6a6a6a";l="y";t="'.$title.'";fs="16";fsb="13";bw="100";ff="4";b="s";lg="'.$lang.'";pid="'.$id.'";</script>
+ <script type="text/javascript" src="http://widgetsplus.com/google_plus_widget.js"></script>
+ </div>
+ </div>');
+ }
+ }
+}
+?>
BIN  optionals/de.easy-coding.wcf.plus.blog.1.1.1.tar.gz
Binary file not shown
11 optionals/de.easy-coding.wcf.plus.blog/eventlistener.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE data SYSTEM "http://www.woltlab.com/DTDs/eventListeners.dtd">
+<data>
+ <import>
+ <eventlistener>
+ <eventclassname>UserBlogSidebar</eventclassname>
+ <eventname>init</eventname>
+ <listenerclassfile>lib/system/event/listener/UserBlogPagePlusListener.class.php</listenerclassfile>
+ </eventlistener>
+ </import>
+</data>
44 optionals/de.easy-coding.wcf.plus.blog/files/lib/system/event/listener/UserBlogPagePlusListener.class.php
@@ -0,0 +1,44 @@
+<?php
+// wcf imports
+require_once(WCF_DIR.'lib/system/event/EventListener.class.php');
+
+/**
+ * extends the blog page with the plus widget
+ *
+ * @author Torben Brodt
+ * @copyright 2011 easy-coding.de
+ * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html>
+ * @package de.easy-coding.wcf.plus.blog
+ */
+class UserBlogPagePlusListener implements EventListener {
+
+ /**
+ * @see EventListener::execute()
+ */
+ public function execute($eventObj, $className, $eventName) {
+
+ $user = $eventObj->userID ? new User($eventObj->userID) : 0;
+ $plus = $user && $user->userID ? $user->getUserOption('googleplus') : false;
+ if(empty($plus)) {
+ return;
+ }
+
+ require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputPlus.class.php');
+ $id = UserOptionOutputPlus::getID($plus);
+ if($id) {
+ $lang = WCF::getLanguage()->getLanguageCode();
+ if($lang == 'de') {
+ $lang = 'ge';
+ }
+
+ // add box to the beginning
+ WCF::getTPL()->assign(array(
+ 'googleplus_title' => WCF::getLanguage()->get('wcf.googleplus.add'),
+ 'googleplus_id' => $id,
+ 'googleplus_lang' => $lang,
+ ));
+ array_unshift($eventObj->sidebarBoxes, 'userBlogBoxGoogleplus');
+ }
+ }
+}
+?>
38 optionals/de.easy-coding.wcf.plus.blog/package.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE package SYSTEM "http://www.woltlab.com/DTDs/package.dtd">
+<package name="de.easy-coding.wcf.plus.blog">
+ <packageinformation>
+ <packagename><![CDATA[Google+ Plus Profile: Blog]]></packagename>
+ <packagedescription><![CDATA[Users will be able to link Google+ Plus Profile Pages.]]></packagedescription>
+ <version>1.1.1</version>
+ <date>DATE</date>
+ <plugin>com.woltlab.wcf.page.user.profile</plugin>
+ <isunique>1</isunique>
+ </packageinformation>
+
+ <authorinformation>
+ <author><![CDATA[Torben Brodt]]></author>
+ <authorurl>http://trac.easy-coding.de/trac/wcf</authorurl>
+ </authorinformation>
+
+ <requiredpackages>
+ <requiredpackage minversion="1.1.0">com.woltlab.wcf</requiredpackage>
+ <requiredpackage minversion="1.1.0">com.woltlab.wcf.page.user.profile</requiredpackage>
+ <requiredpackage minversion="1.1.0">de.easy-coding.wcf.plus</requiredpackage>
+ </requiredpackages>
+
+ <instructions type="install">
+ <files>files.tar</files>
+ <templates>templates.tar</templates>
+ <eventlistener>eventlistener.xml</eventlistener>
+ </instructions>
+
+ <instructions type="update" fromversion="1.1.0">
+ <templates>templates.tar</templates>
+ </instructions>
+
+ <instructions type="update" fromversion="1.0.0">
+ <files>files.tar</files>
+ <templates>templates.tar</templates>
+ </instructions>
+</package>
12 optionals/de.easy-coding.wcf.plus.blog/templates/userBlogBoxGoogleplus.tpl
@@ -0,0 +1,12 @@
+<div class="contentBox">
+ <div class="border">
+ <div class="containerHead">
+ <h3>Google+</h3>
+ </div>
+ <div class="container-1">
+ <script type="text/javascript">ww="100%";bbc="3F79D5";bmobc="3b71c6";bbgc="4889F0";bmoc="3F79D5";bfc="FFFFFF";bmofc="ffffff";bc="6a6a6a";l="y";t="{@$googleplus_title}";fs="16";fsb="13";bw="100";ff="4";b="s";lg="{@$googleplus_lang}";pid="{@$googleplus_id}";</script>
+ <script type="text/javascript" src="http://widgetsplus.com/google_plus_widget.js"></script>
+ </div>
+ </div>
+</div>
+<hr />
54 package.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE package SYSTEM "http://www.woltlab.com/DTDs/package.dtd">
+<package name="de.easy-coding.wcf.plus">
+ <packageinformation>
+ <packagename><![CDATA[Google+ Plus Profile]]></packagename>
+ <packagedescription><![CDATA[Users will be able to link Google+ Plus Profile Pages.]]></packagedescription>
+ <version>1.2.0</version>
+ <date>DATE</date>
+ <plugin>com.woltlab.wcf.page.user.profile</plugin>
+ <isunique>1</isunique>
+ </packageinformation>
+
+ <authorinformation>
+ <author><![CDATA[Torben Brodt]]></author>
+ <authorurl>http://trac.easy-coding.de/trac/wcf</authorurl>
+ </authorinformation>
+
+ <requiredpackages>
+ <requiredpackage minversion="1.1.0">com.woltlab.wcf</requiredpackage>
+ <requiredpackage minversion="1.1.0">com.woltlab.wcf.page.user.profile</requiredpackage>
+ </requiredpackages>
+
+ <optionalpackages>
+ <optionalpackage file="optionals/de.easy-coding.wcf.plus.blog.tar.gz">de.easy-coding.wcf.plus.blog</optionalpackage>
+ </optionalpackages>
+
+ <instructions type="install">
+ <files>files.tar</files>
+
+ <useroptions>useroptions.xml</useroptions>
+ <eventlistener>eventlistener.xml</eventlistener>
+ <languages languagecode="de">de.xml</languages>
+ <languages languagecode="de-informal">de-informal.xml</languages>
+ <languages languagecode="en">en.xml</languages>
+ </instructions>
+
+ <instructions type="update" fromversion="1.1.0">
+ <files>files.tar</files>
+ </instructions>
+
+ <instructions type="update" fromversion="1.1.1">
+ <files>files.tar</files>
+ </instructions>
+
+ <instructions type="update" fromversion="1.0.0">
+ <files>files.tar</files>
+
+ <useroptions>useroptions.xml</useroptions>
+ <eventlistener>eventlistener.xml</eventlistener>
+ <languages languagecode="de">de.xml</languages>
+ <languages languagecode="de-informal">de-informal.xml</languages>
+ <languages languagecode="en">en.xml</languages>
+ </instructions>
+</package>
BIN  screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  screenshot2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 useroptions.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE data SYSTEM "http://www.woltlab.com/DTDs/options.dtd">
+<data>
+ <import>
+ <options>
+ <option name="googleplus">
+ <categoryname>profile.contact</categoryname>
+ <optiontype>text</optiontype>
+ <showorder>30</showorder>
+ <outputclass>UserOptionOutputPlus</outputclass>
+ <validationpattern>^($|[0-9]+$|https?:\/\/plus\.google\.com.*(\/[0-9]+(?:\/|$)))</validationpattern>
+ </option>
+ </options>
+ </import>
+</data>
Please sign in to comment.
Something went wrong with that request. Please try again.