Author Topic: Latest release  (Read 2632 times)

Offline Tonyrc

  • Jr. Member
  • **
  • Posts: 29
Latest release
« 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

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Latest release
« Reply #1 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($nameRCUBE_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($nameRCUBE_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.
 
  

Offline Tonyrc

  • Jr. Member
  • **
  • Posts: 29
Reply to version display
« Reply #2 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($nameRCUBE_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($nameRCUBE_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?

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Latest release
« Reply #3 on: October 17, 2008, 11:49:19 PM »
Yeah, you're right.  I messed up with the last part... here are the steps:

  • Edit /skins/default/templates/login.html and /skins/default/includes/header.html to add the following where I want it:
  • 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.
 
  

Offline Tonyrc

  • Jr. Member
  • **
  • Posts: 29
It works, But
« Reply #4 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

Thanks for your help

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Latest release
« Reply #5 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.
 
  

Offline Tonyrc

  • Jr. Member
  • **
  • Posts: 29
All Done
« Reply #6 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

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Latest release
« Reply #7 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.
 
  

Offline Tonyrc

  • Jr. Member
  • **
  • Posts: 29
Much easier this way!
« Reply #8 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
« Last Edit: November 12, 2008, 09:47:29 AM by Tonyrc »