-
Posts
2,240 -
Joined
-
Last visited
-
Days Won
47
Everything posted by netcarver
-
Just expanding a little on one aspect of diogo's post in case some newer folks don't yet know how to get to the User template or how to expand the fields shown in the user's profile. To add new fields to the User template... Navigate to the templates page Click open the "Filters" Click open "Show System Templates" and click "Yes" You should now be able to edit the User template. Once you have added your fields to the template & want them to appear in the user's profile page... Navigate to the Modules page Find the "User Profile" module and click it open Choose all the applicable fields from the list and save the settings.
-
Looks like $date->closing either doesn't have a value or has the value 0 when that line is executed (0 is interpreted as the Unix epoch which is 1970-01-01 when formatted as a year-month-day.)
-
Just found this one. Thanks Nico, this is very useful.
-
Thanks for the reply Ryan, lots of good ideas in there. I agree that there is no real benefit for the request other than for my module so absolutely no need to worry about core mods. I did consider using URL segments for this module in the beginning but assumed, in ignorance, that enabling URL segments on the bin template would preclude me having the links as child pages and, as I definitely wanted to have the links as child pages, I chose not to explore that route. It's also good to know that URL segments can have uppercase characters. I'll probably look at moving over to a URL segment based solution for version 2 of this module. For now I've moved on to another module project.
-
@Ryan, Is there any way to prevent PW from using all lowercase characters in a page's path? For this module, allowing uppercase characters in the shortened URL would really increase the bin sizes -- or allow shorter links for a given bin capacity. Currently I use a 31 character alphabet for generating the short links giving a maximum of 887,503,681 links using 6 characters. If I could add 19 visually distinct uppercase characters to the alphabet this would increase to 15,625,000,000.
-
Just added some fine-grained control over how link names are generated if the containing bin is nearly full. This also bumps the version to 1.0.0.
-
Thanks for sharing that Nico. I like that you get to use upper-case characters in your shortlinks.
-
Thanks to Ryan, I've managed to knock my next module into usable shape. The URL Shortener adds a link shortening feature to ProcessWire, so you can host your own short URL service from a PW site now. You can create as many bins for short links as you need & the module sets up an example bin when you install it. Each bin is a PW page that uses the LinkShortenerHome template. This template allows you to set the length of the shortened links that will reside in it. Shortened links are simply child pages that automatically use the LinkShortener template. As these links are normal PW pages you can manipulate them from the admin page tree just like any other page. Anytime you create a new short-link page in any of your bins, it will automatically be named with a random string that is not already in use in that bin. You get the chance to review this short string before adding the full URL and saving the page. Once the page is saved any visit to the short link's URL will be redirected to the full URL.
-
Is there any way to extend the fields in a module's uninstall field wrapper? I'd like to add an option that only applies to uninstalling the module (in this case, should the module also remove all the shortlink pages/fields/templates that were created.) I know I could just make this a normal module configuration checkbox field, but as it is only applicable at uninstall time, it would seem logical to have it within the uninstall field wrapper.
-
I need to make the title field collapsedHidden in one of the templates that a new module creates during its install(). I couldn't work out how to do this successfully meaning that the module has some manual installation steps at the moment. In the fieldgroup of the template I added the field to I tried... $ls_fieldgroup->get('title')->set('collapsed', Inputfield::collapsedHidden); $ls_fieldgroup->save(); ... but that doesn't seem to do it. Nor does... $ls_fieldgroup->getField('title', true)->set('collapsed', Inputfield::collapsedHidden); $ls_fieldgroup->save();
-
Forms driving you crazy? Something I'm developing ...
netcarver replied to PHPSpert's topic in Wishlist & Roadmap
Just throwing this into the melting-pot. -
Now done.
-
Ok, delaying calling save() on the fieldgroups until all fields have been removed works. Thanks for the tip Ryan.
-
I get the same errors with the additional line. For now I will try delaying the call to save() on the templates till all the fields are removed and see what I get.
-
Hello, can anybody help me work out why this module's uninstall code doesn't seem to work cleanly? I define an array of fields that the module creates and then adds into the user template on install. However, when reversing this in the uninstall() method I get multiple errors. I must have missed something; the uninstall seems to be doing the reverse of the install routine (to me) yet I get multiple errors saying "Unable to delete from 'field_ppp_login_enable' for field that doesn't exist in fields table" even though that field only undergoes a single delete() call -- and, unless removing() it from the template's fieldgroup also deletes it -- it should exist at the point delete() is called. Ideas?
-
The inter-what? Now what will these youngsters get up to next!
-
Seeing as this has now been raised (indirectly) have you seen this? Don't be put off by that first diagram, it's pretty simple at heart. AFAIK, it is one of the classic git branch management models (though certainly not the only one) and provides command line tools to help folk manage the workflows themselves so it's actually quite easy to use. I also find gitg to be a very useful tool for managing git repos (there are others like gitk and tig as well).
-
If you're running on a linux box how about using one of the many dedicated tools for backup. Here's an example that uses rdiff-backup on a user's home directory. (This addresses file based backup needs only, not really thought about the MySQL side of things but perhaps the percona toolkit includes a non-blocking backup script)
-
Or have it link directly to IRC's webchat perhaps?
-
uploading processwire to hosting online
netcarver replied to danielholanda's topic in Getting Started
Ask the hosting provider to install mod_rewrite. If it's hosted on a virtual server then you will probably find information on installing apache modules in the docs of one of the virtual host providers like SliceHost or Linode or on the apache website. -
Some branded swag needed at the ProcessWire London meet-up I think.