Jump to content

rafaoski

Members
  • Posts

    81
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by rafaoski

  1. @adrian On the browser Firefox something does not play and on Chrome shows correctly:
    Dump with Chrome:

    Tracy-Chrome-compressor.thumb.png.73bc10584f6446019da12f484b64f09b.png

    In the Mozilla most likely the error causes the rule below which I checked in the inspector in the blue frame  I turned off or changed to normal and is ok

    tracy-naprawa-compressor.thumb.jpg.813137271aae6dbc3342ca60d1c217c6.jpg

    It works for me in Mozilla:

    #tracy-debug-panel-PanelSelectorPanel fieldset div label {
        white-space: normal;
    }
    /* OR UNCOMMENT */
    #tracy-debug-panel-PanelSelectorPanel fieldset div label {
       /* white-space: normal; */
    }

    I just commented this line code on the module in style.css on line number 293 and it works correctly ( You just have to refresh the module ):

    #tracy-debug-panel-PanelSelectorPanel fieldset div label {
        width: 300px !important;
        /* white-space: nowrap; */
        border-bottom: 1px solid #e4e4e4;
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
        break-inside: avoid-column;
    }

     

    • Like 1
  2. Hi @adrian ... I noticed a problem with the information of Cookies that overshadowed some of the Tracy Debugger components and changed them, i thought that was exactly what it was.This screenshot I made using Easy Screenshot which changes the resolution while the screenshot it finished. I'll change this Screenshot  to better which will show the bottom of the Tracy Debugger. Usually everything is fine.

    Screenshot taken with a lightshot:

    5a09c6a11beea_Tracy-good.thumb.jpg.ba474bfe5e1a3d2a3d5d6f06542211ba.jpg

     

    • Like 1
  3. Hello All ... I just added a new Site Profile ...

    It is important that you use the latest version that supports the new Fields => Fieldset in Tab , Fieldset ( Page ) for this time it is version 3.0.83 DEV

    A simple profile for quick start new Page ... There are several pages like About Us, Blog, Portfolio, Contact Page ...
    The profile is not based on any framework, I just used some css, flexbox, grid, font awesome, and added a simple FlexBox Grid called GRIDLEX ...

    CAN DOWNLOAD FROM THIS LINK:

    http://modules.processwire.com/modules/site-twilight/

    https://github.com/rafaoski/site-twilight

    Some Screenshots:

    twilight.thumb.jpg.01887ca5446a1603e6f38c2dd300584e.jpg

    OPTIONS PAGE:

    options-page-compressor.thumb.png.3690003b150b4d0e681a410c00318592.png

    CONTACT PAGE:

    contact-full-compressor.thumb.png.ab2a6ae0ba105e07b2ac753f1168a1f1.png

    BLOG PAGE:

    blog-compressor.thumb.png.8859650f7063ab681f6c165e5a081da4.png

    ABOUT PAGE:

    about-compressor.thumb.png.3decb2954a046918d111355d518f9553.png

    PORTFOLIO PAGE:

    portfolio-compressor.thumb.png.6c2e812f04c562e3ad1409bd8d229ebd.png

     

    In addition, I added 2 great modules:

    Tracy Debugger:

    https://modules.processwire.com/modules/tracy-debugger/

    Final-Version-compressor.thumb.jpg.55f886f70326a9ed31c6191e3c02628d.jpg

    Markup Sitemap:

    http://modules.processwire.com/modules/markup-sitemap/

    sitemap-xml.thumb.png.08eae948e65e967157c3a4e302faf2c8.png

     

    • Like 5
  4. Hi @webhoes  ... I changed the code using sanitizer and downloaded $ _POST using input->post ... I added also at the top of the namespace Processwire  and <form action ='./' ... Code below for me to work:

    <?php namespace Processwire; ?>
    <div id='content-body' class="page-b" pw-append>
    <?php
    
    if (isset($_POST["submit"])) {
        $result = '<div class="alert alert-success">Form submitted</div>';
    
        if (!$_POST['name']) {
            $error = "<br />Vul je naam in";
        }
    
        if (!$_POST['email']) {
            $error .= "<br />Vul je emailaddress in";
        }
    
        if (!$_POST['comment']) {
            $error .= "<br />Vul een opmerking in";
        }
    
        if ($_POST ['email'] != "" AND !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
    
            $error .= "<br />Gebruik een geldig emailaddress";
        }
    
    
        if (isset($error)) {
            $result = '<div class="alert alert-danger"><strong>Da hej mangs, er is iets niet goed ingevuld:</strong> ' . $error . '</div>';
        } else {
            // MAIL NEW https://processwire.com/api/ref/mail/new/
            // SANITIZER https://processwire.com/api/variables/sanitizer/
           // INPUT  https://processwire.com/api/variables/input/
    
           // YOUR MAIL
           $your_email = 'yormail@gmail.com'; 
           // OR GET FROM CONTACT PAGE
          // $your_email = $sanitizer->email($page->email); // LIKE strip_tags($_POST['email'])
    
           // SANITIZE MESSAGE
            $email = $sanitizer->email($input->post->email); // LIKE strip_tags($_POST['email'])
            $name = $sanitizer->text($input->post->name); // LIKE trip_tags($_POST['name'])
            $comment = $sanitizer->text($input->post->comment); // LIKE trip_tags($_POST['comment'])
    
            $message = $mail->new();
            $message->to($your_email)->from($email);
            $message->subject('Mail Subject')
                    ->body('Name: ' . $name . "\r\n" . 'Email: ' . $email . "\r\n" . 'Comment: ' . $comment)
                    ->bodyHTML('Name: ' . $name . "\r\n" . 'Email: ' . $email . "\r\n" . 'Comment: ' . $comment);
            $numSent = $message->send();
    
                $result = '<div class="alert alert-success"><strong>Wysłałeś wiadomość.</strong></div>';
    
            }
     echo $result;
        
    
    }
    ?>
    <!-- Button trigger modal -->
    <!-- Modal -->
    <div class="modal fade slide left" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
    
                    </button>
                    <p class="modal-title" id="myModalLabel">Contact met Webhoes!</p>
    
                </div>
                <div class="modal-body">
                    <p class="lead">Laat wat van je horen!</p>
                    <form action='./' method="post" id="myForm">
                        <div class="form-group">
                            <label for="name">Naam:</label>
                            <input type="text" name="name" id="name" class="form-control" placeholder="Name" value=""
                                   required/>
                        </div>
                        <div class="form-group">
                            <label for="email">Email:</label>
                            <input type="email" name="email" id="email" class="form-control" placeholder="Email" value=""
                                   required/>
                        </div>
                        <div class="form-group">
                            <label for="comment">Opmerking:</label>
                            <textarea class="form-control" id="comment" name="comment" required></textarea>
                        </div>
                        <input type="submit" name="submit" class="btn btn-success btn-lg" value="Verstuur">
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-error" data-dismiss="modal">Annuleren</button>
                </div>
            </div>
        </div>
    </div>
    
    </div>

     

    • Like 1
  5. @ROLAND_JUNO ... Add the code between <! - Google Analytics -> {GOOGLE ANALYTICS CODE} <! - End Google Analytics -> As below and in place UA-XXXXX-Y enter code ( tracking ID ) ...
    This is an example in _main.php from processwire 3.x ...
    More info:

    <?php namespace ProcessWire;
    // _main.php template file, called after a page’s template file	
    $home = pages()->get('/'); // homepage
    $siteTitle = 'Regular';	
    $siteTagline = $home->summary; 
    ?><!DOCTYPE html>
    <html lang="en">
    <head id='html-head'>
    <!-- Google Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    
    ga('create', 'UA-XXXXX-Y', 'auto');
    ga('send', 'pageview');
    </script>
    <!-- End Google Analytics -->
    
    <!-- THERE ARE EXAMPLES OF PROCESSWIRE 3.X DO NOT COPY THEM -->
    	<meta http-equiv="content-type" content="text/html; charset=utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<title id='html-title'><?=page()->title?></title>
    	<meta name="description" content="<?=page()->summary?>">
    	<link rel="stylesheet" href="<?=urls()->templates?>styles/main.css">
    </head>

     

    • Like 2
  6. @Ahmad ... My styles and scripts look like this ( Remember the slash before \AIOM ):

    <link rel="stylesheet" href="<?php echo \AIOM::CSS(array('assets/css/uikit.min.css', 'styles/main.css')); ?>">
    <script src="<?php echo \AIOM::JS(array('assets/js/uikit.min.js', 'assets/js/uikit-icons.min.js')); ?>"></script>

    I using Processwire Version 3.0.81 DEV with Uikit 3 site/blog profile ...

    Sometimes also a test environment can cause problems (the last one I had trouble because I used xampp server) which I swapped by going to Laragon development environment for Windows ...

    More options you have in the module, where I usually clean the system cahe ( Empty Cache ) in Menu => Modules/Site/AllInOneminify:

    screen-2.thumb.png.5444a64e30e682074823b4f869c76c83.png

    screen-1.thumb.png.3436f68e108604e5ed6082b00589b1c1.png

    You can remove cache folders from site\assets\cache  and also remove browsing history in chrome or firefox to clear browsing data and finally refresh page and see if it works ...

     

  7. @Ahmad

     This module has a problem in the AllInOneMinify.module file ... When you go to the processwire installation directory and

    site\modules\AllInOneMinify/AllInOneMinify.module

    And change this code from the line 713:

    foreach ($files as $file) {
    $_timestamp = ($_timestamp + $file['last_modified']);
    }

    Change to :

    foreach ($files as $file) {
    $_timestamp = ($file['last_modified']);
    }

    I only deleted the variable " $_timestamp + " and it worked ... But I do not know if it will have any later consequences ...

    In addition, you should install a great debugging module that will help you find problems with the name Tracy Debugger

    • Thanks 1
  8. Hi @louisstephens. I do not know if your input to upload pictures looks like this:

    <input type="file" name='images[]' multiple="multiple" accept=".png, .jpg, .jpeg, .gif"> 

    Important images[] must be array ...

    And im set images $p->set("images",$file);
    My code looks like this:

    // GET NAME
    $name = $input->post->name;
    $p_name = $sanitizer->pageName(time() . '-' . $name);
    // START CREATING PAGE
       $p = new Page();
    // TEMPLATE TO SAVE ITEM
       $p->template = "contact-item";
    // Parent Page
        $p->parent = $pages->get("/contact/");
    // TURN OFF OUTPUT FORMATTING, IF IT'S ON
        $p->of(false);
    // START SAVING INPUT FIELDS
        $p->title = $name;
        $p->name = $p_name;
    // Page Save
        $p->save();
    
    // UPLOAD IMAGES ( If input images was submitted )
        if ($_FILES['images']['name'][0] == true) {
    // Set Maximum Files
        $max_files = 3;
    // Find Created Page id
        $get_id = pages()->get("name=$p_name");
    // Final destination Folder
        $upload_path = $pages->get($get_id->id)->images->path;
    // Instantiate the class and give it the name of the HTML field
        $p_images = new WireUpload('images');
    // Tell it to only accept 3 file
        $p_images->setMaxFiles($max_files);
    // Set Max File Size to 1MB or 2MB => (1024*1024*2)
        $p_images->setMaxFileSize(1024*1024);
    // Tell it to rename rather than overwrite existing files
        $p_images->setOverwrite(false);
    // have it put the files in their final destination. this should be okay since
    // The WireUpload class will only create PW compatible filenames
        $p_images->setDestinationPath($upload_path);
    // Tell it what extensions to expect
        $p_images->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif'));
    // Execute upload and check for errors
        $files = $p_images->execute();
    
    // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors()
    if(!count($files))
    {
    $err = __("Sorry, but you need to add a Photo File like ( 'jpg', 'jpeg', 'png', 'gif' ) !!! ... Max Size ( 1MB ) !!!");
    // ADD SOME SESSION MESSAGE
    $session->info = "<div class='alert-d'><h1>{$err}</h1></div>";
    // TRASH OR DELETE FILE IF NOT EXSIST IMG FILE
    // $pages->delete($get_id);
         // Or Only Trash
    $pages->trash($get_id);
    // Redirect
        $session->redirect('./');
    }
    // Check If To Many Files
    if( count($_FILES['images']['name']) > $max_files )
    {
    $err = __("To Many Images ( MAX 3 Image ) !!! ");
    // ADD SOME SESSION MESSAGE
    $session->info = "<div class='alert-d'><h1>{$err}</h1></div>";
    // TRASH OR DELETE FILE IF NOT EXSIST IMG FILE
    // $pages->delete($get_id);
         // OR Only Trash
    $pages->trash($get_id);
    // Redirect
        $session->redirect('./');
    }
    
    // turn off output formatting, if it's on
        $p->of(false);
    
    // SET IMAGES VALUE
        foreach ($files as $file) {
            // $item .= $upload_path.$file . ',';
                // SET IMAGES FIELD
                $p->set("images",$file);
        }
    // SAVE IMAGE **************** /
        $p->save();
    
    // SUCCESS MESSAGE
        $success = __("Congratulations, you've added Pictures");
    // ADD SOME SESSION MESSAGE
        $session->info = "<div class='succes-m'><h1>{$success}</h1></div>";
    
    // Redirect
    $session->redirect('./');
    }

     

    • Like 3
  9. @svsmailus ... I would recommend starting with W3 SCHOOL ...
    This course also looks quite good: Clever Techie ...
    I also recommend that you also install this site profile:
    READ ARTICLE  => DOWNLOAD PROFILE ...
    Uikit 3 admin theme:
    READ ARTICLE => DOWNLOAD ADMIN THEME ...
    See Short VIDEO how to install the Site Profile and Admin Panel ...

    How to new TEMPLATE system works and VIDEO  ...

    HOW TO USE FIELDS ...

    The latest version of Processwire 3x to be compatible with UIKIT Profiles:

    • Like 1
  10. @ridgedale Add this function to blog.php from the _uikit.php file line no.537

    echo ukPagination($posts);

    Your file blog.php should look like below:

    <?php namespace ProcessWire;
    // This is the template file for main /blog/ page that lists blog post summaries.
    // If there are more than 10 posts, it also paginates them.
    ?>
    
    <div id='content'>
    	<?php
    	echo ukHeading1(page()->title, 'divider');
    // LIMIT POSTS TO SHOW PAGINATION
    	$posts = page()->children('limit=2');
    	echo ukBlogPosts($posts);
    
    // ADD THIS CODE INTO blog.php from _uikit.php line => 537
    	echo ukPagination($posts);
    	?>
    </div>
    
    <aside id='sidebar'>
    	<?php
    	$categories = pages()->get('/categories/');
    	echo ukNav($categories->children, [ 'header' => $categories->title ]);
    	?>
    </aside>

     

    • Like 1
  11. Hi @ryanC, I recently created a profile and added something like this to admin.php:

                               // Add Name Class Module
    if ( !$modules->isInstalled('BodyClass')  )  {
           $modules->refresh();
    }
    // This is Default
    require($config->paths->adminTemplates . 'controller.php');

    If you sign in to Admin Panel then it should refresh all modules including your automatically ...

    In addition, you can protect the front file, such as home.php or basic-page.php, as follows:

     if($modules->BodyClass) { 
       echo 'Your Code'; 
    }

     

    • Like 2
  12. I will be testing Laragon ... I just started to refresh the partition on some Linux derivative (maybe manjaro) ... I have to admit that Processwire has very good people around you who help ... Thank you both @kixe and you @bernhard ... Next time before I start looking for problems I will check on other machines - Such a lesson for the future :)

    • Like 1
×
×
  • Create New...