Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/23/2015 in all areas

  1. The true horror of Microsoft HoloLens:
    5 points
  2. @Rjay, `data_exact` is just the name given to that index, in other words the index 'Keyname'. I'm no expert but hope the following clarifies this:
    4 points
  3. Turning forty this year I right now enjoy a twenty year old red wine from toscana. What a experience really ä.
    3 points
  4. You have the author title in the array keys...But you have to first make sure that you have entered the 'titles' of your authors in their user pages, i.e. the 'Display name (first and last name) field that Blog adds to user pages otherwise the array keys will be empty . Again, we are using their 'titles' not their 'names'. However, if you want to use their names instead, just modify the code above like so...(but I prefer title ) //find blog authors $authors = $users->find('roles=blog-author|superuser, sort=title');//sort doesn't matter here, so can remove //array to hold author NAMES and their posts' count $authorsList = array(); foreach ($authors as $author) { //count number of posts by this author $authorPublishedCnt = count($pages->find("template=blog-post, created_users_id={$author->id}")); //we assume no two authors with identical NAMES, otherwise older will be overwritten //author NAME is $key and their post count $value $authorsList[$author->name] = $authorPublishedCnt; } //sort the associative array $authorsList by posts count ($value), DESC arsort($authorsList,1); //output the author list and post counts foreach ($authorsList as $key => $value) { #this is just for testing. Use your own markup of course echo 'Author Title: ' . $key . ' - Author Post Count: ' . $value . '<br>'; }
    2 points
  5. MarkupSocialShareButtons This module outputs a list of share links for the following services by default * E-Mail (kinda extra) * Facebook * Twitter * Google+ * LinkedIn * Thumblr * Reddit (off by default) * Pinterest (off by default) Usage examples echo $modules->MarkupSocialShareButtons->render(); This outputs a simple UL list with links <ul class='MarkupSocialShareButtons cf'> <li class='mssb-item mssb-facebook mssb-popup'><a href='url'><i>facebook</i></a></li> etc ... </ul> Config Screen See more details and examples on github or modules directory https://github.com/somatonic/MarkupSocialShareButtons http://mods.pw/8j
    1 point
  6. I think this idea has come up a couple of times in other threads, but this is just to rationalise it a little. Currently, the Page Table works rather like a repeater in that it is a way of adding and arranging new content in sections via a field. However, because it works in a more public way (the pages created can be arranged within a publically accessible part of the tree rather than buried under admin), the potential for the field is greater than with repeaters. Primarily, there is the opportunity for the field to have the characteristics of a page field. Take this case: A complex, technical article about using Processwire will be much improved by the use of additional information in the form of asides. Using a page table, it is possible to create the five or six asides needed, sort them into the right order and then insert them into the right places using hanna code. (the hanna code could either call them using their key in the array, or by title or by page id, even - if it were displayed) However, in such an article, it would be also very useful to use an existing aside. For instance, the nice aside "what is php?" might be very useful. But that does mean that it needs to be selected from the existing stock and that is not currently possible with a page table, though it is possible with a page field. What it looks like If the functionality were added to the page table field, this is how I would see it being used in practice: On the creation of the page table field, under the option for selecting a parent, a check box is added "allow selection of existing page" When using the field on a template, where currently you have "Add New" at the bottom of the field you now have a second button "Select" This opens up a lister in a modal window where you can select one or more Asides from the given parent as set in the field. These are then added to the list of asides in the field. Preventing Editing One of the dangers of such a system is that the content of a page called by a page table might be edited out of context. Back to our field! A third checkbox says "prevent editing if used in more than one page." Basically, if our aside is used in more than one page it can no longer be edited from the page table field. The only way it can be edited is by going to the page directly as normal via the page tree, and that might be subject to permission restrictions. There may also be a situation where asides are created in their position within a page tree and the ability to edit them via a page table is completely removed for everyone. Perhaps that is an automatic feature where the aside is created via the page tree and not via a page table field. However, in this case where an aside is not editable, another option may be available: Cloning Another possibility is the idea of New from Old. for instance, I want to use that very good aside about what is PHP but I want to add my own relevant information. In this case I can choose my starter aside and click on "Create New from this aside" in the lister modal. A new aside will be created using the same template and the same content which I can then edit. Limiting Inclusion There are situations in this case, however, where an aside has content that is really limited to that one article and should not be reused. (Legal reasons, perhaps, or just simple editorial context). Back on the field settings there would be another check box "allow limited use" Now, when as Aside is created, on the modal window in the Settings tab it has a checkbox that says "Limit to this article only?" This Aside can now not be selected for use by another article. Other Uses Using this modification as an aside is a very basic example, but there are probably hundreds of others. For instance, product variations or attributes in e-commerce where certain variations need to be available to a range of products. With e-commerce, the various restrictions about editing and limiting inclusion would become very important. So there you go, a lot more power and uses. (Note: this might be the wrong starting point, of course, as it could be argued that this should be a modification of a page field!)
    1 point
  7. adrianmak, So, saving to a page is just like creating a page. (a page in this case being a group of fields in the admin). If you want to view the entries in some other format, you can create a frontend view for those pages, or you can create an admin page (via Process Module) or use the Admin Custom Pages module.
    1 point
  8. Hi renobird, first a big thank you for the module. I’m honest and must say, that I didn’t find the time to test it because I need to finish another project first. But, i definitely will test it and will come here and keep you updated. Anyway, a big thank you for the module! Cheers, Thomas
    1 point
  9. Hey, it would be lovely if the ProcesssWire Blog (http://processwire.com/blog/) would have a rss feed so I don't have to check it every 5 minutes on Fridays but get a note if the post is ready
    1 point
  10. Hello folks. I'm trying processwire for the fisrt time, here, and I must say it is very elegant. Love it. However, I must say I encounter the same problem. Image field working fine on my local server. (LAMP, debian stable), but getting stuck at 100% on my production server, with no image uploaded at all. I've tried quite everything I could find on the forum, regarding images upload problems, but : - I switched to php 5.5 - open_basedir has no value - I have tried setting everything in /assets to 777. (but it shouldn't be a problem, since removing images works perfectly.) - Even deleted : re-installed everything from scratch, using export-site-profile module. (nice one, BTW) Still not working. This goes beyond my poor capacity. It is definitely not a file size problem. I can't even upload a 60 kb file. The only suspicious thing I get from my server log looks like this : "POST /admin/page/edit/?id=1017 HTTP/1.1" 403 185 "http://mysite.com/admin/page/edit/?id=1017&s=1" However, as I said, even 777 couldn't help. I could try the always_populate_raw_post_data trick, however it has the same value on my local and distant server : Off. (Moreover, the distant server is a shared server, so I couldn't change the php.ini anyway.) He who finds the answer will definitely get my eternal gratitude, as it is definitely a problem. And thanks again to the dev(s ?). This really is a nice CMS. It is exactly what I was looking for. (Coming from drupal, I nearly cry out of joy, every time I have a look at the database.) (Not even mentionning the API.) I love it. Will probably use it a lot in a near future. (If I can get it to upload files, that is. )
    1 point
  11. @LostKobrakai, Here's a couple of links on indexing... http://www.sitepoint.com/optimizing-mysql-application/ http://codesamplez.com/database/mysql-indexing-tips http://weblogs.sqlteam.com/jeffs/archive/2007/08/23/composite_primary_keys.aspx http://www.percona.com/files/presentations/WEBINAR-MySQL-Indexing-Best-Practices.pdf http://stackoverflow.com/questions/14206868/two-column-as-a-primary-keys-in-mysql http://stackoverflow.com/questions/217945/can-i-have-multiple-primary-keys-in-a-single-table http://stackoverflow.com/questions/5835978/how-to-properly-create-composite-primary-keys-mysql http://stackoverflow.com/questions/1823685/when-should-i-use-a-composite-index http://stackoverflow.com/questions/5446124/mysql-why-not-index-every-field
    1 point
  12. I won't argue with that, given my position (and almost everyone else's), but I must say that we at least need to take a step back for a moment and ask if we're doing it all right. Great stuff, have downloaded and shall give it a read this weekend (hope I have time).
    1 point
  13. I have just finished a novel about a group of 16 year olds set in the the long hot summer of 1976 (looking for an agent at the moment). Although it is partly a comedy, it also looks at things like anti-Semitism, the National Front in the UK, homophobia, racism and all the other things which were not just kicking around but were on main stream tv in the UK in the form of sitcoms and light entertainment - and our parents wondered why we all rebelled? So, for a special one-off treat, here is the introduction and first three chapters of my novel (before the story gets heavy) - without its title WhatHappened.pdf Note: this is from the draft, so ignore mistakes. PS: Note about subliminal ads - they never existed, but everyone believed it anyway. Something never change.
    1 point
  14. It would be worse if that appeared over the Urinal in a public lavatory.....
    1 point
  15. In my opinion it's not exactly about doing a disconnect. Nowadays tech is our constant focus. You work at a computer, in the evenings, you chat on your phone or your tablet and so on. It's this omnipresence that I think is the problem. If the techology could master the step of becoming independent from this devices I imagine it could do a better job of enhancing real life, as currently it's more of an replacement, which has such an all-consuming feel to it.
    1 point
  16. Joss, you are quite right. Even at my age (23.10), I continuously think about all the things that are changing our societies; our world. We do need a disconnect. Was watching Life on Mars (US version) a few weeks back. If you don't know it, the beginning of the story goes like this: detective Sam get's hit by a car in 2008, dies, and is thrown into 1973. Along the way (he decides to do what he does best, and be a detective), he mentions something about cell-phones to the other detective, who has a good laugh, enquiring as to why on earth anyone would want to carry a 'portable telephone' with them all day. Had a good giggle at that - and then realised how different everything was back then. (Also, I'm heavily open-minded to all possibility, so there was a bit of shock in there too - people were very set in their ways 40 years ago.) There are so many arguments one could throw in the hat regarding tech and its direction. Whilst I'm a tech-savvy person (and enjoy it), I see all the flaws and problems. My big issue is what it's doing to people. Here in SA, we have an education problem which stems from the apartheid era. These days, African kids are not being taught well. They're being taught not to ask questions about their government (you should read some of the Zuma stories). They're being taught to be ignorant. The real problem is that this also happening on a global scale - albeit in different ways. Tech, at an exponential rate, is making us all ignorant. As I'm not ready to step back from the world I live in, I make use of the 'material world' in ways that comfort me, considering I'm 'awake' to the madness. I design websites for one reason: my client has a dream, and I want to help them get there. But, we do need a disconnect - a big one at that. (Although, some day that our use of technology has altered our genes, in that, as children, we automagically know how to use half the stuff that's out there. I'm sure its arguable.) Back to the world of 1973: I'd love to be able to know what people were really like in the 70s. Without all the fancy tech, what were people like compared to today? (Sure, there were TVs - people have always said that they were being fed subliminal information since the invention of a television; may even have been why it was invented in the first place - but today is over-kill in comparison.) Could go on an on -- I have a continuously-spinning mind. Am interested in the fundamentals, though.
    1 point
  17. Just name the script and style sheet same as your module then add init () with a parent::init(); and they get loaded.
    1 point
  18. Well Soma, you are totally right about that. But then again I always wonder my self why so many people behave like silent sheep being robbed from democratic and human rights, year after year. It's almost a social taboo if you stand up against it. It really looks to me that people are afraid and do a good job hiding it.
    1 point
  19. People giggle at me with my allotment, which I have had to give up. But it has always been important to me to be able to run away on my own terms. When I was sixteen in the hot summer of 1976, it was about running away on my bike, running to secret places with my mad girl friend, and picking up a guitar at any given point and playing with people not having a clue as to who I was, where I was from or what I stood for. In my fities (ish) the running away with the girlfriend (rather non-existent at present) is probably unlikely and my songs seem too "out there" for most people. But yelling at a stupid turnip that has refused to grow - Heaven! If my total disconnect idea does not appeal to most, maybe a partial disconnect is in order. One of the most successful and sustainable weight reduction diets is the 5/2 fasting diet - eat well for five days and fast for a couple. Perhaps that should be routine for technology too. Every five days, whatever the weather, you have to stand outside your door and just watch and listen (and shoot at anyone who walks past wearing VR goggles!)
    1 point
  20. When I was a rebellious teenager in the 1970s, the idea of being so wired up to the world so the world would always know where I was would have been horrific. The whole point of being crazy and rebellious was that we could "escape" and "drop-out" True escapism, the real cool proper stuff, was something self-experienced and only shared in a very defined, personal way. Now, escapism seems to mean, "standing still so the world can see you are doing exactly the same as millions of others." The uniqueness is gone. I have always promised myself that if I woke up one day and was insanely rich, I would start a "Disconnect" movement. Under the terms you would set a point in your life (retirement, or whenever) when you would kill your internet connection, throw away your mobile, turn off your virtual reality and bin the PC/Tablet/inplant and simply deal with the life you could see and touch around you. It would be the final statement of being human: "That is it. I have used it as I wished and it got stuff out of me and I got stuff out of it. But now, I am going away and am no longer sharing. Goodbye and thanks for all the fish."
    1 point
  21. Funny, I did that too. We're all gonna look like we're on drugs. Luckily, however, the headset would explain it. Picture what it'd be like if this stuff was done with a small chip implanted in the brain. No headset.
    1 point
  22. It's funny if you take a look at the video, ignore the hologram stuff and just analyse the actions of the people there. Then you'll realise how much has to happen, before something like this really gets useful. By now it's just barely more than a 3D monitor. A year ago I wrote my bachelor theses about virtual reality and the interaction of those, but with the extra feature of (theoretical) haptic feedback of those holograms. That's the point when this will get suddenly much more interesting.
    1 point
  23. Per Ivan's comment below, this will not work because PW won't throw a 404 for the root of the site - this was an oversight on my part, and I do apologise for that. As stated, I'll try and implement this when I rewrite the module. As an alternative, see my post below. Hi Dave Regarding Jumplinks, it would definitely come in handy - though I haven't release a final 1.0 yet. (Next few days, hopefully.) (Also, not compatible with 2.5.3.) You'd basically create a new redirect like so: Source: ?p={id} Destination: rewrite/{id} There's also the alternative, where you can map IDs to URIs (names) using mapping collections. You'd need to export your URIs from WordPress in the format below (one on each line) into to a mapping collection called, say, "wordpress". id=path Example: 1892=this-is-an-awesome-post Your redirect would then look like this: Source: ?p={id} Destination: posts/{id|wordpress} If a source pattern is hit, then it'll check the collection according to the ID provided, and replace it with the new name (posts/this-is-an-awesome-post, in this case).
    1 point
  24. My thoughts exactly, so I thought it would be a good idea to let .htacess rewrite any url with "/?p=$wp-id" to "/rewrite/$wp-id". I had planned to insert into the Page Path History-Database "/rewrite/$wp-id" and the corresponding "processwire-pageid" in the hope that the module could handle that URL format. Since I expect an overhaul on many posts in processwire, especially regarding the Page-Names and thus the Page-Urls, it would be interesting if and how the "Redirects"-Module or the new "Advance Redirects/Jumplinks" work with "Page Path History". But I will have definitely a look into both Modules and playing around. Due to the bilingual nature of the Wordpress and the used Language Module (q-translate *grmblxfix*), I was unable to use the MigratorWordpress-Module, because the Language Module only allowed exporting into one language. Using https://processwire.com/talk/topic/3987-cmscritic-development-case-study/ , I wrote my own module (which proved to be quite cool, since I learned a lot about Processwire) and like I said, everything works as it should. (But I'm still quite unsure about best practices, though)... For the Wordpress-Urls, I simply extracted them from the database, used Regular Expressions to clean them up a little (removed the Toplevel Domain, so that only "/?p=$wp_id" remained) and during the page creation process, I inserted them via MySQL into the Page History Module Database. protected function updateGUID($id, $guid) { $current = time(); $db = $this->dbConnector('dbuser', 'dbpasswd', 'localhost', 'database_name'); $sql = "INSERT INTO page_path_history (path, pages_id, created) VALUES(:path, :pages_id, :created)"; $query = $db->prepare($sql); $query->bindParam(':path', $guid); $query->bindParam(':pages_id', $id); $query->bindParam(':created', $current); $query->execute(); } Another thing that still bugs me, that although $current has the correct timestamp, any insert into the database results in a timestamp of (0000-00-00 00:00:00) but if I leave the field blank, the $query won't execute...
    1 point
  25. I also have a version of this, just saying
    1 point
  26. Hi Pete - I will do so shortly. Thanks. Edit - though, the module isn't compatible with 2.5, so I can't add it... Could we perhaps add a 2.6-dev to that list?
    1 point
  27. data_max_age is set in the module's settings. As for how often, I'll quote from the module directory text.
    1 point
  28. PageNum makes sense to me but how do I find out the actual page number? Only by getting "page" from the url? For your picture profile I would recommend to disable "auto title" and just to do it like this in your picture template: <?php $custom_title = $page->title.' - This is a Photo by '.$page->user->title.' for category '.$page->category->title; include 'head.inc'; . . . And in your head something like: <title><?php ((isset($custom_title)) ? $custom_title : (($page->seo->title != '') ? $page->seo->title : $page->title. ' - '.'My cool Webseite')); ?></title>
    1 point
  29. Wearing my non-pw hat for a second it is not uncommon for multimedia heavy sites (in my case large amounts of mapping) to be pre-seeded, usually using an automated routine written in an automation package (free ones are available and reasonably easy to use straight in the browser). This process in our case resizes, creates pyramids and initiates the cache. While this is overkill for 100 images and I'd agree with the solutions given by the previous poster, pre-seeding in this fashion is certainly an option for sites using vast amounts of multimedia.
    1 point
  30. I think you can prevent them from deleting their own page by using 2 roles. Role 1 would have edit but not delete permissions and would be assigned to their main page. Role 2 would have edit and delete permissions and would be assigned to all the allowable child templates of their main page. (See this post/thread) Here's the modified version of PageEditPerUser. PageEditPerUser.module I'm not entirely this meets all your requirements — I haven't read this topic all that close to be honest.
    1 point
  31. So I spent some time fiddling around with this tonight and managed to get modal editing of page field pages working with the addition of just a few lines of code in InputfieldPage.module: InputfieldPage.module The modified file is attached. I commented the lines that I added with /* MJS 1/15/15 */ You'll want to put this file into /site/modules/ so you don't overwrite the core. Once it's up there, you should see an option in the field config settings for your page field that says 'Allow pages to be edited from field?' Check the box. This only works if you're using ASMSelect with your page field. The catch is that you have to save the page before the modal edit links become available (like when editing fields in the template editor). I think the only way around this would be to significantly re-engineer the ASMSelect inputfield with some AJAXy stuff. Not my strong suit. EDIT: There is a module for this now with more features. Use it instead! https://processwire.com/talk/topic/9857-module-page-field-edit-links/
    1 point
  32. If account_status is of single page select it won't have a add() method like PageArrays have. Multiple page select $new_page->$field->name->add(1023); // like $new_page->account_status->add(1023); // and also this (which seems to append db entry) guess makes sense? $new_page->account_status = 1023; Single page select $new_page->$field->name = 1023; // like $new_page->account_status = 1023; // but not $new_page->account_status->add(ID); // wrong So the page field can have different types based on the dereference settings multiple or single and behave slightly different. Single: it will only be a value of type page and page have no method add, multiple: will be a PageArray. PageArrays have the method add() to add pages, but also the field recognizes just ID's set to it, and it will save the entry and the others already saved or doublicates remain untouched. So to clear a multiple page field you have to call field->removeAll() first. You get this error because the value is most likely not an object (yet). If it dereferences as "single page or false if none selected (!)" .. so if the field is empty it will throw an error: Error: Call to a member function add() on a non-object If you would have already saved a value you would get this error instead, same code but different message because the field now has a page object set: Error: Exception: Method Page::add does not exist or is not callable in this context Hope this shares some light.
    1 point
×
×
  • Create New...