Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. OT: Oh cool, another one using my teflon theme. ;D I just sense you need to update , you're using not the latest one.
  2. I'm just trying to get this working. I'm not sure if I'm doing it correctly, but I get nothing but a warning. 6 times a waring like: Warning: MarkupLoadGCal::makeCalendarItem() [markuploadgcal.makecalendaritem]: Node no longer exists in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/MarkupLoadGCal/MarkupLoadGCal.module on line 334 ... then error: Fatal error: Cannot break/continue 1 level in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/MarkupLoadGCal/MarkupLoadGCal.module on line 340 I'm using this code: $cal = $modules->get("MarkupLoadGCal"); $cal->load('https://www.google.com/calendar/feeds/ph.urlich%40gmail.com/public/basic'); $items = $cal->find('from=2011-12-1, to=2012-01-31'); foreach($items as $item) { echo " <h2>{$item->title}</h2> <p> <b>Date From:</b> {$item->dateFrom} (Timestamp: {$item->from}) <br /> <b>Date To:</b> {$item->dateTo} (Timestamp: {$item->to}) <br /> <b>Location:</b> {$item->location} <br /> <b>Author:</b> {$item->author} </p> {$item->description} "; } When I use your example xml url it works. But the ones I get are also different... https://www.google.com/calendar/feeds/ph.urlich%40gmail.com/public/basic
  3. Hope everybody is enjoying holiday! I'm in Barcelona a couple days with my wife and children in the house of my wife's brother. Nice weather and city, tapas and cuban food (my wife is cuban), cerveza... It's great and I hope I'm abel to relax some from everyday work. Have a merry christmas and a happy new year. I'm sure 2012 will be a great year for ProcessWire! Soma
  4. Ryan is on fire! I'm sure this will be very useful. So many new things to try out. Thanks for this module!
  5. Great thanks Ryan. I also was wondering whats going on, Website runs normal, although very slowly loading from server.
  6. I experience the same error. 2011-12-22 06:52:45: Unknown User:/?/:ProcessWire Error:Exception: SELECT id, class, flags, data FROM modules ORDER BY class (in /home/aoccons/www/aoc/wire/core/Database.php line 72) #0 /home/aoccons/www/aoc/wire/core/Modules.php(160): Database->query('SELECT id, clas...') #1 /home/aoccons/www/aoc/wire/core/Modules.php(79): Modules->load('/home/aoccons/w...') #2 /home/aoccons/www/aoc/wire/core/ProcessWire.php(100): Modules->__construct('/home/aoccons/w...', '/home/aoccons/w...') #3 /home/aoccons/www/aoc/wire/core/ProcessWire.php(45): ProcessWire->load(Object(Config)) #4 /home/aoccons/www/aoc/index.php(166): ProcessWire->__construct(Object(Config)) #5 {main}
  7. That's an easy scenario. Code of VKNT is ok but not working for all pages and levels. Since it uses only $page->parent. If we assume the language tree branches are under the root level like /hr/, /en/ you can check for it in the url using strpos or alike, or by using $page->rootParent->name == 'hr' for example. Your choice. I got a language check that is like this, saving it in a session is not required but I needed it in this project. Setting a $lang and a $langpath variable is also project specific. But you get the idea. <?php // get path of request for finding langpath $url = $page->path; if($session->lang){ // if on langpath as in session or requested by /objects/... if(strpos($url,$session->langpath) !== FALSE ){ $lang = $session->lang; $langpath = $session->langpath; }else{ $lang = ''; } } else{ $lang = ''; } if($lang == ''){ if(strpos($url,"/de-ch/") !== FALSE){ $langpath = 'de-ch'; $lang = 'de'; } else if(strpos($url,"/en-ch/") !== FALSE){ $langpath = "en-ch"; $lang = 'en'; } else if(strpos($url,"/fr-fr/") !== FALSE){ $langpath = "fr-fr"; $lang = "fr"; } else if(strpos($url,"/en-fr/") !== FALSE){ $langpath = "en-fr"; $lang = "en"; } else if(strpos($url,"/de-de/") !== FALSE){ $langpath = "de-de"; $lang = "de"; } else{ $langpath = "de-ch"; $lang = "de"; } $session->set('lang',$lang); $session->set('langpath',$langpath); } /** * YAML Language files * import yaml language file for common translations * * key: "value" * * Available in php with $txt['key'] */ require_once($config->paths->root . "site/libs/yaml/sfYaml.php"); require_once($config->paths->root . "site/libs/yaml/sfYamlParser.php"); // instance a parser object $yaml = new sfYamlParser(); // parse language file $txt = $yaml->parse(file_get_contents($config->paths->root . "site/languages/" . $lang . ".yaml")); ?>
  8. Awesome work again Ryan! Thanks for the implementation. This will help a lot. I will surely at some point test this out. Just to mention something regarding modules. When I put a lot of modules in at once it show me a nice list of the new modules found, but after installing the first it's gone... It would be nice to somehow (don't know how this could work) have that list being saved and actually being a link list or "install" list on top. If that would be done with ajax, or a "install all" feature that would also help and improve the experience more or less. What you think about something like this?
  9. Ah that makes sense now That's ok I think. You could also just use $page->template == "basic-page" as it returns the name and if compared to a string works fine. An alternative would be to have a checkbox field on the template you could check on the desired page and not have the subpages listed. So you don't have to worry about id's. Then going with something like this. <?php if( $page->not_pagelist != 1 && $page->template == "basic-page" && $page->numCildren ) { ... }
  10. I'm still not sure that exactly you're trying to do. You say it returns true when on a child of home but you don't want to? But that's what you're trying to originally want in your code, no? Or do you mean false? Do you have a page "home" ? Or do you mean the root?
  11. I would use .htaccess, much easier.
  12. Maybe you want to check out this http://html5boilerplate.com/docs/htaccess/
  13. Soma

    Log messages

    ... let us know via public post
  14. Made a little update as discussed in a thread about images. - added new section "Files" to the sheet - minor structuring of some advanced entries
  15. That's a strange fix for something done wrong from the beginning. Really, really dirty! The "margin: 0 auto;" together with the "text-align:center" in the body actually does already center the element on page. .. float: left; position: relative; left: 50%; margin-left: -492px; That does the same again using another technique , because it's "position:relative" it enables the "left: 50%", which does moves the left corner of that element in center of window. The margin-left: -492px" moves it to the left by a fixed amount, half the element width. Not something I would recommend but possible. If that fixes the problem it may because of the "float:left", which proves it's a pretty dirty thing and may not working across browsers/oder browsers and in the long run something you should try to avoid. I recommend finding a simple solution to your background image problem, there's quite a lot going on and I'm sure there's a more simple solution, both in markup and css required. Since I can't see how it's meant to be I can't really tell, I would have to take a look more closer and analyze.
  16. Thanks a lot Ryan, after your previous post it ringed a bell I forgot that on first level there's only ressort-page and some others allowed, but I did test with sub-page template access settings which isn't allowed there so that's why. Stupid me really.. I should have found out myself. You're right. Sorry for bothering you for something simple.. maybe I should sleep a little more.
  17. If you want to take a look at it, it's on the dev install I've sent you thru PM... you could see it yourself. There's also a editor/editor1 login you could test.
  18. Edited my post, I deinstalled the module and it still not working on that root branch page like "/de-de/". SO it doesn't matter on the module. Though the additional "create" pages on template role setting seems to work, just not on that one to add new children. Don't know what's going on. I just can say... worked well before the update... PS: I don't understand you suggestion with the return, as it's working well as it is.
  19. Awesome, thanks Ryan for considering and reactivating this. I just pulled the latest and I see there's the option and it seems to work so far. Only problem I got now is that for the language tree branch I have a template for the branch "/de-de/" and I've set it via page references in the user template to be a working space, so all pages in this branch can be edited by the editor role. I have a module for this, where it looks for if pages are in the branch the user has defined. I've set it up so they can't edit the "/de-de/" page but add "new" pages. For some reason after the update there's no "new" action anymore, only on subpages, although I have set the template to allow add pages. Even If I add "edit" permission there's still no "new" action. Here again the code (already posted on multiple thread) I use for the user workspace <?php public function init() { if($this->user->hasRole("editor")) $this->addHookAfter("Page::editable", $this, 'checkpermission'); if($this->user->hasRole("editor")) $this->addHookAfter("Page::addable", $this, 'checkpermission'); //if($this->user->hasRole("editor")) $this->addHookAfter("Page::listable", $this, 'checkpermission'); //if($this->user->hasRole("client")) $this->addHookAfter("Page::viewable", $this, 'checkpermission'); } public function checkpermission(HookEvent $event) { // if it was already determined they don't have access, then abort if(!$event->return) return; $page = $event->object; $parents = $page->parents; // root node access granted //if($page->url == "/") return true; // run check for parent pages and allow recursive inherit access foreach($parents as $p){ if($this->user->editable_pages->has($p)) return true; } // then run check on selected single pages if(!$this->user->editable_pages->has($page)) $event->return = false; } EDIT: I just deinstalled the module and it doesn't change anything. Strange, the template has add children permission set on the editor role, though they can't add children pages to it...
  20. That would be great to have such an option when resizing images. BTW shouldn't we put that image stuff in the cheatsheet for reference?
  21. That's good idea. I think there will be a need for some manifest file or alike in the future. Especially when there will be some sort of package installer, and also to avoid complications/conflicts I thought about having some unique key/namespace that would be registered. I think modx has this for their package management.
  22. You can by using 0 for the side you want to auto scale. I think I've seen another way with using null. Also you can use ->width(100) or ->height(n) respectively doing the same as keeping the ration either on width or height While at it, Ryan how is the compression setting when using API to scale? Is there way to set it?
  23. if you have your categories as pages under a page /categories/ you could loop them and output examples having this category. In this example we assume "category" is the name of the page field in your sample. <?php // get all categories $categories = $pages->get("/categories/")->children; echo "<ul>"; // loop categories foreach($categories as $cat) { echo "<li>{$cat->title}"; // find me all samples having the current category $samples = $pages->get("/music-samples/")->find("category=$cat"); // if any found output them if( count($samples) ) { echo "<ul>"; foreach($samples as $sa) { echo "<li>$sa->title</li>"; } echo "</ul>"; } echo "</li>"; } echo "</ul>"; ...accidently submited before finishing code
  24. Yeah, I'll make the animation of the advanced toggle faster, just simply forgot about it to make it as fast as the other slide animations. Thanks fro mention it diogo. I'm pretty much with ryan here, after all I think it does fit better on bottom of the list.
  25. I think you're trying to save a value to a page field. You can simply use $page->fieldname = 10; $page->save(); Have you looked at the topic http://processwire.com/talk/index.php/topic,262.0.html for a simple poll using pages here?
×
×
  • Create New...