Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Hi Manaus, Yes, you can! 1) Give your users a role, for example 'client'. You can use Page fields to create relationships between Users and Projects. Either create a page field which holds multiple projects and add this field to the User template. Or the opposite way, create a page field which can hold users and add this to your project template. 2) Also possible, but more informations are necessary. I assume that the users can log-in only in the front-end of your website. For the Password-retrieval, you can use and modify the ProcessForgotPassword module (core) to your needs. Cheers and lots of fun with Pw!
  2. If the module needs JS/CSS in the frontend (e.g. in templates), I don't see any solution other than let the dev add those scripts himself or using the Page::render hook, assuming that the module is autoload. Why? Because the module creator can't know your template structure. There are lots of different approaches, using a head.inc file is just one of them. Adding the scripts/styles to the config arrays will only work if those arrays are used to output the scripts in the templates. This is because Pw does not force you how to generate the markup, it's pure freedom
  3. It's urlSegmentsStr or urlSegmentStr (typo)
  4. Method 1 does not work because the syntax is not correct. Try adding the redirect like this in the .htaccess, before Pw does handle the request itself: <IfModule mod_rewrite.c> RewriteEngine On AddDefaultCharset UTF-8 #Redirect here RewriteRule ^/index.php/contact$ /contact/ [R,L] Why does Redirects not work? Any errors? If your page-names in ProcessWire have the same name as on your old site, you could setup a rule like this: RewriteRule ^/index.php/(.*)$ /$1/ [R,L]
  5. There are two errors in your first post, not sure if these are just typos here: 1) Like Kongondo said, Europe/Poland does not exist: http://php.net/manual/en/timezones.europe.php Change to: "Europe/Warsaw" 2) There is a space here which should be removed: setlocale(LC_ALL, 'pl_PL '); On my server, I had to call setlocale like this, maybe this works for you: setlocale(LC_ALL, 'pl_PL.UTF-8');
  6. Thanks John! @Peter I can't access your Pw admin Can you post here what was printed out? Should be an array with a status code other than 200. If nothing was printed, then this seems to be an issue with the curl setup of your server. I coded the class which is interacting with google. Recently there turned up a similar problem on one installation. Not sure if this solves the problem here, but you could try to add this line in the GoogleAnalyticsAPI.class.php file, after this line here curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  7. Hi davo, What kind of users can add events? If you have editors that are creating the events for the website, I'd suggest to use the ProcessWire backend. It's really simple (clicking the "new" button under the events parent page). If your visitors (guest users) can post events, you could do it with a form in the frontend. It's straightforward - I'm sure if you give us some more informations there will be answers here with sample codes. As for the datepicker: You can use any Javascript date-picker in your frontend template. Depending on the complexity of the form, there's also the great FormBuilder module Cheers
  8. Hi Peter, Thanks! My guess is that you maybe forgot to add the redirect URL in the Google APIs console which points to your VPS server? Here is where this error comes from: https://github.com/wanze/ProcessGoogleAnalytics/blob/master/ProcessGoogleAnalytics.module#L955 Google does not return a HTTP 200 status. If you can't solve the problem by setting the redirect URI, you can try to add this code: if ($auth['http_code'] != 200) { print_r($auth); die(); // Add this line and check which error code is returned $this->error('Could not fetch the accessToken'); return; } Good luck
  9. Something like this? $image = $page->images->first(); $img = null; if ($image->width >= $image->height) { // Lancscape $img = $image->width(900); } else { // Portrait $img = $image->height(900); } echo "<img src='{$img->url}' alt=''>";
  10. The support for HTML and CSS looks good. However, the main problem is that floats or positioning is not supported - which means you can't just render your HTML like the browser does it. And in the end it doesn't matter if you use a div or article tag in the pdf. TCPDF has also HTML and CSS support, here are some examples: http://www.tcpdf.org/examples/example_006.pdf http://www.tcpdf.org/examples/example_061.pdf Fonts can be added the same way. And changing the fonts with css or inline css (font-family) is possible too. Would be cool if you could test wether mpdf is *really* better Generate the markup needed for the pdf with mpdf, maybe outside of Pw? Then try to do the same with TCPDF / this module. If it does not look good with TCPDF, I'd switch to mpdf. Edit: Problem is that I can't include two pdf distributions, they're both pretty heavy and extending FPDF, so there would be also a lot of code duplication
  11. Hi Manol, Did you find some any features that tcpdf doesn't have? Can you describe the functionality you need? By looking at the features on the mpdf website, I can't detect anything that isn't doable with TCPDF. However, mpdf is based on FPDF - this is the basic class for all other distributions (TCPDF, HTML2PDF etc.) So it should be very simple to change it in the module. I'd help you out if you really need mpdf! Cheers
  12. Holy..... whatever. I'm smiling like a king right now. Thanks Antii and ryan!
  13. If you can't set the timeout higher, try to load this script from the command line. The script timeout isn't a problem there, as far as I know.
  14. Hi Michiel, Easiest solution would be to use the latest dev version of ProcessWire. There's a setting in each text field which is configured as multilang under the "Details" tab: Language Support / Blank behaviour What should happen when this field's value is blank? [ ] Inherit value from default language [x] Remain Blank Choose "Remain Blank" should fix your problem.
  15. That's because the image gets uploaded right after selecting the file (or using drag & drop). If you don't want to save the page but still uploaded an image, you need to delete the image and save the page.
  16. Hi NikNak, Kongondo is right. You'll find the settings here: Modules > Language Support > Page names Problem is that you maybe have an older version of this module where the settings aren't there yet. So I suggest to update to the latest dev version of ProcessWire. A lot of commits were updates to this module. Cheers
  17. Hi Eltom, Using $pages->find() will always return a PageArray. To get a single page, use $pages->get(). For users, there's also the $users API variable available: $u = $users->get('username'); // Search by Username, ID or Selector $u = $users->find('selector'); // Search multiple users by Selector But specifing the user template as you did above is also fine, I guess
  18. Hi Matthew, Commas need to be escaped because they are also used to separate fields in the Selector. The correct method is this: $np->title = $sanitizer->selectorValue($input->post->title); You should sanitize all values that you use in a selector like this. Use text(), textarea() when you are outputting your data on the website, e.g. in form fields. Btw you are right, Pw does set a name based on the title if you ommit setting ->name. Cheers
  19. It seems like ProcessWire can not load the module, so calling the render() method causes this error. Try this: Uninstall and install the MarkupSimpleNavigation moduleAlso make sure that you uploaded all files + migrated the complete database to your live server. Btw, no need to call the module with all those options. These are the default options that the module will use. Just specify the ones you need to differ from the default ones.
  20. Do you plan to integrate some of Photoshops filters too? Nice module btw, great work!!!
  21. Hi rusjoan, Welcome to Pw! What exactly should your module do? How do you plan to integrate the class into ProcessWire? It's not clear from your description. ProcessWire does save the files/images of a page in the folder /site/assets/files/{page-id}/. So if you wanted to save a word file in ProcessWire, then it could be somewhere in the /site/assets/ directory. If you have one word per page, you'd save it like this: $document->save($config->paths->assets . "files/{$page->id}/myName.docx"); This probably didn't answer your question
  22. Hi Rob, I think you may be looking for this: http://processwire.com/talk/topic/2380-fancy-admin-mode/ Made by somantastic Soma
  23. Hi Marty, What trouble do you have? Let's say Seminar1 and Seminar2 both have the same template. If a user visits those sites, you should be able to do a check like this: // Check if the current user can access this seminar page if ($page->allowedUsers->has($user)) { // Good! List the Seminar children } else { throw new Wire404Exception(); } ... where allowedUsers is your Page field (checkboxes) for the users. Of course you'd need also to check on the seminar subpages, so that a user can't access them directly: if ($page->parent->allowedUsers->has($user)) { // Good! } else { throw new Wire404Exception(); }
×
×
  • Create New...