Jump to content

interrobang

Members
  • Posts

    238
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by interrobang

  1. interrobang

    VetsNet

    There seems to be a problem with the Email obfuscator. The javascript Emailobfuscator.js could not be loaded, clicking on emails results in a 404. But I like the clean and plain design, and the responsive layout works well in my tests.
  2. I think you have to change the line order like in my example. Otherwise the $comment you push into your array doesnt't have the page variable set. Maybe there are other and better ways to do this, I am still new to php. Btw, echo $comment->page shows the ID, but nevertheless $comment->page should be the real page, so things like $comment->page->url should work.
  3. I think you have to store the $page in your $comment. $comment->page should now be the actual page, and not only the page_id. foreach( $blogposts as $blogpost ) { foreach($blogpost->comment as $comment) { if($comment->isApproved()) { $page = $pages->get($comment->pages_id); $comment->page = $page; array_push($comments, $comment); // Build an array of comments } } }
  4. @Soma, @Chad maybe a bit offtopic, but there is no need to call javascript via getURL, actionscript can do it too. Something like that should work for you: function saveGame(game:String, userid:String, score:int):void { var url:String = "/ajax/saveGame.php"; var request:URLRequest = new URLRequest(url); var requestVars:URLVariables = new URLVariables(); requestVars.game = game; requestVars.userid = userid; requestVars.score = score; request.data = requestVars; request.method = URLRequestMethod.POST; var urlLoader:URLLoader = new URLLoader(); urlLoader = new URLLoader(); urlLoader.dataFormat = URLLoaderDataFormat.TEXT; urlLoader.addEventListener(Event.COMPLETE, loaderCompleteHandler, false, 0, true); urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler, false, 0, true); urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true); urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true); for (var prop:String in requestVars) { //trace("Sent: " + prop + " is: " + requestVars[prop]); } try { urlLoader.load(request); } catch (e:Error) { trace(e); } } function loaderCompleteHandler(e:Event):void { var responseVars = URLVariables( e.target.data ); trace( "responseVars: " + responseVars ); } function httpStatusHandler( e:HTTPStatusEvent ):void { //trace("httpStatusHandler:" + e); } function securityErrorHandler( e:SecurityErrorEvent ):void { trace("securityErrorHandler:" + e); } function ioErrorHandler( e:IOErrorEvent ):void { trace("ioErrorHandler:" + e); }
  5. I did not test it, but I looked around in Ryans BlogProfile and saw some interesting methods in BlogTools.php: /** * Find comments from the given selector string * * @param string $selector * @return CommentArray * */ public function findComments($selector) { $comments = FieldtypeComments::findComments($this->commentsField, $selector); foreach($comments as $comment) { if(!$comment->page->viewable()) $comments->remove($comment); } return $comments; } /** * Find $limit recent comments * * @param int $limit Number of recent comments to find * @param int $start Where to start, like 0 (default: null = automatic, based on page number) * @param bool $admin Include non-approved and spam comments? (default: null = determine automatically) * @return CommentArray * */ public function findRecentComments($limit = 3, $start = null, $admin = null) { $limit = (int) $limit; $_limit = is_null($start) ? $limit : $limit+1; $out = ''; $pageNum = $this->input->pageNum; // auto-determine $start if not specified if(is_null($start)) { if($pageNum > 1) $start = $pageNum * $limit; else $start = 0; } // we show pending and spam comments when page is editable if(is_null($admin)) $admin = $this->page->editable(); // build selector to locate comments $selector = "limit=$_limit, start=$start, sort=-created, "; if($admin) $selector .= "status>=" . Comment::statusSpam . ", "; else $selector .= "status>=" . Comment::statusApproved . ", "; // find the comments we want to output $comments = $this->findComments($selector); return $comments; } I think FieldtypeComments::findComments is a new addition to PW, so you might need the lastet version from github. It looks like instead of $comment->parent()->url; you can use $comment->page;
  6. Thank you apeisa, It worked. I just changed your code to this, so that empty/waiting repeaters are not echoed: foreach ($page->repeater as $p) { if ($p->status == Page::statusOn) echo $p->renderFields(); }
  7. I am trying to output all content of all my pages on a single page to get a quick overview where some content is still missing. It doesn't have to be pretty, and the resulting output of the MarkupPageFields.module is sufficient for my purpuse, but I am missing the content of my repeater field. Is there anything simple I can do to include my repeaters fields? This is basically my code: function listPageFields($page) { echo "<h1>{$page->title}:</h1>"; echo $page->renderFields(); if($page->numChildren) { foreach($page->children as $child) listPageFields($child); } } listPageFields($pages->get('/'));
  8. What about setting a min-height in JqueryUI.css like this: .ui-widget-content { min-height: 6em }
×
×
  • Create New...