Jump to content

MindFull

Members
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MindFull

  1. I vaguely recall their api requiring that external includes be put in a separate file in the amember/ directory. It's been awhile, I can check their manual.
  2. What file in your amember directory are you bootstrapping PW in?
  3. I love bacon and coffee with PW in the morning
  4. I concur with letting a payment gateway handle the card processing, PCI compliance is a big deal and a lot of gateways have API's that are easy to implement. In your case, PayPal's API has the IPN (instant payment notification) messaging service that is free for merchant accounts. It sends POST data to the page you specify so you could just point to a page you've created in PW and handle account/page creation after a successful payment has been made. It's done like this: https://developer.paypal.com/webapps/developer/docs/classic/ipn/gs_IPN/ As far as making the deletion of pages automatic, you could try the LazyCron module : http://modules.processwire.com/modules/lazy-cron/ You can test against the creation of the page by using $page->created, it returns a Unix timestamp of the date/time the page was initially created. You can store the anticipated delete time by adding 24 hrs to the $page->created value // LazyCron function on template page function deletingThePage(HookEvent $e) { // Maybe have a checkbox field == 1 to indicate if payment was processed by Paypal // Find all pages with unpaid statuses $unpaidPages = $pages->find("paymentCheckbox=0"); // iterate the results foreach($unpaidPages as $k){ // When the page was created $timestamp = $k->created; // $timestamp + 1 day $deleteTime = strtotime('+1 day', $timestamp); // If the time to delete the page has been met or exceeded if($deleteTime <= time(){ // Delete the page $k->delete; } } } // Add a hook to the function. Check every hour wire()->addHook('LazyCron::everyHour', null, 'deletingThePage'); All pseudo-code - absolutely no promises that any of that works as I've never used the LazyCron module. From what you've listed as requirements, it sounds like you're almost there. Is the PW API the part giving you a hard time or the implementation of using payment gateway API's?
  5. Hmm, I just tried the same process, minus the refreshing of page1, and everything still works as normal. I do the same thing, I usually have the Pages, Templates, Fields, and front end all open in separate tabs/windows at the same time as I throw things together. Question: how are you getting the newly created page available to you for selection if you haven't refreshed page1? If I'm editing page1 that has a pagefield in either a checkbox or select format, then create a new page in the page tree, that new page isn't available to me for selection until I either refresh page1 by using the browser refresh, or hit the Save button on page1. Is this a 2.4 feature? I'm using 2.3
  6. I just tried to replicate the problem with a pagefield I have on a page1, open a new browser tab, add a page to the parent of where the pagefield is set to, refresh page1, select the new page created in the page tree, save... everything works fine. I've seen these same sort of issues when session data clashes, or fails to be generated. But the only time I've had issues with PW is when the server was denying write privileges to the assets directory and sub-directories. Am I replicating the process incorrectly? What browser are you using?
  7. Oh yeah you can. I usually do something like: // in JS var pageName = <?php echo $page->id?>; $.ajax({ async: true, cache: 'no', type: 'POST', //Specify if POST or GET url: 'someurl.php', data: {pgName:pageName}, //Data to be sent off to the url above .... more JS // in 'someurl.php' $phpPageName = isset($_POST['pgName']?$_POST['pgName']:NULL); //get value of pgName
  8. You could set the role and appropriate permissions in the Access section in the Admin so that you know they have page creation privileges. Then create the user and add the role with something like: $new_page = $users->add($firstName.$lastName.$someThingElse); $new_page->addRole('frontEndUser'); If you want to restrict them to only their own pages... well there's a lot of ways to do it. Maybe one of the easiest routes is to place a condition on the return value of $page->createdUser like: if($user == $page->createdUser){ ...display your content } else{ ...do something else } This is really easy if you're using a controller to handle outputting that particular set of page content: something like the SkyScraper Profile _out.php page because you only have to set that code into one page. Again, a thousand and two ways to skin a cat, all depends on what you're working with and what you feel comfortable with.
  9. Well then, ensure that the Language Support - Fields Module is installed. Then, go to Setup -> Fields -> Body and change the type from Textarea to Textarea Language. That should make the field so you can edit it, but without TinyMCE working. I don't have the most experience with the Language Support stuff so maybe someone else can chime in.
  10. I believe the WYSIWYG Raymond is referring to is installed as a module that Processwire installs by default. It is the TinyMCE rich text editor. Do you have "debug" set to true in your config file?. Also, I'd check to see if the TinyMCE module is listed as installed in your "Modules" tab in the admin page. Like Raymond said, a missing file during install could do that, happened to me before.
  11. Awesome! I'm going to give this a try as I was just thinking about incorporating ElasticSearch into an app I'm putting together. I'll let you know how it works out.
×
×
  • Create New...