Customizing block
dreadstar - April 21, 2009 - 15:24
| Project: | Automated Logout |
| Version: | 6.x-1.5 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I would like to know if I can modify the style or text formatting countdown timer in the block that came with automated logout? In addition, I would like to change the default highlight tagging from red to green and highlight threshold from 5 minutes to 30 minutes. However, fiddling around with administer-> site config-> countdown timer-> highlight tagging and highlight threshold values does not seem to affect the output of the timer in the block.

#1
Try the nightly dev snapshot tomorrow for the 6.x-1.x branch.
#2
Thank you for immediately looking into my request.
I tried the development snapshot 6.x-1.x-dev dated april 22, 2009. Changing "highlight tagging" and "highlight threshold values" still does not affect the block. In fact, the countdown timer does not even turn red anymore at the 5 minute mark unlike the official release. I have set the following values as a test on the countdown timer module:
Highlight tagging:
style="color:green;"
Highlight threshold (minutes):
30
So far it just ignores all these settings.
#3
View source on the page and see what the logout block html code is.
It should look something like this (ie no format txt and no highlight code).
You mention the color not working, is the format txt matching the countdown module,
or the old autologout format?
<h2>LOGOUT</h2>
<div class="content">
<span class="countdowntimer">You will be automatically logged out at Wed, 22 Apr 2009 14:47:03 -0400 if this page is not refreshed before then.
<span style="display:none" class="datetime">2009-04-22T14:47:03-04:00</span>
<span style="display:none" class="current_server_time">2009-04-22T14:45:33-04:00</span>
<span style="display:none" class="dir">down</span>
<span style="display:none" class="complete">You have been logged out. </span>
<span style="display:none" class="tc_redir">http://drupal6.vandervortsweb.com</span><span style="display:none" class="tc_msg">Bye!</span></span></div>
</div>
#4
I found the lines in autologout.module
$block['content'] = '<span class="countdowntimer">'. t('You will be automatically logged out at') .' '. date('r', $logout_time) .' '. t('if this page is not refreshed before then.') .'
<span style="display:none" class="datetime">'. date('Y-m-d\TH:i:s', $logout_time) . $tz .':00</span>
<span style="display:none" class="current_server_time">'. date('Y-m-d\TH:i:s') . $tz .':00</span>
<span style="display:none" class="dir">down</span>
<span style="display:none" class="complete">'. t('You have been logged out.') .' '. ($refresh ? ' '. t('This page will refresh in %refresh seconds.', array('%refresh' => $refresh)) : '') .'</span>
';
I'm not sure how to edit this nor what to modify. Help?
For the color problem, I used countdown module format by inputing style="color:green;" under Highlight Tagging: inputbox in the Countdown module admin page. Im not sure what you meant by old autologout format.
#5
Do the view-source on you actual web page. Look at the html shown in the web browser.
View->page source in Firefox, and then find the logout block code.
#6
Thank you. I understood your instructions this time. However it was my fault for not stating the problem very clearly. I only want to change the color format of the countdown timer for the highlighted threshold duration. For example, in the case when the automatic logout is set for 30 minutes and the highlight threshold in countdown timer module is set to 5 minutes. When the countdown timer reaches below 5 minutes, the color of the timer changes color from black to red. I just want to change the color from black to green.
Giving this more thought, I believe this might be an issue with the countdown timer module rather than the automated logout module?
#7
Yep, I still needed to remove the hard coded defaults from autologout so that the global settings for the countdown timer module work. Now that I've done so in autologout 6.x-1.x-dev from 2009-Apr-21 we should be headed in the right direction.
#8
I can confirm that it somewhat works already except the color change is offset by 1 minute. Instead on the 5 minute mark, it changes green a minute earlier at the 6 minute mark. Playing around also with the settings of the countdown timer module does not affect the automated logout block. Still hard coded?