[ABD] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [BETA] Twitter mod 1.0.0

Post by platinum_2007 » Wed May 06, 2009 2:10 pm

Stretcher25 wrote:I have a problem when I go into my profile, the Twitter password is not displayed in the text field. If I go and update my profile and go to save it, it says that the password is requied for my Twitter account. How can this be fixed?

Thanks
This is a bug that will be fixed in the next release asap.

YOUAREtehSCENE
Registered User
Posts: 178
Joined: Wed Feb 11, 2009 3:35 am
Location: Boston, Mass
Contact:

Re: [BETA] Twitter mod 1.0.0

Post by YOUAREtehSCENE » Wed May 20, 2009 9:29 pm

What i wanted was a twitter mod, where everytime I make a new thread or even better yet, everytime i say something in the "Subject" it will send data to my twitter account. So i don't have to keep going there and doing it myself.

platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [BETA] Twitter mod 1.0.0

Post by platinum_2007 » Thu May 21, 2009 1:56 am

YOUAREtehSCENE wrote:What i wanted was a twitter mod, where everytime I make a new thread or even better yet, everytime i say something in the "Subject" it will send data to my twitter account. So i don't have to keep going there and doing it myself.
This will do exactly what you want :)

Note you need 1.0.0 installed for this to work:

open posting.php

find:

Code: Select all

	if ($config['allow_topic_notify'] && $user->data['is_registered'])
	{
		$notify = (isset($_POST['notify'])) ? true : false;
	}
Before add

Code: Select all

	if($user->data['tweet_password'])
	{
	
	include($phpbb_root_path . 'includes/functions_crypt.' . $phpEx);
	$crypt = new encryption_class;
	$key = 'cryptahme';
	$username = $user->data['tweet_user'];
	$passcry = $user->data['tweet_password'];
	$password = $crypt->decrypt($key, $passcry);
	$message = $post_data['post_subject'];
	$url = 'http://twitter.com/statuses/update.xml';
	$curl_handle = curl_init();
		curl_setopt($curl_handle, CURLOPT_URL, "$url");
		curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
		curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl_handle, CURLOPT_POST, 1);
		curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
		curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
		$buffer = curl_exec($curl_handle);
		curl_close($curl_handle);
	}

acer123
Registered User
Posts: 13
Joined: Thu May 21, 2009 2:14 pm

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by acer123 » Thu May 21, 2009 4:56 pm

Cheers! Seems like a really nice mod! Now about to install :)

darkone_d1_2000
Registered User
Posts: 150
Joined: Tue Feb 13, 2007 7:43 pm

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by darkone_d1_2000 » Mon May 25, 2009 7:29 pm

platinum_2007 wrote:
YOUAREtehSCENE wrote:What i wanted was a twitter mod, where everytime I make a new thread or even better yet, everytime i say something in the "Subject" it will send data to my twitter account. So i don't have to keep going there and doing it myself.
This will do exactly what you want :)

Note you need 1.0.0 installed for this to work:

open posting.php

find:

Code: Select all

	if ($config['allow_topic_notify'] && $user->data['is_registered'])
	{
		$notify = (isset($_POST['notify'])) ? true : false;
	}
Before add

Code: Select all

	if($user->data['tweet_password'])
	{
	
	include($phpbb_root_path . 'includes/functions_crypt.' . $phpEx);
	$crypt = new encryption_class;
	$key = 'cryptahme';
	$username = $user->data['tweet_user'];
	$passcry = $user->data['tweet_password'];
	$password = $crypt->decrypt($key, $passcry);
	$message = $post_data['post_subject'];
	$url = 'http://twitter.com/statuses/update.xml';
	$curl_handle = curl_init();
		curl_setopt($curl_handle, CURLOPT_URL, "$url");
		curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
		curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl_handle, CURLOPT_POST, 1);
		curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
		curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
		$buffer = curl_exec($curl_handle);
		curl_close($curl_handle);
	}

This is working fine on twitter when I make a post it shows the post subject on my twitter page. Is there a way to post the forum link to the topic with the subject title?

platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by platinum_2007 » Mon May 25, 2009 10:28 pm

Yes use this line for the message, twitter will auto put it in a tiny link

