Active
Project:
Shoutbox
Version:
master
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
17 Mar 2008 at 00:44 UTC
Updated:
15 Apr 2010 at 16:53 UTC
I believe it would be better if the shoutbox form would appear at the top of the shout box when the "Post newest shouts on top" option is enabled. I have seen at least on site that does this "http://www.thejapanesepage.com/".
Here's the changes I made to the 5.x.1.1 code to achieve this:
File shoutbox.module
Function: _shoutbox_get_view()
/**
* Returns the html to be displayed
* in the block.
*/
function _shoutbox_get_view() {
global $user;
...
.'", defaultUrl : "' . $default_url
.'", basePath : "' . $basePath
.'"} ','inline');
++ // ----------------------------------------------
++ // output the existing shoutbox posts before form
++ // ----------------------------------------------
++ if ($shoutbox_ascending == false) {
++ $shoutbox_posts .= $shoutbox_posts_data['output'];
++ $output .= $shoutbox_posts;
++ }
// ------------------------
// output the shoutbox form
// ------------------------
if (user_access('post shouts') || user_access('post shouts without approval')) {
$output .= drupal_get_form('shoutbox_add_form');
}
else {
$output .= theme('shoutbox_post_forbidden');
}
-- // ------------------------------------
-- // output the existing shoutbox posts
-- // ------------------------------------
++ // ---------------------------------------------
++ // output the existing shoutbox posts after form
++ // ---------------------------------------------
++ if ($shoutbox_ascending == true) {
$shoutbox_posts .= $shoutbox_posts_data['output'];
$output .= $shoutbox_posts;
++ }
// -----------------------
// print the shoutbox page
// -----------------------
return theme('shoutbox_page', $output, $title);
}
Of course I guess you could have a separate option to do this, but the location of the form depending on the sort direction of the posts seems to make sense to me.
Comments
Comment #1
disterics commentedI am not convinced this is a feature that others will find useful. If more people chime in, I will implement it.
Comment #2
stella commentedMarked #259566: Move text box to the top of Shoutbox as a duplicate of this issue.
Comment #3
tonnyl commentedAnyone that can convert the code to version 6? i could really use this.
Comment #4
nuerpel commentedUsers of my website have suggested putting the form on top, too, if the newest shout appears on top. Their argument is that otherwise you're constantly scrolling around between form field an shouts.
Comment #5
disterics commentedIts too late to put it in the upcoming release. I will put it into the next one.
Comment #6
marius.s commentedI find the feature useful. If the designer will not be willing to implement the feature, here's a quick hack
Putting shoutbox entry form on top of shouts in 5.x-1.2 version
1. Backup the shoutbox.module
2. Open the original shoutbox module, and find this text, (second instance of it, around line 859):
$output = $shoutbox_posts_data['output'];3. Delete it
4. Now, around line 864, find this text:
$output .= drupal_get_form('shoutbox_add_form');5. After this text, make a new line and paste the following text there:
6. Save changes and reload your site in browser
Comment #7
lordmorgul commentedGetting this feature in the 6.x version is also very simple, see the code below which uses the configuration variable (shoutbox_ascending true/false) to choose whether the form box is above or below the list of shouts.
The lines starting with + were changed to be what is shown. Do not copy/paste this without removing those +'s at the line start, they are only telling you what to change.
The above is from the version = "6.x-1.0" core = "6.x", with my changes added.
Comment #8
xjmTracking.
Comment #9
alexgreyhead commentedThankyou!! :o)
Comment #10
izus commentedI found this very useful too.
thanks a lot !
hope this will be implemented in the next release