aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter
diff options
context:
space:
mode:
Diffstat (limited to 'mod/twitter')
-rw-r--r--mod/twitter/graphics/thewire_speech_bubble.gifbin0 -> 560 bytes
-rw-r--r--mod/twitter/graphics/twitter.pngbin0 -> 724 bytes
-rw-r--r--mod/twitter/languages/en.php30
-rw-r--r--mod/twitter/manifest.xml10
-rw-r--r--mod/twitter/start.php26
-rw-r--r--mod/twitter/views/default/twitter/css.php63
-rw-r--r--mod/twitter/views/default/widgets/twitter/edit.php20
-rw-r--r--mod/twitter/views/default/widgets/twitter/view.php35
8 files changed, 184 insertions, 0 deletions
diff --git a/mod/twitter/graphics/thewire_speech_bubble.gif b/mod/twitter/graphics/thewire_speech_bubble.gif
new file mode 100644
index 000000000..d0e8606a1
--- /dev/null
+++ b/mod/twitter/graphics/thewire_speech_bubble.gif
Binary files differ
diff --git a/mod/twitter/graphics/twitter.png b/mod/twitter/graphics/twitter.png
new file mode 100644
index 000000000..de51c6953
--- /dev/null
+++ b/mod/twitter/graphics/twitter.png
Binary files differ
diff --git a/mod/twitter/languages/en.php b/mod/twitter/languages/en.php
new file mode 100644
index 000000000..5e9fcd92b
--- /dev/null
+++ b/mod/twitter/languages/en.php
@@ -0,0 +1,30 @@
+<?php
+
+ $english = array(
+
+ /**
+ * twitter widget details
+ */
+
+
+ 'twitter:username' => 'Enter your twitter username.',
+ 'twitter:num' => 'The number of tweets to show.',
+ 'twitter:visit' => 'visit my twitter',
+ 'twitter:notset' => 'This Twitter widget is not yet set to go. To display your latest tweets, click on - edit - and fill in your details',
+
+
+ /**
+ * twitter widget river
+ **/
+
+ //generic terms to use
+ 'twitter:river:created' => "%s added the twitter widget.",
+ 'twitter:river:updated' => "%s updated their twitter widget.",
+ 'twitter:river:delete' => "%s removed their twitter widget.",
+
+
+ );
+
+ add_translation("en",$english);
+
+?> \ No newline at end of file
diff --git a/mod/twitter/manifest.xml b/mod/twitter/manifest.xml
new file mode 100644
index 000000000..5439409db
--- /dev/null
+++ b/mod/twitter/manifest.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="Curverider" />
+ <field key="version" value="1.7" />
+ <field key="description" value="Elgg simple twitter widget" />
+ <field key="website" value="http://www.elgg.org/" />
+ <field key="copyright" value="(C) Curverider 2008-2010" />
+ <field key="licence" value="GNU Public License version 2" />
+ <field key="elgg_version" value="2010030101" />
+</plugin_manifest>
diff --git a/mod/twitter/start.php b/mod/twitter/start.php
new file mode 100644
index 000000000..c316164d5
--- /dev/null
+++ b/mod/twitter/start.php
@@ -0,0 +1,26 @@
+<?php
+
+ /**
+ * Elgg twitter widget
+ * This plugin allows users to pull in their twitter feed to display on their profile
+ *
+ * @package ElggTwitter
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ function twitter_init() {
+
+ //extend css if style is required
+ elgg_extend_view('css','twitter/css');
+
+ //add a widget
+ add_widget_type('twitter',"Twitter","This is your twitter feed");
+
+ }
+
+ register_elgg_event_handler('init','system','twitter_init');
+
+?> \ No newline at end of file
diff --git a/mod/twitter/views/default/twitter/css.php b/mod/twitter/views/default/twitter/css.php
new file mode 100644
index 000000000..f0e51ccb5
--- /dev/null
+++ b/mod/twitter/views/default/twitter/css.php
@@ -0,0 +1,63 @@
+<?php
+
+ /**
+ * Elgg Twitter CSS
+ *
+ * @package ElggTwitter
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+
+#twitter_widget {
+ margin:0 10px 0 10px;
+}
+
+#twitter_widget ul {
+ margin:0;
+ padding:0;
+}
+
+#twitter_widget li {
+ background: url(<?php echo $vars['url']; ?>mod/twitter/graphics/thewire_speech_bubble.gif) no-repeat right bottom;
+ list-style-image:none;
+ list-style-position:outside;
+ list-style-type:none;
+ margin:0 0 5px 0;
+ padding:0;
+ overflow-x: hidden;
+}
+
+#twitter_widget li span {
+ color:#666666;
+ background:white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ padding:5px;
+ display:block;
+}
+
+p.visit_twitter a {
+ background:url(<?php echo $vars['url']; ?>mod/twitter/graphics/twitter.png) left no-repeat;
+ padding:0 0 0 20px;
+ margin:0;
+}
+.visit_twitter {
+ background:white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ padding:2px;
+ margin:0 0 5px 0;
+}
+
+#twitter_widget li a {
+ display:block;
+ margin:0 0 0 4px;
+}
+
+#twitter_widget li span a {
+ display:inline !important;
+} \ No newline at end of file
diff --git a/mod/twitter/views/default/widgets/twitter/edit.php b/mod/twitter/views/default/widgets/twitter/edit.php
new file mode 100644
index 000000000..efb8f622a
--- /dev/null
+++ b/mod/twitter/views/default/widgets/twitter/edit.php
@@ -0,0 +1,20 @@
+<?php
+
+ /**
+ * Elgg twitter edit page
+ *
+ * @package ElggTwitter
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+ <p>
+ <?php echo elgg_echo("twitter:username"); ?>
+ <input type="text" name="params[twitter_username]" value="<?php echo htmlentities($vars['entity']->twitter_username); ?>" />
+ <br /><?php echo elgg_echo("twitter:num"); ?>
+ <input type="text" name="params[twitter_num]" value="<?php echo htmlentities($vars['entity']->twitter_num); ?>" />
+
+ </p> \ No newline at end of file
diff --git a/mod/twitter/views/default/widgets/twitter/view.php b/mod/twitter/views/default/widgets/twitter/view.php
new file mode 100644
index 000000000..71caaf380
--- /dev/null
+++ b/mod/twitter/views/default/widgets/twitter/view.php
@@ -0,0 +1,35 @@
+<?php
+
+ /**
+ * Elgg twitter view page
+ *
+ * @package ElggTwitter
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ //some required params
+
+ $username = $vars['entity']->twitter_username;
+ $num = $vars['entity']->twitter_num;
+
+ // if the twitter username is empty, then do not show
+ if($username){
+
+?>
+
+<div id="twitter_widget">
+<ul id="twitter_update_list"></ul>
+<p class="visit_twitter"><a href="http://twitter.com/<?php echo $username; ?>"><?php echo elgg_echo("twitter:visit"); ?></a></p>
+<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
+<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $username; ?>.json?callback=twitterCallback2&count=<?php echo $num; ?>"></script>
+<?php
+ } else {
+
+ echo "<div class=\"contentWrapper\"><p>" . elgg_echo("twitter:notset") . ".</p></div>";
+
+ }
+?>
+</div> \ No newline at end of file