Main menu

Forum


× Help Forum English

[SOLVED] Eventlist: both dates

  • tuco
  • Topic Author
  • New Member
  • New Member
More
7 years 2 months ago #13973 by tuco
Replied by tuco on topic Eventlist: both dates
Thank you for your patient with such an "pain in the neck" like me ;-).

Good luck in Paris...
and if you got more time in the future, I'm sure you'll find a way to complete this.
As I say: it works fine as it is, but it's "complaining on higher level"

greetings

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

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
7 years 2 months ago #13975 by Lyr!C
Replied by Lyr!C on topic Eventlist: both dates
Thanks!

Don't hesitate to post full code of your php file here (using as you did the "code" tags button) so that i could test it next week.
And list me where you have difficulties ;-)

Best regards,
Cyril

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

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

  • tuco
  • Topic Author
  • New Member
  • New Member
More
7 years 2 months ago - 7 years 2 months ago #13977 by tuco
Replied by tuco on topic Eventlist: both dates
Ha, I'm close to it...
There is a light at the tunnell ;)
BUT:
..first the code I insert (again at Line 126):
			<!-- ------------- me ----------------------  -->
<?php if (iCDate::isDate($item->startdate) && $item->weekdays) : ?>

	<?php if ($item->weekdays == 4 ) : ?>			
	<!--  Startdate-Weekday-->
			<span class="ic-sa-so-day">
			<?php echo JHtml::date($item->startdate, 'D', null); ?> 
			</span>
		<?php else : ?>
			<span class="ic-week-day">
			<?php echo JHtml::date($item->startdate, 'D', null); ?> 
			</span>
		<?php endif; ?>					
	<!--  Startdate-Rest-->
			<span class="ic-period-startdate">
			<?php echo JHtml::date($item->startdate, 'j. M Y', null); ?> 
			</span> - 
			<span class="ic-period-enddate">
		<?php echo JHtml::date($item->enddate, 'D j. M Y', null); ?>
			</span>
		<?php elseif ($dateday) : ?>
			<span class="ic-period-startdate">
			<?php echo JHtml::date($dateday, 'D j. M Y G:i', null); ?>
			</span>
		<?php else : ?>
			<span class="ic-period-startdate">
			<?php echo JHtml::date($item->next, 'D j. M Y G:i', null); ?>
			</span>
	<?php endif; ?>	
	<!-- ---------------------- End me ------------------------  -->

	<?php // Location (different display, depending on the fields filled) ?>

Well, let me say one thing.
The If-command:
<?php if ($item->weekdays == 0 || $item->weekdays == 6) : ?>
it seems not to do, what it should.
see:



that's fine, but then:



what the heck is that? Both outputs have the same if-command (above).
it only should Sunday and Saturday looks like this, but not Wednesday!
but look further:




and




I've tried to set
<?php if ($item->weekdays == 1 ) : ?>
then
<?php if ($item->weekdays == 2 ) : ?>
...and so on..

but nothing happened.
Argh... at first it seems so good... *going_mad*

edit:
I tried the followthing:
I just put the $item->weekdays thing in an php-echo with some <p>-tag to look, what is in that f***ing variable...
<p><?php echo $item->weekdays; ?> </p>

This is what came out:


so, there is not one value in that $item->weekdays, there are many...
How get I the right value out of this (array)?
greetings
Last edit: 7 years 2 months ago by tuco.

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

  • tuco
  • Topic Author
  • New Member
  • New Member
More
7 years 2 months ago - 7 years 2 months ago #13982 by tuco
Replied by tuco on topic Eventlist: both dates
Hello,
well, Cyril, you can stay in Paris some days more ;-)
Total wrong attempt of mine.
What the hell I wanted with the $item->weekdays thing?

All I needed was the JHtml::date($item->next, 'w', null)
So I have somthing 'tinkered':
A real PHP-crack maybe would get mad, when he look at my code, but I made it myself and I'm a little bit proud of it.
Anyway, the code may be not perfect and possibly redundant, but it works!
Whenever you return from France and you got some minutes, please take a look over it, that would be nice.
Not to praise me, only if all is 'good'.
Here the code:
<?php // Next Date ('next' 'today' or 'last date' if no next date) ?>
<!-- ------------- ich ----------------------  -->
<?php if (iCDate::isDate($item->startdate) && $item->weekdays) : ?>
	
	<?php if (JHtml::date($item->startdate, 'w', null) == 0) : ?>
	
	<!--  Startdate-Sunday -->
			<span class="ic-week-day so">
			<?php echo JHtml::date($item->startdate, 'D', null); ?> 
			</span>
<!--  Startdate-Saturday -->		
		<?php elseif  (JHtml::date($item->startdate, 'w', null) == 6) :?>
			<span class="ic-week-day sa">
			<?php echo JHtml::date($item->startdate, 'D', null); ?> 
			</span>
<!--  Startdate-Wochentag -->
		<?php else : ?>	
			<span class="ic-week-day weekd">
			<?php echo JHtml::date($item->startdate, 'D', null); ?> 
			</span>					
		<?php endif; ?>	
		
