test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • emwebmaster Friend
    #178366

    I’m using the JA Bulletin extension in the Joomla 2.5 version of Cloris. It currently displays the Last Modified date, but I need it to display the article Created or Published date instead.

    I’m pretty certain I’ve isolated what code I need to tweak:

    public_html/modules/mod_jabulletin/helper.php

    Lines 168-169:
    [PHP] if ($showdate) {
    $item->date = $item->modified == null || $item->modified == “” || $item->modified == “0000-00-00 00:00:00” ? $item->created : $item->modified;[/PHP]

    But I’m not sure how to write the necessary code. Can anyone suggest some syntax?

    Thanks in advance.

    emwebmaster Friend
    #458392

    I figured it out myself. What’s needed is an additional line of code, not a change to that existing line. I grabbed the code snippet from the helper.php file in JA Sidenews, which does sort by created by dates. I was also wrong about where to add this additional piece of code. I think lines 168-169 belong to the portion of code pertaining to K2 content, I needed to change content pulled from Joomla! articles.

    So here’s what to do, within public_html/modules/mod_jabulletin/helper.php go to lines 425-427. You should see the exact same line of code as mentioned in my previous post.

    Now above that line of code, add this:

    [PHP] $item->modified =($item->modified != ” && $item->modified != ‘0000-00-00 00:00:00’) ? $item->created : $item->created;
    [/PHP]

    So the whole thing should look like, starting from line 420:

    [PHP] $item->introtext = JHtml::_(‘content.prepare’, $item->introtext);
    $item->text = htmlspecialchars ( $item->title );

    $item->modified =($item->modified != ” && $item->modified != ‘0000-00-00 00:00:00’) ? $item->created : $item->created;

    if ($showdate) {
    $item->date = $item->modified == null||$item->modified==””||$item->modified==”0000-00-00 00:00:00″ ? $item->created : $item->modified;
    }
    $item->image = ”;
    [/PHP]

    That seemed to do the trick.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 1 voice, and was last updated by  emwebmaster 12 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum