verdeandrea
Members-
Posts
129 -
Joined
-
Last visited
Everything posted by verdeandrea
-
I've just checked and permissions for the files folder were ok. I tried also to change them to 777 but i still have the same error. I tried to create a new template with a new image field and it still gives me this error when i save, even if i don't upload any image and i left the field blank. This happen only with images/file fields. I don't get any error if i don't have image fields. All filed from the old hoster should be in the new one. But i don't know if there's a way to check it for sure. What else should i check?
-
Hi guys, i've moved a PW site from an hosting to an other. Now everytime i try to edit and save a page with and image field I get this errors Notice: No file uploaded in Unknown on line 0 Notice: No file uploaded in Unknown on line 0 Warning: Cannot modify header information - headers already sent in /var/www/html/mysite/wire/core/admin.php on line 14 Warning: Cannot modify header information - headers already sent in /var/www/html/mysite/wire/core/Session.php on line 464 Warning: Cannot modify header information - headers already sent in /var/www/html/mysite/wire/core/Session.php on line 465 But if I reload the page i can see that the page's been actually edited and saved. I checked Chrome Developer Tool but there is no error there. If i set debug to false from config.php i see only the first two errors. I tried solutions suggested on this forum (initOldSchool(), changing .htaccess, setting directories permissions, checking logs directory, empty session directory, checking if config.php has some empty lines in the beginning) but i had no luck. Pw version is 2.5.3 and PHP version is 5.4.34 Can you please help with this? Thanks!
-
How to relate fields saved in two different submission
verdeandrea replied to verdeandrea's topic in General Support
Thanks @LostKobrakai! Why do you think that is better than a session variable? (I'm asking just to understand better) -
How to relate fields saved in two different submission
verdeandrea posted a topic in General Support
Hi guys, here is my scenario. In my page everyone can submit a simple form with just a input text. User (guest user, no registration needed) writes something in this field and the submits it (the form is submitted via ajax so i don't refresh the page). Every text submitted is saved as a new page. After this step i ask to the user if he/she wants to register his email in order to be updated with infos about his submission. Now, if the user decide to leave his email i need to relate this email with the previously submitted text. What's the best way to do that? Working with some session variable? Putting the new page id in an hidden field? Cookies? Something else? Thanks! -
Thanks @adrian! That's exactly what i needed! Super!
- 2 replies
-
- 1
-
- users
- permissions
-
(and 2 more)
Tagged with:
-
Hi guys, I have this structure: - page group A (template group) --- events group A (template group_events_list) ------ event 1 (template group_event) ------ event 2 (template group_event) ... --- news group A (template group_news_list) ------ news 1 (template group_news) ------ news 2 (template group_news) ... - page group B (template group) --- events group B (template group_events_list) ------ event 1 (template group_event) ------ event 2 (template group_event) ... --- news group B (template group_news_list) ------ news 1 (template group_news) ------ news 2 (template group_news) ... - page group C (template group) --- events group C (template group_events_list) ------ event 1 (template group_event) ------ event 2 (template group_event) ... --- news group C (template group_news_list) ------ news 1 (template group_news) ------ news 2 (template group_news) ... So every group has the same structure with events and news but they share the same template. Now, i would like to limit access for group admin to a specific group branch so that the group A admin, can access, edit, and create/delete new pages for group A, but i can not edit other group. The same for group B admin, and so on. I understand that the best idea would be to use a template - role access, but i don't want to create a different template for every group, since every group page has the same fields, structure etc. I've tried this module http://modules.processwire.com/modules/page-edit-per-user/ (even if it says just to pw 2.4 and i'm using pw 2.7.2) and i can limit access to just one group per user, but just for editing pages, not for creating new ones. And if i give page creation permission to a template, let's say group_events_list, for a specific role, than that role can create pages for every group events. How can i limit editing and creating permission just for a single group (and its children pages) per user. Is it possible? Thanks a lot!
- 2 replies
-
- users
- permissions
-
(and 2 more)
Tagged with:
-
Hi guys, i have a news archive, where i cycle through a lot of pages and this cycle is paginated. In my home page i need to link to a specific news, but not directly to its page, but to the archive page containing this news. So if, for example, i have e news in page 3 of my archive, i would like to link to this page. The question is, what is the best way to get the link to the right page of my archive? Thank you
-
Hi, I've followed this post https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users%C2'> I've created a new template and a new parent page for some kind of user. Everything is working fine, but i would like to have a default role for this kind of user when a new one is created, so the site administrator doesn't have to change it (...and probably mess with it....). Is it possible? Thanks
-
Hi guys, this is what i'm trying to do. I have a template with a textarea and a repeater field. When I create a page i want to paste some text copied from excel and the when i save the page i want to cycle through that text and create new repeaters item in the same page according to it. I'm just starting with hooks and stuff so i'm doing something wrong caso I alway get this error "Call to a member function getNew() on null" Here is what I've written in my module public function init() { $this->pages->addHookAfter('Pages::saveReady', $this, 'afterRankSave'); } public function afterRankSave($event) { $page = $event->arguments[0]; // excel_paste is the textarea field where i paste from excel if($page->template == 'group_rank' && $page->excel_paste !== '') { $this->message("You pasted an excel"); $rows = explode("\n", $page->excel_paste); foreach($rows as $idx => $row) { $row = explode( "\t", $row ); $this->message($row); $rank_position = $page->group_rank_user_repeater->getNew(); $rank_position->group_rank_user_name = $this->sanitizer->text($row[0]); $rank_position->group_rank_user_concessionaria = $this->sanitizer->text($row[1]); $rank_position->group_rank_user_points = $row[2]; if($row[3] == 1) { $rank_position->gruppo_rank_user_winner = 1; }; } $page->excel_paste = ''; } } I need to empty the "excel_paste" fielsd, otherwise it get in an infinite loop. I'm not sure on what hook I should use. I not sure about the logic of this stuff. Thank you!
-
Problem with repeater fields in multi language pages
verdeandrea replied to verdeandrea's topic in Multi-Language Support
Now I've tried upgrading to the last PW dev version, but this didn't work too. No one knows what could I try with this problem, guys? Ryan? I think that the only thing i can do is recreate every page and every page field related to tem via api. -
It wasn't so hard in the end. I decided not to store the rank in the database, but just constructing it from the user points. I solved the problem of users with the same rank position in this way // I get the players pages and sort them by points $players = $users->find("sort=-user_points, sort=name"); // I explode the players into a scores array $scores = $players->explode("user_points"); // Using array_unique to remove duplicated scores $unique_scores = array_unique($scores); // With array_unique previous key are preserved so i need to create a new array with new keys $reindexed_scores = array_values($unique_scores); // I cycle through players foreach($players as $player) { // I get the key of the user pointe in the array $position = array_search($player->user_points, $reindexed_scores); echo $position; echo " - "; echo $player; echo " - "; echo $player->user_points; } Hope this could help someone else with the same need.
- 1 reply
-
- 3
-
It seems I have no luck here. I check "Users override CSV settings", then save, but when the page load again "Users override CSV settings" is still unchecked
-
Thanks @adrian . I'm trying the solution you described. I don't know if I'm doing something wrong but the "Fields to export" select is not showing the user template fields. I made some screenshot of the setting tab and of the "field to export" select. The editor is giving me some problem attaching them so here are the links to the screenshots https://www.dropbox.com/s/16oqik2ann07y40/settings_tab.png?dl=0 https://www.dropbox.com/s/c0h2gvgty27k3uw/Schermata%202015-11-04%20alle%2009.57.46.png?dl=0
-
Thanks @adrian yes i was talking about Home > Admin > Access > Users Unfortunately i've commented that line, and i can see the Batch Child Editor block in Children Tab, but when i click on export csv nothing happen And yes i need this to be available regularly to export users. Thanks for helping.
-
Thanks Adrian, great module! I'm trying to use it to export users page into csv, but the module doesn't show in "Users" parent page. Is there a way to make it work?
-
Hello guys, this is my situation. I have a website where users can do some tests. At the end of the test they earn some points. Se there is a rank showing users results. I'm trying to understand what could be the best way to store and organize data in this case. I'm thinking about using ProField Table to create an edit the rank. Every row of the table would have this information: Rank position - User - Points Everytime a user do a new test the rank should be updated. Can this be a good solution? Can i find and edit row of the table via API? Can Table field be sorted by one column? I was also thinking about using repeater. One repeater item for every rank row. Another problem is the rank should be like this: - 1. John Smith - 240 - 2. John Doe - 200 - 2. Jane Doe - 200 - 3. Bla bla bla - 180 etc. So if more user have the same points they should have the same rank position. I need to show "You rank position is: n" in home page for every user. So i would like to have a function like "get_rank_position($user)" but i have no idea where to start with this. Have any of you ever done something like that? Thanks!
-
Problem with repeater fields in multi language pages
verdeandrea replied to verdeandrea's topic in Multi-Language Support
I've tried deleting the repeater items for a page, and the adding then again but nothing change. It only works if i delete the page and i create a new page. But there are alot of pages, related to other pages, so i can not recreate every page. Does anyone have an idea about how to resove this problem? Please tell me if my previuos explanation is not clear enough. Thanks. -
Hi guys, something very strange is happening with a multilanguage site. Some repeater fields are not showing if i change the active language. I have this pages with information about professors and one of the fields is a repeater field called "professor_info". So, if in a blank professor template i write "echo $page->professor_info" i get ids of the repeater items, but if i switch language to english (the default language is italian) those fields are not showing. Moreover, this only happens with existing pages. If I create a new page the repeater field is working in both languages. I can't understand what is causing this problem.
-
Thanks netcarver, i've tried that but it's still not working. Could it be something related to "addHook"?
-
Hi guys, i've working on this site based on pw. I'm getting the error 324 err_empty_response in my homepage, but soon as i delete this line wire()->addHook("Page::wordLimiter", null, "wordLimiter"); everything is working fine again. This is the complete code of the hook function wordLimiter(HookEvent $event){ $field = $event->arguments[0]; // first argument $limit = $event->arguments[1]; $endstr = isset($event->arguments[2]) ? $event->arguments[2] : ' …'; $page = $event->object; // the page $str = $page->get($field); $str = strip_tags($str); if(strlen($str) <= $limit) return; $out = substr($str, 0, $limit); $pos = strrpos($out, " "); if ($pos>0) { $out = substr($out, 0, $pos); } return $event->return = $out .= $endstr; } wire()->addHook("Page::wordLimiter", null, "wordLimiter"); and is written on the top of the page. I really don't get what can cause that problem. Could you please help and suggest what can be wrong? Thanks
-
Page field - New page active url in different language
verdeandrea replied to verdeandrea's topic in Multi-Language Support
Another possible and very useful solution could be a field that works like a page field when you choose and existing page but works like a page table field when you create a new one. That would be great not just in this case but in a lot of other cases i can think of. But probably the easiest solution for now is trying to understand if we can change some pw core file to get that result. -
Page field - New page active url in different language
verdeandrea replied to verdeandrea's topic in Multi-Language Support
Thanks LostKobrakai. How can i use the snippets you suggested for the admin panel? I'm creating pages using the panel and not via API. Thanks -
Hi guys, i'm working on a multi language website (italian and english) . I'm trying to create a simple tag system using a page as tags container and its children pages as tags. Then in my news template i'm using a page field that allows new pages to be created from this field. Now, everything works fins but when i create a new tag using the page field it actually creates a news page but the name for the second language is not active (see the attached image). If i create a new page using the pages tree the active checkout is already checked. Is there a way to make it automatically active everytime a new page is created using the page field? Thanks a lot
-
Great thanks! It seems to work properly now. Yes i have "Rename on save" checked, i forgot to tell. Really thanks!
-
These are the logged errors in a page with two repeater items, one image per each: pageid: 1372 page->id: 1053 page->name: digital-compositing-nuke fieldid: 98 field->name: single_image template->name: corso pageid: 1373 page->id: 1053 page->name: digital-compositing-nuke fieldid: 98 field->name: single_image template->name: corso pageid: 1373 page->id: 1373 page->name: 1427738337-12-1 fieldid: 120 field->name: cover_image template->name: repeater_slideshow I'm not sure, but maybe there is something strange with this: "page->name: 1427738337-12-1" (that's not the page name), and this "field->name: cover_image" because cover_image is not a field inside the repeater, it's outside. If it can help you I can give you access to the admin page, or to the project directories. Thanks!