Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/20/2015 in all areas

  1. Hello! I like to share a project developed using ProcessWire. App-UNIVERSE.net is a modern online service with software database download. We provide access to a rich app database for desktop operating systems based on Windows and Mac OS. Within each category we present both free and commercial apps used by professionals in industries as movie creation, interior design, transportation, creating presentations, coding apps and games, etc. All available apps in App-UNIVERSE contain information like license, name of developer, date of app update, actual description of main features and direct links to files hosted on developers homepage. Site visitors can search for apps not only through the catalog, but also an advanced search engine. Applications can be searched by criteria such as category, developer, name of the application or alternative. Unlike many competing sites we do not offer download of files via download assistant that under the pretext of simplifying the process of installing apps are spying software and are installing in system toolbars and other unnecessary components. We focus primarily on all valuable apps that we can height recommend to our users.
    6 points
  2. Also, you can remove the current page from the array to avoid the IF check inside the loop $results = $pages->find("tags={$page->tags}")->remove($page)->shuffle(); Or, do the same as above with one less method: $results = $pages->find("id!={$page},tags={$page->tags}")->shuffle();
    4 points
  3. Pw converts pageArrays to a string in that formal automatically when inside selectors, so this should do the same: $results = $pages->find("tags={$page->tags}")->shuffle();
    3 points
  4. Hi everyone, This new video fieldtype extends FieldtypeFile. Video is available via: $page->video_field->url Module automatically creates a poster image of the video on upload and makes this available via: $page->video_field->poster Shows the duration of the video on the title bar, next to the filesize Stores VTT files for subtitles accessed via: $page->video_field->subtitles Formats a transcript from the subtitles, accessed via: $page->video_field->transcript Users can easily upload videos and enter VTT files. The following code is used in the template file. <video src='{$page->video_field->eq(1)->url}' poster='{$page->video_field->eq(1)->poster}' width='720' height='408' ><track kind='subtitles' src='{$page->video_field->eq(1)->subtitles}' srclang='en' /></video> Additional Settings You can additionally set a few different options in the field's Input tab: Number of poster images to generate - if you change from the default of 1, the editing user will be able to select which image they want to use for the poster image Copy poster image to dedicated image field - not necessary but gives you more options of interacting with the poster image(s) Field that you want poster images copied into - only relevant if the option above is checked Try it out (NB: the code is rough - it works, but needs cleaning up. Github: https://github.com/adrianbj/FieldtypeVideo NB: Requirements The module requires ffmpeg and ffmpeg-php, although I can make the latter optional fairly easily. I don't have any requirement checking implemented yet, so if you don't have these, you'll get php errors. Possible future enhancements Ability to specify what frame is used for the poster - either by number, and/or by offering several options to choose from Done! Push poster image to a dedicated image field Done, although could be improved Field for pasting in or uploading closed captions Done, but need to look into multi-language options etc Support for uploading multiple formats of the same video (mp4, webm, etc) and/or automated video format conversion My biggest concern, is how useful this will be to people - how many hosts actually have ffmpeg setup? Do any have ffmpeg-php? Anyone have any ideas for features they'd like to see?
    1 point
  5. Dynamic Roles are a powerful access control tool for ProcessWire. They pick up where traditional roles leave off, and allow you to assign permissions at runtime based on any factor present with the user. Once a user receives one or more dynamic roles (at runtime), those dynamic roles then specify what pages the user can view, edit, or add children to. If traditional roles are a sledgehammer, Dynamic Roles are a scalpel, allowing nearly any finely tuned access control scenario. Traditional ProcessWire roles are limited to assignment of view/edit/add access on a per-template basis. Dynamic roles go outside those limitations and enable you to assign that access based on any factors present with a page (i.e. match any field values). Dynamic Roles assign new access, but do not revoke existing access provided by traditional roles. As a result, Dynamic Roles can be used together with traditional roles, and the two work beautifully well together. Though Dynamic Roles can also replace all situations where you would use traditional roles for access control assignments. If using Dynamic Roles to assign page-view access, you would typically want to use traditional roles to revoke view access from at least the "guest" role at the template level. Then use Dynamic Roles to assign view access to those pages in a more granular manner. This module directly affects the results of all page getting/finding operations by applying the access control directly to the database queries before pages are loaded. As a result, it is fast (regardless of scale), pagination friendly, and requires no further intervention by the developer other than configuring the dynamic roles as they see fit. Because it relies upon new features present only in ProcessWire 2.4.6+, it requires the current dev branch. Sponsored by Avoine Concept by Antti Peisa Code by Ryan Cramer PLEASE NOTE: This module is in pre-release state (like the PW dev branch it requires) and is not recommended for production use just yet. Though we do appreciate any testing and/or feedback that you are able to provide. While not required, this module benefits from ProFields Multiplier. If you have ProFields Multiplier installed before installing this module, it will make this module more powerful by making all of your access control selectors have the ability to use OR-group conditions. Depending on your access control needs, this enables you to accomplish more with fewer Dynamic Roles. How to install Make sure you are running ProcessWire 2.4.6 (dev branch) or newer. Download from GitHub (we will add this module to the Modules directory later). Place all files from this module in /site/modules/DynamicRoles/. In your admin, go to Modules > Check for new modules. Click "install" for the Dynamic Roles module (ProcessDynamicRoles). Click to Access > Dynamic Roles for the rest (see example and instructions below). Example and instructions Lets say you ran a Skyscrapers site and wanted a role enabling users with "portmanusa.com" in their email address to have edit access to skyscrapers designed by architect John Portman, with at least 40 floors, and built on-or-after 1970. Yes, this is an incredibly contrived example, but it is an example that also demonstrates the access control potential of this module. 1. In your admin, you would click to Access > Dynamic Roles. 2. Click "Add Dynamic Role". Enter a name for the dynamic role, like: "skyscraper-test-editor" and save. 3. Under "Who is in this dynamic role?" section, click "Add Field" and choose: Email => Contains Text => "portmanusa.com". This will match all users having "portmanusa.com" in their email address. 4. Under "permissions" check the boxes for: page-view and page-edit. 5. For this contrived example, we will assume the user already has view access to all skyscrapers, so we will leave the "What can they view?" section alone. 6. For the "What can they edit?" section: Click "Add Field" and choose: template => Equals => Skyscraper. Click "Add Field" and choose: architect => Equals => John Portman. Click "Add Field" and choose: floors => Greater Than Or Equal => 40. Click "Add Field" and choose: year => Greater Than Or Equal => 1970. 7. Click Save. Now users matching the conditions of your dynamic role will be able to edit the matching pages, but not any others (unless assigned by traditional roles).
    1 point
  6. https://github.com/ryancramerdesign/ProcessWire-2.0/commit/2eef88ad57ccb2a7f58dcacc2a3f44f7ed43951e
    1 point
  7. Hi Felix, This sounds like a great idea - I am pretty limited on time at the moment, so a PR would be awesome. I am thinking that it shouldn't be too hard to put together by borrowing from Ryan's PWImage button and maybe looking at how teppo added a new button to CKEditor with his Hanna Code Helper: http://modules.processwire.com/modules/hanna-code-helper/ Perhaps with the time I have available I should sort out removing of sublime video (since they are now dead). As a replacement I would like to make it possible to link to your preferred player (via a provided CDN link) and then provide the required code for playing, eg if you like using mediaelementjs, you'd define like this: <video src='{url}' poster='{poster}' width='720' height='408' ><track kind='subtitles' src='{subtitles}' srclang='en' /></video> Your embed button would make use of these two config settings: 1. CDN Link, 2. Play code (replacing the {} parts with the correct values from the selected video. It would be great to add these features and actually release this module in the PW modules directory. What do you think?
    1 point
  8. You're welcome Remove is in the cheatsheet, you have to toggle the advanced mode (button on top)
    1 point
  9. Not exactly. I've build something like this already (textformatteroembed). I'm talking about a dedicated video button inside ckeditor that can also be used for self hosted videos.
    1 point
  10. Didn't know that. Even cleaner.
    1 point
  11. I would love to have a possibility to embed videos via CKEDITOR the same way images are embedded (instead of shortcodes). This would be so much easier (i mean: after all video is just another html tag). Any plans on doing this? If you ain't got time / plans to do this I'd be happy to help you with it (I thought about building this as a module for quite a long time).
    1 point
  12. Hi Horst, Nice bit of code! Tried it out and works nicely. Don't know what I was doing wrong but this helps quite a bit. Thanks a lot!
    1 point
  13. You can build logic upon a permission. if ($user->hasPermission('just-a-permission')) { // do something } Every user has role. (A Role extend Page, so behaves like a page)Every role can have multiple permissions (A Permission extends Page, so behaves like a page) Every user can have multiple roles. When you ask $user->hasPermission('something'), ProcessWire will loop all roles and see if one of those roles has that permission. And it returns a boolean true or false on it's findings.
    1 point
  14. I'd not store the images below the user, but rather use another place in the pagetree and link them with an pagetable to the user.
    1 point
  15. 1 point
  16. Filetype is JPEG you said? If you change things for testing purposes, you can add a param "forceNew" => true to an options array to always override previous versions. And if you want check filesize compared to quality settings you can use the suffix setting for a complete check loop like that: $img = $page->images->first(); // grab you an image (change code to match your setup) $newWidth = ($img->width == 2500) ? 2499 : 2500; // set a width value different than the original image size! (is needed for the test only) $qualities = array(100, 90, 80, 70, 60, 50, 40, 30, 20, 10); foreach($qualities as $q) { $options = array('forceNew'=>true, 'quality'=>$q, 'upscaling'=>true, 'sharpening'=>'soft', 'suffix'=>"quality{$q}"); $variation = $img->width($newWidth, $options); echo "<p>variation: {$variation->name} :: " . filesize($variation->filename) . "</p>"; } Code is written in browser, if it doesn't work as expected, please check for typos or come back here and tell me. And if it works, please drop a note about the result.
    1 point
  17. I'm working on a few big updates atm on multiple PW sites. For me, every day is a ProcessWire day.
    1 point
  18. I don't know why but when I use my work email address which is managed by Gmail, but is not a @gmail address, I need to use: Nothing else seems to work for me except this. Hopefully that might be a useful addition to @cstevensjr's excellent post.
    1 point
  19. I posted 2 times in another topic about the SMTP settings for Google. Here is the consolidated information from those posts: If you use a Google email address, this will work: Other major providers are setup similar (you just need to check what their SMTP requirements are - this information is easily found, otherwise ask your hosting provider for correct setup and ports) ------------- Second Post ----------------- I will & here is additional information regarding Gmail. There are specific variations that will work and sometimes people don't understand why an option is needed. These links should educate anyone on why certain settings work and others don't. https://support.google.com/a/answer/176600?hl=en http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm http://email.about.com/od/accessinggmail/qt/et_gmail_imap.htm http://email.about.com/od/accessinggmail/qt/How_to_Access_a_Gmail_Account_with_any_Email_Client_via_POP.htm
    1 point
  20. Just wanted to throw in my two cents. If you come at it as a front-end developer that's a complete beginner to CMSs, then PW should be very easy to get going. It's built around working the same way that existing web technologies work… Pages map in the same way that URLs do… Template files are just plain HTML/PHP files… the API is largely the same as a front-end API (jQuery)… and so on. So if you know your basic web technologies outside of CMSs, then you won't find a simpler system than ProcessWire. The problem is most other CMSs don't work that way. So the line gets more blurry when you've become used to the terminology and approach of another CMS, because PW can be quite different. Sometimes you have to unlearn what you know from elsewhere in order to appreciate the simplicity of PW. People are always trying to find complexity that isn't there, especially those that grew up on other platforms. PW is a system that rewards you by being curious. We aim to show you how to fish so that you can catch the big fish. We're not here to catch the fish for you. You don't have to know anything about fishing, but you should know how to yell for help if you fall in the water. And you should be willing to learn by example. I learn best by example, so this is the way I tend to teach too (and I recognize not everyone learns the same way). PW is a CMS and CMF, not a website builder. If you are curious and willing to explore, you'll find it is very simple indeed. Certainly far simpler than even WordPress in creating a custom website. You do have to come from the point of view of "I want to create and have the system adapt to me" rather than "I will create something based on what the system provides." If you already know what you want to create and it's something unique, you won't find a simpler path to get there than PW. WordPress is a different beast, in that it's basically saying "YOU WILL CREATE A BLOG or modify this blog and call it something else." Some people like that underlying structure… "okay, we're starting with a blog, what can we do with it?" Others do not like that underlying structure. Our audience consists of those that want to have a system support their original creation rather than mash up an existing creation. There was a PDF posted earlier that I think hit upon some good points, and I appreciate the effort that went into putting it together. The fictional character being scripted in the dialog is not our target. I can go into specifics if anyone wants me to, but I was definitely left feeling at the end of it that we have to be careful about hand-feeding too much or else we'll start attracting people beyond our support resources. Folks that want the fish cooked and filleted rather than folks learning to fish. Perhaps in time we will want to attract more of the consumer-type audience, but currently I don't know how to support users looking to find all the answers in a sitemap file. Keep in mind that unbridled growth is not necessarily desirable. Most of us don't get paid for most of the work we do here and we do best if we grow in a more healthy manner, attracting more thoughtful designer/developers that are here to learn and also contribute. Obviously the author of the PDF is one of the thoughtful ones (and the PDF is a great contribution), even if his fictional character isn't necessarily, but we'll welcome him anyway. But we will definitely be going through the PDF in more detail to learn and improve from it where appropriate, while keeping our audience in mind. I think we're doing something right, because our audience is growing rapidly. I'm nearly full time on ProcessWire now, and it's still difficult to keep up with everyone. At present, I like that our audience is largely open-minded, curious and thoughtful designers and developers. Somehow we've attracted an incredible quality of people and that's what makes this place great. We could not ask for a better group of people here. I'm reluctant to lead PW towards a website builder direction because I think that's when the quality of the community could go down, as people come looking to eat fish rather than learn, catch some fish, and throw some back. The reality is that part of our long term goals include converting the rather large audience that has outgrown WordPress into ProcessWire users. I'm convinced that we do that by giving them more ProcessWire, and not more WordPress. But at the same time, we always have to keep an eye on WordPress and learn. They've been lucky no doubt, but they are also doing many things right. So we have been and always will be working to make the WP-side of users more comfortable in ProcessWire, while also trying to help them grow by distancing them from the limited WP mindset.
    1 point
  21. Try this...quick and dirty...works for me...could be better/smarter/other ways... $articles = $pages->find('template=articles, parent.status!=2049'); 2049 = unpublished status...
    1 point
  22. This is correct, $page->httpUrl is what you are looking for, and it will include the port as well. It will also account for https if the page in question is configured to use https from its template settings. The equivalent of $config->urls->root that you are looking for then would be: $pages->get('/')->httpUrl; Just note that it has to be accessed at it's URL in order for it to know it. So if you are working with the command line API, it's not going to know it...
    1 point
  23. I agree this should go in the near term roadmap. Though I'm thinking it would just be a warning rather than a lock, i.e. "Warning this page is currently being edited by Soma. You should avoid making edits until Soma is finished." The reason I think a warning rather than a lock is better is because someone may just leave their window open to a page, and we're pretty generous with long session timeouts.
    1 point
×
×
  • Create New...