septor / twits

e107v2: Twitter Status Plugin
2 stars 1 forks source link

Suggestion #1

Open Floryn opened 12 years ago

Floryn commented 12 years ago

i. Ajax-based Status-loader instead of having to refresh the page to get new content. This will also speed up the page load, currently I am using the twitter menu that was implemented in my theme and when twitter is having issues, it also affects the page loading on my site because of the way the script is loaded.

I tried to make a simple ajax based menu a while ago using this script: http://code.google.com/p/ajax-based-twitter-status-loader/ - unfortunately that one has issues reading the re-tweets so it's a no go.

ii. Option to configure the number of twits to display.

That's about it, simple is better also I had to comment out my theme twitter script to make this one working, there seem to be a conflict with this:

function theme_foot() { global $pref, $tp; return ($pref['xp_comment']==1?"

        <script type='text/javascript' src='http://twitter.com/statuses/user_timeline/" . $tp->toFORM( $pref['xp_twitter_username'] ) . ".json?callback=twitterCallback2&amp;count=" . $pref['xp_twitter_number'] . "'></script>":'');
septor commented 12 years ago

I had thought about adding some sort of ajax refresh, but haven't gotten around to it. The number of statuses isn't really the intention of this menu, but I'll see what I can do. Perhaps a javascript carousel, something similar to what you see at the bottom of this?

If you could make a gist of the Twitter code your theme uses and then add the URL as a comment here I can investigate.

Floryn commented 12 years ago

The issue is generated by the 2 scripts linked in previous post once I commented those it works. I now see that they got stripped out from previous comment, let me try again using gist: https://gist.github.com/2978373

As for the display of twits it can be a simple unordered list, important part is the loading method (and to be able to determine latest x tweets to be displayed) twitter sometime becomes unresponsive and it's known to cause issues with page load, now I never seen these issues when ajax was used. The ajax twitter script I previously linked works Ok, problem is that it can't read re-tweets which is a big issue.

My current twitter menu can be seen here: http://www.bob-guild.net/gw/ on bottom left menu. On bottom right I also have the Google plus widget, which has a nice example on how to slide the twits.

septor commented 12 years ago

I'd hazard a guess that line 6 of that code block is what is causing the conflict. My menu calls to a similar area and it's probably denying one of them because it's already been called.

A work around for the long page loads, outside of using ajax/javascript would be to cache the actual RSS file, but then you're running into the problem of how long to cache it so that your tweets are still getting registered. At the end of the day someone is going to have a long page load every X amount of minutes/hours.

As for the style of the displaying of more than one tweet, that can be worked out once I get it added. The list type approach seems viable, mostly because it would be the easiest to work into a template format.

Floryn commented 12 years ago

I just found this widget: https://twitter.com/about/resources/widgets/widget_profile I played with the layout and the settings and created a menu, with the following code: https://gist.github.com/2978980

it works brilliantly on the test site, will deploy it on live if you can't see any security issues with my lame menu :P

Later edit: it's on the live site now in same spot where the old one was, if you can make a proper plugin for e107 from that widget a lot of ppl will be grateful. For me it works ok as it is (hardcoded) I can always open the php file and edit the username. -)

septor commented 12 years ago

There's a thread with something similar to that on the e107 forums. You could package that up as a plugin so long as you make it easy to edit the username aspect.

septor commented 11 years ago

Not sure if you're still interested but I'm in messing around with an Ajax reload for the menu. I recently (earlier today) made changes that would allow for displaying more than one tweet (up to five, which really seems like the most anyone ever displays anyways).

I may have a commit up later today with the refresh stuff.

septor commented 11 years ago

Cancel that. It's proving more difficult than I'd like. Pushing this aside for now until I have more time to work with jQuery inside e107.

nlstart commented 11 years ago

I would leave it until e107 v2 is pushed out; it's made easier (and still hard!) to use frameworks like jQuery, Prototype and alike in v2.

septor commented 11 years ago

With the caching system added, I think this feature is pretty much nullified for now. Even if not, I think I'll take nlstart's advice and wait until 2.0 is out. Working with jQuery and e107 right now are nothing short of annoying.

I'm leaving this open because I still want to add it, but I'm going to take it as 'in the future'.