Page 1 of 1
what is ?
Posted: Thu Aug 30, 2007 4:34 pm
by fire2006
hi there, i just viewed the source output of my joomla page, and noticed this...
what is this text, and how do I get rid of it (i am parsing the output and i dont want this text)
Re: what is ?
Posted: Thu Aug 30, 2007 4:45 pm
by bascherz
That's actually an XML comment. The "" ends it. Everything between should be ignored. You'll see this sort of thing from time to time in generated HTML. It's probably some sort of debug code.
Re: what is ?
Posted: Thu Aug 30, 2007 5:03 pm
by matthewhayashida
I have also noticed the number increases all the time. It must be some type of timestamp? or counter?
I remember seeing a post that explained it. I will look.
Re: what is ?
Posted: Thu Aug 30, 2007 5:10 pm
by Tonie
Don't know what it's used for, but the number is a UNIX Timestamp. This is a time representation that is the number of seconds since 1970. A converter can be found
here.
Re: what is ?
Posted: Thu Aug 30, 2007 6:21 pm
by matthewhayashida
Oh. Thanks for that. I was wondering. Is it safe to remove? If so how do I do it?
Re: what is ?
Posted: Fri Aug 31, 2007 6:38 pm
by fire2006
I need to know too how to remove it... any ideas?
Re: what is ?
Posted: Fri Aug 31, 2007 7:08 pm
by bascherz
You'll need to look at the code of the module, template, or whatever it is you are working on and search for the "<--". There is going to be a line of code that either echoes that string or appends it to a variable, followed by a time string and the "-->" ending part. Just delete any lines of code involved in outputting that string and you should be fine.
Re: what is ?
Posted: Fri Aug 31, 2007 7:27 pm
by matthewhayashida
This code isn't in templates or modules/plugins/components. Its somewhere in the core.
Re: what is ?
Posted: Fri Aug 31, 2007 8:22 pm
by bascherz
So, do a recursive grep for it. It should be safe to remove.
Re: what is ?
Posted: Fri Aug 31, 2007 8:25 pm
by GMassi
Look almost at the end of main Joomla index.php file
// loads template file
if ( !file_exists( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' ) ) {
echo _TEMPLATE_WARN . $cur_template;
} else {
require_once( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' );
echo '';
}
That's the code that generates the timestamp.
Re: what is ?
Posted: Sat Sep 01, 2007 3:57 am
by fire2006
you rock GMassi!!!! Thanks!!!
Re: what is ?
Posted: Fri Sep 07, 2007 8:32 pm
by ctf20
do you just remove this line?....
echo '';
and nothing else?
any reason not to remove it?
Re: what is ?
Posted: Fri Sep 07, 2007 11:25 pm
by Puckeye
I don't know if there's a reason that you need to keep it but I must say I don't think there's any reason to remove it.
But if you want to remove it I'd remove the whole else block
Code: Select all
else {
require_once( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' );
echo '<!-- '. time() .' -->';
}
Note you have to keep the closing } located in front of the else keyword.
Re: what is ?
Posted: Sat Sep 08, 2007 7:46 am
by jalil
i'm writing code to utilise that bit of information in future. if you remove it your site will be unique and would not be able to use the component i haven't made
Re: what is ?
Posted: Mon Sep 10, 2007 4:08 pm
by ctf20
Puckeye wrote:I don't know if there's a reason that you need to keep it but I must say I don't think there's any reason to remove it.
But if you want to remove it I'd remove the whole else block
Code: Select all
else {
require_once( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' );
echo '<!-- '. time() .' -->';
}
Note you have to keep the closing } located in front of the else keyword.
i removed that you said, and the site disappeared, just blank. --so i put it back...
Re: what is ?
Posted: Tue Sep 11, 2007 3:49 pm
by ChiefGoFor
Personally, I do not think it hurts anything to leave it in. If you use the "Cache" setting withing Joomla, you can use that timestamp to know if you are looking at a cached version.
If you hit "refresh", the timestamp should change. If it does not change, then you know that you are looking at a cached version of that page.
I'm sure there are other reasons, but that is what I use it for.
Re: what is ?
Posted: Tue Sep 11, 2007 11:58 pm
by jalil
also the timestamp, since it is there can be used to measure time delays between user request and response, which is extremely useful to manage users coming from various types of links. so it is a useful subtle feature.
Re: what is ?
Posted: Wed Sep 12, 2007 2:03 am
by DeanMarshall
This debug code has been removed from the SVN (latest development version) of Joomla.
Dean