Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: Tonyrc on September 12, 2008, 04:49:14 PM

Title: Latest release
Post by: Tonyrc on September 12, 2008, 04:49:14 PM
I have been running with RC for some time now.
Looking at index.php it would appear I'm on 0.1.1
Questions;
Is there a way of displaying the release without having to go into the code as I have above?
Is there a newer release of RC?

Thanks in advance
Title: Latest release
Post by: bpat1434 on September 12, 2008, 05:23:00 PM
0.1.1 is the latest stable release.  If you wanted to display it, you'd have a bit of work cut out for you.

You could edit your skins/default/templates/login.html or skins/default/templates/mail.html and add this to it:



Then go into program/includes/rcube_template.inc and find the method "xml_command" around line 442.  Inside the switch in the xml_command method look for this:
 // return variable
      case 'var':
        $var = explode(':', $attrib['name']);
        $name = $var[1];
        $value = '';
       
        switch ($var[0])
        {
          case 'env':
            $value = $this->env[$name];
            break;
          case 'config':
            $value = $this->config[$name];
            if (is_array($value) && $value[$_SESSION['imap_host']])
              $value = $value[$_SESSION['imap_host']];
            break;
          case 'request':
            $value = get_input_value($name, RCUBE_INPUT_GPC);
            break;
          case 'session':
            $value = $_SESSION[$name];
            break;
        }
       
        if (is_array($value))
          $value = join(", ", $value);
       
        return Q($value);
Now, after "case 'session':" add this:
 case 'defined':
$value = constant($name);
break;

So it should look like:
      // return variable
      case 'var':
        $var = explode(':', $attrib['name']);
        $name = $var[1];
        $value = '';
       
        switch ($var[0])
        {
          case 'env':
            $value = $this->env[$name];
            break;
          case 'config':
            $value = $this->config[$name];
            if (is_array($value) && $value[$_SESSION['imap_host']])
              $value = $value[$_SESSION['imap_host']];
            break;
          case 'request':
            $value = get_input_value($name, RCUBE_INPUT_GPC);
            break;
          case 'session':
            $value = $_SESSION[$name];
            break;
          case 'defined':
            $value = constant($name);
            break;
        }
       
        if (is_array($value))
          $value = join(", ", $value);
       
        return Q($value);

Works as expected.
Title: Reply to version display
Post by: Tonyrc on October 17, 2008, 10:54:48 AM
Quote from: bpat1434;13820
0.1.1 is the latest stable release.  If you wanted to display it, you'd have a bit of work cut out for you.

You could edit your skins/default/templates/login.html or skins/default/templates/mail.html and add this to it:



Then go into program/includes/rcube_template.inc and find the method "xml_command" around line 442.  Inside the switch in the xml_command method look for this:
 // return variable
      case 'var':
        $var = explode(':', $attrib['name']);
        $name = $var[1];
        $value = '';
       
        switch ($var[0])
        {
          case 'env':
            $value = $this->env[$name];
            break;
          case 'config':
            $value = $this->config[$name];
            if (is_array($value) && $value[$_SESSION['imap_host']])
              $value = $value[$_SESSION['imap_host']];
            break;
          case 'request':
            $value = get_input_value($name, RCUBE_INPUT_GPC);
            break;
          case 'session':
            $value = $_SESSION[$name];
            break;
        }
       
        if (is_array($value))
          $value = join(", ", $value);
       
        return Q($value);
Now, after "case 'session':" add this:
 case 'defined':
$value = constant($name);
break;

So it should look like:
      // return variable
      case 'var':
        $var = explode(':', $attrib['name']);
        $name = $var[1];
        $value = '';
       
        switch ($var[0])
        {
          case 'env':
            $value = $this->env[$name];
            break;
          case 'config':
            $value = $this->config[$name];
            if (is_array($value) && $value[$_SESSION['imap_host']])
              $value = $value[$_SESSION['imap_host']];
            break;
          case 'request':
            $value = get_input_value($name, RCUBE_INPUT_GPC);
            break;
          case 'session':
            $value = $_SESSION[$name];
            break;
          case 'defined':
            $value = constant($name);
            break;
        }
       
        if (is_array($value))
          $value = join(", ", $value);
       
        return Q($value);

Works as expected.


Took a while to get arounfd to this change, but it doesn't work
changes made as above to;
skins/default/templates/mail.html
&
program/include/rcube_template.inc <==== Note include not includeS
in my RC this was after line 536!

Is there something missing?
Title: Latest release
Post by: bpat1434 on October 17, 2008, 11:49:19 PM
Yeah, you're right.  I messed up with the last part... here are the steps:

  • Edit /program/include/rcmail_template.inc to add the "var" case on line 537 to the xml_command method:
         case 'defined':
            $allowed = array('version'=>'RCMAIL_VERSION');
            if(array_key_exists($name, $allowed))
              $value = constant($allowed[$name]);
            else
              $value = '';
            break;
  • Save all files, upload

You can view a working example at http://roundcube.bpatterson.info:8080/0.1.1

I chose to use an allowed array in the defined case since certain constants you might not want to be divulged, so it's just a safe-guard; although, not entirely necessary.
Title: It works, But
Post by: Tonyrc on October 18, 2008, 10:15:40 AM
I now get the version on the login page positioned top left to the right of the line under the RC logo.
On the mailbox (header.html) pages the version is above and partly behind the RC logo!

all is see is "0.1.1" whereas you seem to have "powered by Roundcube webmail v0.1.1" at the bottom of the login box.

P.S. my login box does not have the server line displayed, I seem to remember changing something to stop it being displayed.

See the result of my changes here Welcome to RoundCube Webmail - Login page (http://mail.sturgess.co.uk)

Thanks for your help
Title: Latest release
Post by: bpat1434 on October 18, 2008, 10:25:24 AM
Well this is where your design skills come in.  You can place it anywhere you want.  To get the powered by, you have to actually add the text "Powered by ..." and then do the roundcube var html.  So for example, here's the body portion of my login.html:



"<roundcube:object" style="margin:2px 12px" />










" />





Powered by RoundCube Webmail v.






You just have to play around with it a bit to get it to look the way you want.
Title: All Done
Post by: Tonyrc on October 19, 2008, 07:09:57 PM
Thanks for the guidance, I have it showing the version both on the login page, in the format similar to yours, and the mail page at the top of the folders box.

Many thanks
Title: Latest release
Post by: bpat1434 on November 11, 2008, 11:25:51 PM
Just wanted to toss in an update.  You can actually just use:


instead of doing the above edits.  But either would work.
Title: Much easier this way!
Post by: Tonyrc on November 12, 2008, 09:42:09 AM
Quote from: bpat1434;15200
Just wanted to toss in an update.  You can actually just use:


instead of doing the above edits.  But either would work.


file changed; skins/default/includes/header.html

changes made:- (whole file here)



             






    Version.



Result is logged on userid above the RC logo and
Version 0.1.1 below the logo.
Note: the   x 7 for the userid - positions the userid above and lined up with
Round
Cube
Webmail
then the   x 2 lined up with the left end of the line under the logo.

Exactly what I was looking for.
Many thanks to all