Search the Community

Showing results for tags 'php'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 98 results

  1. I'm puzzled by something I thought would be rather easy: I want to send a request to a PW page. It's POST, and I define a header, and send data as JSON. I need to send data in the following format: $ POST https://mysite.com/foo/bar/ {"headers": {"Authorization": "Bearer API_KEY", "Content-Type": "application/json"}, "body": {"fields": {"Name": "<get name>", "Department": "<get team>", "Home Address": "<get address>", "Phone #": "<get phone>", "Personal Email Address": "<get email>", "Birthday": "<get birthday>", "Date Added": "<call>currentDate</call>" }}} This is supposed to be sent via a Chatbot engine (Dexter). In the PW page that should handle this, $_POST is always empty, as is $_REQUEST. Same for PW's $input or if ($config->ajax) {}. I get the header, but no data. So I dug deeper, and tried this: @ini_set("allow_url_fopen", true); @ini_set("always_populate_raw_post_data", true); $data = json_decode(file_get_contents('php://input'), true); $d = print_r($data, true); // I store this, along with the header infos and timestamp in a PW page-field (instead of using file_put_content) I checked page permissions, I made sure I use pagename/, i.e. with trailing slash only, to avoid stripping the header away due to redirects (which somebody in an older forum thread once highly suggested). I tried to send the same stuff that the chatbot does via CURL. Nothing. PW error logs don't report anything (site is still in dev-mode). PW 3.0.81 - everything else runs just fine. Any ideas what I should change? Any more PHP/Apache settings maybe? Help is highly appreciated.
  2. I'm looking for someone familiar with processwire based in the USA, preferably in South Florida. I need a part-time developer to help with a few projects. Our previous developer was incredible but just disappeared into thin air... no call, no show, no text, no facebook... Please message me for details.
  3. Hi, I have php includes in my template file that are working fine....however I need to have some additional includes within a text area field, where I enter my HTML content. For example, this code at the top of my template file: <?php $myPath = $config->urls->templates;?> Allows me to have something like this on every page: <?php include("includes/footer.inc.php"); ?> So far so good, but I have a text area field named page_content, where I would like to manually enter additional includes. If I enter this in that text area field, I get a photo: <img src="images/photo.jpg" /> But if I enter this in that same field, nothing happens at all: <?php include("includes/phone.inc.php"); ?> Any thoughts? I have reviewed this thread https://processwire.com/api/ref/files/include/ but I don't think it gets at what I'm looking for. Thanks!
  4. So maybe has already figured this out, but I am stumped. I have a field (test_field) that is set to pdfs, and I was trying to get a count of the number of pdfs in that field so I could add it to a status bubble on the front end. I tried: function testPDF() { $a = $page->test_field->count(); echo "<span class=\"bubble\">" . $a . "</span>"; } but it is returning "NULL" . I currently have 3 added to the field. I also tried putting this function in _func.php, though I need to use wire('pages'), but I only need to get the count for that specific page, so I am sort of at a loss of how to proceed.
  5. Hi all, Im trying to install this core module and got the error of not having the ImageMagick library installed. But if im checking for the version of my ImageMagick installed on my server via SSH im getting this response; identify -version Version: ImageMagick 6.9.4-9 Q16 i386 2016-06-21 http://www.imagemagick.org Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Features: Cipher DPC Delegates (built-in): bzlib freetype gslib jng jpeg png ps tiff xml zlib Does this even mean the library is installed? And if yes, why cant i install my module? Pleaassee help me Greetz.
  6. Noob to Processwire. Trying to convert some older sites to Pwire. I am having trouble including a legacy form class into my templates: If I embed the php directly in the template, it works. But if I use include statements, the form object returns null. This works: use formbuild\Form; session_start(); $form = new Form(init1, 'init2', ...'); $form->param1 = ...; $form->param2 = ...; $form->param3 = ...; $form->render(); ----------------------------------------------------------------------------------------- This fails: include_once ($config->paths->templates."forms/form1.php"); $form->render(); ____________________________________________________________________ My referencing is OK, no error message. The only code that cannot reside in the include file are the following lines: use formbuild\Form; $form = new Form(init1, 'init2', ...'); My PhP is rusty, maybe that is the problem, but it could be something about Pwire, namespace maybe. I have tested it outside Pwire and no problems. Please advise. Thanks.
  7. I have a foreach loop on a dashboard page where I sorting the pages titles to different columns based on a date field. Unfortunately, I am doing it with multiple different if statements for the sorting (with multiple foreach loops), as I needed something quickly for testing. I thought it would be nice to implement wireSMTP to send an email out to alert the users that created the pages, which I got working in no time. However, now I have hit a roadblock. The dashboard page has a javascript function that refreshes the page every few hours to get the changes in the date, which then triggers the $mail to fire the email out. I guess my question is there a way to limit the emails to be sent out only once the date/time has changed once instead of it firing every time the page refreshes?
  8. I was working on a simple "to-do" style template that has a form on a page. Once the form is submitted, I use the API to create a new subpage under a pre-existing page, but I notice that it does resubmit the form data (as to be expected) if a user were to refresh the page. Is there a way to prevent this behavior so duplicate content will not be posted by using something like exit(), or is this not proper due to usability? I guess I am curious as to how other developers handle the same hurdle.
  9. Hi, I know the the templates in processwire are html files. I search it into foleder "site" of standard installation of processwire standard theme (blanck and that blue) but I don't find any html file to modify it by html code. So, I must modify it only by php code? Can I traduct php pages templates in html page?
  10. Hi, I need to separate the header, footer and sidebar from the _main.php file. I've tried all of the following without success: <?php include ("header.php"); ?> <?php include ("/_header.php"); ?> <?php include ("./header.inc"); ?> <?php $header = pages()->get('/rcl-header.php'); // include header echo $header; ?> Any guidance would be appreciated.
  11. I have been scratching my head on this one for a while, so I thought maybe someone could shed some light on this issue. I am using a grid layout (that I have created over the years) with a class for responsive images (very similar to bootstrap, but very stripped down). Using this, I created a gallery using a foreach loop, and included a "print button" to print each image. I got the classes and everything worked out, but I ran into a small problem with the print functionality. My images (which are around 2400px wide to fill the space) are just fine in the grid and on resize, but when I print, they "run off" the page. I understand that they are just too big to be printed in portrait mode, which led to me think that I could use $image->size(); to print a scaled down version of the image (which adds a bit more load time as now the site needs to load the image large scale and the scaled down version). However, I can't seem to wrap my head around serving just the scaled down version for print only (obviously display:none; doesn't do the trick). Has anyone tackled this before, or does anyone know of a more elegant solution to the conundrum that I have found myself in? The Foreachloop: $printclass = 1; foreach($page->galleries as $gallery) { $printclass++; $printimage = $gallery->gallery_image->width(600)->url; $out = ""; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<img src=\"{$gallery->gallery_image->url}\" class=\"reimage\"/>"; $out .= "</div>"; $out .= "</div>"; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<a href=\"#\" onClick=\"printCoupon('printable{$printclass}');\">Print</a>"; $out .= "</div> "; $out .= "</div> "; $out .="<div id=\"printable{$printclass}\"><img src=\"{$printimage}\"/></div>"; echo $out; }
  12. I am trying to integrate another script, Questions2Answer, with Processwire user management. The script needs an array with key/value pairs for user->name => user->id The script provides an array $userids with active user->ids that looks like this var_dumped for a page with two users: array(2) { [0]=> int(1107) [1]=> int(41) } How can I take $userids, find the corresponding $user->names in Processwire as values and then return that to Q2A as a clean key/value array? This is probably basic PHP, but I have tried so many variations that I now completely lost the plot. Any pointers appreciated.
  13. Good afternoon, I am attempting to loop through approximately 600 XML nodes. Each of those nodes has 2 child nodes (example below). One is an id for an existing page and the other contains values for a page reference field. I have put together a loop (below as well) to attempt to save each page with the label values. This all works....once. After getting the first XML node "label" saved to the correct page, nothing else is saved. I'm sure there is probably something that I have overlooked. But, I am also very new to this CMS. I'm hoping there is a veteran user who may be able to point me in the right direction. <row> <id>1041</id> <labels>lifestyle|savings</labels> </row> foreach ($xml->row as $items) { //get page id to update and set output formatting to false $blog_page = $pages->get('id='.$items->id); $blog_page->of(false); //create array from pipe separated label values $labelsArray = explode('|', $items->labels); //loop through array to get page ids by page name $labelIDS = array(); foreach ($labelsArray as $labelValue) { $labelPage = $pages->get('name='.$labelValue); array_push($labelIDS, $labelPage->id); } //add labels to label field in post $blog_page->labels = $labelIDS; //save page $blog_page->save(); }
  14. Hello I am using the Fancybox 3 gallery and I have a problem loading the images from the backend via PHP into the imagegallery. Please help with the PHP.... I am using the Gallery with one preview image: http://codepen.io/fancyapps/pen/jyEGGG/?editors=1000 Here is the original code: <h3>Gallery with one preview image</h3> <p> To show only one or a few images but have a large gallery, simply hide the rest of the links. <br /> Optionally, use <code>data-thumb</code> for thumbnail image. </p> <p> <a href="https://c1.staticflickr.com/1/357/31876784275_12286240d4_h.jpg" data-fancybox="images-single"> <img src="https://c1.staticflickr.com/1/357/31876784275_fbc9696913_m.jpg" /> </a> </p> <div style="display: none;"> <a href="https://farm3.staticflickr.com/2947/33594572585_b48eba935b_k_d.jpg" data-fancybox="images-single" data-thumb="https://farm3.staticflickr.com/2947/33594572585_46ca00f3a5_m_d.jpg"></a> <a href="https://farm3.staticflickr.com/2859/33395734202_522f9d8efd_k_d.jpg" data-fancybox="images-single" data-thumb="https://farm3.staticflickr.com/2859/33395734202_15a81c4ef3_m_d.jpg"></a> </div> How do I put all my images into the div? I guess it is quite simple, but I have failed all day trying to implement this. My folder in the backend with the images is called 'galerie'. I have tried something like this with a foreach array but it doesn't work. <h3>Gallery with one preview image</h3> <p> To show only one or a few images but have a large gallery, simply hide the rest of the links. <br /> Optionally, use <code>data-thumb</code> for thumbnail image. </p> <p> <a href="https://c1.staticflickr.com/1/357/31876784275_12286240d4_h.jpg" data-fancybox="images-single"> <img src="https://c1.staticflickr.com/1/357/31876784275_fbc9696913_m.jpg" /> </a> </p> <div style="display: none;"> <?php foreach($page->galerie as $image) { echo "<a href='{$image->url}' data-fancybox="images-single" title='{$thumbnail->description}'></a>"; } ?> </div> Thank's a lot for any help! Jakob
  15. I have the following import script being included in the homepage template file: <?php $mmpid = wire('pages')->get('template.name=makes')->id; // Manufacturers: $file = __DIR__.'/manufacturers.csv'; importCSV($file, 'mamo_manufacturer', $mmpid); // Models: $file = __DIR__.'/models.csv'; importCSV($file, 'mamo_model', 0, $mmpid); function importCSV($filepath, $template, $parent_id = null, $grandparent_id = null) { $csv = array_map('str_getcsv', file($filepath)); array_walk($csv, function(&$a) use ($csv) { $a = array_combine($csv[0], $a); }); array_shift($csv); # remove column header //echo '<pre>'; print_r($csv); echo '</pre>'; foreach($csv as $r) { $p = new Page(); $p->name = wire('sanitizer')->pageName($r['title']); $p->template = $template; if($parent_id !== 0||null) { $p->parent_id = $parent_id; } elseif($parent_id == 0||null) { //$parent = wire('pages')->get('title=' . $r['parent']); //echo $parent.' ';// echo $r['parent'].' '; echo $grandparent_id.' '; $parent = wire('pages')->get('title=' . $r['parent'] . ', parent_id=' . $grandparent_id)->id; echo $parent.' '; $p->parent_id = $parent; unset($r['parent']); } $p->save(); foreach($r as $k=>$v) $p->$k = $v; $p->save(); echo '<br>'; } } Output = Why is it running the ELSE when the condition for the IF is met? (the first 9 lines) All 14 models (lines past 9) are created under the first manufacturer. I've been messing with it, been able to get them to display the page IDs proper at one point for the models but still there's the standing issue of all of them being created under the first manufacturer nonetheless and also the ELSE running despite not being a condition of ELSE. What's up please...
  16. CodeRunner 2 is on sale at MacUpdate: https://www.macupdate.com/app/mac/38362/coderunner Mostly I use it for writing shell scripts, mocking up algorithms in PHP, JavaScript/jQuery. But is also supports other programming languages as well. https://coderunnerapp.com/ "An advanced, highly flexible, and easy-to-use programming editor for your Mac. CodeRunner supports a large number of languages, and delivers big IDE features while remaining lightweight and clutter-free."
  17. I am just creating my very first template files and have been unable to resolve the following problem. It says the '=' sign is unexpected but I have other templates files where identical code works OK. Is there something I'm missing? I have just included the 2 lines of code involved. Any help would be appreciated. Line 64 $ground-equipment = $page->children(); Line 65 foreach($ground-equipment as $ground) Parse error: syntax error, unexpected '=' in /volume1/web/Testing-Ryan/site/templates/GroundEquipment_Display_Page.php on line 64
  18. Hi there, I'm having a weird issue with the instanceof operator where it works locally and not on my server. I'm using PW3 + PHP7. I've posted the question on Stackoverflow but I was wondering if anyone here have seen it? http://stackoverflow.com/questions/42552855/php-instanceof-works-locally-but-not-on-host-server Thanks in advance.
  19. I just started trying to clean up an old site, and possible utilize some things I have learned over the past year (especially since my knowledge of php has gotten much better). I was trying to utilize a function to switch out the included header based on the url, but I can't seem to get it right. I started off with: // Include New Header function headerSwap(){ $homepage = $config->httpHost; $header_one = "/page-link-one/"; $header_two = "/page-link-two/"; switch($homepage){ case "/page-link-one/"; include('headerone.inc'); break; case "/page-link-two/"; include('headertwo.inc'); break; default: include('default.inc'); } } However, it seems that it is always using the default case. I tried echoing $homepage, but that doesnt seem to be returning anything. Any help on this would be amazing.
  20. Hi there, I was wondering if anyone has any tips for Multithreading in PHP 7. I've done some preliminary research and not sure which of the following I should be using? 1) Use built in Thread Object in the PHP Language 2) cURL ? https://www.reddit.com/r/PHP/comments/3a2yyu/async_in_php/ 3) This exec hack https://medium.com/async-php/multi-process-php-94a4e5a4be05#.uiboo7tro 4) Some 3rd party Library I'm not aware of? Icicle? I'm implementing a new search that searches the title, contents of the article and the author names. It would normally be 3 sequential searches followed by formatting the results before outputting. Would like to implement some asynchronous searches here and keep it if it runs faster than the sequential counterpart. Thanks in advance!
  21. Hello, I am just started playing around with processwire and it looks very nice. I am not a real developer (hopefully start this education next year). I am working on a template where I took some javascript from aother template. For the front page I have created a repeating field blok wich holds a text blok, a background color and a waves color and waves checkbox (0/1). This all is working. But when the waves checkbox is unchecked I want to add to the div display:none. This part is not working as it is part of the for each for the block (I think). I am a bit stuck, can anyboy give me a hint? testpage is pw.webhoes.nl This is the for each loop <?php foreach($page->extra_body as $extra_bodies) { ?> <div class="container-fullwidth" style="background-color:<?php echo "{$extra_bodies->extra_bg_color}"; ?>"> <div class="container"> <section> <div class="row"> <div class="col-md-12 body-front wow fadeInUp animated"> <?php echo "<p>{$extra_bodies->extra_body_text}</p>"; ?> <?php echo "<p>{$extra_bodies->extra_waves}</p>"; ?> </div> </div> </section> </div> <script type="text/javascript">var waves = <?php echo "{$extra_bodies->extra_waves}";?>; if (waves = 0) document.getElementById('svg_waves').style.display = "none"</script> <div class="svg_waves"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 157"> <g id="footer_wave" fill="none"> <g id="Artboard" fill="<?php echo "{$extra_bodies->extra_wave_color}" ; ?>"> <g id="waves" transform="matrix(-1 0 0 1 1649 31)"> <path id="wave--bg" d="M62.871 104.03C216.871 87.324 286 79.324 589 79.324S958 125 1249 125s445.587 1 445.587 1L1678 225 183.67 235.324S-91.129 120.734 62.871 104.03z"/> <path id="wave--bottom" d="M72.868 151.295C103.996 138.363 484.122 47.5 650.155 47.5c166.034 0 320.54 45.056 611.54 45.056 291 0 464.044-67.495 464.044-67.495l-80 132.939-1437 32s-167-98.777-135.871-111.71v73.005z" opacity=".06" transform="matrix(-1 0 0 1 1794.739 0)"/> <path id="wave--middle" d="M43 2c154-9.807 423.81 29.65 538.81 45.5C696.81 63.35 966 94 1257 94c291 0 457.203-42.22 457.203-42.22l-69.753 97.447H201.001S-111 11.807 43 2z" opacity=".15"/> <path id="wave--top" d="M616.074 103.938c-293.347 0-472.782-20.373-472.782-20.373l70.315 97.447h1455.087s329.601-143.286 174.36-153.093c-155.242-9.807-605.136 26.69-721.063 42.54-115.927 15.85-212.571 33.479-505.917 33.479z" opacity=".1"/> </g> </g> </g> </svg> </div> </div> <?php } ?> Below is my code for the home.php template that includes the above code. <?php namespace ProcessWire; ?> <?php /* include_once("./_header.inc"); */ // home.php (homepage) template file. // See README.txt for more information ?> <div class="container"> <header> <!-- Top Navbar --> <nav id="headeroom" class="navbar navbar-fixed-top navbar-intro navbar-intro-full headeroom-padd" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar-collapse-fixed-top"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand navbar-brand-img-lg" href="/"><img src="<?php echo $config->urls->templates?>/images/Logo_webhoes.png" alt="Webhoes" class="img-responsive"></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="main-navbar-collapse-fixed-top"> <?php /* <div id="search-wrap" class="navbar-form navbar-right"> <form class='search' action='<?php echo $pages->get('template=search')->url; ?>' method='get'> <input type='text' name='q' placeholder='Search' value='<?php echo $sanitizer->entities($input->whitelist('q')); ?>' /> <button type='submit' name='submit'>Zoeken</button> </form> </div> */ ?> <ul class="nav navbar-nav navbar-right"> <?php foreach($homepage->and($homepage->children) as $item) { if($item->id == $page->rootParent->id) { echo "<li class='current'>"; } else { echo "<li>"; } echo "<a href='$item->url'>$item->title</a></li>"; } // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) echo "<li class='edit'><a href='$page->editUrl'>Edit</a></li>"; ?></ul> </div><!-- /.navbar-collapse --> </div> </nav> </header> </div> <?php /* ?> <div class="container-fullwidth animated fadeIn"> <section id="zoom-out-header"> <div id="zoom-out-background" style="background: url('[[*blog_main_image]]') no-repeat center center; background-size: cover; "></div> <div id="zoom-out-tagline"> <div class="container"> <div class="row no-border no-marg-tb"> <div class="col-md-12"> <h1 class="no-marg-b backg-black-transp20 color-light text-center padd-20">$page->title; </h1> </div> </div> </div> </div> </section> </div> */ ?> <?php // if there are images, lets choose one to output in the sidebar if(count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide //$image = $image->width(1140); uit om responsive te maken // output the image at the top of the sidebar... $header = $image->url; // ...and append sidebar text under the image // $sidebar .= $page->sidebar; } else { // no images... // append sidebar text if the page has it // $sidebar = $page->sidebar; echo "$config->urls->templates"; ?>images/full-bg.jpg" <?php } ?> <!-- Full Page Image Background Carousel Header --> <div id="carouselFade" class="container-fullwidth container-marg-b color-primary-backg carousel carousel-fade slide bs-full-slider bs-full-slider-h50 animated fadeInDown"> <!-- Indicators --> <ol class="carousel-indicators z-index-2"> <!--<li data-target="#carouselFade" data-slide-to="[[+idx:decr]]" [[+idx:is=`1`:then=`class="active"`]]></li> --> </ol> <!-- Wrapper for Slides --> <div class="carousel-inner"> <div class="item active"> <div class="fill header-fill" style="background-image:url(<?php echo $header; ?>)"> </div> <div class="carousel-caption height-100 caption-vertical z-index-1" > <div class="caption-vertical-item"> <h1><?php echo "$page->title"; ?> </h1> <p class="lead marg-b20"><?php echo "$page->headline"; ?></p> </div> </div> </div> </div> <!-- Controls --> <a class="left carousel-control z-index-2" href="#carouselFade" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control z-index-2" href="#carouselFade" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> <div class="container"> <section> <div class="row"> <div class="col-md-12"> <!-- breadcrumbs --> <div class='breadcrumbs'><?php // breadcrumbs are the current page's parents foreach($page->parents() as $item) { echo "<span><a href='$item->url'>$item->title</a></span> "; } // optionally output the current page as the last item echo "<span>$page->title</span> "; ?></div> </div> </div> </section> </div> <div class="container-fullwidth" style="background-color:<?php echo $page->bodyBackgroundColor; ?>"> <div class="container"> <section> <div class="row"> <div class="col-md-12 body-front"> <?php $page->headline; ?> <div class="wow fadeInUp animated"> <?php echo $content; ?> </div> <?php // Primary content is the page body copy and navigation to children. // See the _func.php file for the renderNav() function example $content = $page->body . renderNav($page->children); ?> </div> </div> </section> </div> <div class="svg_waves"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 157"><g id="footer_wave" fill="none"><g id="Artboard" fill="<?php echo $page->bodyWavesColor; ?>"><g id="waves" transform="matrix(-1 0 0 1 1649 31)"><path id="wave--bg" d="M62.871 104.03C216.871 87.324 286 79.324 589 79.324S958 125 1249 125s445.587 1 445.587 1L1678 225 183.67 235.324S-91.129 120.734 62.871 104.03z"/><path id="wave--bottom" d="M72.868 151.295C103.996 138.363 484.122 47.5 650.155 47.5c166.034 0 320.54 45.056 611.54 45.056 291 0 464.044-67.495 464.044-67.495l-80 132.939-1437 32s-167-98.777-135.871-111.71v73.005z" opacity=".06" transform="matrix(-1 0 0 1 1794.739 0)"/><path id="wave--middle" d="M43 2c154-9.807 423.81 29.65 538.81 45.5C696.81 63.35 966 94 1257 94c291 0 457.203-42.22 457.203-42.22l-69.753 97.447H201.001S-111 11.807 43 2z" opacity=".15"/><path id="wave--top" d="M616.074 103.938c-293.347 0-472.782-20.373-472.782-20.373l70.315 97.447h1455.087s329.601-143.286 174.36-153.093c-155.242-9.807-605.136 26.69-721.063 42.54-115.927 15.85-212.571 33.479-505.917 33.479z" opacity=".1"/></g></g></g></svg></div> </div> <div class="container-fullwidth" style="background-color:#<?php echo $page->body2BackgroundColor; ?>"> <div class="container"> <section> <div class="row"> <div class="col-md-12 body-front wow fadeInUp animated"> <?php echo "$page->body2"; ?> </div> </div> </section> </div> <div class="svg_waves"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 157"><g id="footer_wave" fill="none"><g id="Artboard" fill="#<?php echo $page->body2WavesColor; ?>"><g id="waves" transform="matrix(-1 0 0 1 1649 31)"><path id="wave--bg" d="M62.871 104.03C216.871 87.324 286 79.324 589 79.324S958 125 1249 125s445.587 1 445.587 1L1678 225 183.67 235.324S-91.129 120.734 62.871 104.03z"/><path id="wave--bottom" d="M72.868 151.295C103.996 138.363 484.122 47.5 650.155 47.5c166.034 0 320.54 45.056 611.54 45.056 291 0 464.044-67.495 464.044-67.495l-80 132.939-1437 32s-167-98.777-135.871-111.71v73.005z" opacity=".06" transform="matrix(-1 0 0 1 1794.739 0)"/><path id="wave--middle" d="M43 2c154-9.807 423.81 29.65 538.81 45.5C696.81 63.35 966 94 1257 94c291 0 457.203-42.22 457.203-42.22l-69.753 97.447H201.001S-111 11.807 43 2z" opacity=".15"/><path id="wave--top" d="M616.074 103.938c-293.347 0-472.782-20.373-472.782-20.373l70.315 97.447h1455.087s329.601-143.286 174.36-153.093c-155.242-9.807-605.136 26.69-721.063 42.54-115.927 15.85-212.571 33.479-505.917 33.479z" opacity=".1"/></g></g></g></svg></div> </div> <?php foreach($page->extra_body as $extra_bodies) { ?> <div class="container-fullwidth" style="background-color:<?php echo "{$extra_bodies->extra_bg_color}"; ?>"> <div class="container"> <section> <div class="row"> <div class="col-md-12 body-front wow fadeInUp animated"> <?php echo "<p>{$extra_bodies->extra_body_text}</p>"; ?> <?php echo "<p>{$extra_bodies->extra_waves}</p>"; ?> </div> </div> </section> </div> <script type="text/javascript">var waves = <?php echo "{$extra_bodies->extra_waves}";?>; if (waves = 0) document.getElementById('svg_waves').style.display = "none"</script> <div class="svg_waves"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 157"> <g id="footer_wave" fill="none"> <g id="Artboard" fill="<?php echo "{$extra_bodies->extra_wave_color}" ; ?>"> <g id="waves" transform="matrix(-1 0 0 1 1649 31)"> <path id="wave--bg" d="M62.871 104.03C216.871 87.324 286 79.324 589 79.324S958 125 1249 125s445.587 1 445.587 1L1678 225 183.67 235.324S-91.129 120.734 62.871 104.03z"/> <path id="wave--bottom" d="M72.868 151.295C103.996 138.363 484.122 47.5 650.155 47.5c166.034 0 320.54 45.056 611.54 45.056 291 0 464.044-67.495 464.044-67.495l-80 132.939-1437 32s-167-98.777-135.871-111.71v73.005z" opacity=".06" transform="matrix(-1 0 0 1 1794.739 0)"/> <path id="wave--middle" d="M43 2c154-9.807 423.81 29.65 538.81 45.5C696.81 63.35 966 94 1257 94c291 0 457.203-42.22 457.203-42.22l-69.753 97.447H201.001S-111 11.807 43 2z" opacity=".15"/> <path id="wave--top" d="M616.074 103.938c-293.347 0-472.782-20.373-472.782-20.373l70.315 97.447h1455.087s329.601-143.286 174.36-153.093c-155.242-9.807-605.136 26.69-721.063 42.54-115.927 15.85-212.571 33.479-505.917 33.479z" opacity=".1"/> </g> </g> </g> </svg> </div> </div> <?php } ?>
  22. How can I execute a php script like echo "hallo world"; within a process-wire site. I copied the php script, but only the text command of the php scripts was displayed on the fronted.
  23. Hello everyone, this is my first post here, and i hope its the right place for my question. I am getting started with PW and right now, im trying to bring a existing static Site to PW In this static site i was working with some PHP to import svg code echo file_get_contents("img/icons/ticket.svg") I placed the img folder in the assets folder but now i am having troubles to point at this file using $config->urls->assets i was trying to do something like echo file_get_contents("$config-urls-assets/img/icons/ticket.svg") but of course this fails and as i am not quite good with PHP i do not know how to nest this php to get what i want. I don`t want to use fields to store the svg code, because i need different icons on one page and i do not want to create multiple field for that. Any advice is highly appreciated. Thank you.
  24. Hi, I'm trying to write a bash script that automates our release procedures. 1 of the things I've written is a php module that clears the Procache settings and resets. The php module runs if I call it from a browser but if I call it from a bash script I get a connection refused error. Error: Exception: SQLSTATE[HY000] [2002] Connection refused (in /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php line 293) This error message was shown because: you are using the command line API Error has been logged. Assuming this is a security precaution, I was wondering if there is a different way around this? Perhaps write a container php module that launches the bash scripts instead?
  25. 777 seems excessive - is there something that I'm missing here? This is a print out of the /site content; ``` total 28 drwxrwxr-x 6 geot geot 4096 Sep 9 13:30 . drwxrwxr-x 8 geot geot 4096 Sep 9 13:17 .. drwxrwxr-x 2 geot geot 4096 Sep 6 10:10 assets -rwxrwxrwx 1 geot geot 1548 Sep 6 10:10 config.php drwxrwxr-x 3 geot geot 4096 Sep 6 10:10 install drwxrwxr-x 2 geot geot 4096 Sep 6 10:10 modules drwxrwxr-x 5 geot geot 4096 Sep 6 10:10 templates ``` I'm sure that I shouldn't have to have permissions so high, but I'm pretty new to this. Here's a shot of the setup that I'm currently going through; http://imgur.com/a/WkhAX You can see that the error (for site/config.php) is no longer there with these permissions, but they still 'feel' wrong. Thanks