Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/22/2015 in all areas

  1. I recommend the following steps: make a new clean install of PW put your templates, assets, modules in the site folder download Ryans Module Database Backups here: http://modules.processwire.com/modules/process-database-backups/ go to Setup > Database Backups > Upload upload your sql If necessary reset admin password with the following code in your home template $users->get("admin")->setOutputFormatting(false)->set('pass', 'newpassword')->save(); look what happens. If needed switch on debug mode to clean-up your templates $config->debug = true; // in config.php Add your IP adress to HTTP hosts whitelist $config->httpHosts = array('xxx.xxx.xxx.xxx'); // in config.php
    4 points
  2. Hi folks So I actually just added this as a pull request on Github before figuring out it's already possible in the system. What I wanted was an ASMSelect field (can be a normal select or other Page field) where the list was ordered in a certain way and pulled from two sets of pages with different templates. The trick was that I wanted the labels for one set of pages to include the parent page name in the label so they're sorted by parent title, then title, but the other set of pages was just to be added to the end in alphabetical order. I've anonymised the example somewhat, but I have a medical blog where I wanted to categorise posts against medical procedures listed on the site, as well as other blog-specific, general categories. To achieve what I wanted, I selected ASMSelect as the Page Inputfield type, then used the "Custom PHP code to find selectable pages" option and did this: $options = new PageArray(); foreach ($pages->find("template=surgery, sort=parent.name, sort=name") as $category) { $category->title = $category->parent->title . ' / ' . $category->title; $options->add($category); } $options->add($pages->find("template=blog-category, sort=name")); return $options; This results in a nice, alphabetised list such as: Surgery Category A / Procedure 1 Surgery Category A / Procedure 2 Surgery Category A / Procedure 3 Surgery Category B / Procedure 4 Surgery Category C / Procedure 5 Surgery Category C / Procedure 6 General Category A General Category B General Category C and so on, so the surgery pages are in the format {parent.title} / {title} in the Select list, and the blog-category pages are just the normal {title}, all ordered alphabetically by parent (where necessary) and page title. Nice and easy
    3 points
  3. I don't get it, why don't they use the favicon? Sometimes apple is just too bossy!
    3 points
  4. Hanna code is certainly a great way to place an audio file into a textarea, the files themselves loaded into your files field and then referenced in the RTE; to make it easier for editors you could add tagging on the files and then reference the tag in your hanna code. Using the RTE itself, you could simply use the link button and then select the audio file. Then you can initialize that with something like Soundmanager2. So in other words, you would end up with an anchor in your textarea linking to an audio file, which then using a jQuery selector could be turned into a player. For more control, you could check the field (e.g. using strpos) at the top of your template file, and then do a str_replace on the field. The main advantage in that is that you could initialize the audio players and load specific assets based on the existence of said mp3 link, instead of on all pages, and you could also replace the simple anchor with more specific markup that might be required for your player. Lastly you could make a module that would essentially do the same thing, and apply it as a textformatter to the field.
    2 points
  5. Choose 'Fieldtype File' and set allowed format under details tab to mp3 or wav. call the file via API. Here a code snippet I used once $playlist = "<ol id=\"playlist\">\n"; foreach($page->audio as $file) { $playlist .= "<li><a href=\"$page->path?src=$file->url\" data-src=\"$file->url\">$file->description</a></li>\n"; } $playlist .= "</ol>\n"; $body = <<< _OUT <!-- Media Page --> <section id="basic"> <div class="container"> <div class="col-lg-12 text-center"> <h2 class="section-heading">$page->title</h2> <h3 class="section-subheading text-muted">$page->subheader</h3> </div> <div class="col-sm-8 col-sm-offset-2 audio-player"> <audio$src preload="auto" controls> $html5error </audio> $playlist </div> </div> </section> _OUT;
    2 points
  6. Actually that's how this should be. Never change a running system, especially if you've no clue about the details of the system. Only exception are critical security updates.
    2 points
  7. I use Serverpilot.io and though I could probably spend the time setting up the stack myself, its time I'm saving and hopefully more useful tweaks in the future that they can build in. (It seems a little fine on functionality currently)
    2 points
  8. can't replicate it google maps api response is also ok: https://maps.googleapis.com/maps/api/geocode/json?address=S6%201ND
    2 points
  9. I cannot insist on how much this comment is true, I was a total PHP noob, never really understanding what I was doing with other CM's. Its like, before I was just scripting my way through life, with Processwire it feels a lot more like I'm actually programming. Now I'm just a noob actually learning programming along with Processwire.
    2 points
  10. Hi! Just finished my first module This module adds a new "Google-Analytics" Page in your Admin-Panel and displays various Statistics from a Google Analytics Account. It uses the JQuery plugin "jqplot" to display the charts. Github: https://github.com/w...GoogleAnalytics Modules directory: http://modules.proce...ogle-analytics/ Features Visits by Date (Chart) General Statistics about Visits (Total visits, Visit duration, New visitors, Returning visitors etc.) Demographics: Countries, Cities, Languages System: Browsers, Operating Systems, Screen Resolutions Mobile: Operating Systems, Screen Resolutions Pageviews by Date (Chart) Top Content Traffic Sources: Keywords, Referral Traffic by Domain and URI Choose a default date range displaying statistics: last 24 hours, 2 days, 1 week, 1 month etc. Custom date range by setting a "start date" and "end date" Requirements Google Account and Analytics Account A Project in the Google APIs Console cURL Installation 1) Create a Project in the Google APIs Console: Create a new Project in the APIs Console: code.google.com/apis/console/ Under Services, enable the Analytics API Under API Access: create an Oauth 2.0 Client-ID Give a Product Name, choose "Web-Application", Domain doesn't matter Enter a Redirect URI to the GA-Page in your Processwire Installation: http://yourdomain.com/processwire/google-analytics/ Notes: The redirect URI must exactly match with the URL from the new "Google Analytics" page in Processwire. Open the Page and copy the URL from the address-bar (localhost does work too!) The project created in the APIs Console can be reused for every Processwire installation using this module. You just have to enter more redirect URIs 2) Install the module: Place the module's files in /site/modules/ProcessGoogleAnalytics Install the Module via the Admin-Panel Enter Client-ID and Client-Secret keys from the created project in the module config Load the newly created page "Google-Analytics" and click on the button "authenticate" Grant the module access to the Analytics Data Choose a Google Analytics account (Domain) from the dropdown Done: You should see the statistics. Check out the module config options for further customization In order to let other users see the Google Analytics page, you must give their role access to the "ga-view" permission. Ps. Processwire is awesome and so is this community!
    1 point
  11. Hi, three new sites i've worked on recently going live: Photographer - http://www.samhofman.co.uk/ Photographer - http://www.domeni.co.uk/ Illustrator / 3D artist - http://www.mircopinna.com/
    1 point
  12. Thanks for your help Bernhard, it seems to have corrected itself deleting and re-adding the field. It must have just been a strange bug. Thank you very much for your response and help, it's much appreciated.
    1 point
  13. choosing a cms your organization will love, read here, (and also see the first posted comment)
    1 point
  14. Hehe, this is the time zone advantage! +02:00
    1 point
  15. @Alxndre' That sounds inordinately long. Are you importing on a local or remote server? On a local server, I imported 10K rows with 3 fields in two equal batches and it took no more than 10 minutes in total (IIRC). If you can, direct SQL import will be faster than PHP. If you are working on a remote server, maybe try to import to a local server first, then get a DB dump of the import and on the remoter server import the db dump instead. Of course, page IDs will need to match what you expect on the remote server. Just a thought...
    1 point
  16. it works! $lang = $user->language->name; if($lang == 'default') { setlocale(LC_TIME, "de_DE.UTF8"); } else { setlocale(LC_TIME, "en_EN.UTF8"); } and utf8_encode(strftime('%A <br>%d %B %Y', $page->getUnformatted('postDate'))) THANKS!
    1 point
  17. Do you use setlocale somewhere?
    1 point
  18. You'll probably like the Bourbon family, on SCSS. http://bourbon.io -- Mixins http://neat.bourbon.io -- Semantic grid http://bitters.bourbon.io -- Bootstraping styles On bigger/more complex projects, have a look at the Susy SCSS layout framework, mixed with Bourbon and Bitters. http://susy.oddbird.net uikit and the like are nice, but I think there is too much overhead when modifying them.
    1 point
  19. Strange behavior. I have the following settings in my Details Tab: German: %e. %B %G English: %e %B %G A slightly difference - German has a dot(.) after %e - it outputs all in correct language: German: 22. Oktober 2015 English: 22 October 2015 Try it with this date formats and see if the result are the same as in this example. Best regards Jürgen
    1 point
  20. OK, so I changed line 4 of the code here above to if ($page->fields->adr_rubrik) { And now everything works fine. Thank you all for your patience and help.
    1 point
  21. The error essentially means something is trying to insert a record in the database with the unique key being one, that's already present. Not very helpful on it's own, but the db doesn't have any more knowledge about what you're trying to do at that point.
    1 point
  22. Thanks for sharing Pete . Also speaks volumes about the beauty of OOP. Don't know how/if you could have achieved that using procedural code.
    1 point
  23. I would make this with regular PW pages (events), and then selectable options for game or tournament (asm select would allow both to be selected). if the event is a tournament, then you show a page-table field for child events, which would be similar to the event template but assume they are games (if they are child of an event marked as a tournament)
    1 point
  24. You beat me to it, I had just read the article
    1 point
  25. have you added google maps to your frontend <head>? <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> if yes: maybe you can show us some code?
    1 point
  26. I really recommend to do yourself a favor and try one - LESS is for example really easy to set up. I use only a few of its features - nesting, variables, etc - but I won't ever go back to native CSS. When I have to I feel like using pure PHP instead of PW (just to illustrate my feelings ). After all you can write pure CSS but the advanced features are available if you need them.
    1 point
  27. Thanks! Modules: all use AIOM, Images with cropping, Batcher, Admin Save Actions, Export Site Profile, Page Delete, Redirects, and Template Notes. Sam's also uses: Select Multiple Transfer, Page List Image Label, Images Manager. I've got into the habit of running peoples new site as a subdomain, then putting it live through adding an A record to their domain, and if it's a bigger client I'll take a copy of the site and have live and dev for future alterations.
    1 point
  28. Update version 1.0.1 (Dev only for now) Note: Haven't had time to update README Changes As requested, added ability to find column/row pages using custom PHP code. Thanks @adrian. This is a really powerful feature. Note that the order of precedence for the 3 methods to return row/column pages is: 1. Selector 2. Custom PHP code 3. Page field (3 is greatest). Browser warning alert for reset button + rename the button (@adrian). Done + enhancement by @mackski, the button styling now matches other PW buttons Added two properties: rowLabel and columnLabel (in memory only; not saved to DB) to return user-friendly row/column header info. E.g. echo matrix->rowLabel could render 'Red' or 'Large' instead of echo matrix->row that would instead render the page's ID. These are searchable in-memory ONLY, e.g. $results = $page->results->find("columnLabel=Maths"). Added two methods getRow() and getColumn() for mainly syntactic convenience. These do in-memory searches. Can search by path, title, ID, page object (see examples below). Examples columnLabel //find all results for one column - using 'user friendly selector'; $results = $page->results->find("columnLabel=Maths");//@note: in-memory selector echo '<h3>The are the results of: ' . $results->first()->columnLabel . '</h3>';//maths results foreach ($results as $r) echo $r->rowLabel . ': ' . $r->value . '<br>';//student name: score rowLabel $results = $page->results->find("rowLabel=Maurice|Joel|Mi Mong");//@note: in-memory selector #$results = $page->results->find("");//will show all echo '<h3>The are the MULTIPLE results for several students</h3>'; $row = array(); foreach ($results as $r) { if(!in_array($r->row, $row)) { echo '<h4>' . $r->rowLabel . '</h4>';//echo'es student name (e.g. Joel) $row[] = $r->row; } echo $r->columnLabel . ': ' . $r->value . '<br>';//echo'es each subject's results, e.g. Maths: 70 } getRow()//accepts 3 arguments selector value, limit, sort #$p = $pages->get(1088); #$results2 = $page->results->getRow($p->id);//get by ID #$results2 = $page->results->getRow($p->title);//get by Title #$results2 = $page->results->getRow('Joel');//get by Title (case sensitive) #$results2 = $page->results->getRow($p);//get by Page #$results2 = $page->results->getRow($p->path);//get by Path $results2 = $page->results->getRow(1087);//get by ID//get by ID #$results2 = $page->results->getRow('/students/richard/');//get by Path #$results2 = $page->results->getRow($p, 4, 'random');//get by Page, limit to 4 random values #$results2 = $page->results->getRow($p, 4, 'asc');//get by Page, limit to 4 values, sort ascending #$results2 = $page->results->getRow($p, 3, 'desc');//get by Page, limit to 3 values, sort descending #$results2 = $page->results->getRow($p->title, 4);//get by Page title, limit to 4 #$results2 = $page->results->getRow($p, '', 'asc');//get by Page, no limit, sort ascending #$results2 = $page->results->getRow($p->path, '', 'desc');//get by Path, no limit, sort descending echo '<h3>The are the results for: ' . $results2->first()->rowLabel . '</h3>';//student name foreach ($results2 as $r) echo $r->columnLabel . ': ' . $r->value . '<br>';//subject: score getColumn()//accepts 3 arguments selector value, limit, sort Similar to getRow() except for columns $results3 = $page->results->getColumn('/subjects/physics/'); echo '<h3>The are the results for: ' . $results3->first()->columnLabel . '</h3>';//Subject foreach ($results3 as $r) echo $r->rowLabel . ': ' . $r->value . '<br>';//student:score Some feature requests still pending + thinking whether to implement findRows() and findColumns(). Please test and let me know (if you can, both fresh install and upgrades [test on non-critical data please])
    1 point
  29. Not many specific use cases, beyond the general examples I mentioned in the README Some of my own modules have used their own database tables, partly for performance reasons, and partly because storing that kind of data on pages didn't seem like it would make sense and/or be worthwhile. Simple ORM like this can make dealing with such data easier and more enjoyable especially from developers' perspective; it's essentially a layer of abstraction, a middle ground between PDO and PW's API, and (at the very least) it can help avoid some extra rows of code. The specific use case for which I ended up building this module for was more or less similar to those existing modules: a Process module that handles custom data. In this case I found RedBeanPHP's fluid mode especially cool, as I could just dispense beans, add content, store the beans, and RB would create a schema for me automatically. RAD at it's finest, and at the end I could just switch to frozen mode, add some indexes, and be done with it Other than that, I would imagine that this could come in handy when dealing with content in external databases, or perhaps in SQLite databases. Haven't had many needs like that recently, but it's a topic that pops up even here sometimes.
    1 point
  30. A few weeks ago, Hashicorp, the company behind Vagrant, announced Otto: https://ottoproject.io/ I'm excited to give this a shot and have it finally replace my (embarrassingly antiquated) WAMP setup, although it's a still a very young and perhaps has a lot of kinks that need to be worked out at this moment in time. If anyone tries it out with ProcessWire, I'd love to hear your experiences about it. Jonathan
    1 point
  31. Don't get me wrong, but there are other topics where DigitalOcean is recommended or mentioned. If you use ServerPilot.io (which I do for two accounts: one production and one test) the set-up is extremely simple and straight forward. You could also search my friend if you want hosting recommendations
    1 point
  32. It's been an extremely busy last few months for me, but I finally managed to launch Christopher Todd Studios: http://christophertoddstudios.com/ I'm using my go-to frontend approach, which is based off of Sage. Some frontend packages I'm using include: Bootstrap SASS Animsition for the page transitions Slider Revolution for the home page slideshow (using the Ken Burns effect) Slick Carousel for the portfolio slideshows (with the lazy loading feature enabled... very important) Ekko Lightbox for the video modals Headroom.js for the navbar hide/show interaction jQuery Lazyload for other image lazy loading (like the blog) MatchHeight for some areas that need matched heights ResponseJS for loading content when a specific breakpoint is hit (rather than it being loaded but hidden, which is bad for performance and sloppy; very important) Linearicons I wrote the slideout navigation menu myself. Just some CSS and JS. My goal was to make sure this site is fast and doesn't feel clunky. I feel it has met that objective especially with the performance and optimizations that have been done (there's still a few I will eventually get to and squeeze out even more performance). In terms of ProcessWire modules being used: FormBuilder is being used and it's submitting results to Tave, which is a lead management system. FormBuilder made this easy with its 'Send duplicate copies to to another URL or 3rd Party Service' feature. Image Extra Social Share Buttons Page List Image Label Hannacode The original site was based on WordPress and had many blog articles. Using Ryan's great writeup, I imported all the posts into ProcessWire. The blog setup is self made and inspired by the Blog Profile (not using the blog module). The original site also didn't have permalinks enabled in WordPress, so I wrote some code to capture the necessary URL variables and forward them to the correct page so that old links are maintained, which is also good for maintaining SEO. The client loves ProcessWire and its simplicity.
    1 point
  33. I tested adding this function to the module: <?php function convert_twitter_links($tweet) { //converts URLs to active links $tweet = preg_replace('/((http)+(s)?:\/\/[^<>\s]+)/i', '<a href="$0" target="_blank">$0</a>', $tweet ); //converts mentions (e.g. @stathisg) to active links, pointing to the user's twitter profile $tweet = preg_replace('/[@]+([A-Za-z0-9-_]+)/', '<a href="http://twitter.com/$1" target="_blank">$1</a>', $tweet ); //converts hashtags (e.g. #test) to active links, pointing to a twitter's search URL $tweet = preg_replace('/[#]+([A-Za-z0-9-_]+)/', '<a href="http://twitter.com/search?q=%23$1" target="_blank">$0</a>', $tweet ); return $tweet; } and then called it like this: $text = $this->convert_twitter_links($text); Though, I had to put this line just below this line (this is within renderItem() definition ): $text = wire('sanitizer')->entities($text); I will guess I must be doing something wrong here not sanitizing this string before rendering it, but I can't really tell, I don't know much about this "entities" methods, so I will recommend taking this solution as unsafe or something like that until someone else gives a hand
    1 point
  34. I deleted and recreated the field and this problem went away.
    1 point
  35. Nearly two months and no comments on this? I am checking it out. I like what I see. I just discovered what Gulp/Grunt is the other day, and then I started looking at Bower. I can't figure out a LOT of things, but I'm taking my time with it all, reading the documentation I have found. Making little progressive steps
    1 point
  36. For a rather small community (at least compared to the big cms players) it's best to keep things in english, so everyone can give input as well as benefit from answers given.
    1 point
  37. Hi fliwatuet and welcome to processwire. Many pw users report that working with processwire has a php learning side-effect I can confirm from my own experience with processwire that working with processwire you will learn php along with it. With processwire you don't have to learn first a new cms or need to have a lot of coding experience. Instead you can immediately use all html, css, js and php experience that you already have and start using it with processwire. Processwire comes with multi-language out of the box ! With only a few steps you will have it configured. They all have their place, but when compared, processwire is going to save you a lot of time and headache.
    1 point
  38. By the way the order does not matter if your main module is not an autoloading module. Its real class is not loaded until the module is requested in the template. You will only have a placeholder that is created based on the cache, without including the main module's code.
    1 point
  39. That sounds like a really interesting project Some measures you can consider: Session inactivity timeouts. Force regular password changes and/or use 2-factor authentication. Use SSL. Ensure users can only access the data they are allowed to. Not just through interface options, but URLs as well. Look at the hosting infrastructure. Credentials to access it. Who has access? What about your provider? Where is your database is stored? (Shared hosting? Easy to guess credentials?) Look at how data is imported and exported within the system. Is it possible to bypass any validation or auth checks? Forms. They should definitely be using CSRF protection. Can user input be overloaded? That is, can I submit additional form values that the system doesn't check or expect, but still get saved to the DB. Logging. Log as much as you can in order to provide an audit trail. It is guaranteed that somewhere down the line, someone will ask the question "When did this record change to this value and who made the changed?" Backups. Hopefully the data will be backed up. How easy and quick can this be restored? What granularity? User education. Some users may need it explaining to them that sharing usernames and passwords, or writing them down, is not good practise. There are probably some additional things - that could start getting into the realms of penetration testing - but that's a summary things I can think of in a short time
    1 point
  40. Joss, you can get the page number with $input->pageNum, so: if ($input->pageNum < 2) { // Show the thing }
    1 point
×
×
  • Create New...