bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

1970 issue

(9 posts)
  • Started 11 months ago by electroniques
  • Latest reply from chrishajer
  • This topic is not resolved

Tags:

  1. Hey.

    Usually it only displays the freshness of my forum's post, but when using the search function it also shows the date the post was created.
    Unfortunately it show the year 1970.
    Here's the link:
    http://www.cmscentral.de/content/forum/search.php?q=Family

    Does anyone know how to fix this?

    Thanks in advance!

    Posted 11 months ago #
  2. vafaaaan
    Member

    db table bb_topics -> row topic_time is datetime and picks time from server ? check if server time is correct .. maybe

    did you add the topic manually?

    Posted 11 months ago #
  3. I reported a similar problem for the bbPress plugin forum about 6 weeks ago, but there is no action on the ticket.

    http://trac.bbpress.org/ticket/753

    My guess is the template is calling the wrong time/timestamp function since it doesn't happen with the stock kakumei theme.

    Posted 11 months ago #
  4. Could you post the search.php in your template? and check database to ensure the time is correct in database.

    Posted 11 months ago #
  5. Hey.

    I checked the Database time and it is correct.
    So it must be some theme/bbpress related error.
    Here's my search.php:


    <?php bb_get_header(); ?>

    <h3 class="bbcrumb">"><?php option('name'); ?> » <?php _e('Search')?></h3>
    <?php search_form( $q ); ?>

    <?php if ( !empty ( $q ) ) : ?>
    <h2><?php _e('Search for')?> “<?php echo wp_specialchars($q); ?>”</h2>
    <?php endif; ?>

    <?php if ( $users ) : ?>
    <h2><?php _e('Users')?></h2>

    <?php endif; ?>

    <?php if ( $titles ) : ?>
    <h2><?php _e('Thread title matches')?></h2>

      <?php
      foreach ( $titles as $topic ) :
      $count = $topic->topic_posts;
      ?>

    1. <h4>"><?php topic_title(); ?></h4>
      <small><?php printf(__(' %1$d replies — Last reply: %2$s'), $count, get_topic_date(__('F j, Y'), $topic->topic_id) ) ?> </small>
    2. <?php endforeach; ?>

    <?php endif; ?>

    <?php if ( $recent ) : ?>
    <h2><?php _e('Recent Posts')?></h2>
    <ol class="results">
    <?php foreach ( $recent as $bb_post ) : ?>

  6. <h4>"><?php topic_title($bb_post->topic_id); ?></h4>
    <p><?php echo show_context($q, $bb_post->post_text); ?></p>
    <p><small><?php _e('Posted') ?> <?php echo date(__('F j, Y, h:i A'), bb_get_post_time()); ?></small></p>
  7. <?php endforeach; ?>

    <?php endif; ?>

    <?php if ( $relevant ) : ?>
    <h2><?php _e('Relevant posts')?></h2>
    <ol class="results">
    <?php foreach ( $relevant as $bb_post ) : ?>

  8. <h4>"><?php topic_title($bb_post->topic_id); ?></h4>
    <p><?php echo show_context($q, $bb_post->post_text); ?></p>
    <p><small><?php _e('Posted') ?> <?php echo date(__('F j, Y, h:i A'), bb_get_post_time()); ?></small></p>
  9. <?php endforeach; ?>

    <?php endif; ?>

    <?php if ( !$topics && !$recent && !$relevant && !users) : ?>
    <p><?php _e('No results found.') ?></p>
    <?php endif; ?>

    <p><?php printf(__('You may also try your search at Google'), bb_get_option('uri'), urlencode($q)) ?></p>
    <?php bb_get_footer(); ?>
    </code

Posted 11 months ago #
  • livibetter
    Member

    This is quite old (check this diff)

    <?php echo date(__('F j, Y, h:i A'), bb_get_post_time()); ?>

    replace it with

    <?php bb_post_time( __('F j, Y, h:i A') ); ?>

    You are using 0.8.3, right? You should use an updated theme.

    Posted 11 months ago #
  • electroniques
    Member

    Hey.

    Yes, that's it.
    Works like a charm now!
    And yes again, I'm using 0.8.3, but switching to a different theme is close to impossible since I have modified it so heavily to match my Wordpress-Blog.

    Thanks a lot!

    Posted 11 months ago #
  • livibetter
    Member

    I see.
    There are some useless code in search.php, like $users and $titles. They are not used in 0.8.3. If you can't switch to an updated template, then you should diff to find out what has been changed.

    Posted 11 months ago #
  • chrishajer
    Moderator

    Now the plugin browser theme just needs to be fixed :)

    Posted 11 months ago #

  • RSS feed for this topic

    Reply

    You must log in to post.

    Code is Poetry.