Jump to content

benbyf

Members
  • Content Count

    692
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by benbyf


  1. Sure this has been asked a million times but cant find a simple answer.

    Trying to set the page to redirect to after login in the front end - i.e. not on the admin login page.

    some reason this works for super users but not normal users redirecting to a page which is viewable by members not guest role users.

     

    $showLoginError = false;
        if($input->post->user && $input->post->pass) {
        	$username = $sanitizer->username($input->post->user);
        	$pass = $input->post->pass;
    
            try {
    
    			$session->login($username, $pass);
    
    			// redirect user
    			$session->redirect("/events/");
    
            } catch (\Exception $e) {
                $showLoginError = true;
            }
        }

     


  2. 2 minutes ago, MarcoPLY said:

    Please, someone can explain me how I can customize the style of the Stripe payment form? :)

    I try to use the same class but doesn't work. I looking inside the module but not have find any css file. If the style come from Stripe how I can change it?
    I see the Stripe doc, but I don't have understand well, the module works differente, there isn't one page with the form. or not? 

    Thank you.

    ? think you have to make the form yourself, no? or do you meand the Stripe button? not sure you can style much coming direct from Stripe.


  3. Thought I's try SystemNotifications and found it over kill as I would get alot of warnings, changes and errors appearing and persisting which was scaring my client. But now I'm unable to uninstall it without getting errors on the user edit page saying it requires a module that doesnt exsist any more... anyone had this issue or can recommend how to use this module correctly?


  4. Thanks @Juergen got it working finally, I had the file here:

    mystyles:/site/modules/InputfieldCKEditor/mystyles.js

    And turns out I had errors in that file too. But got it to working after finding the errors in the console when CKEditor wasnt loading properly.

    • Like 1

  5. Still finding it super difficult to edit the CKeditor.

    Trying to add my own styles, to the styles panel. Added the file mystyle.js to /site/modules/InputCKEditor/ the styles button is present. and I added code to that file as well as the path (or name or both none worked for me) to the Custom editor Js styles field. :(

    CKEDITOR.stylesSet.add( 'mystyles',
    [
        // Block-level styles
        { name : 'Italic Aleo', element : 'p', styles : { 'class' : 'aleo' } },
    ]);

     


  6. On 22/01/2018 at 7:34 PM, Macrura said:

    i have at least 1 site using jquery unveil.js in combo with isotope and works perfectly

    any tips, it causes a strange little jump or reflow of layout when a new image comes in for me.


  7. On 19/11/2017 at 6:01 PM, Macrura said:

    one thing that i would find difficult from the perspective of UI, is that if you click on an image, you lose all context of where you are at, scrolled down – the page scrolls to the top, and even if you close the larger image at the top, it doesn't put you back where you were – this results in an insane amount of vertical scrolling if you wanted to peruse the portfolio items. You may need to either add prev/next navigation to the opened image, or find some other way of presenting the detail of the images when clicked.

    This has now been addressed.

    I've also spent some time spedning up the load of the site by lazy loading alot of the images, however I havent found a nice way of this playing well with Isotope, but works well enough currently.

     

    • Like 2

  8. Just checked on: http://castfeedvalidator.com/

    and still not delivering partial headers, anyone have any experience on this, I'm running PW on nginx. Here is my current php code for the file request:

    <?php namespace ProcessWire;
    if($page->mp3){
    
        $page->of(false);
        $page->counter += 1;
        $page->save();
        $page->of(true);
    
    
        //
        // adapted from GIST: https://gist.github.com/codler/3906826
        //
        $options = array(
            // boolean: halt program execution after file send
            'exit' => true,
            // boolean|null: whether file should force download (null=let content-type header decide)
            'forceDownload' => false,
            // string: filename you want the download to show on the user's computer, or blank to use existing.
            'downloadFilename' => '',
        );
    
        $file_path = $page->mp3->filename;
    
        $fp = @fopen( $file_path, 'rb' );
        $size   = filesize( $file_path );
        $length = $size;
        $start  = 0;
        $end    = $size - 1;
    
        header("Content-type: audio/{$page->mp3->ext}");
        header( "Accept-Ranges: 0-$length" );
        header( "Content-Length: $length" );
    
        // find request headers for partial content
        if ( isset($_SERVER['HTTP_RANGE']) ) {
            // if the HTTP_RANGE header is set we're dealing with partial content
            $partialContent = true;
    
        } else {
            $partialContent = false;
        }
    
        if ( $partialContent ) {
    
            $c_start = $start;
            $c_end   = $end;
    
            // Extract the range string
            list(, $range) = explode( '=', $_SERVER['HTTP_RANGE'], 2 );
            // If the range starts with an '-' we start from the beginning
            // If not, we forward the file pointer
            if ( $range{0} == '-' )
            {
            	// The n-number of the last bytes is requested
            	$c_start = $size - substr($range, 1);
            }
            else
            {
            	$range  = explode( '-', $range );
            	$c_start = $range[0];
            	$c_end   = ( ( isset( $range[1] ) && is_numeric( $range[1] ) ) ? $range[1] : $size );
            };
            // End bytes can not be larger than $end.
            $c_end = ($c_end > $end) ? $end : $c_end;
            $start  = $c_start;
            $end    = $c_end;
            $length = $end - $start + 1;
            fseek( $fp, $start );
    
            // Start buffered download
            $buffer = 1024 * 8;
            while ( ! feof( $fp ) && ( $p = ftell($fp) ) <= $end )
            {
            	if ( $p + $buffer > $end )
            	{
            		$buffer = $end - $p + 1;
            	};
    
            	set_time_limit( 0 );
    
            	echo fread( $fp, $buffer );
    
            	flush();
            };
            header( "Content-Range: bytes $start-$end/$size" );
            header( 'HTTP/1.1 206 Partial Content' );
    
            fclose( $fp );
    
        }else{
            // send file
            wireSendFile($page->mp3->filename, $options);
        }
    }

     

    • Like 1

  9. On 27/11/2017 at 1:59 PM, flydev said:

    PS: A small suggestion @benbyf, you could include in the first post a) a small "howto customize" the ckeditor and/or b) a list of forum links where people can find useful information on "howto customize" the ckeditor (I remember that sometime I need to look at the javascript source-code of the plugin to find the right button-code to include in the ckeditor settings).

    Hey @flydev would love someone to add this as im very much confused about how to edit the CKeditor well, :) I usaully hack it abit till it works


  10. Hello, sure there is something stupid im doing here but cant seem to get the pagination to work. The page list appears but clicking on any of the next

    template has Allow URL segments? checked and contains:

    $results = $page->children("limit={$limit}");
    
    $pagination = $results->renderPager();
    $out .= "<section class='blog-posts'>";
    foreach($results as $result) {
        $out .= "<h3><a href='{$result->url}'>{$result->title}</a></h3>";
    }
    $out .= $pagination;

     

×
×
  • Create New...