Module: Twitter new posts
Posted by Brian Moon
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
twitter-1.0.1.tar.gz | 2.8 KB | open | download | Brian Moon | 05/03/2008 | Read message |
twitter-2.0.0.zip | 16.4 KB | open | download | Thomas Seifert | 10/13/2010 | Read message |
May 03, 2008 09:50PM |
Admin Registered: 19 years ago Posts: 4,495 |
This module sends the subject and URL (via tiny URL) to Twitter. You can then publish the Twitter feed and your users can follow things on Twitter.
Well, this is a quick new release. My copy editor, aka Maurice pointed out some typos.
Edited 1 time(s). Last edit at 05/03/2008 10:15PM by Brian Moon.
Well, this is a quick new release. My copy editor, aka Maurice pointed out some typos.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 1 time(s). Last edit at 05/03/2008 10:15PM by Brian Moon.
May 03, 2008 09:51PM |
Admin Registered: 19 years ago Posts: 4,495 |
A nice addition to this may be to add some code to grab people's Twitter status and display it somehow in their profile.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Module: Twitter new posts November 06, 2008 02:56AM |
Registered: 12 years ago Posts: 13 |
Brian,
Thanks much for this module. I'm wondering if there's a way to limit the Twitter posts to threads within a certain forum... For example, I'd like the Twitter posts to be the publicly available ones, but I have an admin only forum from which I don't want Twitter posts. I didn't see anything in the Read Me file for something like this...
Thanks much for this module. I'm wondering if there's a way to limit the Twitter posts to threads within a certain forum... For example, I'd like the Twitter posts to be the publicly available ones, but I have an admin only forum from which I don't want Twitter posts. I didn't see anything in the Read Me file for something like this...
November 07, 2008 01:46AM |
Registered: 17 years ago Posts: 687 |
I don't want to take this thread off-topic, but could someone please post a simple paragraph or two explaining the desirability of using Twitter for this purpose? I don't really "get" Twitter you see, and therefore can't currently see what advantage it would have over RSS.
Cheers,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Cheers,
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Re: Module: Twitter new posts November 07, 2008 02:01AM |
Registered: 12 years ago Posts: 13 |
November 07, 2008 02:10AM |
Registered: 17 years ago Posts: 687 |
OK, interesting. I'm all for diversity, I was just curious to know if I was missing out on some obvious killer feature of Twitter.
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
/\dam
--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz

Re: Module: Twitter new posts January 16, 2009 08:27PM |
Registered: 12 years ago Posts: 13 |
For anyone that cares, I've spent some time working on this module to get it to do what I like.
The changes I've made allow you to choose the forums from which tweets are made. I've not made it compatible with any sort of vroot stuff, just forums. Also, the code is probably a little messy, as I'm not really a programmer. :)
Anyway, below are the two files I changed.
settings.php
twitter.php
It appears to work as I intended it for now. Just figured I'd throw this out there in case anyone else wanted this feature and it can be cleaned up and worked into the official plugin, if desired.
Edited 2 time(s). Last edit at 01/16/2009 08:47PM by rtetzloff.
The changes I've made allow you to choose the forums from which tweets are made. I've not made it compatible with any sort of vroot stuff, just forums. Also, the code is probably a little messy, as I'm not really a programmer. :)
Anyway, below are the two files I changed.
settings.php
Language: PHP
<?php // Make sure that this script is loaded from the admin interface. $forum_list_global = phorum_get_forum_info(1,0); // Save settings in case this script is run after posting // the settings form. "username" => (string)$_POST["username"], "password" => (string)$_POST["password"], "new_posts" => (bool)$_POST["new_posts"], ); foreach ($_POST["forum_list"] as $v => $k ) { } $PHORUM["mod_twitter"] = $settings; $error = ';Database error while updating settings.';; } else { phorum_admin_okmsg(';Settings Updated';); } } // We build the settings form by using the PhorumInputForm object. include_once ';./include/admin/PhorumInputForm.php';; $frm =& new PhorumInputForm(';';, ';post';, ';Save';); $frm->hidden(';module';, ';modsettings';); $frm->hidden(';mod';, ';twitter';); // Here we display an error in case one was set by saving // the settings before. phorum_admin_error($error); } $frm->addbreak(';Edit settings for the Twitter module';); // Twitter Username $row = $frm->addrow ( ';Twitter Username ';, $frm->text_box ( ';username';, $PHORUM[';mod_twitter';][';username';], 30 ) ); $frm->addhelp ( $row, ';Twitter Username';, "Enter the name you use to log in to Twitter." ); // Twitter Password $row = $frm->addrow ( ';Twitter Password ';, $frm->text_box ( ';password';, $PHORUM[';mod_twitter';][';password';], 30 ) ); $frm->addhelp ( $row, ';Twitter Password';, "Enter the password you use to log in to Twitter." ); // Send new topics or all posts $row = $frm->addrow ( "Type of Posts ", $frm->select_tag ( "new_posts", $PHORUM["mod_twitter"]["new_posts"] ) ); $frm->addhelp ( $row, ';Type of Posts';, "Select if you want to send all posts or only new topics to Twitter." ); // Select forums from which to send posts $checkboxes = ';';; foreach ($forum_list_global as $forum_list_id => $forum_list_path) { if ($enabled === FALSE) $enabled = 0; else $enabled = 1; $checkboxes .= $frm->checkbox("forum_list[$forum_list_id]", "1", "", $enabled) . " $forum_list_path<br/>"; } $frm->addrow("Twitter new posts for which forums?", $checkboxes); // Show settings form $frm->show(); ?>
twitter.php
Language: PHP
<?php function mod_twitter_url(){ global $PHORUM; $PHORUM["DATA"]["URL"]["TWITTER"] = "http://www.twitter.com/".$PHORUM["mod_twitter"]["username"]; } function mod_twitter_posts($message){ global $PHORUM; if( ($PHORUM["mod_twitter"]["new_posts"]==0 || $message["parent_id"]==0) && in_array($message[';forum_id';],$PHORUM["mod_twitter"]["forum_list"]) ){ // Format the read URL. $url = phorum_get_url( PHORUM_FOREIGN_READ_URL, $message[';forum_id';], $message[';thread';], $message[';message_id';] ); // Strip auth data from the URL, if availble. ';!,?'; . PHORUM_SESSION_LONG_TERM.';='; . ';';, $url ); } // fetch a tiny URL. $url = $response; } curl_setopt($curl_handle,CURLOPT_USERPWD, $PHORUM["mod_twitter"]["username"].":".$PHORUM["mod_twitter"]["password"]); } return $message; } ?>
It appears to work as I intended it for now. Just figured I'd throw this out there in case anyone else wanted this feature and it can be cleaned up and worked into the official plugin, if desired.
Edited 2 time(s). Last edit at 01/16/2009 08:47PM by rtetzloff.
Re: Module: Twitter new posts May 18, 2009 11:05PM |
Registered: 15 years ago Posts: 51 |
May 19, 2009 10:22AM |
Admin Registered: 16 years ago Posts: 8,532 |
The module was written with 5.2 and not tested on 5.1, so it would be an option to at least test that out. You could setup a test 5.2 Phorum with that module to see if that would work for you. If the module doesn't work in your test-5.2 either, then some more investigation is needed to see what causes the issue.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: Module: Twitter new posts May 20, 2009 06:48PM |
Registered: 15 years ago Posts: 51 |
Sorry, only registered users may post in this forum.