Roych

Members
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

6 Neutral

About Roych

  • Rank
    Jr. Member

Recent Profile Visitors

651 profile views
  1. Thank you for help I tried something similar, but had no luck. I tried your code It gave error than I realised one ")" was missing. But still not working, sadly. Nothing shows up. Any ideas? <?php if (date('d-m-Y') == date('d-m-Y', $single->Start_date)): ?> <div class='Danes-text'>TODAY!</div> <?php endif; ?> This is what I have now ... R
  2. Hello, I need you help again with this Everything is working fine but I need to put another line of text like "TODAY" if a date is today. <?php $events = $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date'); ?> <?php if(count($events)): ?> <?php foreach($events as $single): ?> <!-- Event --> <li> <div class="date"> <span> <span class="day"><?php echo strftime("%d", strtotime($single->Start_date)); ?></span> <span class="month"><?php echo strftime("%h", strtotime($single->Start_date)); ?></span> <span class="year"><?php echo strftime("%Y", strtotime($single->Start_date)); ?></span> </span> </div> <div class="event-content"> <h6><a href="<?=$single->url?>"><?=$single->title?></a></h6> <ul class="event-meta"> <li><i class="fa fa-clock-o" aria-hidden="true"> </i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup><?= $out = __("h"); ?></sup></li> <!-- <div class='Danes-text'>TODAY!</div> --> </ul> </div> </li> <!-- /Event --> <?php endforeach; ?> <?php else: ?> <div style="font-size: 14px;margin-top:-15px;color: #63b2f5;"><?= $out = __("No upcoming events at this time!"); ?></div> <?php endif; ?> You can see where I wan't to put in the TODAY text. Can this be done? I tried if elseif else but no luck. Any ideas how can this be done? Thank you in advance R
  3. Hello, I like this but how do I use this within <?php foreach($page->downloadi as $download): ?> <a href="<?=$download->fajli->url ?>">Download</a><?=$download->Content ?> <?php endforeach; ?> I'm using pagetable field for adding my "downloads" Thank you R
  4. I agree completely. But still learning here, hehe. Thank you R
  5. Yes now it is working great. I got it working with my code also "I think". I used my version of code and put if-else inside like you've said and somehow works. <?php foreach($page->Slides as $Slides): ?> <?php $image = $Slides->images->first(); ?> <?php if ($Slides->Link): ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" data-link="<?=$Slides->Link ?>" data-target="_blank" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php else: ?> <?php $image = $Slides->images->first(); ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" data-target="_blank" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php endif; ?> <?php endforeach; ?> I will use your code ofc, shorter and probably better. Thank you very much R
  6. Thank you for reply I tried your suggestion but I get Parse Error: syntax error, unexpected 'endif' (T_ENDIF) ... Error. not sure what is wrong here Thank you R
  7. Hello, I need some help as I'm not a coder. I've created a slider from repeater which is working great. I need to make some slides with a link so I have created a "Link" field (also working) but now all my slides have links. The one with the new link is linking right but all others link to root. Basicaly what I need is if field is empty show this else this. ..;) I've tried with this: <?php if($page->Slides->Link): ?> <?php foreach($page->Slides as $Slides): ?> <?php // get the very first image from images list since image field is accepting multiple images (unless you change the value of `Maximum files allowed` under Fields > images > Details tab > Maximum files allowed). $image = $Slides->images->first(); ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" data-link="<?=$Slides->Link ?>" data-target="_blank" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php endforeach; ?> <?php else: ?> <?php foreach($page->Slides as $Slides): ?> <?php // get the very first image from images list since image field is accepting multiple images (unless you change the value of `Maximum files allowed` under Fields > images > Details tab > Maximum files allowed). $image = $Slides->images->first(); ?> <li data-transition="<?php echo $page->Slide_Effect; ?>" data-slotamount="7" > <img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"> <div class="tp-caption" data-x="100" data-y="115" data-speed="700" data-start="1000" data-easing="easeOutBack"><h2><?=$Slides->title ?></h2></div> </li> <?php endforeach; ?> <?php endif; ?> Not really working. Any help is appreciated. R
  8. Yes, exactly what I need It's working perfectly Thank you for the code, very useful. I was trying to do something like this but not realy good with PHP. R
  9. this should be the same as in the first code, I forgot to change it back as I was playing and trying all sorts of things. As I said I'm not a coder so I'm playing around, sorry for that So the first code is the one I'm using to show the events and all is working. All I need is to show the text if there is no upcoming events. Not sure how to put arjen's code together. thx R
  10. Hmm... I was to fast it's not working :/ I'm doing something wrong ... My whole original code looks like this: <?php foreach ( $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date') as $single ):?> <!-- Event --> <li> <div class="date"> <span> <span class="day"><?php echo strftime("%d", strtotime($single->Start_date)); ?></span> <span class="month"><?php echo strftime("%h", strtotime($single->Start_date)); ?></span> <span class="year"><?php echo strftime("%Y", strtotime($single->Start_date)); ?></span> </span> </div> <div class="event-content"> <h6><a href="<?=$single->url?>"><?=$single->title?></a></h6> <ul class="event-meta"> <li><i class="fa fa-clock-o">&nbsp;&nbsp;</i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup><?= $out = __("h"); ?></sup></li> <li><i class="icons icon-location"></i> 340 W 50th St.New York</li> </ul> </div> </li> <!-- /Event --> <? endforeach; ?> I tried to work with your code but I'm doing it totaly wrong I guess :/ <?= $events = $pages->find('template=calendar-post, limit=8, Start_date>=today, sort=Start_date'); if (count($events)) { echo '<li>', '<div class="date">', '<span>', '<span class="day">{echo strftime("%d", strtotime($single->Start_date))}</span>', '<span class="month">{ echo strftime("%h", strtotime($single->Start_date))}</span>', '<span class="year">{ echo strftime("%Y", strtotime($single->Start_date))}</span>', '</span>', '</div>', '<div class="event-content">', '<h6><a href="<?=$single->url?>"><?=$single->title?></a></h6>', '<ul class="event-meta">', '<li><i class="fa fa-clock-o"> </i> <?php echo strftime("%H:%M", strtotime($single->Start_date)); ?><sup><?= $out = __("h"); ?></sup></li>', '<li><i class="icons icon-location"></i> 340 W 50th St.New York</li>', '</ul>', '</div>', '</li>'; } else { echo "<span style='font-size:12px;text-align:center;'>No upcoming events at this time!</span> "; } ?> If I just paste your empty code in I get Id's of articles like 1106|1107|1108 ... Thank you R
  11. It works, but if there is an upcoming event, it also shows me the id number of an event how do I get rid of it. And for multilanguage site I tried <?= $out = __('No events at this time.'); ?> but it's not working. (not that important atm) Thank you R
  12. Hello, The upper works like a charm but was wondering if it is somehow possible to add some text if there is no upcoming events. like (There is no upcoming events ...) So maybe some if else statements or something, I'm not a coder, but understand a little. I'm using Start_date>=today option from upper posts to show upcoming events. <?php foreach ( $pages->find('template=calendar-post, limit=8, sort=Start_date') as $single ):?> Thank you R
  13. Hello, any update on this or some new modules maybe. I tried this couple of times but somehow can't get this to work at all.. I'm new to PW but I think that there should be some module for this would be much easier for beginners ike me. I need this so that my "client" should see the clicks and other info like mr-fan image here Any help is appreciated Thank you. R
  14. Good to know, thank you R
  15. Oh, that easy, hehe. Works great Thank you very much, was struggling with that for some time before I decided to ask here. R