Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


Messages ABOVE component heading
Date: 2008/08/10 13:03 By: vilo Status: CB Doc subscriber  
Karma: 0  
Fresh Joomlapolitan

Posts: 13
graphgraph
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
Click here to see the profile of this user The administrator has disabled public write access.

Re:Messages ABOVE component heading
Date: 2008/08/10 19:41 By: slabbi Status: CB Doc subscriber  
Karma: 69  
Moderator

Posts: 1172
graphgraph
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 Development
CB Language Workgroup
CB 3rd Party Developer
Click here to see the profile of this user The administrator has disabled public write access.

Re:Messages ABOVE component heading
Date: 2008/08/10 21:56 By: vilo Status: CB Doc subscriber  
Karma: 0  
Fresh Joomlapolitan

Posts: 13
graphgraph
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:

  function uddeJredirect($url$msg='') {          global $mainframe;     $redirecturl $url;     if ( class_exists('JRoute') ) {         $mainframe->redirect$redirecturlJText::_($msg) );     }     mosRedirect$redirecturl$msg ); } function uddeJSEFredirect($url$msg='') {     global $mainframe;     if ( class_exists('JRoute') ) {         $redirecturl JRoute::_($urlfalse);         $mainframe->redirect$redirecturlJText::_($msg) );     }     $redirecturl sefRelToAbs($url);     mosRedirect$redirecturl$msg); }



TO:

Code:

  function uddeJredirect($url$msg='') {          global $mainframe;     $redirecturl $url;     if ( class_exists('JRoute') ) {         $mainframe->redirect$redirecturlJText::_($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::_($urlfalse);         $mainframe->redirect$redirecturlJText::_($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 }



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
Click here to see the profile of this user The administrator has disabled public write access.

Re:Messages ABOVE component heading
Date: 2008/08/10 22:19 By: slabbi Status: CB Doc subscriber  
Karma: 69  
Moderator

Posts: 1172
graphgraph
Be careful: Your code is NOT safe against XSS attacks and maybe other attacks! Please do not use _GET to receive the text!
uddeIM Development
CB Language Workgroup
CB 3rd Party Developer
Click here to see the profile of this user The administrator has disabled public write access.

Re:Messages ABOVE component heading
Date: 2008/08/24 02:11 By: vilo Status: CB Doc subscriber  
Karma: 0  
Fresh Joomlapolitan

Posts: 13
graphgraph
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:

 echo stripslashesstrvalmosGetParam( $ _GET'nomosmsg''' ) ) );

Click here to see the profile of this user The administrator has disabled public write access.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login