Keyword

Show items with current creation date

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89387 by stavroch
Show items with current creation date was created by stavroch
How can I show items in category list with current creation date?Note: I have items from the past and from the feature :) but I would like to show on the category page the items with the current date.

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89388 by stavroch
Replied by stavroch on topic Show items with current creation date
Any news about the above?

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89389 by stavroch
Replied by stavroch on topic Show items with current creation date
Hy Leigh,
My site is an entertainment portal. For example I have category with the cinema movies. I have define on the creation date the date where the movie will start. So I would like to display on the category page the whole items where start today. (creation date = current date).

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89390 by stavroch
Replied by stavroch on topic Show items with current creation date
and how can I sort the items on the category page?

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89391 by stavroch
Replied by stavroch on topic Show items with current creation date
I don't want manually I would like to sort the items through the creation date, where the creation date = current date.

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89392 by stavroch
Replied by stavroch on topic Show items with current creation date
The Oldest first display the oldest items for example items where the creation date is 28 of Oct. it doesn't display the current date items ex 18 Oct.

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89393 by stavroch
Replied by stavroch on topic Show items with current creation date
you are right. but it will not display the items with the current date. I could delete the old items So to display the current date items but I would like to have as a movie library. If the user choose horror film then they can see the whole movies.

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89394 by Jiliko.net
Replied by Jiliko.net on topic Show items with current creation date
Hi Stavros,

What you can do is creating a K2 template override and add some code in the 'category.php' file to filter items by current date before they're being displayed.

Olivier

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89395 by stavroch
Replied by stavroch on topic Show items with current creation date
What kind of code do I have to write?

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89396 by troponin
Replied by troponin on topic Show items with current creation date
should be something similiar to --> see attachment



but I think Olivier aka Yoda should correct me - could be that the code isn't 100% correct. Didn't tried it.


Stavros said:What kind of code do I have to write?
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89397 by Jiliko.net
Replied by Jiliko.net on topic Show items with current creation date
Work, this code should...

Olivier

Troponin said: should be something similiar to --> see attachment



but I think Olivier aka Yoda should correct me - could be that the code isn't 100% correct. Didn't tried it.


Stavros said:What kind of code do I have to write?

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89398 by stavroch
Replied by stavroch on topic Show items with current creation date
I change the original category.php
I paste the
I get white page. The source code of this file is
How can I change it to work?
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89399 by troponin
Replied by troponin on topic Show items with current creation date
imo you should wrap the if clause around

<-- Leading items -->
till
<-- Pagination -->

The other Question is:
What about Date Formating - does it matter for getdate() ?
Maybe someone could answer...

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89400 by stavroch
Replied by stavroch on topic Show items with current creation date
Tha date format is dd mm yyyy (without time)

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89401 by stavroch
Replied by stavroch on topic Show items with current creation date
Here is the code of category.php
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89402 by Jiliko.net
Replied by Jiliko.net on topic Show items with current creation date
Hi Stavros,

I've checked the code and the test is not at the right place.

But, more important is that by hiding the items with date != today, you're gonna have layout & pagination problems.

Let me explain :

K2 got a function that retrieves items with params corresponding to the itemlist menu you've configured (ordering, # of items in primary, secondary, etc).
This function returns a number of items and pagination is generated from this result.
In the category.php, You've got all the returned items (let say 20 items), if you filter with date = today, you may now have 6 items, so pagination won't be right anymore and primary, secondary columns won't display the items correctly due to missing items in the item list.

The best thing to do would be to modify K2 core files to add a new param in item filter list like 'Only today item'.

Olivier

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89403 by stavroch
Replied by stavroch on topic Show items with current creation date
Right this is what I would like to have on the admin page and not on the template code. The best think is to show the items with the current date and after that to show the most recent items. So if I choose 20 items per category page then they can show the first 5 items with the current date and the next 15 to show the recent items.

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 7 months ago #89404 by stavroch
Replied by stavroch on topic Show items with current creation date
I have check out that the mod_aidanews_for_K2 has the attribute to show the upcoming events. So, can I have this attribute (upcoming events) to the K2 category page?

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #89405 by Jiliko.net
Replied by Jiliko.net on topic Show items with current creation date
Stavors,

In attachment, a category.php modified file that retrieves the x items of the day and displays them before the core item list.

You can configure in the file the number of items of the day to display. The items are sorted the same way as other files.

Sure, all this could be done in a nice K2 plugin but the essential is here.

Olivier

Please Log in or Create an account to join the conversation.

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
14 years 6 months ago #89406 by stavroch
Replied by stavroch on topic Show items with current creation date
Hy Olivier,

Thank for your job some elements are not closed to the right position.
Also it doesn't display the image of items on the category page.

I am waiting your new version

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum