-
Posts
134 -
Joined
-
Last visited
Everything posted by tooth-paste
-
I have build an agenda with repeater. Now I would like to show three recent items(limit=3) on the homepage but can not get it to work. I've tried several things like, pages, get, find template. system template(setup->temp->filter): repeater_agendaitem Original code on agenda page(works perfect): if(count($page->agendaitem)) { $today = strtotime("today"); $upcoming_dates = $page->agendaitem->find("agenda_datum>=$today, sort=agenda_datum"); if(count($upcoming_dates)) { foreach($upcoming_dates as $upcoming_date) { echo "<h4>{$upcoming_date->agenda_activiteit}</h4><p> <b>{$upcoming_date->agenda_datum} {$upcoming_date->agenda_tijd}</b><br /> {$upcoming_date->agenda_beschrijving} </p> <div class='stippellijnzwart'></div>"; } } }
-
Ok, thx!
-
Nope:( The template is called: repeater_agendaitem. In my original code the repeater is included but not in your example. Is this necessary? $page->agendaitem
-
This line doesn't work. Could it have to do with the repeater 'agendaitem'? $upcoming_dates = $pages->agendaitem->find("template=agenda, agenda_datum>=$today, sort=agenda_datum, limit=3");
-
@PWaddict: Thank you, but can I place the code on a different page(homepage)? I tried the following code but it does not work. I added 'get' $upcoming_dates = $pages->get("/agenda")->agendaitem->find("agenda_datum>=$today, sort=agenda_datum, limit=3");
-
Thanx for your explanation. I will try the new code.
-
Can I place the code on another page (like homepage, recent three)? if(count($page->agendaitem)) { $today = strtotime("today"); $upcoming_dates = $page->agendaitem->find("agenda_datum>=$today, sort=agenda_datum"); if(count($upcoming_dates)) { foreach($upcoming_dates as $upcoming_date) { echo "<h4>{$upcoming_date->agenda_activiteit}</h4><p> <b>{$upcoming_date->agenda_datum} {$upcoming_date->agenda_tijd}</b><br /> {$upcoming_date->agenda_beschrijving} </p> <div class='stippellijnzwart'></div>"; } } }
-
Thx! works perfect!
-
I'm trying to build a calendar from a repeater field. One of the field is the date of an event. Is it possible to only display the items for today and later? Can I hide older items? Code: foreach($page->agendaitem as $item) { echo "<h4>{$item->activiteit}</h4><p> <b>{$item->datum} {$item->tijd}</b><br /> {$item->beschrijving} </p> <div class='stippellijnzwart'></div>"; }
-
Thanks for your reply. Something is still not right. Could you check these settings? I've created a field 'media' and added it to my template. When I try to add files the 'Insert media' button does not work. I have added files thru upload. My template looks like this. But it brings no output to the front-end. Am I doing something wrong? <?php include("./header.php"); ?> <div class="container paddingbottom3 paddingtop2"> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-6 bglichtgrijs link paddingbottom3"> <div class="paddingleft4 paddingright5"> <div class="paddingleft4"> <h2>Preken</h2> <?php $media = $pages->find('template=media-manager-audio, include=all, limit=10'); // $media is a PageArray foreach ($media as $m) { // media_manager_image is a Pagefiles foreach ($m->media_manager_audio as $audio) echo $audio->url; } ?> </div> </div> </div> <div class="col-md-6 bggeel link paddingtop2 paddingbottom2"> <h2 class="colorwit"><?php echo $page->title; ?></h2> <br /><br /> <span class="glyphicon glyphicon-arrow-right colorwit paddingright5"></span><a href="/contact">Neem contact op</a> </div> </div> </div> </div> </div> <?php include("./footer.php"); ?>
-
I'am having some problems to output audio(mp3) files. I've installed Media Manager but don't 'get' it quit yet. The media manager is working and I can upload files. My template is called 'prekenarchief' and placed the code from the documentation: $media = $page->media;// returns a MediaManagerArray. Needs to be looped through foreach ($media as $m) { echo $m->id;// e.g. 1234 (hidden page in /admin/media-manager/media-parent/) echo $m->type;// e.g. 3 (a media of type image) OR 1 (a media of type audio) echo $m->typeLabel;// e.g. 'document' (i.e. type would be 2) echo $m->title;// e.g. 'My Nice Trip' (whose media file could be my-nice-trip.mp4) /* @note: - $m->media returns an object; either a ProcessWire Image (for image media) or File object (for audio, document and video media) - This means you have access to all the properties of that object, e.g. ext, tags, description, url, filename, basename, width, height, modified, created, filesize, filesizeStr, etc as well as associated methods, e.g. size() */ echo $m->media->tags; } // only output images foreach ($media as $m) { if($m->typeLabel =='image') { echo "<img src='" . $m->media->size(100,75)->url . "'><br>"; } } // There's also a toString() method so you can do: echo $page->media; 1. What do I need to add to the template to get it to work? I added a new field to the template called 'media', but it doesn't work. 2. Do I need to alter the example code above. For example: Do I need to place an ID.
-
This module looks great. I need to upload 300 audio files and it looks this module can do the job. Is it possible to only show 'Audio' and hide tabs like 'Documents' and 'Images'?
-
How do you handle the back-end and upload. Is every file a page?
-
I need to replace CMS Wp into PW. I have an archive of over 300 sermon audio files. Any advice? The back-end needs to be dummy proof and easy to maintain. I would like to avoid to have a page for every sermon.
-
THX, I found a solution:)
-
I can not get it to work. Not enough js knowledge i'am afraid. This is my code: <div class="container" style="padding-top: 6%;color: white"> <div class="row"> <div class="col-md-6 col-md-offset-3" style="background-color:black;"> <h6 class="text-center">Forge of Empires</h6> <h2 class="text-center" style="padding-bottom: 4%">Calculator Arc bonus (1,8)</h2> <div style="padding-bottom: 8px">Level huidig/maximum</div> <input id="b" type="number" oninput="fire()"> / <input id="c" type="number" oninput="fire()"> <br /> <div> </div> <div style="padding-bottom: 8px">Beloning (De beloning die een speler krijgt op een specifieke positie)</div> <input id="a" type="number" oninput="fire()"> <b><span id="arcbonus"></b></span><br /> <div> </div> <div style="padding-bottom: 8px">Inleg uitdager (degene die al op deze positie fp's heeft ingelegd)</div> <input id="d" type="number" oninput="fire()"><br /> <div> </div> <div> </div> <div style="font-size: 18px"><span id="result"></span> <span id="bonus"></span></div><br /> <div> </div> <div> </div> <div> </div> <div style="font-size: 10px;padding-bottom: 25px">*Magische getal = Level maximum <b>-</b> level huidig <b>-</b> (P1 beloning * 1,8) <b>+</b> P1 huidig</div> </div> </div> </div> <script> function fire() { var a = parseInt(document.getElementById ( "a" ).value); var b = parseInt(document.getElementById ( "b" ).value); var c = parseInt(document.getElementById ( "c" ).value); var d = parseInt(document.getElementById ( "d" ).value); var output = document.getElementById ( "result" ); var result = calculate(a, b, c, d); output.innerHTML = "Magische getal* = <b>" + result + "</b>. <br />Wanneer een positie veilig is om in te nemen moet het magische getal lager zijn dan:"; var output = document.getElementById ( "bonus" ); var bonus = calbonus(a); output.innerHTML = "<b>" + bonus + "</b>"; var output = document.getElementById ( "arcbonus" ); var arcbonus = calarc(a); output.innerHTML = "(Incl. Arc bonus:" + arcbonus + ")"; } function calculate(a, b, c, d) { return c - b -(a * 1.8) + d; } function calbonus(a) { return a * 1.8; } function calarc(a) { return a * 1.8; } </script> Can you give me a clue about how to implement output.style.color = "red";
-
I trying to make a Forge of Empire calculator. But before I start my design I want my formula to work. The code below works fine (thx to Bernard and kixe). Is it possible to color the result green or red on a curtain result? <DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Forge of Empires - Arc bonus Calculator</title> </head> <body> <h3>Forge of Empires - Arc bonus Calculator</h3><br /><br /> <body> P1 beloning<input id="a" type="number" oninput="fire()"> <span id="bonus"></span><br /> Level huidig <input id="b" type="number" oninput="fire()"><br /> Level maximum <input id="c" type="number" oninput="fire()"><br /> P1 huidig <input id="d" type="number" oninput="fire()"><br /> <span id="result"></span> </body> <script> function fire() { var a = parseInt(document.getElementById ( "a" ).value); var b = parseInt(document.getElementById ( "b" ).value); var c = parseInt(document.getElementById ( "c" ).value); var d = parseInt(document.getElementById ( "d" ).value); var output = document.getElementById ( "result" ); var result = calculate(a, b, c, d); output.innerHTML = "Veilig: " + result; } function calculate(a, b, c, d) { return c - b -(a * 1.8) + d; } </script>
-
Great, I will look into it:)
-
How can I make a form with a formula. Does anyone have ideas. Example: Inputfield 1: variable #1 Inputfield 2: variable #2 Inputfield 3: variable #3 #1 - #2 -(#3 x 1.8) RESULT
-
I've installed a SSL on my server. What do I have to do to make sure PW is using the certificate? My host told me that Wordpress have a button build in the CMS to include the SSL. What methode is PW using?
-
309
-
I use a blank database. After googling it is possible I need an upgrade of MySQL because utf8mb4 is a newer set of utf8. I'm running MySQL version 5.1.73.
-
Yes, but it still not works. Does anyone has the same experience?
-
Great Job! When I'am trying to import the database I'm getting an error: Fout SQL-query: /*!40101 SET NAMES utf8mb4 */; MySQL meldt: #1115 - Unknown character set: 'utf8mb4' When importing
-
THX!