SA Twitter Integration

Started by SMFHacks.com Team, August 17, 2011, 04:26:47 PM

Previous topic - Next topic

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

~DS~

Here's a view of what's coming in the next version. :)
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

SA™

0.4 relesed

chnaged to a different twitter php lib [fixes most of the Bugs]
fixed issue where it was calling twitter info on each page load now only does it when needed
added support for custom login url
added support for custom login img
now reqires oauth keys from twitter
now uses session url whn loggin in
updated twitter logs in admin to use creat list function
fixed errors with api call failing with try and catch functions to catch errors
added support for at anywere
now you can import twitter avatars
added allready registerd check
added support for last tweets at index
added supoort for reg agreement
added publisher
fixed issue showing redirect boards in bards list
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat

#63
Hi SA,
Thanks for the update BUT I am getting a bunch of errors after installation (it installed no problems), as follows:

hxxp://www.awolonline.net/forum/index.php?http://www.awolonline.net/forum/
8: Undefined index: oauth_token
File: /home/xxxxx/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 442

hxxp://www.awolonline.net/forum/index.php?http://www.awolonline.net/forum/
8: Undefined index: twusername
File: /home/xxxxx/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 465

hxxp://www.awolonline.net/forum/index.php?http://www.awolonline.net/forum/
8: Undefined index: twuserid
File: /home/xxxx/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 467

hxxp://www.awolonline.net/forum/index.php?http://www.awolonline.net/forum/
8: Undefined index: twpic
File: /home/xxxxx/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 468

These errors are accumulating rapidly! Also if I try to access my forum as a guest it doesn't load properly. I uninstalled the old (last version) mod but didn't delete it and the uninstallation seemed also to have no problem. Any clues as to what is happening?

P.S I have just uninstalled it, but now (as a guest trying to open the forum on Google Chrome) I am getting the following error appearing:
Fatal error: Call to undefined function twit_init() in /home/awolonl1/public_html/forum/Sources/Load.php(2494) : eval()'d code on line 260

Would this be some stray code that hasn't been removed in either the old or new version of the mod?

P.P.S I have reinstalled the previous version and my forum is accessible again for guests; interestingly I was logged in as admin all the time and never had any issues (thankfully) so that might give you a clue to where the problem lies?

SA™

hmm it shouldent be loads them vars on index have you got twit_init() decalred someware else

prob down to this
Call to undefined function twit_init() but it is an eval()' error can you disable template evalation

admin>server settings>Disable evaluation of templates then try a repopulate that error it should give more info this way

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat

Sorry for the delay in replying. I have Simple Twitter installed, but that was installed with the previous version as well - I assume that might declare twit_init()? The eval error appeared not in the error log but at the top of the screen when the forum wouldn't load properly as a guest. I am loathe to reinstall the new version for fear it will break the forum completely, so I will wait to see if anyone else has similar problems I think. I have a suspicion that it is either a conflict (possibly with Simple Twitter) or there might be some code that is not being removed fully when I uninstall the old version. When i have time I will look at the parse and compare it to my files. My forum is heavily modded so there is every chance that something is conflicting though.

SA™

#66
twit_init has nothing todo wit the simple twitter mod you have a custom theme right?

did you do this to add the login button?
http://www.simplemachines.org/community/index.php?topic=446987.msg3153017#msg3153017

if so your need to remove that and use show_twitter_login() with the new version other wise using twit_init in the new version will give the errors above
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat

Hi SA,
Thanks, that fixed the problem with the errors (after I also removed the same code from my portal block), and I have successfully added the Twitter button to my themes, but it does not show up on the default curve theme - can you tell me how to add it there? Also how can I make sure it goes below the Facebook button rather than alongside it on my themes?  I am sure others will also want a more detailed description of what how and where to put the code as well. Thanks for the mod and your help so far.

SA™

for the default theme  index.template.php

echo '
<input type="hidden" name="hash_passwrd" value="" />
</form>';


add after
show_twitter_login();

to make them side by side wich needs to be done anyway cos it does look better ill have to play around with the code mmore later


http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat

Hi SA,
OK, did that but no button is showing, either side by side or below the Facebook one. That is on the forum home page (in my case a portal where i have also managed to add FB and Twitter buttons to the user block which do show) but also on the login and register pages for all my themes. Which file(s) do i need to edit to get it on the login and register pages, and again, what should I add and where?

SA™

hmm make sure you have anbled the mod after updating cos it installs disabled as default this is the only reason i can think of why it dont show
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat

Hi SA,
Yes, I discovered that last night but didn't have a chance to come on here to update. I would still like to be able to put the Twitter button below the Facebook one on some themes though, so any hint how I can do that? Thanks for all your help by the way, and again for the mod.

SA™

if you inserted the button manualy you need to add echo'<br />'; between the button coded like this

facebook code
echo'<br />';
twitter code

if it is the one that show when the mod is installled you need to

depending on what was installed first twitter or facebook

for twitter sources/twitter/twitterhooks.php

$buffer = preg_replace('~(' . preg_quote('<div class="info">'. $txt['guestnew']. '</div>') . ')~', '<a href="'.$url.'"><img src="'.$modSettings['tw_app_log_img'].'" alt="'.$txt['twittsign'].'"/></a><br /><div class="info">'. $txt['guestnew']. '</div>', $buffer);

replace with

$buffer = preg_replace('~(' . preg_quote('<div class="info">'. $txt['guestnew']. '</div>') . ')~', '<a href="'.$url.'"><img src="'.$modSettings['tw_app_log_img'].'" alt="'.$txt['twittsign'].'"/></a><br /><div class="info">'. $txt['guestnew']. '</div><br />', $buffer);

if that does not do it your need todo simualr to the sources/facebook/facebookhooks.php file
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat


Dblog

thanks for the update
show_twitter_login();
works cool

awolexpat

Hi SA, me again  :-[
I'm getting some errors in my error log as follows:

http://www.awolonline.net/forum/index.php?action=register2
8: Undefined index: tw_enpub
File: /home/awolonl1/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 84

http://www.awolonline.net/forum/index.php?topic=827.0
8: Undefined index: tw_enpub
File: /home/awolonl1/public_html/forum/Sources/Twitter/TwitterHooks.php
Line: 133

The first one has appeared many times, the second one only once (so far). They are all from guests, not logged in members. Any ideas?

SA™

enable then disable the publisher and they will go
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Dblog

SMF package manager shows 0.3.3 and why doesnt it show version is old, when existing new version is 0.4

SA™

package_info.xml says 0.4 so you must of got the old version
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

awolexpat


Advertisement: