Jump to content

JasonS

Members
  • Posts

    50
  • Joined

  • Last visited

Posts posted by JasonS

  1. Hi Horst,

    With your instructions and help, I got it to work.

    Thanks again for working with me in understanding proper methods for rendering the values I needed.

     

    For Future reference for anyone else(including myself if I forget )... There are two methods for rendering data from Metadata EXIF module.

    Array Method:

    // output the value for one key of the returned array
    $firstGalleryImage = $page->galleryimages->first()->getExif( array('FNumber') );
    echo $firstGalleryImage['FNumber'];

    Object Method:

    // if you have choosen the result as object, you would use
    $options = array('toObject' => true, 'keys' => array('FNumber'));
    $object = $page->galleryimages->first()->getExif($options);
    echo $object->FNumber; 

     

    • Like 1
    • Thanks 1
  2. Quote

    echo $page->galleryimages->first()->getExif( array('FNumber') );

    Returned :

    Quote

    Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/photography/site/templates/clientgallery.php on line 9
    Array

     

  3. Quote

    var_dump($page->galleryimages->first()->getExif());

    Notice: Undefined offset: 0 in /Applications/XAMPP/xamppfiles/htdocs/photography/site/modules/MetadataExif/MetadataExif.module on line 44
    array(5) { ["FILE"]=> array(6) { ["FileName"]=> string(12) "apc_0046.jpg" ["FileDateTime"]=> int(1511813872) ["FileSize"]=> int(1160717) ["FileType"]=> int(2) ["MimeType"]=> string(10) "image/jpeg" ["SectionsFound"]=> string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF" } ["COMPUTED"]=> array(9) { ["html"]=> string(26) "width="2797" height="3496"" ["Height"]=> int(3496) ["Width"]=> int(2797) ["IsColor"]=> int(1) ["ByteOrderMotorola"]=> int(0) ["ApertureFNumber"]=> string(5) "f/2.2" ["Copyright"]=> string(20) "photography" ["Thumbnail.FileType"]=> int(2) ["Thumbnail.MimeType"]=> string(10) "image/jpeg" } ["IFD0"]=> array(10) { ["ImageDescription"]=> string(36) "time flies" ["Make"]=> string(5) "Apple" ["Model"]=> string(14) "iPhone 6s Plus" ["XResolution"]=> string(5) "240/1" ["YResolution"]=> string(5) "240/1" ["ResolutionUnit"]=> int(2) ["Software"]=> string(49) "Adobe Photoshop Lightroom Classic 7.0 (Macintosh)" ["DateTime"]=> string(19) "2017:11:27 16:17:21" ["Copyright"]=> string(20) "j.sobers.photography" ["Exif_IFD_Pointer"]=> int(302) } ["THUMBNAIL"]=> array(6) { ["Compression"]=> int(6) ["XResolution"]=> string(4) "72/1" ["YResolution"]=> string(4) "72/1" ["ResolutionUnit"]=> int(2) ["JPEGInterchangeFormat"]=> int(896) ["JPEGInterchangeFormatLength"]=> int(17303) } ["EXIF"]=> array(26) { ["ExposureTime"]=> string(6) "1/2400" ["FNumber"]=> string(5) "22/10" ["ExposureProgram"]=> int(2) ["ISOSpeedRatings"]=> int(25) ["ExifVersion"]=> string(4) "0230" ["DateTimeOriginal"]=> string(19) "2017:07:10 11:47:22" ["DateTimeDigitized"]=> string(19) "2017:07:10 11:47:22" ["ShutterSpeedValue"]=> string(16) "11228819/1000000" ["ApertureValue"]=> string(15) "2275007/1000000" ["BrightnessValue"]=> string(8) "8488/781" ["ExposureBiasValue"]=> string(3) "0/1" ["MeteringMode"]=> int(5) ["Flash"]=> int(16) ["FocalLength"]=> string(5) "83/20" ["SubjectLocation"]=> array(4) { [0]=> int(2015) [1]=> int(1511) [2]=> int(2217) [3]=> int(1330) } ["SubSecTimeOriginal"]=> string(3) "208" ["SubSecTimeDigitized"]=> string(3) "208" ["ColorSpace"]=> int(1) ["SensingMethod"]=> int(2) ["SceneType"]=> string(1) "" ["ExposureMode"]=> int(0) ["WhiteBalance"]=> int(0) ["FocalLengthIn35mmFilm"]=> int(29) ["UndefinedTag:0xA432"]=> array(4) { [0]=> string(5) "83/20" [1]=> string(5) "83/20" [2]=> string(4) "11/5" [3]=> string(4) "11/5" } ["UndefinedTag:0xA433"]=> string(5) "Apple" ["UndefinedTag:0xA434"]=> string(39) "iPhone 6s Plus back camera 4.15mm f/2.2" } }

     

    Quote

     

    var_dump($page->galleryimages->first()->url);

     

     

    string(48) "/photography/site/assets/files/1031/apc_0046.jpg"

     

    Sorry about that, i corrected my mistake. see above.

  4. 17 minutes ago, horst said:

    var_dump(count($page->galleryimages));

    returns - int(2)

    Quote

    $image = $page->galleryimages->first();

    Returns - nothing.
     

    Quote

    var_dump($page->galleryimages->url);

    returns - string(36) "/photography/site/assets/files/1031/" 

    Quote

    var_dump($page->galleryimages->getExif());

    returns - array(2) { ["apc_0046.jpg"]=> NULL ["img_0335.jpg"]=> NULL }

  5. 1 minute ago, horst said:

    please verify that:

    • your field has at least one image
    • that the image is of type jpeg
    • that it (the original version) contains EXIF-data
    • that it contain an entry FNumber

     

    Yes I can confirm all of this. The multi-image field has two images. Using your example array from the first post of this thread I can see Exif information being returned for both. Both files are jpg type files.

    See array information returned from your working example code below.

     

    Screenshot at Nov 27 17-12-27.png

  6. 1 hour ago, adrian said:

    which I think you have already tried, but just not in the code you just posted.

    yes i did. Didn't work.

    1 hour ago, adrian said:

    Also, is loginform.php selected in the module settings for the "Login Template" setting?

     

    Yes, it is.
     

    1 hour ago, adrian said:

    <?php namespace ProcessWire; echo $content = $loginForm; require_once '_main.php';

    I applied your code and doesn't work. I'll attach a screenshot of what I see.


     

    Screenshot at Nov 04 22-20-23.png

  7. 4 minutes ago, adrian said:

    Does populating $content with anything else actually get output on the end?

    No, That's the confusing part. 

    loginform.php

    <?php namespace ProcessWire;
    
    echo $loginForm;

    _main.php
     

    <?php namespace ProcessWire;
    
    /**
     * _main.php
     * Main markup file
     *
     * This file contains all the main markup for the site and outputs the regions 
     * defined in the initialization (_init.php) file. These regions include: 
     * 
     *   $title: The page title/headline 
     *   $content: The markup that appears in the main content/body copy column
     *   $sidebar: The markup that appears in the sidebar column
     * 
     * Of course, you can add as many regions as you like, or choose not to use
     * them at all! This _init.php > [template].php > _main.php scheme is just
     * the methodology we chose to use in this particular site profile, and as you
     * dig deeper, you'll find many others ways to do the same thing. 
     * 
     * This file is automatically appended to all template files as a result of 
     * $config->appendTemplateFile = '_main.php'; in /site/config.php. 
     *
     * In any given template file, if you do not want this main markup file 
     * included, go in your admin to Setup > Templates > [some-template] > and 
     * click on the "Files" tab. Check the box to "Disable automatic append of
     * file _main.php". You would do this if you wanted to echo markup directly 
     * from your template file or if you were using a template file for some other
     * kind of output like an RSS feed or sitemap.xml, for example. 
     *
     * See the README.txt file for more information. 
     *
     */
    ?><!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    	<meta name="viewport" content="width=device-width, initial-scale=1" />
    	<title><?php echo $title; ?></title>
    	<meta name="description" content="<?php echo $page->summary; ?>" />
    	<link href='//fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' />
    	<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" />
    </head>
    <body class="<?php if($sidebar) echo "has-sidebar "; ?>">
    
    	<a href="#main" class="visually-hidden element-focusable bypass-to-main">Skip to content</a>
    
    <h1 align="center" class="logo-text">
          <a href="<?php echo $config->urls->root ?>" class="logo-link"><?php $page->sitename ?></a>
        </h1>
    
    	<!-- top navigation -->
    	<ul class='topnav' role='navigation'><?php
    		// top navigation consists of homepage and its visible children
    		foreach($homepage->and($homepage->children) as $item) {
    			if($item->id == $page->rootParent->id) {
    				echo "<li class='current' aria-current='true'><span class='visually-hidden'>Current page: </span>";
    			} 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>
    
    	<!-- search form
    	<form class='search' action='<?php echo $pages->get('template=search')->url; ?>' method='get'>
    		<label for='search' class='visually-hidden'>Search:</label>
    		<input type='text' name='q' placeholder='Search' id='search' value='<?php echo $sanitizer->entities($input->whitelist('q')); ?>' />
    		<button type='submit' name='submit' class='visually-hidden'>Search</button>
    	</form>-->
    
    	<!-- breadcrumbs -->
    	<div class='breadcrumbs' role='navigation' aria-label='You are here:'><?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 id='main'>
    
    		<!-- main content -->
    		<div id='content'>
    			<h1 align="center"><?php echo $title; ?></h1>
    			<?php echo $content; ?>
    		</div>
    
    		<!-- sidebar content -->
    		<?php if($sidebar): ?>
    		<aside id='sidebar'>
    			<?php echo $sidebar; ?>
    		</aside>
    		<?php endif; ?>
    
    	</div>
    
    	<!-- footer -->
    	<footer id='footer'>
    		<p>
    		Powered by <a href='http://processwire.com'>ProcessWire CMS</a>  &nbsp; / &nbsp; 
    		<?php 
    		if($user->isLoggedin()) {
    			// if user is logged in, show a logout link
    			echo "<a href='{$config->urls->admin}login/logout/'>Logout ($user->name)</a>";
    		} else {
    			// if user not logged in, show a login link
    			echo "<a href='{$config->urls->admin}'>Admin Login</a>";
    		}
    		?>
    		</p>
    	</footer>
    	<script   src="https://code.jquery.com/jquery-3.2.1.min.js"   integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="   crossorigin="anonymous"></script>
    	<script>
    	$('img').bind('contextmenu', function(e) {
        return false;
    }); 
    </script>
    
    </body>
    </html>

     

  8. 29 minutes ago, adrian said:

    Is the missing $ in your post a typo here in the forum?

     

    yes that's a typo in the forum.
     

     

    29 minutes ago, adrian said:

    Also, it depends on how your _main.php is set up. Is $content the final variable that is echo'd at the end, or is it $out or something else? Of course you need to use the variable that is actually used in your _main.php file. $content is just an example.

    Yes, $content is the main output variable coming from the _main.php file.

    My loginForm template page works if i use :

    <?php namespace ProcessWire;
    
    echo $loginForm;

    shows blank screen using:

    <?php namespace ProcessWire;
    
    $content = $loginForm;

    Maybe i'm missing something simple...

  9. Hi Everyone,

    I was wondering if anyone can help me with a problem I'm having.

    I'm currently using the Intermediate templating schema which you can choose from when first developing PW on localhost. 

    Firstly, let me say this is a great module and thank you for developing it.

    Secondly, to the problem, I'm trying to render login form via "$content .= loginForm;" however that doesn't appear to work and produces nothing but a blank page.

    The only way the login form shows is without the _main.php layout by using the default "echo loginForm;" approach.

     

  10. On 2/9/2017 at 10:19 AM, Thachakrit said:

    Thanks pwfoo for your very useful module. I'm still very new and I got an issue about the password validation as the attached image. The text "Not yet validInvalidToo shortToo commonWeakOkGoodExcellent" shown when I get in my Register page. It not work like in the back-end. How to fix it ?

    Screenshot - 02092017 - 09:10:47 PM.png

     


    I'm having the same problem. It's unclear from the previous post on how to fix this issue.
    Shouldn't this be included in module package?

  11. Steps taken are exactly as described in the instructions. If there were any errors I would've posted them. I've been through it, I've also been though it with 2 of our IT guys and they can't see why it's not working either. 

    Update: I've been trying to add the styles to the 'body' field, with no success. As soon as I tried adding them to a different field, voila, it works. I've gone back and tried the body field again but it still doesn't work. Possibly caching?

    I had the same problem, make sure you have styles enabled and the path to your js in the body field.

    Instructions can be found on here.

    .

  12. Hi Kongondo,

    Thanks for the great module.

    I've been searching all day but been unable to find where I can change the labels of comments as I did for PW comments.

    My labels within my Label array aren't working as I thought.

    I also looked at for your documentation on your website but seems to be down for the moment.

    http://kongondo.com/tutorials/specific-features/creating-a-blog-in-processwire/

    What I used before which works for Generic PW commenting system were as followed:

    'labels' => array(
            'cite' => '<label for="author">Name *</label>',
            'email' => '<label for="email">Email <small>(will not be published)</small> *</label>',
            'website' => '<label for="url">Website</label>',
            'stars'=> '<label>Rate this page:</label>',
            'submit' => 'Post Comment'
            
    


    If you can provide any assistance it would be helpful, thanks.

  13. How the class is written now it don't has access to WireMailSmtp, as WireMail is the parent class and not WireMailSmtp. To make it work with not known methods it needs a total rewrite, if even possible. But there's a work around.

    // This don't work with methods not know by WireMail
    $mail = wireMail();
    
    // When you instantiate WireMailSmtp yourself it all works
    $mail = $modules->get('WireMailSmtp');
    
     

    This worked for me too.

    Would really like if i could implement dynamic data in the email?

    Not sending to the wrapper. Maybe you could access what you want from the wrapper with the wire('') functions.

    When you use this module from a normal page page is available with wire('page').

    You could also add your variable to the config, later-on in the wrapper you could access that with wire('config')

    Is this the only way to implement this at the moment?

×
×
  • Create New...