Keyword

Show items with current creation date

More
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 11 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
13 years 10 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