Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 13, 20177 yr ON \IPS\Content\Search\Index::indexData /* Or if this *is* the first comment, add the title and replace the tags */ $title = $object->mapped('title'); $isForItem = FALSE; if ( $object instanceof \IPS\Content\Comment ) { $itemClass = $class::$itemClass; if ( $itemClass::$firstCommentRequired and $object->isFirst() ) { $title = $object->item()->mapped('title'); $tags = ( $object->item() instanceof \IPS\Content\Tags and \IPS\Settings::i()->tags_enabled ) ? implode( ',', array_filter( $object->item()->tags() ) ) : NULL; $prefix = ( $object->item() instanceof \IPS\Content\Tags and \IPS\Settings::i()->tags_enabled ) ? $object->item()->prefix() : NULL; $isForItem = TRUE; } } /* Get the last updated date */ if ( $isForItem ) { $dateUpdated = $object->item()->mapped('last_comment'); } else { $dateUpdated = ( $object instanceof \IPS\Content\Item ) ? $object->mapped('last_comment') : $object->mapped('date'); } I suggest to replace ( $object instanceof \IPS\Content\Item ) ? $object->mapped('last_comment') : $object->mapped('date'); //TO ( $object instanceof \IPS\Content\Item ) ? $object->mapped( isset($object::$databaseColumnMap['updated']) ? 'updated' : 'last_comment' ) : $object->mapped('date');
August 15, 20177 yr I would actually suggest it be the other way - check for last_comment and if it doesn't exist, use updated. (I'm on my phone, I can't properly type code right now.) @bfarber we can have searchable content items that don't have comments (and therefore have no mapping for last_comment), but they still might have a mapping for updated.
August 16, 20177 yr 15 hours ago, HeadStand said: I would actually suggest it be the other way - check for last_comment and if it doesn't exist, use updated. (I'm on my phone, I can't properly type code right now.) @bfarber we can have searchable content items that don't have comments (and therefore have no mapping for last_comment), but they still might have a mapping for updated. Thanks - I've raised this internally for consideration.
August 22, 20177 yr During discussions about this suggestion it was pointed out that anything that can be 'updated' would get bumped to the top of activity streams, which is inconsistent and not intended. Is there a valid use case for having content that is updated bump to the top of an activity stream?
August 22, 20177 yr Author When user sort for Updated if some items are edited them must go on first page (for example wiki style content for pages app). I am building a app that when items are updated the activity show the items on "recent updated" feed helping users find real updated items (page polls with optionally have comments). I have not tested but I could extend get_last_comment and check for updated data if setted (not equal 0).
August 23, 20177 yr 11 hours ago, bfarber said: During discussions about this suggestion it was pointed out that anything that can be 'updated' would get bumped to the top of activity streams, which is inconsistent and not intended. Is there a valid use case for having content that is updated bump to the top of an activity stream? Fair enough. But I would still recommend checking if the last_comment mapping exists instead of assuming it does.
Archived
This topic is now archived and is closed to further replies.