1
tedsmith
WF-Downloads 3.2 RC1 - Recent Downloads date showing as seconds since Unix Epoch as integers
  • 2007/6/20 16:12

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


The latest upgrade from 2.05 to 3.2 RC1 of WF-Downloads ic causing me a problem in my 'Recent Downloads' block. Basically, the date is being displayed as the integer based value as seconds passed from the Unix Epoch date value as opposed to the normal human readable date format. For example, '1182189976' is shown instead of 18/06/07. Screenshot Illustrates (this is confirmed by visitinghttp://www.unixtimestamp.com).

My template values for wfdownloads_block_new.html read as follows :

<ul>
  <{foreach 
item=download from=$block.downloads}>
    <
li>[<{$download.date}>] <a href="<{$xoops_url}>/modules/<{$download.dirname}>/singlefile.php?cid=<{$download.cid}>&amp;lid=<{$download.id}>"><{$download.title}></a> </li>
  <{/foreach}>
</
ul>


The obvious value here being <{$download.date}> which I assume is a PHP function call to a date converter in Smarty? The value for the news module by comparison is working fine and can be seen in the same screenshot at the bottom. It uses [<{$news.date}>]. To add insult to injury, since updating the template for the 'Recent Downloads' block (to see if that helped) they are now all shown in a bizarre order - not in date order as they were before (whereas before they were still listed in date order even though the date conversion was not taking place).

I have requested support at The Smart Factory here if anyone wants to post there :http://smartfactory.ca/modules/newbb/viewtopic.php?topic_id=2050&forum=12&post_id=8273#forumpost8273

XOOPS 2.0.16
Software server : Zeus/4.3
PHP version : 4.4.7
MySql version : 4.1.22-standard-log

Cheers

Ted

2
tedsmith
Re: WF-Downloads 3.2 RC1 - Recent Downloads date showing as seconds since Unix Epoch as integers
  • 2007/6/21 18:48

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


No one else had this?

3
skenow
Re: WF-Downloads 3.2 RC1 - Recent Downloads date showing as seconds since Unix Epoch as integers
  • 2007/6/21 19:00

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Have you tried changing the date format in WFD's preferences?

4
tedsmith
Re: WF-Downloads 3.2 RC1 - Recent Downloads date showing as seconds since Unix Epoch as integers
  • 2007/6/21 21:19

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


Date format is set d-M-Y as required (http://uk.php.net/date). But those settings are just the PHP rendering of the converted and calculated dates. In this case the integer values are not being converted intoa date at all.

5
skenow
Re: WF-Downloads 3.2 RC1 - Recent Downloads date showing as seconds since Unix Epoch as integers
  • 2007/6/23 20:41

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Very odd.

I have not had this problem in any of my upgrades.

Let's take this apart - the block template looks like this

<ul>
  <{foreach 
item=download from=$block.downloads}>
    <
li>[<{$download.date}>] <a href="<{$xoops_url}>/modules/<{$download.dirname}>/singlefile.php?cid=<{$download.cid}>&lid=<{$download.id}>"><{$download.title}></a> </li>
  <{/foreach}>
</
ul>


You are correct, the <{$download.date}> value is what is being displayed as the published date for the download. The smarty being used just enumerates the different array values returned from the block code. The code returns an array - $block - which holds the titles, ids, published date, and wfdownloads directory for each download listed. There is no additional formatting done here - the formatting is done in the code that returns the array.

-> Template appears to be OK

The code that returns this information is in wfdownloads/blocks/wfdownloads_top.php using the function b_wfdownloads_top_show.

The line that fills the published date value is this one (line 50 in my copy) -

$download['date'] = formatTimestamp($download['published'], $wfModuleConfig['dateformat']);


formatTimestamp is defined in XOOPS_ROOT/include/functions.php. The first argument of the function is the timestamp to be formatted, the second is the format to use (and there is a third for the user's timezone offset).

Now, since you state the Recent News block is working correctly and it uses the same function (formatTimestamp), I will deduce that function is working correctly.

-> XOOPS functions appear to be OK

So, the question comes down to is the code in the block function OK and is the timestamp in the database OK?

Most likely, you database is OK, because the update does not impact the data, only the files.

Look for any 0 byte files in your wfdownloads directory and subdirectories. Then look at wfdownloads_top.

Good Luck!

Login

Who's Online

160 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 160


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits