All 'Created Date' of articles show today's date

Advanced newspaper or magazine Joomla template to build news website with unique and detailed design.
GK User
Fri May 07, 2010 3:49 am
I am not talking about the module. I have no problem with the module. There is a problem with blog pages.

There is a systemic problem with the template as it is written in that the Created Date variable is passed down incorrectly to the plain Joomla Section and Category Blog pages.

The blog-item.php file in the /html/com_content/section and /html/com_content/category directories has the correct code for displaying the variable:

<?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2')) ?>

However, the variable $this->article->created contains the WRONG DATA. It contains the wrong data even before it gets to the blog-item.php program file. That is the problem. The template, as currently written, has a problem. When the program gets to the line above, the variable $this->article->created contains Today's Date, not the date the article was created.

I read this thread and hoped that putting

<?php $this->article = $this->item; ?>

at the beginning of the blog-item.php files would help, because it seemed to help other people, but it solves one problem (fixes the date) and creates another (displaying the Written By). This new problem is created because $this->item seems to contain more information than we want, because $this->article->created ends up equal to some odd mix of the date and author data.

So I'm not talking about modules here. I'm talking about a problem with the basic Joomla blog function, that exists only in this TWN template. I can change the template on my site o something else and I do not have the same problem. It is particular to your template code.

You can see the same problem on your very own demo page here:

http://demo.gavick.com/joomla15/dec2009 ... Itemid=70#

Look below the modules and slideshow to the actual mainbody. Here you will see ALL the articles have the NOW date. Not just today's date, but the very date and time stamp at which you loaded the page. This is not right. How can anyone tell which articles are new and old if they all have the same date and time?

Again, I believe the problem is that the $this->article or $this->article->created variables are incorrectly set before these variables even get to teh blog-item.php files. That is my theory.

I'd be interest to know what you think.

Thanks in advance.

Sean

Sean
User avatar
Fresh Boarder

teitbite
Sun May 09, 2010 6:50 pm
Hi

Yes it's a bug with wrong name use. I'm addressing it to our programmer.
User avatar
Moderator

GK User
Sun May 09, 2010 7:38 pm
Thank you! Your help is greatly appreciated!
User avatar
Fresh Boarder

GK User
Mon May 10, 2010 9:55 pm
User avatar
Administrator

GK User
Mon May 10, 2010 10:22 pm
Thanks for the fix and the great support!

Sean
User avatar
Fresh Boarder

GK User
Wed May 12, 2010 10:52 am
I don't understand. There is no update package. You mean the gk_town_J!15.tgz file? And find the files referenced and replace them? I tried that and it did not work.
User avatar
Fresh Boarder

GK User
Wed May 12, 2010 11:12 am
Ok, figured it out. You guys missed a step in the instructions. Please add this to the update instructions so others don't have the same issue:


Open templates/gt_twn/html/com_content/frontpage/default_item.php and paste the following into Line 9.

Code:
$this->article = $this->item;
User avatar
Fresh Boarder

GK User
Wed May 12, 2010 2:10 pm
same bug exists in pulse template (thread)
User avatar
Senior Boarder

GK User
Wed Dec 08, 2010 4:49 am
Spanners wrote:CURRENT SOLUTION

OK I think I have it fixed :woohoo: . Here's what I have.

Open templates/gt_twn/html/com_content/frontpage/default_item.php and paste the following into Line 9.

Code: Select all
$this->article = $this->item;


Then open templates/gt_twn/html/com_content/category/blog_item.php and paste the following into Line 9.

Code: Select all
$this->article = $this->item;


Finally, open templates/gt_twn/html/com_content/section/blog_item.php and paste the following into Line 9.

Code: Select all
$this->article = $this->item;


@teitbite, can you confirm this is correct? Is this going to stuff my website down the track?



THX it's work fine!
User avatar
Fresh Boarder

GK User
Fri May 13, 2011 3:49 pm
Can you please define clearly what is the solution to this problem... I'm having the same issue... Created date changes every time I edit existing post. :(
User avatar
Fresh Boarder


cron