Skip to Content Skip to Menu

Messages ABOVE component heading

  • vilo
  • vilo
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
16 years 3 months ago #70916 by vilo
Messages ABOVE component heading was created by vilo
Guys, I love your instant messenger. It works seamlessly with Community Builder and it's easily customizable... except for one little part for which I am pulling my hair out trying to get around. Messages like "Reply sent and original message moved to trash" are ABOVE the component heading using uddeJSEFredirect to send the message to mosRedirect. It completely breaks the visual design. To keep things consistent, component header should be always on the TOP of the page. No message should appear above it. The way uddeIM 1.2 is done, anytime there is message like "Message sent" the whole component header moves down and message appears above it.

Worst, I don't see any way around it without rewriting the whole logic of how pages are submitted. Would you know of any way how to get around this problem? Is there a way to move post-action messages BELOW the component header? (Maybe to the empty space to the right of the menu icons?)

Any help would be much appreciated. I know that each of us has limited time, but if there is solution to this problem, please be so kind and let me know.

thank you

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
16 years 3 months ago #70931 by slabbi
Replied by slabbi on topic Re:Messages ABOVE component heading
The only way to fix this for your template is to remove the text manually.

Maybe you can change the uddeJSEFredirect function, so that no text is passed to mosRedirect.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

  • vilo
  • vilo
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
16 years 3 months ago #70939 by vilo
Replied by vilo on topic Re:Messages ABOVE component heading
slabbi wrote:

The only way to fix this for your template is to remove the text manually.

Maybe you can change the uddeJSEFredirect function, so that no text is passed to mosRedirect.


Thanks for the quick reply.

This is what I ended up doing and it wasn't that difficult.

in "components/com_uddeim/includes.php" I altered two functions, uddeJredirect and uddeJSEFredirect as follows

FROM:
[code:1]
function uddeJredirect($url, $msg='') {

global $mainframe;
$redirecturl = $url;
if ( class_exists('JRoute') ) {
$mainframe->redirect( $redirecturl, JText::_($msg) );
}

mosRedirect( $redirecturl, $msg );
}

function uddeJSEFredirect($url, $msg='') {

global $mainframe;
if ( class_exists('JRoute') ) {
$redirecturl = JRoute::_($url, false);
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
$redirecturl = sefRelToAbs($url);

mosRedirect( $redirecturl, $msg);
}
[/code:1]

TO:

[code:1]
function uddeJredirect($url, $msg='') {

global $mainframe;
$redirecturl = $url;
if ( class_exists('JRoute') ) {
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
//added
if (trim( $redirecturl )) {
if (strpos( $url, '?' )) {
$redirecturl .= '&nomosmsg=' . $msg ;
} else {
$redirecturl .= '?nomosmsg=' . $msg ;
}
}
//added end

//mosRedirect( $redirecturl, $msg );//org
mosRedirect( $redirecturl);//changed
}

function uddeJSEFredirect($url, $msg='') {

global $mainframe;
if ( class_exists('JRoute') ) {
$redirecturl = JRoute::_($url, false);
$mainframe->redirect( $redirecturl, JText::_($msg) );
}
$redirecturl = sefRelToAbs($url);
//added
if (trim( $redirecturl )) {
if (strpos( $url, '?' )) {
$redirecturl .= '&nomosmsg=' . $msg ;
} else {
$redirecturl .= '?nomosmsg=' . $msg ;
}
}
//added end

//mosRedirect( $redirecturl, $msg);//org
mosRedirect( $redirecturl);//changed
}

[/code:1]

and then added at the bottom of the function print_uddemenu in the same includes.php file this snippet to display the message within the menu


As you see I added some table formating too for nicely displaying the message on the right side. Top of this table is not shown in the snippet.

>> I tried to post that snippet here for 20 times but joomlaboard is generating error with that snipped and is not letting me to submit this post. It seems that any attempt to use GET var will kill the message, even if I put it in the code tags.<<

The whole difference was not sending $msg from uddeJredirect and uddeJSEFredirect to mosRedirect, and rather append to url our own message in "nomosmsg" and then getting it after submission from GET "nomosmsg".

It wasn't that hard after all. Thanks again.

Post edited by: vilo, at: 2008/08/10 22:09

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
16 years 3 months ago #70940 by slabbi
Replied by slabbi on topic Re:Messages ABOVE component heading
Be careful: Your code is NOT safe against XSS attacks and maybe other attacks! Please do not use _GET to receive the text!

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

  • vilo
  • vilo
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
16 years 2 months ago #72053 by vilo
Replied by vilo on topic Re:Messages ABOVE component heading
slabbi wrote:

Be careful: Your code is NOT safe against XSS attacks and maybe other attacks! Please do not use _GET to receive the text!


Thanks for pointing that out. I changed it to:

[code:1]echo stripslashes( strval( mosGetParam( $ _GET, 'nomosmsg', '' ) ) );[/code:1]

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum