Jump to content

snobjorn

Members
  • Posts

    169
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by snobjorn

  1. Anyone else got this problem? I tried on multiple installations of ProcessWire. Always when trying to create (or save an existing) Hanna Code in PHP, I'm throw and error. I.e. this one: Forbidden You don't have permission to access /processdisplay/processwire/setup/hanna-code/edit/ on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
  2. I have some trouble with an "unstable" Hanna Code at my 2.6.1 site. Whenever I edited a php code, I was redirect to a 404 front end error. So I installed Hanna Code afresh. But also when I am trying to add a new php code, I get the error. Creating a html code works. Any ideas? (I tried with debug mode on, but got no notifications.)
  3. Anyone tried this with the dev branch of PW 3.0.x? I got to the second part, where connecting "columns" with fields. And it could not find the fields. Maybe I'm missing something, maybe it's not compatible?
  4. Thanks kixe. My solution: I checked with a couple of your lines of code. There was no change of super user ID in my config file. I would have had to manipulate my database, I guess. But I ended up spending a little extra time to setup a new installation (copying files, export/import templates and field, and modules). This was all for my own "base installation", and I would rather not come across errors related to this (or how I 'fixed' it) in the future. But knowing there's an answer is always a great part of the ProcessWire learning process for me.
  5. I had one. I can easily make more. None of them have id 41 or get when I create new users. The reason I'm asking is because of an notice I get: Notice: Trying to get property of non-object in /Users/ness/framework.pw/wire/core/Page.php on line 1211 I thought it was an v3 error, but when I reported it I was told it was because of no superuser with id 41.
  6. I seem to have a problem because my superuser does not have 41 as ID (but 1074). I have no idea how this happened, but I have been moving this installation around during development. Anyway, is there a way to change this back?
  7. When I migrated my WordPress blog to ProcessWire a while ago, I ended up doing it by exporting WordPress to CSV and importing it to ProcessWire with the "Import Pages from CSV files" module. It was a bit of manual work. But I wanted full control and did it in parts. Multiple steps. I wanted to split my tags into new page types, such as directors, ratings and tags. And I split my categories into genres and media type (film, tv). Because I wanted more options, and as you see, it was a movie blog. Because I had around 2700 posts at the time, I did it all locally (MAMP). But first I did a lot of search and replace in the CSV (using Google Spreadsheet). Split content into columns (that became field types). And replaced e.g. my genres with the ID of newly manual created genre pages. Director pages was created automatically during CSV import based on director names. I also imported the images from a local folder using the ProcessWire API and some coding in a template file. Which was what I did last. This is not a step by step guide for how to do it. But I did it after having used ProcessWire for only a few months. So if you got time, get to know ProcessWire a little first, and see the possibilites.
  8. I recently noticed a strange problem in my body field. I have a multilanguage setup with Norwegian and English. And I am using Ckeditor. The strange problem was that the (inline) toolbar wouldn't show on Norwegian, neither would text input in Norwegian be saved. English worked fine though. I tried this and that. And at last I found that using custom editor JS styles set was the error. Simply removing the path to my file made this work again. During all this I logged on and off a couple of times when testing. But since I hadn't edited the JS for a long time, I wanted to know what was the specific problem. So I removed some and all of the content in the JS (which I had named ckeditor.js by the way). And I logged on and off during each time. But nothing would work. One last shot was to rename my custom JS file named ckeditor.js to something like mystyles.js. And it worked again, with all the same content as before. I have no idea why this "suddenly" went wrong, and why a rename seemed to fix it. I might have something to do with modules, a migration of the site (I cleared the sessions folder though). ProCache? Updating to 2.7.1 (from 2.6.x) didn't fix the problem. So I am at a loss as of why. But I am sharing this in case anyone else have been experiencing something similar. And because I couldn't find any answers on the issue.
  9. Did you ever managed to get this working? I have been trying with config.templates_files and config.templates without luck. Both in /site/modules/CKEditor and /site/templates, different ways each place. The only thing I've got working is if I replace the code in /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-4.4.6/plugins/templates/templates/default.js And as mentioned all over, never code or place anything in wire. So no luck here as well.
  10. (I am unsure of where to put this question, it might be both module and template related.) I was looking at the module PageRenderIPRestriction and started wondering. Would it be possible to do something similar, but give a guest a user role based on IP (v6 preferrably)? Not for security measures, but for presentation. I'm working on a mixed webpage with both intranet features and normal web page stuff. There's some parts of my templates I was thinking of restricting to a specific (or multiple) user role(s), namely employees. Example: If visitor's IP range is A-B, then he's an employee and should be able to view some extra buttons in a news article. If visitor's IP range is else, no buttons are visibile.
  11. I edited my post. I was able to show my sitemap when I reduced links to around 2400. That is the number of pages I have if I exclude my tags (actors and directors). The the sitemap is now working. But it stops working if I allow all my pages again.
  12. On my new site a couple of months ago, I setup Ryan's sitemap from this thread. It worked fine. After that I have added a whopping 18 000 pages (tags, etc.), and my sitemap is no longer working. I have no idea if there's a connection. But could there be a limit? My code is still exactly like Ryan's, no customisation. URL is http://filmdagbok.no/sitemap.xml Chrome shows nothing, Firefox shows an error. Extra info: No trailing slash. No cache (although I should probably setup this for this template?). Edit: I figured out that if I exclude the parent for my different tag types, the XML worked. But still, I wonder if there's a limit on how many pages the sitemap can hold? And how one would solve the problem.
  13. Thanks, that last one seems like something I could use. I'll try it another day and will mark it as solved then.
  14. Thanks, that part is clear, but I would like to have headings for each group, and have the results in each group wrapped in UL-tags. I have updated my post to reflect this with bold headers and bullet points.
  15. I have a question on how to group search results by template, with pages sorted alphabetical (as standard) in each group. I have a film blog running ProcessWire. It has lots of posts, ratings, categories, ratings, directors, actors and tags, my search result is getting crowded by all this pages after a while. These pages have different templates. Until now I have had badges with the template label by their title in the search result. I am wondering if there's a simple way of coding it to group the search result, kind of like how IMDb does it: Titles are grouped first, then names second. Like this. To illustrate, here's a part of my structure, template name in brackets: --- Main (home) Blog (posts) Movie 1 (post) Movie 2 Actor (actors) Actor 1 (actor) Actor 2 Director (directors) Director 1 (director) Director 2 Tag (tags) Tag 1 (tag) Tag 2 --- And here's how I would want my search result to show, e.g. if all these pages where to mention Tom Hanks somehow: --- Movies: Movie 1 Movie 2 Directors: Director 1 Director 2 Tags: Tag 1 Tag 2 Actors: Actor 1 Actor 2 --- I am in a learning process, and I am sure there are other problems that will appear when considering usability. Limits within groups, etc. But for now this is a way of sorting that I might also want to use elsewhere later on. Whereas I have headings and results in separate lists. (PS: I have read a couple of posts on group sorting based on parent ID, but none of them was exactly what I was looking for.)
  16. I have tried to use this setup on my movie blog, but replaced author with director. The thing is, I have 2300+ movie posts, and 1400+ director pages. Is there a way to use count instead of find to ease the performance (first line?)? I have used the following code for testing purposes, but even locally (MAMP) without diagnostic I noticed the page load is a bit too much. $directors = $pages->find("template=director"); $res = new PageArray(); foreach($directors as $a) { $a->postcount = $pages->count("template=post, director=$a"); $res->add($a); } foreach($res->filter("sort=-postcount, limit=10") as $a) { echo "<li><a href='$a->url'>$a->title ($a->postcount)</a></li>"; }
  17. If I was to put a static/hardcoded <li></li> into a Menu Builder menu, how would I best approach a solution? Is there a way to have no wrapper_list_type, or echo my additional <li></li> together with $out? I guess my problem could be solved with Hanna Code, but the question still intrigue me. Here's my current code, for reference. With two <ul>s that I am trying to merge into one. <?php if($user->isSuperuser()) : ?> <ul> <li><a href='<?php echo $page->editURL; ?>'><i class='fa fa-pencil'></i> <?php echo __('Rediger', '/site/templates/header.inc'); ?></a></li> <li><a href='<?php echo $config->urls->admin; ?>'><i class='fa fa-gears'></i> <?php echo __('Kontrollpanel', '/site/templates/header.inc'); ?></a></li> </ul> <?php $adminmenu = 'administrator-menu'; $options = array( 'wrapper_list_type' => 'ul', 'list_type' => 'li'); $menu = $modules->get('MarkupMenuBuilder'); $out = $menu->render($adminmenu, $options); echo $out; ?> <?php endif; ?>
  18. I have a site with multiple subsites (for sub-organization under our main organization) on the same install. Simple stuff really, and useful because I have news/events that these have sub-organizations have common. Therefore I also have common categories. But I want to tag the news based on where their main location is. (So that people now they will be directed to another sub-organization if they click on a link with a tag). My site structure: Home -Site A --News -Site B --News -Site C --News -Categories --Cat 1 --Cat 2 On each site (Site A, Site B and Site C), I have a code for foreaching selected categories, it goes like this: <?php $ids = $page->show_news_cat; $nnow = time(); $news = $pages->find("template=news-post, show_news_cat={$ids}, limit=3, date_publish<$nnow"); foreach ($news as $new) // If unpublish has a date if($new->date_unpublish != "") { if(time() > $new->getUnformatted('date_unpublish')) { $new->of(false); $new->addStatus(Page::statusHidden); $new->save(); } } echo "<div class='col-md-4'>" . "<a href='{$new->url}'><h2>{$new->title}</h2></a>" . date("d. F Y", $new->date_publish) . "</div>" ; ?> E.g. I would want to tag news located in Home>Site A>News with "Site A", if I am currently browsing on Site B or Site C. I looked around the forum and tried this and that, but with no luck. If nothing fancy works, I could always have my code check if url/path for each news contains "site-a" or "site-b", and then output something based on that. But I never found the right functions for that. Could someone help to point me in the right direction. (IF you have other comments on the code above, I am not one for saying no thanks to improvements. I never learnt php proper.)
  19. Hi. What is the current status on this project? I just recently discovered this post, and the modules looked both promising and something I would have much use for on my current website project.
  20. I have read and re-read the first post so many times I was getting blind. I never saw the code under Checking for a unique username. With that included, I got it working. I should really read better on my own in the future! Thanks, cstevensjr, horst and pwFoo!
  21. Thanks, cstevensjr. Here's my code from my template "registration-page": Code has been removed by me to clean up this forum post a little. All that was missing was a section of code inlcuded in the first forum post (that the original poster had moved to functions.php). So it was not really a problem I have removed the include functions (don't know what it is for) and the require phpmailer, and have setup WireMailSwiftMailer instead. Therefore I have also changed some lines from $mail = new wireMail(); I have added new fields to the system template user, which is why I have first name and last name in here. I am running my test site on a MAMP installation. The error that show in errors.txt is (lines should match up with the pasted code): 2015-04-18 21:44:50 guest http://localhost/registration/ Error: Call to undefined function username_validation() (line 102 of /Applications/MAMP/htdocs/sitename/site/templates/registration-page.php) I think that's most of it.
  22. I've been trying for a couple of hours to set this up. But for the last hour it has given me an "Internal Server Error". The error log says "Error: Call to undefined function username_validation()". I have no idea what could be wrong. I have not included any functions.php file, as I do not have one or do not have any idea what code that should contain. I could paste more code, or tell more about my setup, but I'll start with the error.
  23. Thank for you reply, Macrura. I also tried what you suggested, but without any luck. I am not able to get the name with that code line. I only get the ID from $menuname, using this line: $menuname = $page->show_menu; The Menu Builder module page says I can render with the ID. But I do not get it to work with this line: echo $homemenu->render($menuname, $options); I get it to work with this: echo $homemenu->render(1045, $options); where 1045 is the ID for home-menu.
  24. Background I have a home.php template in which I have a dropdown select box. From this dropdown I am able to choose between my menus. I have Menu Builder installed. I created a field type with the name show_menu and type Page. Then I set the Menu Builder folder as parent of selectable pages. Back end / admin It seems to work back end. All my menus are listed when I edit a page that has the home.php template. Front end / home.php Here is my problem. I am trying to get the name from the selected menu (from back end) to show in my code. For a while I was able to get the ID, then I got all 3 IDs (I have 3 menus to choose from). The menu I want to show is named home-menu, labeled Home Menu. In the following code I have included both a non-working line as line 16. And a working line as line 17. But line 17 is "manual" and not connected to the back end editing, which is what I am trying to do. So can anybody help me with the right code line to output the name for Home Menu? (I tried to work with the ID, but got fatal errors. Those errors disappeared when I manually use line 17.) <?php $homemenu = $modules->get('MarkupMenuBuilder'); $menuname = $page->show_menu->select_value; $menuname = "home-menu"; $options = array( 'has_children_class' => 'has_children', 'current_class' => 'current', 'menu_css_id' => $menuname, 'menu_css_class' => 'nav', ); echo $homemenu->render($menuname, $options); ?> Btw. I am no PHP guru, I get by mostly through copy/paste simple snippets. Please ask me if I lack any details or am unclear on my problem. This is my first post, so please correct me if I am posting wrong or something.
×
×
  • Create New...