Jump to content

leoric

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by leoric

  1. hi ,soma before this i had tried to use "remove" ,but it does not work. so i change to "removeAll" and i found : if there have this pages in page field [Multiple pages (PageArray)]: page1 , page2, page 3..etc removeall() : will remove all pages => its worked removeall(page1): page1 will be removed. => its worked remove(page1): nothing changed.. => its not working
  2. ok,i did it like this: $user->user_app->removeAll($page); its working, is it right?
  3. hi,everyone! i could add some pages in page field like this: $user->user_app->add($page1); $user->user_app->add($page2); $user->user_app->add($page3); ...etc $user->save(); now the issue is i dont know how to delete one page. thanks!
  4. add a question , this code not work( jquery version: 1.9) $('.ajaxSearch_close') .live('click',function(){ $(this).closest('#ajaxSearch').fadeOut(); }); you can use this replace it $(document).on("click", ".ajaxSearch_close", function (e) { $(this).closest('#ajaxSearch').fadeOut(); });
  5. i used soma 's AJAX PAGE SEARCH module today i found a issue after test: when i type a keywords not use letter or number (chinese keywords) ,the result will return "Please enter a search term in the search box (upper right corner)...", obviously the search.php cant get inputbox "q"'s value..thise issue just happend on IE. Chrome and FireFox work ok. then i open AjaxSearch.js, find "data: param_name+"="+value," (line 76) replace into "data: param_name+"="+encodeURI(value)," and its working.. nice module, thank you ,soma!
  6. ok,finally i found the reason caused these issues. my MySQL Database Version 5.0.51b, and i upload to my server (MySQL Version: 5.0.95) ,its work perfect. this topic is helpful.. http://processwire.com/talk/topic/4047-drag-and-drop-page-sorting-with-blog-profile-not-working/ thanks all.
  7. hi,everyone! i have two issues : ----------------------------------------------------------------------------------------------------------------------------------------- 1.the first (serious): there is a page tree like this in my site backend : site category A child-id 1 child-id 2 child-id 3 .. newest page... category B child-id 1 child-id 2 child-id 3 ... newest page... category C child-id 1 child-id 2 child-id 3 ... newest page... and i wana be this: (some category's children reverse sort by id/created ,such as category A and C ; there two cateogries have unlimited articles.): site category A newest page... .. child-id 3 child-id 2 child-id 1 category B child-id 1 child-id 2 child-id 3 ... newest page... category C newest page... .. child-id 3 child-id 2 child-id 1 then i do this manipulate: edit page" category A/C" -> children ->sort settings -> children sortted by (created) And checked "Reverse sort direction?" after this manipulate,i found its not working ,there nothing be changed at last i use this module : "Pagetree Add New Childs Reverse" http://modules.processwire.com/modules/page-tree-add-new-childs-reverse/ after module configuration completed, its still not working. -------------------------------------------------------------------------------------------------------------------------------------------------------- 2.another one is very funny: category A and category C have pagination. (code: $page->children("limit=12,sort=-id"); ) in frontend page, if i login system, in front page the sort is not work ,when i logout its working. like this: when i logged in ( sort=-id, not work): page-id 1 page-id 2 page-id 3 page-id 4 ... but when i logout( sort=-id, work correct) page-id 4 page-id 3 page-id 2 page-id 1 ... -------------------------------------------------------------------------------------------------------------------------------------------------------- what caused those issue? it looks like when i login system "sort=-id/sort=-created" will not work. i had read so many topics but they cant solve my issue. ---------------------------------------------------------------------------------------------------------------------------------------------------------- PS: these days i have been using PW do my project. and there are many problems have been resolved in forums. in the fact its difficult for me learn PW(i am from china,there no chinese PW helpful resource in internet),my english is not good enough.most of the time i have to use dictionary.but i really like PW. thanks!
  8. ok,its done when i delete "limit=n" the menu will work correctly , there is only one "limit=n" in the page and i use this instead of "limit=n" foreach($items as $item) { $in++; //control nums if($in==6) break; xxxx } thanks again! regards!
  9. i am back... omg,its working i dont changed something,just do as you say : add "$item->id" then i found its work correctly its a big joke,i think if the cache caused? my work space in localhost (appserv + win7 x64) @adrian thank you very much!
  10. yes,i had checked "Allow page numbs". the include is working, and there is no php errors thank you,adrian, i'll checking the problem well.
  11. @adrian @teppo i am sorry for my expression is not clear. and i want to do like this article id: 1 2 3 4 5 6 7 8 9 10 11 12 ... page 1 12 11 10 9 page 2 8 7 6 5 page 3 4 3 2 1 ... but when i use this code "$matches=$pages->find("parent_id=$page->id, limit=5,sort=-id");" or "$matches = $page->children("limit=5,sort=-id");" its not working.. if i use "$matches=$pages->find("parent_id=$page->id, limit=5")->sort("-id")"; the result will be this: article id: 1 2 3 4 5 6 7 8 9 10 11 12 ... page 1 4 3 2 1 page 2 8 7 6 5 page 3 12 11 10 9 ...
  12. thank you for you reply,adrian in the fact,i try do this earlier,but the problem is still
  13. today i use pagination found two questions and one is http://processwire.com/talk/topic/4751-sort-id-not-working/ and another question is the menu of all pages is missing. exclude first page. the menu code is wiritten in header.inc ,i use "include("./header.inc"); " get it. and this is the menu code: <?php $homepage = $pages->get("/"); $children = $homepage->children("limit=5"); $children->prepend($homepage); //index foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; $liclass=$child->numChildren(true) ? " class='hmp'" : ''; //get 2 menu //$finalstr=''; if($child->numChildren(true)) { $items=$child->children("limit=5"); $fstr="<div class='mc'> <ul>"; foreach($items as $item) { $fstr.="<li><a href='$item->url'>$item->title</a></li>"; } $fstr.=" </ul> <div class='ft'><b></b><i></i><div> </div></div> </div> "; } //end echo "<li$liclass><a$class href='{$child->url}'>{$child->title}</a>".$fstr."</li>"; } ?>
  14. <?php $matches=$pages->find("parent_id=$page->id, limit=5,sort=-id"); $pagination = $matches->renderPager(); echo $pagination; echo '<ul class=rows>'; foreach($matches as $item) { echo '<li><a href="'.$item->url.'">'.$item->title.'</a></li>'; } echo '</ul>'; echo $pagination; ?> hi , this is my code , the problem is "sort=-id" isnot working this is some articles in many pages. when i use "$matches=$pages->find("parent_id=$page->id, limit=5)->sort("-id");" then i found the articles order by -id in current page,but i want to them work in all of the pages. and if i use "sort=-title/title" replace "sort=id/-id" ,its working perfect. whats wrong with this? thank you !
×
×
  • Create New...