Code: Select all

       $message = $post_data['post_subject']." View: http://www.street-steeze.com/viewtopic.php?t=$topic_id";
Change the obvious to your board url :)

darkone_d1_2000
Registered User
Posts: 150
Joined: Tue Feb 13, 2007 7:43 pm

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by darkone_d1_2000 » Tue May 26, 2009 10:53 am

That did work. Does twitter reformat the links when they come in?

It shows this link: http://bit.ly/ebIFo

Now it does link back to my website why just wondering why it would be like this?

darkone_d1_2000
Registered User
Posts: 150
Joined: Tue Feb 13, 2007 7:43 pm

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by darkone_d1_2000 » Tue May 26, 2009 11:12 am

I also noticed this one issue after applying the mod. See the screenshot:

Image

If you notice in the image the quick reply and search buttons are misaligned now. This is at the top of the page the bottom of the page the buttons show up fine. I can post some code if you need it.

platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by platinum_2007 » Tue May 26, 2009 1:46 pm

darkone_d1_2000 wrote:I also noticed this one issue after applying the mod. See the screenshot:

Image

If you notice in the image the quick reply and search buttons are misaligned now. This is at the top of the page the bottom of the page the buttons show up fine. I can post some code if you need it.
There are no edits that would effect that area of the page.

An yes Twitter re-formats the links to a shorter link when you tweet one.

CemetaryMan
Registered User
Posts: 59
Joined: Sat Jun 21, 2008 2:29 pm
Contact:

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by CemetaryMan » Wed Jul 01, 2009 1:46 am

platinum_2007 wrote:Yes use this line for the message, twitter will auto put it in a tiny link

Code: Select all

       $message = $post_data['post_subject']." View: http://www.street-steeze.com/viewtopic.php?t=$topic_id";
Change the obvious to your board url :)
I just tried this and it twittered the post but it got directed to "viewtopic.php?t=0" what can i have done wrong?

Apart from this its working good so far, great work ;)

CemetaryMan
Registered User
Posts: 59
Joined: Sat Jun 21, 2008 2:29 pm
Contact:

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by CemetaryMan » Wed Jul 01, 2009 1:51 am

Nevermind i changed the message line in the posting to

Code: Select all

$message = $post_data['post_subject']." ". generate_board_url()."/viewtopic.php?t=$topic_id - ".$user->data['username'];
And is working now :)

CemetaryMan
Registered User
Posts: 59
Joined: Sat Jun 21, 2008 2:29 pm
Contact:

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by CemetaryMan » Wed Jul 01, 2009 2:04 am

Do you think it is possible to add this function to other mods like the blog or the calender, so that it updates Twitter whenever a new blog or event is posted.

CemetaryMan
Registered User
Posts: 59
Joined: Sat Jun 21, 2008 2:29 pm
Contact:

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by CemetaryMan » Fri Jul 03, 2009 5:50 pm

CemetaryMan wrote:Nevermind i changed the message line in the posting to

Code: Select all

$message = $post_data['post_subject']." ". generate_board_url()."/viewtopic.php?t=$topic_id - ".$user->data['username'];
And is working now :)
I thought I had this working until i started a fresh post and it posted the topic_id=0 again, i then posted a reply to that post and it then gave it the correct topic_id on twitter, So its working when someone replies to a post but not when you make a new post, any suggestions to how i can fix that ;)

sferis
Registered User
Posts: 3
Joined: Fri Jul 03, 2009 5:48 pm

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by sferis » Tue Jul 07, 2009 10:54 am

Hello,
I have problem. I've installed this Twitter mod.

When I'm viewing memberlist or viewtopic i'm asking username and password in popup window.

Screen:
Image

Please help me :(

sitwi
Registered User
Posts: 83
Joined: Fri Jul 21, 2006 10:53 am
Contact:

Re: [BETA] Twitter mod 1.0.0 -- pg.2 for post subject tweeting

Post by sitwi » Tue Jul 07, 2009 11:12 am

I had this problem - it was becuase someone in the thread (whose Twitter updates were set to show under their posts) had their Twitter account set to private.

So anybody without access to the Twitter updates got the same pop-up as you're seeing now.

Locked

Return to “[3.0.x] MODs in Development”