Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROBLEM No date/time information after update to 3.3.10
#1
Hi,

I try 3.3.10 on a local WAMP server, installing it from download file and then copying my web gs files into the new installation.

Amazingly, only one problem occurs: My site has date functions, like strftime, in the footer, and in newsmanager posts, with DATE_FORMAT settings, which work well in my old online installation (3.3.5), but not on my local WAMP server. The new installation simply shows nothing instead of the date.

On the other side, a file like the attached datum.php works fine on the same WAMP server...


What am I doing wrong? Huh

Thank you for your help,

Hypertexter


Attached Files
.php   datum.php (Size: 883 bytes / Downloads: 3)
Reply
#2
Are you sure it's an issue with GS 3.3.10? Had you tried previous GS versions in the same WAMP server?

What NM version?

The file you attached does not use strftime, by the way.
Reply
#3
Did you set a timezone is gsconfig?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
Hello Carlos,
Hello shawn_a,

no, I'm not sure, 3.3.10 is my first installation on the WAMP server.

In the gsconfig.php I found this:

PHP Code:
# Define default timezone of server, accepts php timezone string
# valid timeszones can be found here http://www.php.net/manual/en/timezones.php
define('GSTIMEZONE''Europe/Amsterdam'); 


The file was only to see if my WAMP server says something about date/time at all. But even the permanent data information in News Manager posts (post date) is not displayed.

It is News Manager 3.1 and News Manager Addons 0.9.3.1.

Hypertexter

PS: Now I updated to News Manager 3.3.1 and News Manager Addons 0.9.3.2 after I saw the update information in the plugins section of my old online 3.3.5 installation. (but I still get no post date)

The local 3.3.10 installation shows no update information for the plugins and no one for the GS version, so there seems to be something else wrong with my installation...
Reply
#5
Maybe an issue with some locales not available in WAMP. Try selecting en_US in NM Settings and check if English dates are shown in posts.
Reply
#6
Quote:Try selecting en_US in NM Settings

This only shows "Published on _" instead of "Veröffentlicht am _", followed by no date.
Reply
#7
Perhaps error logs say something, since you do not usually get a blank output in php.
or enable debugging
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
PHP error log is empty.

I switched from my modified Innovation theme to the standard Cardinal theme, and Cardinal displays a "Published on  August 9th, 2016" at the bottom of the page.

What I had in Innovation template.php and what always worked online was

PHP Code:
<article>
            
            <
section>
                
                <!-- 
title and content -->
                <
h1><?php get_page_title(); ?></h1>
                <?php get_page_content(); ?>
                
                <!-- page footer -->
                <div class="footer">
                    <?php /* <p>Published on <time datetime="<?php get_page_date.strftime('Y-m-d'); ?>" pubdate> */ ?>
                    Heute ist <?php echo strftime("%A, der %-d. %B %Y"); ?>
                </div>
            </section>
            
        </article> 


OK, that was not the published date, but the actual date. But it worked.

But in both themes no date in News Manager posts...
Reply
#9
Those tokens are based on the OS support, and installed php libraries, so some are not always supported.


ohh maybe you are just using it wrong though

PHP Code:
function get_page_date($i "l, F jS, Y - g:i A"$echo=true) {
    global 
$date;
    global 
$TIMEZONE;
    if (
$TIMEZONE != '') {
        if (
function_exists('date_default_timezone_set')) {
            
date_default_timezone_set($TIMEZONE);
        }
    }
    
    
$myVar date($istrtotime($date));
    
    if (
$echo) {
        echo 
$myVar;
    } else {
        return 
$myVar;
    }

NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#10
@shawn_a

I do not understand your last post. Where do I have to insert that code?
Reply
#11
I get closer to the News Manager problem.

Online I used the following user defined setting for date:
DATE_FORMAT <time itemprop="datePublished" datetime="%Y-%m-%dT%H:%M:%S%z">%-e.&nbsp;%B %Y</time>

which worked fine. But I need to delete it to get a date in WAMP NM posts. What could be wrong with that?


Edit: Oh no... it just was my very special "-e", which avoids two empty spaces before a one digit date number... Undecided
Reply
#12
OK, I could solve nearly all my problems by reading this thread:
http://get-simple.info/forums/showthread.php?tid=6887

It works with strftime, displays the page date in german, wonderful - but only online.
Something on my WAMP server seems to ignore strftime completely. If somebody knows how I could enable it, please tell me. Heart

Thank you for your help.

Hypertexter
Reply
#13
I suggest you don't use %-e on Windows hosts, as it is not supported.
Use %#d instead, or %e, that will be converted to %#d by News Manager anyway.
Reply
#14
OK, I see. Thank you!
Reply
#15
Isn't there a wrapper for this, that does the substitution for you ?
format_date or something ?

I do not have 3.3.x code in front of me.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#16
NM has its own nm_get_date

GS 3.4 has formatDate (which also does the %e -> %#d conversion on Windows hosts) (GitHub #85)
Reply
#17
ahh right
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)