Jump to content

Brian Scramlin

Members
  • Content Count

    27
  • Joined

  • Last visited

Community Reputation

7 Neutral

About Brian Scramlin

  • Rank
    Jr. Member
  • Birthday 03/02/1987

Profile Information

  • Gender
    Male
  • Location
    Wabash, Indiana

Recent Profile Visitors

1,002 profile views
  1. @wbmnfktr, Thank you for your reply and ideas. I have confirmed that in my config.php file my timezone settings are aligned with my local time. Is this the only place to check for timezone settings? How do I view mail settings?
  2. My confirmation emails are coming in around 12 hours after submission. Does anyone know what settings I can check on my server or the module?
  3. I have noticed that when using builtwith.com, ProcessWire does not show up in the stack. I wonder why that is? I don't know how many people utilize that site, but I often browse through it when I find an exceptional website or application, and I hate for people to miss the greatest CMS of all time!
  4. Thank you, everyone! These are helpful strategies and I will integrate them into my work. What a great community. Regarding the auto-pre/appending, this is documented on the PW (https://processwire.com/docs/tutorials/how-to-structure-your-template-files/) as Direct Output with Automatic Inclusions, but I know Delayed Output and Markup Regions are probably preferred and I will work on switching to those strategies.
  5. 1. Would the file be overwritten when upgrading PW? 2. BLAST! Thank you.
  6. I just wanted to share that I added an AJAX-powered gallery to an artist website that I developed and host: https://jackpinecreations.com/gallery/ There were two things that frustrated me about creating this. Perhaps you can show me a better way. 1. After creating my processing script, which I placed under /templates/scripts/get-items.php, I realized that I would get a 403, due to ProcessWire's routing and security. This forced me to have to create a template and page for this little script. This was frustrating simply because it seemed unnecessarily confusing. But worse, see #2. 2. I usually use config.php to prepend and append each of my templates with a head.inc and foot.inc, which keeps my templates easy to use and I don't have to go and use the GUI to do so on each template separately. However, since I realized I needed to create a new template and page so as to access it, whenever I sent POST params to it, I would get the header and footer along with it!!! I could find no workarounds and had to remove the pre/append calls in config.php and use the GUI on each template individually. Code Below if you're interested: HTML and JavaScript (forgive my sad JavaScript skills, I know this can be tightened up) <!-- Begin Grid --> <div class="container mt-4"> <div id="gallery" class="row"> <?php foreach ($page->children("limit=9") as $child): ?> <div class="col-6 col-md-4 gallery-item"> <a href="<?= $child->url ?>" title="View <?= $child->title ?>"> <img class="gallery-item" src="<?= $child->item_featured_image->size(640, 640)->url ?>" alt="<?= $child->title ?> Image"> </a> </div> <?php endforeach; ?> </div> </div> <!-- End Grid --> <div class="center-block text-center"> <button id="get-more-items" type="button" name="get-more-items" class="btn-vintage">Load More</button> </div> <script type="text/javascript"> var buttonGetItems = document.getElementById("get-more-items"); var indexStart = 0; buttonGetItems.addEventListener("click", function() { indexStart += 9; $.ajax({ url: '<?= $pages->get(1186)->url ?>', type: "POST", dataType:'json', // add json datatype to get json data: ({page_id: <?= $page->id ?>, index_start: indexStart}), success: function(data){ console.log(data); if (data[1]) { //for each element, append it. $.each(data, function(key, value) { $("#gallery").append(value); }); } else { $("#get-more-items").after('<p class="center-block text-center">There are no more items to load.</p>'); $("#get-more-items").remove(); } } }); }); </script> Processing Script <?php $items_array = []; $i = 0; foreach ($pages->get($input->post->page_id)->children->slice($input->post->index_start, 9) as $child) { $i++; $items_array[$i] = "<div class='col-6 col-md-4 gallery-item'> <a href='$child->url' title='View $child->title'> <img src='{$child->item_featured_image->size(640,640)->url}' alt='$child->title Image'> </a> </div>"; } echo json_encode($items_array); I love ProcessWire for hundreds of reasons, but I've been using AJAX more and more, and I'm not liking having to create templates to access scripts. Any advice?
  7. I am reading up on these links now. Thank you @bernhard!
  8. I am getting an error on line 21 for PW version 3.0.89 upon install. Something about the method needing the abstract keyword.
  9. Hello, I am newer to web development, but have fallen in love with Processwire over the past few years. I love the simplicity and flexibility of the entire platform. One area, however, continues to elude me: Modules. Desiring to respect the community, I have done my due diligence in reading other posts, the documentation, and learning more about PHP OOP so I better understand the syntax and patterns of Modules. But, I am still confused and was hoping some interaction would help me. For my first module, I am desiring to create a new Fieldtype which allows a user to Visually select an icon from the Font Awesome library (something like this https://codepen.io/scramlo/full/XGaOgv) Render markup. I have written the necessary parts of the module: <?php namespace ProcessWire; class FieldtypeIconPicker extends FieldType implements Module { public static function getModuleInfo() { return [ "title" => "Icon Picker", "summary" => "The Icon Picker module allows you to preview and render icons from the Font Awesome icon library.", "version" => 1, "autoload" => true ]; } public function ready() { if ($this->page->template == "admin") { } } } I have been looking at the FieltypeSelect and FieldtypeColorPicker modules as I thought I could learn from them. I see they both start by creating this function and returning the value. public function getInputfield(Page $page, Field $field) { $inputField = $this->modules->get('InputfieldColorPicker'); //lots of magic here return $inputField; } Where does this function get called? Please forgive me for my lack of understanding. Here are my confusions: I need to create a button that links to my module's JavaScript file. In my JavaScript file I can create a popup with all of the icons. When a user clicks on an icon, I need to set a value somehow in the database. I can use a hidden field if needed, I would suppose. I need to be able to render the output. I am guessing that in my module, something like the following is what I need: $iconMarkup = "<i class="fa " . $this->icon_class . "></i>"; Perhaps that is the return value of the getInputField function? Thank you for your patience and help. Please feel free to let me know if there is documentation I should have read, but missed. I want to work hard to fully grasp module development in ProcessWire.
  10. I am reading through replies, but wanted everyone to know as of one hour ago, I was able to reload backup from a couple of days ago. Thankfully my server configuration was set up to do this automatically. I'm new to this journey, and I will always be more careful. In fact, I am finally convinced I should have the following workflow: virtualized local configuration matching server config > commit to git local > push git to cloud > upload changes to live site.
  11. Macrura,

    I have a client who has grown beyond my ability to assist them. Are you available for a project quote? I can give you all the details. I came across you when I read about your experience with integrating foxycart with pw. 

  12. Hey everyone, I had one of the worst days of my life today due to the setlocale(LC_ALL,'en_US.UTF-8'); suggestion at the notification bar of my admin panel. I went into config.php, went to the last line and added setlocale(LC_ALL,'en_US.UTF-8'); Then my client's 30k/day site completely crashed. All I can get is the following output: 404 page not found (no site configuration or install.php available) Of course I removed the line of code and the problem is still there. In the midst of all of that I did NOT have the site profile exported, nor did I have a backup of the files and when I panicked I tried to upgrade the Processwire components, but in the fray of it all I recursively removed the assets folder--losing about 3-4GB of images and files. The client pays to get access to many of these photos, most of which are mug shots for newly released criminals and they do not have a local backup. So, I thankfully had a copy of all my templates, remade every one of my fields, and at least tried to get them publishing fresh again. Well, that same error showed up at the top of the screen. Guess what I did? The SAME THING!!! Only now I am BEGGING for help. I cannot start over again. Please, someone offer any advice. I thought I did EXACTLY what I was instructed to do.
  13. 1. After reading some documentation, there are fears I have about switching over to InnoDB. I will continue to read, but I decided not to delve into it without feeling more confident I can properly configure everything. Right now there is just as much chance as making things worse, than better! 2. That makes sense. The thing is, we are almost always under 3GB of memory usage (see attached image), but the "spikes" reach higher (I actually can't find out through any logs how high it reaches). But, I am not opposed to suggesting this if I run out of ideas. 3. No, everything is very basic. So, it sounds like what you are saying should be true: the pages are cached. 4. The below image is the only information on the memory usage I could find. In the past two days, it appears that we broke 5GB. I don't know what is "normal" for ProcessWire. I do find it interesting though, that the per/second memory was not increased during the above-5GB mark... so maybe it is just legitimate traffic overloading the server? The client already doesn't like spending $80-100 a month on server cost. Thanks everyone for your help!
×
×
  • Create New...