Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/11/2016 in all areas

  1. 12 points
    This week we've been focused on one of the major 3.x roadmap items, which is to have strong Composer support in ProcessWire. In this post, we now have an outlined process and a full proof-of-concept module built to demonstrate it all, plus info on how other module authors can support Composer as an alternative installation method. To add to that, we get into Google's Client API with a new 3.x specific module and how to connect Google's Calendar services with ProcessWire. https://processwire.com/blog/posts/composer-google-calendars-and-processwire/
  2. 11 points
    Hello, this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page. To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers: Minimum Required Facebook App configuration: on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "https://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows: Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post. Usage edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept. Download PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost Note: Facebook SDK for PHP is utilized.
  3. 5 points
    I think this is good idea. Personally I have a number of module ideas but have no firm idea what to prioritise. Something like this would be of benefit to me. As for a calendar module, I have been working on something for a while now. These are very old screenshots and will change. The module was based on dhtmlxScheduler but that will definitely change. Maybe I should release this module next
  4. 4 points
    Or you can use adjustName=>true option in the save.
  5. 3 points
    It occurred to me that a good addition to the forums would be some way for PW users to indicate support for a module idea. Similar to the Wishlist subforum but for functionality that belongs in a module rather than in the core. I'm thinking mainly of commercial modules, although if someone wanted to take up a module request and release it freely that would be cool. So users could propose a module idea, then others would vote for it (using likes or some special voting option) so that a vote means "I'd buy that", with the expectation of pricing in the general ballpark of Ryan's pro modules and Apeisa's PadLoper. As a beginner-intermediate developer I'm really enjoying working with PW and learning as I go - the API is so intuitive that I've been able to build my own solutions to things that in another CMS I would have been reliant on someone else's module to achieve. But there are things that I know are beyond my current skills, and for those things I look to third-party modules. My clients are non-profits and small businesses so I'm never likely to have the budget to commission a custom module alone. But there might be other PW users out there with similar needs and maybe that demand would make it worthwhile for an experienced developer to take on a proposal and release it as a commercial module. Currently there isn't a way to measure the demand for modules apart from occasional forum posts like "Is there a module that...?" Any thoughts on this? Here's a module request to start off with: I would be happy to buy a full-featured event calendar module. I've searched the module directory and the forums and Lindquist's module is the most feature-rich I've seen, but it's in an alpha proof-of-concept state and some important functions aren't implemented. Features I would be looking for are: Calendar grid interface in admin, allowing for easy addition and editing of events. (Nice but non-essential) Week and day views in admin, in addition to month view, with drag editing for event date and duration (I'm dreaming of something awesome like the dhtmlxScheduler interface or Fullcalendar interface). Although drag operations would really need an undo to correct accidental edits, so this may be more trouble than it's worth. Events are edited in a modal window, to avoid losing one's place in the calendar. Recurring events, with user-friendly selection of recurrence options. The ability to individually edit or remove an event that is a child of a recurring event (i.e. make an exception for that individual event). (Nice but non-essential) A couple of out-of-the-box minimal rendering options for the frontend (read-only calendar view, list view). This is the kind of module I need frequently. I've been lucky that I haven't had a client request a full event calendar since I've been using PW, but it's only a matter of time. I'm sure there are other PW users who need this and who would, like me, be happy to pay for such a module.
  6. 3 points
    Yes, fantastic! Ryan, Hari KT and anyone else hiding behind the scenes; thank you.
  7. 3 points
    Hello netcarver, you are absolutely right, I just updated my post. I have submitted the module and it is currently pending approval. Thank you!
  8. 3 points
    I use a zero-width space word joiner character to destroy the markdown: [Link-Beschreibung]⁠(http://www.beispiel.de) This will prevent users from copying it from the field description, though…
  9. 2 points
    you need to get the page then get the imagesfield then select the desired image do the resize Will say, it is done as always. Where is your page that holds the imagesfield? Do you have a path, a name or a id of it? // within a modules method you will do something like 1) $p = $this->pages->get(YOURPAGESELECTOR); 2) $images = $p->yourImagesField; 3) $image = $images->first(); // or whatever you like 4) $image->size(x, y); PS: Please do not send me PMs with something like: "how can I do xy, please help its urgent." Use the forums support thread or the job section!
  10. 2 points
    Hi Peter I can share with you my Mailgun journey.... I have: FormBuilder PW 3 latest dev Mailgun account Horst's wonderful WireMailSmtp module As you say mate, lots of moving static parts What stumped me was that I too was not getting any mails sent. Now I develop sites locally in MAMP and for some reason, the "sending of emails" did not work when I tried to get ProcessWire to send an email out from within my development environment. What I ended up doing was uploading the site to a live server and once I did that, mails were sent instantly! I am not sure what exactly causes the MAMP environment to have trouble sending things out Peter, but that just tells me maybe you should not trust your development environments settings to be able to send out emails. Try a live server Peter. The parts you have do work, as I have gotten them to wok and I'm just a dummy ( but a persistent one ) Hope that helps! For others that are looking into this in the future.. those of you that are using Digital Ocean, so much of the documentation for Digital Ocean and Mailgun focuses on using your existing DNS settings for your domain but adding records into it for a Mailgun subdomain. This approach really caused me lots of headaches so here is how I got it all working... My domain name is www.mysite.com. Let's use this as a base. First thing in Digital Ocean is to create a brand new domain to create a subdomain. This is not commonly mentioned in Digital Oceans docs or all the Digital Ocean - Mailgun tutorials out there. So, I have departed from everyone else by NOT touching my main website's ( www.mysite.com ) records. So I created a brand new domain called mail.mysite.com. The "mail" bit is my chosen subdomain. But as I said, I created a brand new domain to create that desired subdomain. Now, in Mailgun, I created an account with the domain mail.mysite.com to match the new domain I created in Digital Ocean. When you create the account in Mailgun, you will get two text values and one cname value. Head over to Digital Ocean and for your domain entry ( mine being the mail.mysite.com domain entry ), we edit the DNS entries and add the two text records and add a single cname record. Go back to Mailgun and hit the Check DNS Records Now button and the 3 entries mentioned earlier should light up green. Sometimes we may need to press the button two or three times Next in Mailgun go to Manage SMTP credentials and create a new user. Take note of this and the password it generates. We take these to our site and punch them into Horst's WireMail user credentials along with setting the Port to 587 and the SMTP hostname to be smtp.mailgun.org. There is also the local hostname field and I set that to www.mysite.com. After doing all this, it works great! Just a side note. What I have done is used a nice paid email service called FastMail. And so how I have set things up is I edit my main site's DNS records ( www.mysite.com ) and add two text records pointing to FastMail. So.... my domain mail.mysite.com sends out mails via Mailgun and by configuring things in WireMailSmtp I have set the sender address for these emails as: admin@mysite.com Should someone reply to one of these emails, then Fastmail picks that up via mysite.com's records and routes it to my email client. They have a really nice iOS app for business accounts by the way. And what is not apparent from signup is that you can pay for 6 months first. Apologies if the above helps no one and or contains lots of errors!
  11. 1 point
    This module adds a "SEO" tab to every page where you can define a special title, description, keywords, etc. Try it http://aluminum-j4f.lightningpw.com/processwire/ Name: demo Pass: demo123 How to use You can choose between include automatically or use the following methods: $config->seo // includes all the default values and configuration settings // e.g.: $config->seo->title $config->seo->keywords $page->seo // includes all the default values mixed with the page related seo data // e.g.: $page->seo->title $page->seo->keywords // for rendering: $page->seo->render . . Screenshot Download You can download it in the modules repository: http://modules.processwire.com/modules/markup-seo/
  12. 1 point
    Hmm... I don't see anything. Did you forget to insert the image/screencast?
  13. 1 point
    So, here we are. Sorry the actions are a little hectic in respect of the file size (though its still huge enough to get trouble with the forum upload). tried imgur now:
  14. 1 point
    I ended up making a ton of mods to this for things that were very specific to our needs. Coincidentally, I worked on cleaning it up and getting it back to a more releasable state earlier this week. I'll take a look at it on the devns branch on Monday/
  15. 1 point
    Posting this in case anybody else has been tinkering with this module or if "updates out soon" mentioned a while back are getting closer. Thought I'd give this a try in 3.0.10 and adapt it to my needs. The only thing needed to get it working was to change some PHP short tags (<? ) in MarkupActivityLog.inc. I've added a config variable for selecting fields to ignore, using it in changesToJSON(). Figured I'd ignore any fields that are not supported yet and do something about them later. One thing that isn't working is the New vs Old display for rich text (CKEditor fieldtype). The information is there in the markup but clicking the tabs doesn't toggle their visibility. You always see the New data.
  16. 1 point
    I managed to fix this problem and now I have the Editor Protocol Handler working with Eclipse. Here comes what I did: I followed the document here: http://teleyag.com/blog/2011/08/19/openineclipse-url-scheme-for-mac/. The only change was to fix that urlencoding problem above with the following AppleScript change. On line 6 I added: set this_URL to replace_chars(this_URL, "%2F", "/") And in the end of the script this function for replace_chars: on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars
  17. 1 point
    So, in the near future it will be possible to have a composer.json file that allows to bootstrap Processwire with all the extra module awesomeness?
  18. 1 point
    If you only want to allow one page you should also configure to only allow single page. Currently you have a single select but the field is multiple.
  19. 1 point
    Maybe you selected the wrong input field type?
  20. 1 point
    I'm not sure why you'd need sql for that. Sql queries cannot supply you with a datastructure like you suggested it, it can only return data in a tabular structure, so you need to build up the array no matter how you tackle the problem. $usersWithOrders = $users->find("orders.count>0"); $orders = $pages->find("template=order"); $byUser = array(); foreach($usersWithOrders as $u){ $byUser[$u->id] = $orders->find("id=$u->orders"); }
  21. 1 point
    One of those hidden beauties that would be great to have them in the Cheat Sheet...
  22. 1 point
    You need to create a file /site/modules/InputfieldCKEditor/contents.css with the styles you want to apply inside the Editor. And have a look at /site/modules/InputfieldCKEditor/README.txt on how to activate it: contents.css ============ Example CSS file for the admin editor. To make CKEditor use this file, go to your CKEditor field settings and specify /site/modules/InputfieldCKEditor/contents.css as the regular mode Contents CSS file.
  23. 1 point
    You certainly need to keep mysql connections and mysql queries apart. The first one is causing your db to crash, whereas the latter ones are using these connections. If 30 visitors are causing 400 (I'd expect concurrent) connections I'd check if mysql connections are properly closed.
  24. 1 point
    What are you displaying on this site where you get this count? Any field that is not configured as "autoload" will require one select query per page where you access the field. So if you have 20 fields on a template and you're displaying each field for 100 pages in a loop, this would produce about 100*20 = 2000 queries.
  25. 1 point
    Hi, false alarm, the problem was my end. I had a GreaseMonkey script installed called "SimpleFormSaver" it was messing up the css - doesn't properly namespace I guess. I realised when it kept populating my posts here with crap. Thanks anyway.
  26. 1 point
    Seems to be working fine for me on 3.0.10 - but I haven't exercised it to the full yet.
  27. 1 point
    Here's what I did. /* if(strlen($this->input->get->include) && $this->input->get->include !== 'hidden') { if($this->input->get->include === 'all') { if(!$this->user->isSuperuser()) $this->errors[] = "The option 'include=all' is only allowed for administrators"; } else { $this->errors[] = "Unrecognized value for 'include'"; } } */ //SB replaces above which FileCompiler thinks is a including a file $ginc = $this->input->get->include; if(strlen($ginc) && $ginc !== 'hidden') { if($ginc === 'all') { if(!$this->user->isSuperuser()) $this->errors[] = "The option 'include=all' is only allowed for administrators"; } else { $this->errors[] = "Unrecognized value for 'include'"; } }
  28. 1 point
    Some very cool applications and modules being developed in the PW community - as usual!
  29. 1 point
    Currently I'm building a multilanguage website but what's more important, I managed to convert my "drop-in" helpers into modules. These include TemplateLatteReplace and NetteFormsHelper modules, which will be shared after they look stable enough. The Latte template engine module is almost invisible: handles default template render and wireRenderFile just fine. I may have gone with the TemplateEngine module but I like that it's lightweight and that I understand what's going on inside NetteFormsHelper makes creating forms a breeze (though it's 100% developer-centric), and I'm working on adding useful features to it. Currently it supports: ajax or non-ajax submission live form validation (js) automatically add js/css assets saving data as page using "json_storage" field (which is a simple textarea holding a json encoded array, but visually looks like a formatted table in the admin) send emails with Latte tempates several form layouts (form renderers) autocomplete: supports suggestions from arrays and urls (ajax) character counter: needs only passing an array of settings, can count up/downwards, its text is customizable/translatable Form and field definitions are separated so forms can be easily copied to another project. Just to clarify: these are non-PW fields. I also have an AutoSmush module (imagemin through resmush.it) which actually works but needs a major revisit before going public, if ever. Anyway, bulk running on site images eliminates google pagespeed warning, which is great. Another helper I'm usng is Tracy debugger, which was made into a module by adrian so one todo item could be removed These modules makes development much more fun. I should have started them as modules right from the beginning.
  30. 1 point
    Update: I've added a "Media" admin page with a quick create option for new library pages.
  31. 1 point
    In Sublime Text i can do this by quick search "inputfield.php@___"
  32. 1 point
    Any chance this can be used instead of this page: http://processwire.com/apigen/ I guess the best case scenario would be if Kongondo would be willing to maintain it there? Or maybe that URL can be an alias that points to this version?
  33. 1 point
    .. resolved the issue in less than three minutes, yesterday I was too lazy to take a closer look (in other words: my battery was empty). Edit php.ini, to avoid this warning set 'always_populate_raw_post_data' to '-1', restart php and the message is gone ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is ; to disable this feature and it will be removed in a future version. ; If post reading is disabled through enable_post_data_reading, ; $HTTP_RAW_POST_DATA is *NOT* populated. ; http://php.net/always-populate-raw-post-data always_populate_raw_post_data = -1 Before: <br /> <b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br /> <br /> <b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br /> [{"error":false,"message":"Added file: body.png","file":"\/site\/assets\/files\/1\/body.png","size":26952,"markup":"\n\t<li id='file_60984d6634e55217fe6424485038dd7d' class='InputfieldFileItem InputfieldImage ui-widget'>\n\t\t<p class='InputfieldFileInfo InputfieldItemHeader ui-widget ui-widget-header ui-helper-clearfix'>\n\t\t\t<span class='HideIfSingle HideIfEmpty InputfieldFileDrag'><i class='fa fa-sort'><\/i> <\/span>\n\t\t\t<i class='fa fa-caret-right InputfieldFileDrag HideIfMultiple'><\/i> \n\t\t\t<label class='InputfieldFileDelete'><input type='checkbox' name='delete_images_60984d6634e55217fe6424485038dd7d' value='1' title='Delete' \/><i class='fa fa-fw fa-trash'><\/i><\/label>\n\t\t\t<a class='InputfieldFileMove InputfieldFileMoveBottom' href='#' title='Move to bottom'><i class='fa fa-fw fa-angle-double-down'><\/i><\/a> \n\t\t\t<a class='InputfieldFileMove InputfieldFileMoveTop' href='#' title='Move to top'><i class='fa fa-fw fa-angle-double-up'><\/i><\/a> \n\t\t\t<a class='InputfieldFileName pw-modal pw-modal-large' title='body.png: body.png (720x101)' href='\/processwire\/page\/image\/edit\/?id=1&file=1,body.png&rte=0&field=images' data-buttons='#non_rte_dialog_buttons button' data-autoclose='1' data-close='#non_rte_cancel'>body.png <i class='fa fa-pencil ui-priority-secondary'><\/i><\/a> \n\t\t\t<span class='InputfieldFileStats'>26 kB, 720x101 <\/span> \n\t\t<\/p>\n\t\t<div class='InputfieldFileData ui-widget ui-widget-content'>\n\t\t\t<div class='InputfieldImagePreview'>\n\t\t\t\t<a class='InputfieldFileLink' target='_blank' href='\/site\/assets\/files\/1\/body.png?nc=10'><img height=\"100\" src=\"\/site\/assets\/files\/1\/body.0x100.png?nc=1455052838\" alt=\"\" data-gridsize=\"100\" \/><\/a>\n\t\t\t\t<div class='InputfieldImageActions'>\n\t\t\t\t\t<a title='body.png (720x101)' href='\/processwire\/page\/image\/edit\/?id=1&file=1,body.png&rte=0&field=images' class='pw-modal pw-modal-large' data-buttons='#non_rte_dialog_buttons button' data-autoclose='1' data-close='#non_rte_cancel'><i class='fa fa-fw fa-crop'><\/i><\/a>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t<div class='InputfieldFileDescription'><label for='description_images_60984d6634e55217fe6424485038dd7d' class='detail'>Description<\/label><input type='text' name='description_images_60984d6634e55217fe6424485038dd7d' id='description_images_60984d6634e55217fe6424485038dd7d' value='' \/><\/div>\n\t\t\t<input class='InputfieldFileSort' type='text' name='sort_images_60984d6634e55217fe6424485038dd7d' value='2' \/>\n\t\t<\/div>\n\t<\/li>","replace":false,"overwrite":0}]
  34. 1 point
    Just though I'd post in case anyone else was interested in creating a 5 star rating system. It is very rudimentary I should point out and am sure there are thousands of better ways but it seems to get the job done OK for me. It's only using cookies to check if someone's already voted so it's not at all foolproof! If any advanced users have any pointers to improve it, that would be great! <?php include("./header_plain.inc"); ?> <div id="new_blog_view" class="row"> <div id="blog_header"> <a href="<?php echo $config->urls->root; ?>"><img src="<?php echo $config->urls->templates; ?>styles/images/ag_logo_2.png" alt="" /></a> <h4><a href="<?php echo $page->parent->url; ?>">From the Blog</a></h4> </div> <h1><?php echo $page->title; ?></h1> <h6><?php echo $page->entry_date; ?></h6> <?php if ($page->image) { ?> <img src="<?php echo $page->image->url; ?>" alt="<?php echo $page->title; ?>" id="blog_image" /> <?php } ?> <?php $class = "new_blog_view_content"; if (!$page->image) { $class .= " divide"; } ?> <div class="<?php echo $class; ?>"> <?php echo $page->body; ?> </div> <?php echo $page->comments->render(); ?> <?php echo $page->comments->renderForm(); ?> <?php if ($page->vote_count > 0) { $vote_average = round($page->vote_score / $page->vote_count, 2); if ($vote_average > 0 && $vote_average < 1) { $url = $config->urls->templates . "styles/images/stars_0.png"; } elseif ($vote_average >= 1 && $vote_average < 2) { $url = $config->urls->templates . "styles/images/stars_1.png"; } elseif ($vote_average >= 2 && $vote_average < 3) { $url = $config->urls->templates . "styles/images/stars_2.png"; } elseif ($vote_average >= 3 && $vote_average < 4) { $url = $config->urls->templates . "styles/images/stars_3.png"; } elseif ($vote_average >= 4 && $vote_average < 5) { $url = $config->urls->templates . "styles/images/stars_4.png"; } elseif ($vote_average = 5) { $url = $config->urls->templates . "styles/images/stars_5.png"; } ?> <h5>Current rating:</h5> <p><img src="<?php echo $url; ?>" width="100" height="25" alt="<?php echo $page->name . " - " . $vote_average . " stars"; ?>"/><span> (<?php echo $vote_average . "/5"; ?>)</span></p> <?php } ?> <?php $rating = $page->vote_score; $votes = $page->vote_count; $out = ""; if (isset($input->post->submit_rating) && $input->post->test == "") { $out = "<h5>Thank you for rating!</h5>"; $new_rating = $input->post->rating + $rating; $votes++; $page->of(false); $page->set("vote_score", $new_rating); $page->set("vote_count", $votes); $page->save(); $voted = true; $page->of(true); // set cookie to ensure only 1 vote (not foolproof!) setcookie('voted',$page->name,time() + (86400 * 7)); echo $out; ?> <?php } elseif(isset($_COOKIE['voted']) && $_COOKIE['voted'] == $page->name) { echo "<br>You have already voted, thank you!"; } else { ?> <div id="rating_box"> <h4>Please feel free to rate this article!</h4> <form action="" method="post"> <select name="rating" id="rating">Your rating <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <input type="text" id="test" name="test"> <input type="submit" id="rating_submit" name="submit_rating" value="Submit rating"> </form> </div> <?php } ?> <a href="<?php echo $pages->get("/blog/")->url; ?>" id="back_blog_link">← Return to Blog</a> </div> <?php include("./footer_plain.inc"); ?>
  35. 1 point
    Glad it helped. For keeping class on for month when you are on the day page: $class = $page === $child || $child->children->has($page) ? " class='active'" : ''; Worked fine for my case. Or the other way around like diogo suggested a few posts above: $class = $page === $child || $page->parents->has($child) ? " class='active'" : ''; Hope it helps. PS: nice picture from Bkk
  36. 1 point
    From this page on php.net: So for objects === has got to be faster because it only has to compare one thing (memory location). Whereas, == compares lots of things. So I think that === is what you want when comparing two pages to see if they are the same. Most of the time this works perfectly. But there are some situations where that could fail. An example would be if you loaded a page $a, saved page $b, then loaded another copy of page $a, which we will call $c. If you compared $a === $c, it would fail because you'd saved $b. Why? Any time you save a page it clears the memory cache. So while this seems like an unlikely situation, it can happen. As a result, it's technically more reliable to compare pages by their ID property, like: $a->id == $c->id would still work in situations when "$a === $c" wouldn't. You can also do "$a" == "$c", which is the same as comparing the id property. This works in ProcessWire since the string value of any page is its ID.
  37. 1 point
    Why not? Actually pretty fine solution to add it in page to be able to say where it should go. There's actually some different ways you could archive something like this. - add a field for selecting what navigation the page should go. - add a structure to define navigation. Special type of pages where you can select what page should have link in footer navigation. - same but only one page with page reference field - add the 2-3 links manually to the footer nav code. And make them hidden in admin. - by a special template for footer pages.
×
×
  • Create New...