Hello Stalski,
Since your module is going to be a central piece of a project that I'm working on, I've been looking deeper into it, and had a few findings, questions and ideas.
#1. In shouts.module, in theme_shoutform_message(), there's an option to "clear" the shout. The span doesn't have a class, so one needs to use template.php to alter the function. The span is pushed right up against the message, so this seems to almost be a requirement for any kind of decent looking presentation.
My suggestion is to replace:
$clear = '<span>'.l(t('Clear'), 'shout/clear', $options).'</span>';
with:
$clear = '<span class="shout_clear">'.l(t('Clear'), 'shout/clear', $options).'</span>';
#2. I personally find it helpful to have the "time ago" right next to the latest shout. That way if people stumble on the person's profile, and find under the latest shout that "Andrey is making popcorn", they won't want to come over to my place if it was posted 10 days ago and popcorn is already stale if it's even still there.
So my next suggestion is to add the time ago right before the $clear in theme_shoutform_message().
Attached is a patch against the Jan.25 dev that implements #1 and #2.
#3. I was wondering why the hb_activity uses UNIX Timestamp and shouts uses the MySQL date format?
#4. I plan to use the shouts module here as it's used on Facebook, and I'm using form_alter to add the username before the box and add a default_value of "is" into the empty shoutbox. I'm quite happy doing it my way, but I think some might find it useful to have an option to automatically do this. I'll attach a screenshot, so you get an idea of what I mean.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | shouts-patch-2009-03-21.txt | 1.06 KB | mr.andrey |
| #7 | shouts-2009-02-09.txt | 1.97 KB | mr.andrey |
| #4 | shouts-2008-02-02.txt | 4.73 KB | mr.andrey |
| #3 | shouts-facebook.jpg | 165.5 KB | mr.andrey |
| #3 | shouts-2008-02-01.txt | 4.28 KB | mr.andrey |
Comments
Comment #1
mr.andrey commentedHere is an updated patch that takes into account the AHAH, and replaces "0 sec ago" with "a moment ago" for times ago < 60 secs.
Comment #2
mr.andrey commentedOops, forgot to t() the "a moment" string. Updated patch here.
Comment #3
mr.andrey commentedAttached is an updated patch to shouts.module for the above features plus addressing the following issues:
#365800: Time format incorrect
#366200: "Post shout" and "Post new shout" serving the same purpose
http://drupal.org/node/363671#comment-1219685 (form-submit through NON-AJAX gives blank statuses)
Patched against Jan.25 dev
Facebook status replication
I'm using the shouts module like Facebook status updates. Attached is a screenshot of how it looks (almost exactly like facebook, with jquery and all).
To replicate that functionality, add this to form_alter:
Optional CSS styles:
Optionally, embed this in user profile using this in user-profile.tpl.php:
Note that I'm using imagecache and imagecache_profiles to replicate the user picture functionality. To set that up, follow the instructions for "user_image_small" in imagecache_profiles README.
I would love to see an option to enable this functionality in the core of shouts module. The code's all there, and I imagine the translation of it into the module wouldn't be too hard.
Enjoy,
Andrey.
Comment #4
mr.andrey commentedAttached is an updated patch to shouts.module that addresses the following issues:
#365800: Time format incorrect
#366200: "Post shout" and "Post new shout" serving the same purpose
#368072: Clear shout only clears for uid 1
http://drupal.org/node/363671#comment-1219685 (form-submit through NON-AJAX gives blank statuses)
... and adding the following features:
#1. Add a CSS class to the "Clear" span.
#2. Add time-ago to the latest shout
Comment #5
mr.andrey commentedAttached is a patch for Feb.08-dev which is an update to previous one that addresses the following:
#1. #366200: "Post shout" and "Post new shout" serving the same purpose
#2. Add time-ago to the latest shout
#3. http://drupal.org/node/363671#comment-1219685 (form-submit through NON-AJAX gives blank statuses)
#4.
In the Feb.08-dev, the $date variable gives option to show "a momoent ago" rather than 0 sec ago, however it is not used in the line below it.
Features implemented since previous dev:
#365800: Time format incorrect
#368072: Clear shout only clears for uid 1
Add a CSS class to the "Clear" span.
All the Best,
Andrey.
Comment #6
nils.destoop commentedHi Andrey,
I think you forgot to add the patch. :)
Next week, i'll add some default css, to make the shout form look a bit nicer.
Comment #7
mr.andrey commentedAh yes, here's the patch. Thanks.
Andrey.
Comment #8
Stalski commentedComment #9
Stalski commentedComment #10
mr.andrey commentedThis is a patch for Mar-16 dev shouts.module that addresses the following:
#1. #366200: "Post shout" and "Post new shout" serving the same purpose
#2. Add time-ago to the latest shout
Best,
Andrey.
Comment #11
Stalski commentedOk applied and fixed