Main menu

Forum


The developer takes a few days off for Summer vacation...
...and will be back with charged battery!

From 14 June to 29 June, 2025 included
During this period,
assistance from developer will not be provided.

NEWS: iCagenda 4.0.0-alpha1 will be available for testing for users with a PRO subscription in July!

× Help Forum English

[SOLVED] Eventlist: both dates

  • tuco
  • Autore della discussione
  • New Member
  • New Member
Di più
8 Anni 4 Mesi fa #13973 da tuco
Risposta da tuco al 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

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
8 Anni 4 Mesi fa #13975 da Lyr!C
Risposta da Lyr!C al 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.11
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 allegato:

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • tuco
  • Autore della discussione
  • New Member
  • New Member
Di più
8 Anni 4 Mesi fa - 8 Anni 4 Mesi fa #13977 da tuco
Risposta da tuco al 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
Ultima Modifica 8 Anni 4 Mesi fa da tuco.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • tuco
  • Autore della discussione
  • New Member
  • New Member
Di più
8 Anni 4 Mesi fa - 8 Anni 4 Mesi fa #13982 da tuco
Risposta da tuco al 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
Allegati:
Ultima Modifica 8 Anni 4 Mesi fa da tuco.

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
8 Anni 4 Mesi fa #14002 da Lyr!C
Risposta da Lyr!C al 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.11
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 allegato:

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • tuco
  • Autore della discussione
  • New Member
  • New Member
Di più
8 Anni 4 Mesi fa #14006 da tuco
Risposta da tuco al 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

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • tuco
  • Autore della discussione
  • New Member
  • New Member
Di più
8 Anni 4 Mesi fa #14013 da tuco
Risposta da tuco al 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
Ringraziano per il messaggio: Lyr!C

Si prega Accedi o Crea un account a partecipare alla conversazione.

  • Lyr!C
  • Avatar di Lyr!C
  • Administrator
  • Administrator
  • Lead Developer
Di più
8 Anni 4 Mesi fa #14019 da Lyr!C
Risposta da Lyr!C al topic Eventlist: both dates
You're welcome! ;-)

Best regards,
Cyril

Latest version : iCagenda 3.9.11
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 allegato:

Si prega Accedi o Crea un account a partecipare alla conversazione.

Moderatori: Lyr!C
Tempo creazione pagina: 0.162 secondi

Follow Us

Create your Joomla templates with Template Creator CK

acymailing logo new