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
  • Auteur du sujet
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 4 mois #13973 par tuco
Réponse de tuco sur le sujet 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

Connexion ou Créer un compte pour participer à la conversation.

  • Lyr!C
  • Portrait de Lyr!C
  • Administrateur
  • Administrateur
  • Lead Developer
Plus d'informations
il y a 8 ans 4 mois #13975 par Lyr!C
Réponse de Lyr!C sur le sujet 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) .

Fichier attaché :

Connexion ou Créer un compte pour participer à la conversation.

  • tuco
  • Auteur du sujet
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 4 mois - il y a 8 ans 4 mois #13977 par tuco
Réponse de tuco sur le sujet 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
Pièces jointes :
Dernière édition: il y a 8 ans 4 mois par tuco.

Connexion ou Créer un compte pour participer à la conversation.

  • tuco
  • Auteur du sujet
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 4 mois - il y a 8 ans 4 mois #13982 par tuco
Réponse de tuco sur le sujet 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
Pièces jointes :
Dernière édition: il y a 8 ans 4 mois par tuco.

Connexion ou Créer un compte pour participer à la conversation.

  • Lyr!C
  • Portrait de Lyr!C
  • Administrateur
  • Administrateur
  • Lead Developer
Plus d'informations
il y a 8 ans 4 mois #14002 par Lyr!C
Réponse de Lyr!C sur le sujet 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) .

Fichier attaché :

Connexion ou Créer un compte pour participer à la conversation.

  • tuco
  • Auteur du sujet
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 4 mois #14006 par tuco
Réponse de tuco sur le sujet 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

Connexion ou Créer un compte pour participer à la conversation.

  • tuco
  • Auteur du sujet
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 4 mois #14013 par tuco
Réponse de tuco sur le sujet 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
Les utilisateur(s) suivant ont remercié: Lyr!C

Connexion ou Créer un compte pour participer à la conversation.

  • Lyr!C
  • Portrait de Lyr!C
  • Administrateur
  • Administrateur
  • Lead Developer
Plus d'informations
il y a 8 ans 4 mois #14019 par Lyr!C
Réponse de Lyr!C sur le sujet 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) .

Fichier attaché :

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: Lyr!C
Temps de génération de la page : 0.281 secondes

Follow Us

Créez vos templates Joomla avec Template Creator CK

acymailing logo new