Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/14/2012 in all areas

  1. My third ProcessWire website was released today For a German therapist. Very simple and easy to build. Thanks to PW of course
    4 points
  2. Normally they are voting contests yes but as I mentioned, I'm doing this in two ways .. One for People's Choice in which case, voting counts and another which is Critic's Choice in which the judges will decide and votes won't matter. I'm not looking to become another Packt Open Source Awards type deal. That's one of the reasons I started these, so smaller systems or communities have equal chances.
    2 points
  3. hm, I can be wrong here, but the problem is that pages are not translated, only fields are. You could check if one field is translated and assume that it means that the others are also. You can't check that directly because it will give you the default language value, it it doesn't exist. But you can do this (taken from here): $page->setOutputformatting(false); // turn off outputFormatting (if it's not already) $dutch = $languages->get('dutch'); // get the language we want $body = $page->body->getLanguageValue($dutch); // get the unformatted value in Dutch If $body is not empty, the translation exists... should work, no?
    1 point
  4. I'd definitely buy processwire merchandise. And maybe ryan could set up a store with these items to help him with the costs.
    1 point
  5. Thanks for sharing that Nico. I like that you get to use upper-case characters in your shortlinks.
    1 point
  6. Just for inspiration: My version of an URL-Shortener (kind of older code previously featured on my blog): require_once('database.class.php'); $db = new database('localhost', '', '', ''); $pass = '123'; $base_url = 'http://go.nico.is/'; function is_url($url) { if(!preg_match("#^http(s)?://[a-z0-9-_.]+\.[a-z]{2,4}#i", $url)) { return false; } else { return true; } } function url_encrypt($id) { $codeset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $base = strlen($codeset); $converted = ""; while ($id > 0) { $converted = substr($codeset, ($id % $base), 1) . $converted; $id = floor($id/$base); } return $converted; } function url_decrypt($converted) { $codeset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $base = strlen($codeset); $c = 0; for ($i = strlen($converted); $i; $i--) { $c += strpos($codeset, substr($converted, (-1 * ( $i - strlen($converted) )),1)) * pow($base,$i-1); } return $c; } if($_GET['do'] != '' && isset($_GET['url']) && $_GET['pass'] == $pass) { $url = rawurldecode($_GET['url']); if($_GET['do'] == 'remove') { if($db->delete('urls', '`url`=\''.$url.'\'')) { $note = 'true'; } else { $note = 'false'; } } elseif($_GET['do'] == 'stats') { $note = (($db->get_element('urls', 'stats', '`url`=\''.$url.'\'')) ? $db->get_element('urls', 'stats', '`url`=\''.$url.'\'') : '0'); } elseif($_GET['do'] == 'add') { if(!$db->get_element('urls', 'converted', '`url`=\''.$url.'\'')) { $id = $db->get_next_id('urls'); if($db->insert('urls', array('id' => $id, 'url' => $url, 'converted' => $converted, 'stats' => 0))) { $note = $base_url.url_encrypt($id); } else { $note = 'false'; } } else { $note = $base_url.$db->get_element('urls', 'converted', '`url`=\''.$url.'\''); } } } elseif(isset($_GET['converted'])) { $id = url_decrypt($_GET['converted']); $url = $db->get_element('urls', 'url', '`id`=\''.$id.'\''); $db->update('urls', array('stats' => ((int)$db->get_element('urls', 'stats', '`id`=\''.$id.'\'') + 1)), '`id`=\''.$id.'\''); header('HTTP/1.1 301 Moved Permanently'); header('Location: '.$url); exit; } if($note != '') { echo $note; }
    1 point
  7. I actually got it and felt it like a nice touch (the scrolling at the end). Maybe it could reveal little surprise, like handwritten "Welcome" and arrow to the door would be nice touch there?
    1 point
  8. Hey, congrats to every EU member of this forum. We won the "Nobel Peace Prize" Sorry american guys but maybe you sometime will win some kind of Nobel Prize too
    1 point
  9. All those things will have to be handled with javascript... the cms will be doing only background work here. I mean, the real form will have to be hidden, and filled dynamically by javascript. Have a look at jQuery ui draggable and droppable to know what I'm talking about. http://jqueryui.com/droppable/ Do you mind if I ask who will make this website?
    1 point
  10. Do you get paid for the sites that you would with PW? When you come to the forums to get help, do you limit your questions purely to development work that you are doing for free? I originally developed PW to help us all create better sites in less time, and with more fun. I'm hoping that PW is helping others to be more competitive in all ways, including financially. But recognize that PW did not come into existence on its own. Years worth of time and money has gone into making ProcessWire happen. If you are using ProcessWire to develop sites you get paid for, then you are profiting from ProcessWire. And that's fine with me, no ROI is expected or wanted--I've never asked anyone for anything. But it is disheartening to hear a user make a statement with the implications yours makes. Form Builder is not about making a profit. I don't expect that I will ever make enough on it to offset the actual time investment on it. My hope is that eventually it will be something where the community and myself have split the cost to create. If I wanted a profit, I would go make a Form Builder for WordPress or Drupal where the user base is large enough for that potential to exist. Form Builder is a tool that wouldn't exist if I had to fully self fund it. It's also an experiment to determine if I can reduce my client workload and substitute some of it with ProcessWire-related development that benefits all of us. But I can't substitute something that supports my family with something that doesn't. Form Builder is here to benefit you, not me. If you build sites for a living (or even a hobby) it's going to pay for itself the first time you use it. If you previously spent half a day building a form, now you can spend minutes and get a better, more secure and capable result that can do all sorts of things with the results it collects. Also want to note that Form Builder is something completely different from the original subject of this thread and I don't view them as similar products at all. Likewise, Form Builder is completely different from something like Zend Form or others like it. One does not preclude the use of the other and we should all keep more than one tool in our forms toolbox. I fully support Clinton's project and any others that benefit forms in ProcessWire. Forms are one of the most diverse and important aspects of web development. I feel very confident about the value of Form Builder in your toolbox, so have made it 100% refundable if you find it isn't for you (this type of return policy is pretty rare with digital products).
    1 point
  11. +1 to that. Working in anything else these days feel like a chore to me.
    1 point
  12. Would be nice to have a shortcut to delete pages on the PAGES section instead of having to EDIT then delete each page.
    1 point
  13. @Soma: Thank you very very much! Works perfectly now. Here the corrected original code from post #9, which works fine as shown below - just, as Ryan already mentioned, don't forget do activate the support of page numbers in your template settings, under the "URLs" tab... <?php // get the images you are going to display $items_per_page = 4; $start = ($input->pageNum - 1) * $items_per_page; $total = count($page->images); $images = $page->images->slice($start, $items_per_page); // make this to give MarkupPagerNav what it needs $a = new PageArray(); // add in some generic placeholder pages foreach($images as $unused) $a->add(new Page()); // tell the PageArray some details it needs for pagination // (something that PW usually does internally, for pages it loads) $a->setTotal($total); $a->setLimit($items_per_page); $a->setStart($start); // output your images foreach($images as $p) { $img = $p->img; echo "<img src='{$img->url}' alt='{$img->description}' />"; } // output the pagination navigation echo $a->renderPager(); Kind regards, Christian
    1 point
×
×
  • Create New...