How can I filter a blog view to display only future events?

More
13 years 5 months ago #28683 by grabit
Thank you Micker,

there was also a line needed
Code:
<?php endif; ?>
just at the end after
Code:
</li> <?php endif; ?> <?php endfor; ?> </ul>

Now the page is displaying well but the condition seems not working because I can still see all the films.

My release date field is displayed in underdescription position.

I will check tonight.

An Apple a days keeps the doctor away

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

More
13 years 5 months ago #28700 by grabit
I have an error 500 now here is the message.

DateTime::__construct(): Failed to parse time string (9 janvier 2013) at position 5 (v): The timezone could not be found in the database


Any suggestions?

An Apple a days keeps the doctor away

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

More
13 years 5 months ago #28705 by ggppdk
What if FLEXIcontent module had
-(a) pagination and
-(b) order by custom field?

you not be able to use a category template
but
you could copy the news.php module template and shape close to your needs


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

More
13 years 5 months ago #28709 by grabit
Yes but I find the module a bit slower than the blog. (it is only an impression).

But I think I am close to find the solution with the Micker proposal the only problem is the datetime and the Timezone problem. This was not present in Joomla 1.5 and FC 1.5.6.
Code:
<?php for ($i=0; $i<$leadnum; $i++) : $enddate = $items[$i]->fields['Dfin']->display; $enddate = new DateTime($enddate); $enddate = $enddate->format('Ymd'); $now = date('Ymd', strtotime('+1 day')); if( $now <= $enddate) : ?>

new DateTime($enddate); gives me an error 500 with this message:

DateTime::__construct(): Failed to parse time string (9 janvier 2013) at position 5 (v): The timezone could not be found in the database


An Apple a days keeps the doctor away

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

More
13 years 5 months ago #28724 by micker
oups my solution is for fc 1.5.6 .. sorry

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 5 months ago #28726 by ggppdk
What is the format of your date field??

- first go to the edit flexicontent field and make sure it is outputting in a acceptable format, e,g for J2.5:
(a) select custom format,
(b) with format string d/m/Y

then if you have some dates that maybe invalid

you could use :
Code:
try { $enddate = new DateTime($enddate); } catch(Exception $e) { // catches 'Failed to parse time string $enddate = false; // Do not use this }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

More
13 years 5 months ago #28731 by micker
my format is
%Y%m%d
paybe the problem ;)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 5 months ago #28737 by grabit
Well with the code from GGPPDK the error 500 is gone but now I have a white page with 3 articles and I lost all my website around flexicontent.

Here is a picture with part of the output code underneath.

[attachment=0:2yk8jg7w]<!-- ia0 -->Capture d’écran 2012-09-20 à 11.14.02.png<!-- ia0 -->[/attachment:2yk8jg7w]

An Apple a days keeps the doctor away

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

More
13 years 5 months ago #28757 by ggppdk
this page looks like a PHP error occurred inside you FLEXIcontent template that is why you see a part of the page

-- enable error reporting
-- do a view page source
-- and look at the bottom of the page source

note if you enable error reporting then other PHP notices unrelated to your FLEXIcontent template may appear


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

More
13 years 5 months ago #28790 by grabit
Ok i Found the error that line was wrong
Code:
$enddate = $enddate->format('Ymd');
if I remove it the page display some items but in a weird way still in 4 pages but not complete some are displayed past and future so no rule.

I am a little bit lost and surely not a php programmer :oops: :lol:

An Apple a days keeps the doctor away

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

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save