test
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • wogand Friend
    #131060

    The albums of mine has been showing for 2 months now. When will the status “new” disappear?

    When I add an album I want it to be shown as “new” for like a few weeks or so after that the word new must disappear.

    Is it also possible when I added new pictures to an existing album it gets the status “updated”?

    Hope you can help.

    Regards

    Sherlock Friend
    #261110

    Hi
    you can see that ststus in gallery.php(componentscom_rsgallery2templatesja_semantichtml folder)
    Those lines :

    <span class='rsg2-galleryList-newImages'>
    <sup><?php if( $this->gallery->hasNewImages() ) echo _RSGALLERY_NEW; ?></sup>
    </span>

    wogand Friend
    #261229

    yes, but that isn’t an answer to my question.

    I found out the following in “includes/gallery.class.php”

    function hasNewImages(){
    global $database;
    $lastweek = mktime (0, 0, 0, date(“m”), date(“d”) – 7, date(“Y”));
    $lastweek = date(“Y-m-d H:m:s”,$lastweek);
    $database->setQuery(“SELECT COUNT(1) FROM #__rsgallery2_files WHERE date >= ‘$lastweek’ AND gallery_id = ‘{$this->id}'”);
    $database->query();
    return (bool) $database->getNumRows();

    Here it says after 7 days the status NEW should disappear. Howcome I still have status new? It has been months now…is the code above correct??

    Sherlock Friend
    #261296

    Hi
    You must change like this

    function hasNewImages(){
    global $database;
    $lastweek = mktime (0, 0, 0, date("m"), date("d") - 7, date("Y"));
    $lastweek = date("Y-m-d H:m:s",$lastweek);
    $gid=$this->id;
    $database->setQuery("SELECT * FROM #__rsgallery2_files WHERE date >= '$lastweek' AND gallery_id = '$gid'");
    //echo $database->getQuery();
    $database->query();
    return (bool) $database->getNumRows();
    }

    And in gallery.php(componentscom_rsgallery2templatesja _semantichtml folder)
    Change from :

    <span class='rsg2-galleryList-newImages'>
    <sup><?php if( $this->gallery->hasNewImages() ) echo _RSGALLERY_NEW; ?></sup>
    </span>

    to

    <span class='rsg2-galleryList-newImages'>
    <sup><?php if( $kid->hasNewImages() ) echo _RSGALLERY_NEW; ?></sup>
    </span>

    Sherlock Friend
    #261297

    <blockquote>Is it also possible when I added new pictures to an existing album it gets the status “updated”?</blockquote>
    you can change “new ” to “updated” as you want by edit english.php(administrator/components/com_rsgallery2/language/ folder)
    Search this line :

    DEFINE("_RSGALLERY_NEW", "New!");
    Change to

    DEFINE("_RSGALLERY_NEW", "Updated!");

    wogand Friend
    #261513

    I think it works now, have to wait 7 days to see for sure 🙂 Thanks alot!

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

This topic contains 6 replies, has 2 voices, and was last updated by  wogand 16 years, 5 months ago.

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