<!--  Startdate-Rest-->
			<span class="ic-period-startdate">
			<?php echo JHtml::date($item->startdate, 'j. M Y', null); ?> 
			</span> - 
			
		<?php if (JHtml::date($item->enddate, 'w', null) == 0) : ?>	
<!--  Enddate-Sunday -->	
			<span class="ic-week-day so">
			<?php echo JHtml::date($item->enddate, 'D', null); ?> 
			</span>
<!--  Enddate-Saturday -->		
		<?php elseif  (JHtml::date($item->enddate, 'w', null) == 6) :?>
			<span class="ic-week-day sa">
			<?php echo JHtml::date($item->enddate, 'D', null); ?> 
			</span>
<!--  Enddate-Wochentag -->
		<?php else : ?>	
			<span class="ic-week-day weekd">
			<?php echo JHtml::date($item->enddate, 'D', null); ?> 
			</span>					
		<?php endif; ?>						
<!--  Startdate-Rest-->				
			<span class="ic-period-enddate">
			<?php echo JHtml::date($item->enddate, 'j. M Y', null); ?>
			</span>
		
	<?php elseif ($dateday) : ?>
		<?php if (JHtml::date($item->dateday, 'w', null) == 0) : ?>
<!--  Dateday-Sunday -->	
			<span class="ic-week-day so">
			<?php echo JHtml::date($item->dateday, 'D', null); ?> 
			</span>
<!--  Dateday-Saturday -->		
		<?php elseif  (JHtml::date($item->dateday, 'w', null) == 6) :?>
			<span class="ic-week-day sa">
			<?php echo JHtml::date($item->dateday, 'D', null); ?> 
			</span>			
<!--  Dateday-Wochentag -->
		<?php else : ?>	
			<span class="ic-week-day weekd">
			<?php echo JHtml::date($item->dateday, 'D', null); ?> 
			</span>					
		<?php endif; ?>	 		
<!--  Enddate-Rest-->		
		<span class="ic-period-startdate">
		<?php echo JHtml::date($dateday, 'j. M Y G:i', null); ?>
		</span>
	<?php else : ?>
		<?php if (JHtml::date($item->next, 'w', null) == 0) : ?>
<!--  Nextday-Sunday -->	
			<span class="ic-week-day so">
			<?php echo JHtml::date($item->next, 'D', null); ?> 
			</span>
<!--  Nextday-Saturday -->		
		<?php elseif  (JHtml::date($item->next, 'w', null) == 6) :?>
			<span class="ic-week-day sa">
			<?php echo JHtml::date($item->next, 'D', null); ?> 
			</span>
<!--  Nextday-Wochentag -->
		<?php else : ?>	
			<span class="ic-week-day weekd">
			<?php echo JHtml::date($item->next, 'D', null); ?> 
			</span>					
		<?php endif; ?>

<!--  Enddate-Rest-->

		<span class="ic-period-startdate">
		<?php echo JHtml::date($item->next, 'j. M Y G:i', null); ?>
		</span>
<?php endif; ?>	
<!-- ---------------------- Ende ich ------------------------  -->
<?php // Location (different display, depending on the fields filled) ?>
...and here's just a little "sneak preview":


after all it looks pretty good

greetings and all the best
Attachments:
Last edit: 7 years 2 months ago by tuco.

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

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
7 years 2 months ago #14002 by Lyr!C
Replied by Lyr!C on topic Eventlist: both dates
Hello!

Well, nothing wrong with you code.

Just 1 question :
- Where do you use from the variable $item->dateday and $dateday ? (i don't thing those variables are defined in list of events by iCagenda?...)

One recommendation :
- replace "$item->next" by "$EVENT_NEXT" (to be sure it will keep working with iCagenda 4.0 and future dates system, as i will change this part for next, but will keep the good value to $EVENT_NEXT using the future new system ;-) )

Best regards,
Cyril

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

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

  • tuco
  • Topic Author
  • New Member
  • New Member
More
7 years 2 months ago #14006 by tuco
Replied by tuco on topic Eventlist: both dates
Hello, welcome back ;-)

Just 1 question :
- Where do you use from the variable $item->dateday and $dateday ? (i don't thing those variables are defined in list of events by iCagenda?...)


I got this code from this thread #13530 - where you offer that code... Isn't this safe?

replace "$item->next" by "$EVENT_NEXT" ...


Alright, then I am just going to work and change this variable. If something is going wrong, I 'll be right back here ;-)

Thanks for your answers.
greetings

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

  • tuco
  • Topic Author
  • New Member
  • New Member
More
7 years 2 months ago #14013 by tuco
Replied by tuco on topic Eventlist: both dates
So, I found some time and changed your suggestions. All works fine.
I'll go and set this thread as solved, that thing lasted long enough ;)

Greetings
The following user(s) said Thank You: Lyr!C

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

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
7 years 2 months ago #14019 by Lyr!C
Replied by Lyr!C on topic Eventlist: both dates
You're welcome! ;-)

Best regards,
Cyril

Latest version : iCagenda 3.9.3
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

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

Moderators: Lyr!C
Time to create page: 0.206 seconds

Follow Us

Create your Joomla templates with Template Creator CK

acymailing logo new