Jump to content

benbyf

Members
  • Content Count

    676
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by benbyf


  1. Hi @MarcoPLY.

    I love this module and use it alot but find that it needs a lot of TLC after not having much activity over the last few years. I usually work on my own copy of it for different needs as my pull requests never get looked at. https://github.com/benbyford/PaymentStripe

    My suggestion is to make a copy and work on the code yourself or pay someone to add the functionality you need. The currency options never worked for me either simply becuase it was never really implemented in the module (not sure about the paypal one as i never use it).

    • Like 1

  2. 19 minutes ago, benbyf said:

    $resultTime = intval($currentTime) - intval($seconds);

    $log->message("result ".$resultTime); // save user page

    $user->set($this->fieldName, $resultTime);

    $this->users->save($user); }

    think i fixed it! adding

    $user->setOutputFormatting(false);

    GRRRRRRRRRRRRR OF() trips me up everytime. is there a good reason why this is here?? can't it default to not always being a pain :(


  3. Hello, having trouble getting PW to save my user or field in cron hook.

    It seems to report the same field info each time unchanged. It should be counting down in seconds.

    	public function init() {
    
    		// set to every30Seconds in settings
    		$this->defaultInterval = $this->cron_check;
    
    		// add hooks to CRON
    	    $this->addHookAfter("LazyCron::{$this->defaultInterval}", $this, 'checkUserSubscription');
    	}
    
    	public function ___checkUserSubscription(HookEvent $e){
    
    		// seconds since last lazycron
    		$seconds = $e->arguments[0];
    
    		$log = wire('log');
    
    		$field = $this->exclusiveRole;
    
    		// users with specific role and field
    		$users = $this->users->find("roles=$field");
    		foreach ($users as $user) {
    
    			// get stored time
    			$currentTime = $user->get($this->fieldName);
    
    			// if time not null
    			if($currentTime){
    
    				// evalute stored time minus time past
    				$resultTime = intval($currentTime) - intval($seconds);
    
    				$log->message("result ".$resultTime);
    
    				// save user page
    				$user->set($this->fieldName, $resultTime);
    				$this->users->save($user);
    		}
    	}
    }

     


  4. Hi @kaba86 as @dragan mentioned you can simply add another foreach loop to check another level down. I would defiantly check out some tutorials on using processwire to get yourself kickstarted in the right direction and theres lots of quality tutorials not to mention some of my own. https://processwire.com/docs/tutorials/

    <?php
    				$children = $pages->get('/')->children;
    				foreach($children as $child){
    					$class = "";
    					if($page->id == $child->id){
    						$class = " current";
    					}
    					if($child->id == $page->parent->id){
    						$class = " parent";
    					}
    					// echo nav links
    					echo '<a name="'.$child->title.'" class="ajax-link'.$class.'" href="'. $child->url .'">'. $child->title . '</a>';
                      	
    	                // new code below
                        $childChildren = $child->children;
                        foreach($childChildren as $subChild){
                          	$class = "";
    	  					if($page->id == $subChild->id){
    							$class = " current";
    						}
    						if($child->id == $page->parent->id){
    							$class = " parent";
    						}
                          
                          echo "<div class='sub-item'>";
                          echo '<a name="'.$subChild->title.'" class="ajax-link'.$class.'" href="'. $subChild->url .'">'. $subChild->title . '</a>'; 
                          echo "</div>";
                        }
    				}
    			?>

    The above is not optimised or elegent - just off the top of my head. I seem to remember one of the default themes has a funciton in it's _func.php file that gives you a nest page list given a page varible (and optional max depth) so you could use that too. Hope that helps (also please post you website when its done :)

    • Like 3
    • Thanks 1

  5. 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;
            }
        }

     


  6. 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.


  7. 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?


  8. 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

  9. 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' } },
    ]);

     


  10. 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.


  11. 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
×
×
  • Create New...