• Content count

  • Joined

  • Last visited

Community Reputation

24 Excellent

About modifiedcontent

  • Rank
    Sr. Member

Recent Profile Visitors

1,177 profile views
  1. Thanks szabesz. I had seen some info about that and have made a "loadmore" template and set up some kind of page. But how should I configure that page? I have it hidden etc., but you still have to publish it, right? Will it behave exactly the same as a plain php inc template part? Or do I have to do other things to prevent it from being parsed and filtered etc.? What is the mysterious $config->ajax; ?
  2. Is there no way to do this without plugins? I am trying, but can't get even the most basic Ajax to work. I am trying to jQuery load() a test.php from an /inc folder in templates, but keep getting file not found. Is there something in Processwire that prevents getting template parts via Javascript? When I put 'test.php' outside of Processwire, in the root of the site, including it with jQuery load() is no problem.
  3. I'd normally use: <meta content='3; URL =' http-equiv='Refresh' /> What would be the Processwire way to do that with $session->redirect? Still confused...
  4. Saving a complete user object also doesn't seem to work. When I try something like this, only the username gets saved, none of the other fields - except maybe addRole: $u = new User(); $u->of(false); $u->firstname = $sanitizer->text($input->post->firstname); $u->lastname = $sanitizer->text($input->post->lastname); $u->name = $sanitizer->text($input->post->name); $u->email = $sanitizer->email($input->post->email); $u->registrationDate = time(); $u->addRole(''); $mainsite->users->save($u); Or am I doing something wrong? This works: $newuser = $mainsite->users->add(); $u = $mainsite->users->get( $newuser->id ); $u->of(false); $u->firstname = $sanitizer->text($input->post->firstname); $u->lastname = $sanitizer->text($input->post->lastname); $u->fullname = $u->firstname.' '.$u->lastname; $u->name = $sanitizer->text($input->post->username); $u->email = $sanitizer->email($input->post->email); $u->registrationDate = time(); $u->addRole(''); $mainsite->users->save( $u );
  5. Oops, kongondo. $forum should have been $mainsite. Now corrected in the example. @ Sergio, I know that, but is there a way to make that work from a "sister site" with this method? $mainsite->user->isLoggedin(); doesn't work.
  6. I kinda use this forum to keep track of how-to's and things I need. Your response will probably be useful to others looking for the same kind of thing. Tested it. Very cool. Dumping this into a template of another PW installation on the same server works: <?php $mainsite = new ProcessWire('/home/serverpath/public_html/mainsite/site/', ''); if($input->post->createuser) { $item = $mainsite->users->add('fred'); echo 'hello ' . $item->name; } $skyscrapers = $mainsite->pages->find('parent=skyscrapers, limit=3'); foreach($skyscrapers as $skyscraper) { echo '<h4>' . $skyscraper->title . '</h4>'; } ?> <form method=post> <input type=submit name=createuser value='add Fred to the main site'> </form> Fred gets added as a user to the main site. Pulling in content from the main site is straightforward. Is there a way to check if a user is loggedin on the main site?
  7. Thanks horst, I vaguely remembered hearing something about this, but couldn't find it. This looks perfect for my use case. I'll try this and will report back...
  8. I have one central website, with membership registration and content etc., and then several related websites with their own URL/domains, each on Processwire, all on the same server. I would like to access the database of the central website from the sister websites. How would I do that? You can't bootstrap one PW installation into another. You can include template parts from one in the other by just using the server path, but whatever you try to get/post just comes/goes to the database of the site you are on. Could you switch databases by including the config.php from another PW installation somewhere? What is the correct, secure way to do this?
  9. It would be great if 'choose file' in the image field would be able to handle other input sources than only the client's OS file manager; Amazon S3/cloud storage, Dropbox, an image folder on an intranet, another folder on the same server where PW is installed, whatever. It would be super convenient if you could just upload images to a folder/directory in the templates folder or root, without any processing, and be able to access that as a source option in the image field. Any way to make that happen? I had started a thread about this here. BitPoet posted a very helpful partial solution specifically for Zenphoto, but it would be great if there was a more source agnostic solution built into Processwire. Letting Processwire download images from any external media gallery/repository would be a good alternative to having a full centralized Media Manager. Or am I missing something that would make this impossible/a bad idea? Edit: Robin S has a module that adds one alternative input option.
  10. Thank you BitPoet, that looks like a great starting point. I'll try this and report back... This recent experimental module by Robin S - add imgs via urls - could also be part of a solution.
  11. Thanks dragan, but those threads really focus on uploading to AWS. I am looking for a way to download from an external library, instead of the client machine. I don't mind if the images are then stored/uploaded in the regular PW way. How can I modify 'choose file' in the image field to open a file manager on a URL, instead of a client machine OS file manager?
  12. OLSA, thanks for your feedback. I personally like how Processwire handles images, but I have a client who wants a central media library. That is why I want to create an external media library - Zenphoto in my case - and have Processwire "upload" the images from there instead of from a client OS file manager. How can I modify 'choose file' in the image field to use other source options? Is it possible to have that open a web-based file manager of another script on the server or on a cloud service, AWS, whatever?
  13. Is there a way to change the input options for the images field? I am trying to figure out if it would make sense to use an external script like Zenphoto as a central media library/manager. How could I connect that with Processwire? 'Choose File' in the images field would have to be able to open that 3rd party media library or a directory on the server or some cloud service instead of (only) the client file manager. Could justb3a's field type module Image Extra be part of the solution? I will try that and report back. Other field types/modules? I know there is a pro module Media Manager that does look very slick, but would prefer to make this work with a mature, tested 3rd party script if a central media gallery is never going to be a core Processwire feature.
  14. Either or both! A JSON field would probably be most useful. I am watching some of those other threads. Simplepie takes input as a list of comma-separated links, not key => value - does that type of array have a name? I managed to make it work with a repeater field.
  15. Another dumb question: Is there a field type for a text-based array? In my case I need to store an array of RSS feeds for SimplePie. Storing that list of links in a textarea - text formatted to look like an array - doesn't work with the script. It works with one link. The images field is an array. I assumed there would be an equivalent for URLs or text in general. Or is there another approach for these cases? Edit: I guess using the optional (module) Repeater field type is the best solution in this case? I have now a working solution based on that. Still curious about other ideas.