-
Posts
11,210 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Might be a namespace issue - try calling it with: $summ = \wordLimiter($properties->body); or: $summ = \ProcessWire\wordLimiter($properties->body); Not sure what namespace your _func.php file is in.
-
Just a quick update to let you all know that: 1) With lots of help from @gmclelland we have been ticking off a lot of PHP 7.2 errors. Not sure that we have discovered them all yet though, so please let me know if you come across any. 2) I just forced the Validator panel to use the HTML5 version all the time. I was finding the other version wasn't working for some sites. Hopefully this won't cause any problems, but please let me know if you find anything amiss.
-
Firstly, sorry about the number of settings in Tracy - that isn't a sign of your lack of PHP knowledge, but rather a sign of my indecisiveness Really this is up to you. I leave it running - it's not accessible to regular users anyway. In production mode it can send you emails when it logs errors. But if you want you can uncheck the "Enable Tracy" option so there is no load at all from it, although it's not noticeable in production mode anyway.
-
Actually @alan - I should note that in some instances using the Console panel for this purpose may not achieve what you are looking for. If your template had overridden $user somewhere you might be better off doing bd($user) or bd($user->name) just before that isLoggedin() check so you know you are getting the value that is being used right there in your code. You can do this in your code editor, or you can even do it in the Template Editor panel and use the "Test" button - that way no changes are even made to your template files, so no need to remove debug statements when you're done. Have a read here: https://processwire.com/blog/posts/introducing-tracy-debugger/#template-editor-panel
-
@theoretic - have you had a look at @Macrura's new module: https://processwire.com/talk/topic/17458-settings-train-module-preview-all-aboard/? Maybe this will take care of your needs?
-
Sorry if it seems like I am promoting Tracy here, but if you were using her, you could just do this in the Console panel and you'd instantly see if $user is an object and what the name of that user is.
-
The video fieldtype can do autoplay and loop - take a look at the Mediaelement API (https://github.com/mediaelement/mediaelement/blob/master/docs/api.md). You can also completely replace the video rendering code in the settings of the module with another player if you'd prefer. Not to say that a normal files field isn't fine, the Video fieldtype just makes it easier to manage videos in the backed because it creates images, shows the length of videos, and a few other things. Really depends on your needs as to what will be best.
-
Or if you want a solution for generating poster images and providing an easy play option, check out: https://github.com/adrianbj/FieldtypeVideo
-
Any chance this is helpful: https://processwire.com/talk/topic/5658-alpha-release-usergroups-page-based-permissions/
-
@Livius - welcome to the forums! If it's just one branch per user, then this will do what you need: http://modules.processwire.com/modules/admin-restrict-branch/
-
Get dimensions (height/width) from file upload field
adrian replied to a-ok's topic in General Support
http://caniuse.com/#search=mp4 But I am also using http://www.mediaelementjs.com/ as the default player in that module - it has a flash fallback for any browsers that don't support mp4 -
Get dimensions (height/width) from file upload field
adrian replied to a-ok's topic in General Support
Absolutely, although you need to consider if there are any resource issues with calling ffmpeg-php's getDimensions() at runtime - are you just processing one video at a time on the frontend? I worry that if you are processing many at a time that this might be an issue. Ideally it would be good to store width/height on upload, but there is no easy place to store these in the PW db structure. In the Video fieldtype module I actually rely on the dimensions of the created thumbnail so it's not an issue. -
Get dimensions (height/width) from file upload field
adrian replied to a-ok's topic in General Support
It is currently designed as a video only fieldtype, but if you want to allow other files as well, it shouldn't be hard to implement that option. As for returning width and height - it determines them and uses them when using ->play() but yes it doesn't make them available via ->width() / ->height(). It would also be a pretty easy addition. -
Not meaning to hijack, so maybe any further conversation should be continued in its thread, but what aboutL https://processwire.com/talk/topic/11016-autocontent-generator/ If someone finds a better non-lorum text generator I'd be happy to integrate it into that module. What do you guys think of the approach used in that module vs the manual approach discussed here?
-
Just add this to Tracy's Console panel: $selector = "template=basic-page, title=Contact 2"; d($pages->find($selector)->each("title")); d($pages->getPageFinder()->find(new Selectors($selector), array('returnQuery' => true))->getQuery(), array('maxLength' => 99999)); I save it as "Selector SQL Generator". This will return the results of the selector in the first dump and the SQL in the second. Let me know if you have any troubles with it.
-
Which one - the one to generate an SQL query from a PW selector, or the actual SQL query itself?
-
I haven't been following this closely for a while, but perhaps an SQL query would be helpful? SELECT COUNT(id) FROM `pages` WHERE (pages.templates_id=29) AND (pages.title='My Page') AND (pages.status<1024) GROUP BY pages.id You might find this snippet helpful. It will generate an SQL query from a find selector. I just modified the returned result to be a COUNT instead.
-
Hi @ukyo - thanks for sharing this, but I must admit I am little confused. I am honestly not really sure what you are trying to achieve - no offense intended - I am probably just missing something here Can you please explain how: <?php $str = "You can visit our <a hre='{pages(1):url}'>{pages:get(1):title}</a>"; echo processString($str); ?> is any better than using the API variables in a string like this: <?php $str = "You can visit our <a hre='{$pages(1)->url}'>{$pages->get(1)->title}</a>"; echo $str; ?> BTW, pages(1) and pages->get(1) are the same thing. The other thing you might want to take a look at is the tag compiler: https://processwire.com/blog/posts/processwire-3.0-alpha-2-and-2.6.22-rc1/#new-module-file-compiler-tags which is not really what you are doing, but it's sort of related.
-
Just a quick FYI - you can get Tracy's debug bar when logged out two different ways. If you are on a local dev machine, check the "Force Guest Users into Development Mode on Localhost" option. The other way if you are on a live server is to use the User Switcher to logout. Hope that helps you get data you may want while logged out.
-
Good to hear it's working again. I hope that splitting up of that info across the PW Info panel and this new Request Info panel is proving ok for you. As I mentioned above, I wanted to make the relevant info also appear in the AJAX bar, but didn't want doubling up of links to the PW admin and other things that don't change, hence the need for this change.
-
Thanks @mel47 - can you please test the latest version and let me know how it goes for you?
-
Thanks @mel47 - that explains it - it's because you are running your site in a subdirectory: /24h/ Could you please confirm that: d($urls->root); in the Tracy Console panel returns: /24h/ Once I know that I'll be able to fix this.
-
Also, check out the Performance Panel in Tracy to show the time between named breakpoints. https://processwire.com/blog/posts/introducing-tracy-debugger/#performance-panel
-
Multiple posts on this - lots of options amongst these. https://processwire.com/talk/topic/11337-resolved-hiding-parent-url-error/ https://processwire.com/talk/topic/3275-hide-parent-page-from-url/ https://processwire.com/talk/topic/9692-hidemask-a-parent-page-from-front-end/ https://processwire.com/talk/topic/5448-remove-parents-from-url/ http://processwire.com/talk/topic/1799-routes-and-rewriting-urls/
-
I am worried that there won't be any 404 responses to any requests to your site though. It still feels like it's the wrong solution to whatever the problem is, but maybe I am not understanding the use case.