
celfred
Members-
Posts
199 -
Joined
-
Last visited
Everything posted by celfred
-
I had the same issue and hard-coded the url pointing to the asset file (using the id and basename fields)... Actually, it seemed like a workaround to me. Getting a url from the module would be much better, but I couldn't firgure out how to do that :-(
-
Well... I feel a little proud, then ;-) And I'm happy I was able to contribute a little. I so often 'take' from all of you without being able to 'give'... Glad I helped!
-
This website is just... amazing! Congratulations MadeMyDay! I liked the idea of the search field at the bottom. I feel like not having seen that often and I think it's pretty cool. One small remark : when I hide the sidebar on the right, I get a horizontal scroll at the bottom which disappears when I open the sidebar (Firefox 25, on a 16:10 portable computer 1200x800). This happens also when I go fullscreen.
-
Hello, I'm coming back on the issue of a request returning a '500 internal error' but working if we add 'debug=1' to it... From what I've understood so far, the remote PHP version not really up to date is the cause, but I must admit it's way over my head (and I can't change the remote version) but here's my situation (and I hope there's a solution) : - I'm trying to deploy my local site on a remote server - I found out my 'password hash' problem is coming from the different PHP versions (Up to date on localhost, but 5.3.3... on remote). I managed to solve this. - My site is making a strong use of the Page Service Module all all my request ended in a 500 internal Server Error. - I ended up here and found that adding 'debug=1' helped me getting rid of my errors : cool! - BUT : the response is not in the same form as usual (without debug) and I'm stuck by being unable to treat it accordingly! I used to do : load: function(team) { if (team) { var url = "service-pages/?template=player&sort=title"+team+"&debug=1"; // Added debug=1 to skip the 500 internal error var promise = $http.get(url).then(function (response) { return response.data.matches; // USED TO WORK, but no more... }); } return promise; I have no idea how I can solve this issue... Just in case you wonder where my code is from : it's inside an AngularJs service. Thank you for your help ;-) Edit 01 : Well, I re-read the whole topic trying to understand... and I tested Pete's answer about headers and... it worked, but I really don't know why... Just so you know, I use Firefox 25. I'm worried to know if it'll work with other browsers... If it can help others : I changed line 236 in the ServicePages.module file : Original line : else header('Content-Type', 'application/json; charset=UTF-8'); New line : else header('Content-Type: application/json'); Anyway : thanks Pete! And if someone can take the time to explain why this manipulation is needed, I'd appreciate! Still thinking : if other browsers need different headers, would there be a way to specify this in the same place in the file (like if browser is IE, then send such headers, if it's Firefox, send this one...)? Edit 02 : Me again... I keep reading about those headers... and tried a couple of things and here's what I got I just changed syntax in line 236 mentionned above : Doesn't work : else header('Content-Type', 'application/json'); WORKS ! else header('Content-Type: application/json; charset=UTF-8'); I checked the PHP manual about the header function and I thought maybe the second parameter in the original line in the module is interpretated as the 'replace' parameter they talk about in the documentation... It it makes sense maybe the line should be changed in the module? I actually have NO idea if what I'm saying makes sense. Maybe all this is obvious to everyone here, but I kept stuck on that for a few hours today ;-)
-
Hello ioio, Welcome to the ProcessWire community! Don't be afraid of messing the admin part of ProcessWire as long as you touch templates in the site/templates/ directory of your installation. You can indeed use the same names head.inc and foot.inc even though you change all their content. The Admin part is left clean because it resides in the wire/ directory and you don't want to touch this one ;-) Actually, this is my first answer to someone's question! No doubt another member of the community will provide you with useful recommendations. Hope I helped ! EDIT : Woa... You guys are so fast...
-
Woa... I'm always astonished by how you guys can put things up so quickly and simply... I guess it's exactly what I need! THANKS adrian!
-
Hello, I'm using the Comments Manager module on my site and I was wondering if there was a way to block comments on certain pages. I'm sure this would be possible by coding something in my templates, but I looked for a simple 'Disable comments on this page' checkbox in the 'Edit' area where comments are listed at the bottom of the page and couldn't find it. Do you think this could be a possible new useful feature for this module? Please understand I'm not saying 'do this for me please'. Maybe there's another easy possibility to achieve this which I can't think of at the moment. I must admit I haven't spent much time thinking about it. I'm just facing this issue right now and thought about a checkbox ;-)
-
Hi there, @Manol, this is exactly the issue I've facing these days with my project! And I got crazy over it... without finding any solution except giving up routing through AngularJs ;-) I had to admit this was way over my head trying to find a way to articulate both AngularJs routing and 'getting out of it' to come back to PW in the same 'app'... But I'm sure others real programmers here will give us clues ;-) I'll keep an interested eye over here ! To finish my comment, I eventually only used controllers in the pages I wanted JS 'power' and managed the routing 'manually' through PHP. I actually didn't HAVE TO change route in my app (for the moment).
-
Hello there, In my long slow way of discovering coding, I ended up realizing I needed something like... the Pages Web Service. I installed it, tried it and thought.... Woa! How can Ryan do so much... It seems perfect for my needs right now! I was stcuk and now I can go forward again. So I'll keep on exploring and trying to do my stuff. But on my way, I wanted to stop and say THANKS to Ryan for his work and the way he's sharing it... I sometimes ask for help, this time, no answer needed ;-)
- 1 reply
-
- 9
-
-
Nice explanation. Thank you very much!
-
Hello, My code seems to become quite messy very quickly when I do something... For example : $taskId = $input->post->task[$checked_player]; if ( $taskId != 0) { // Task selected // Get the task bonuses $task = $pages->get($taskId)->title; $new_XP = $pages->get($taskId)->XP; $new_HP = $pages->get($taskId)->HP; $new_GC = $pages->get($taskId)->GC; // Do the math $player->XP = $player->XP + $new_XP; $player->HP = $player->HP + $new_HP; $player->GC = $player->GC + $new_GC; } I feel like I'm using to many 'bridges' variables (I'm not sure this is clear)... Do you think the following would be better? : if ( $input->post->task[$checked_player] != 0) { // Task selected // Get the task bonuses $task = $pages->get($input->post->task[$checked_player])->title; $new_XP = $pages->get($input->post->task[$checked_player])->XP; $new_HP = $pages->get($input->post->task[$checked_player])->HP; $new_GC = $pages->get($input->post->task[$checked_player])->GC; // Do the math $player->XP = $player->XP + $new_XP; $player->HP = $player->HP + $new_HP; $player->GC = $player->GC + $new_GC; } Or even (not tested) : if ( $input->post->task[$checked_player] != 0) { // Task selected $task = $pages->get($input->post->task[$checked_player])->title; // Do the math $player->XP = $player->XP + $pages->get($input->post->task[$checked_player])->XP; $player->HP = $player->HP + $pages->get($input->post->task[$checked_player])->HP; $player->GC = $player->GC + $pages->get($input->post->task[$checked_player])->GC; } Is it just personal preferences or does it have a performance issue to use variables ? It may sound like a 'noob' question, and I know it's not specific to ProcessWire, but I felt like asking, so I know better ;-) Thanks! PS : I've just noticed there was a 'dev forum' for such questions! It should go there... But I guess that's too late... Sorry!
-
Well that was a quick answer! I trust your experience and follow the advice. If I can handle thousands of events, I guess I'll have more than enough! Thanks a lot!
-
@apeisa (or others) I've tried doing something with 'event' template for history. It works fine for my purpose right now but I'm still wondering something about scalability. Should I add a new 'event' page (child of 'player' page) each time a player does something or should I have only 1 'events' page and I append to this page? In the first case, I'll end up having like 500 pages by players. Is this a problem? In the 2nd case, I would have only 1 page with either many fields (or 1 big text field, like a log file?) Which would be best? Keep in mind that eventually, I'll try to manage history so I can see how a player does on 1 particular task (let's say, for example, 'No homework' or 'No copybook', useful information for parents' meeting) and for now, I feel like the 1st solution would be better to handle this kind of sorting...
-
Right about the useless 'All Players'. I got rid of it and displayed the stats on the 'Players' page. Thanks. Great idea about the 'event' template ! I'll dig this a little and keep you informed. And you understood perfectly the need of having freedom and being able to add vustom information ;-) Thanks!
-
Hi kongondo, Yes, The 'All Players' page pulls the scores from each player's page to display the scores. But then, I think I'll make it possible to edit the scores on the same 'All Players' page because I don't want having to go through each player's page in the Admin Panel to edit individually the scores. I think of checkboxes on the All Players page to be able to select multiple players at once. And by submitting the new All Players page, I would update each player's pages. For the moment, I can't think of another way of managing all theses scores. I'll keep you updated about my progress...
-
Hi there, Thanks a lot for your answers and your encouraging words! I appreciate a lot. Now, I agree I have to start very small and simple and then build on top of that. That's why I got in touch with you, actually, because I was unable to figure out how to start with PW, and possibly JS to make things more 'dynamic'. From what I see so far, I should forget about JS (or at least not worry about it for the moment) and start digging about my page structure with PW. So far, my first tests lead me to the following simple structure : Home - Players - Player 01 - Player 02 - ... - All Players The 'player' template has the fields : title,team,XP, Lvl, GC, HP. And I filled the values 'by hand' to make an initial state ('title' is the name of the pupil, 'team' is the class, 50 Health Points, 0 Experience, Level 01, 0 Gold Coins). The 'All Players' page allows me to have a list and see the different scores on 1 page. At first, I just thought about being able to update things from this 'All Players' page by checking the names of the players involved and selecting some kind of 'rewards' from a list. Then, I thought it wouldn't be good to display a unique form with about 30 players (1 class) _checkboxes_ with 4 input fields each (like a table) and 1 select to choose the 'task' type which would trigger the score changes. (That's why I started thinking JS...). I just imagined I would have trouble recording things for each player if I have only 1 form. The thing is : - I'd like to keep some kind of freedom about points (manually change something for 1 player) so an input field sounds good. - I could then have a submit button to save all changes (but I guess I would re-save everything since I wouldn't know only 1 field changed). - I thought about updating scores onSelect-ing the rewards (JS) so the kids could see the impact right away, even before submitting the form. [Now I guess I'll bother with that later ;-)] - I imagine the list of tasks could be built in PW Admin interface under a new page 'Tasks'. For example the task 'Homework' could have fields such as 'XP Gain' '3', 'GC Gain' '5'... so I can add different tasks little by little. Writing this, I see another problem : some tasks are positive when done, or negative when not done... Should I make a list like 'Homework', 'No Homework'... But what do I do with 'Class Participation' in which I have 4 levels : Very bad, Bad, Good , Very Good : 4 different tasks? So the 'final' simple structure would be : Home - Players - Player 01 [title(name), XP(0), HP(100), Lvl(1), GC(0), Team(class)] - Player 02 [title(name), XP(0), HP(100), Lvl(1), GC(0), Team(class)] - ... - All Players - Tasks - Homework [title, XP Gain(3), GC Gain(5)] - No Homework [title, HP Loss(5)] - Very Good Class Participation [title, XP Gain(3),GC Gain(3)] - Good Class Participation [title, XP Gain(2),GC Gain(1)] - Bad Class Participation [title, HP Loss(3)] - Very Bad Class Participation [title, HP Loss(5)] - ... My main problem is that I tend to see the final product even though I want to stay very simple at the beginning, but this prevents me from starting because I keep wondering what is best. I'm always scared of heading the wrong direction right from the beginning. (I'd like to keep a history for each player because it's not just a game, it would be useful to analyse the 'Homework' task with the student and the parents... _ but that' would be for LATER, of course) I'd love it to be scalable, but I'm not sure I'm ABLE to think of it as scalable! Anyway, I hope I don't bother you with my long post about how I see my project. Maybe I should just dive in and ask you more specific questions when I'm stuck. But I do think organisation and structure are very important and represent the foundation and you know what happens if you build on sand... So I'll start how I've just described it to you, but please, feel free of interfering and giving advice if you see me heading in a wrong direction ;-) Thanks in advance.
-
Hello all, I haven't been around for quite a while, but I'm still trying developing stuff for my classrooms (I'm an English teacher) and this time I'm a little stuck even before starting... Let me explain : I've used ProcessWire for my English site (FLEnglish : http://flenglish.tuxfamily.org - if you're curious) and I just loved it (not my site, ProcessWire ;-), and I appreciated the community help a lot) So here I am again with a 'new' project and my questions : I'd like to implement some kind of RPG Game (in the style of HabitRPG) for the language classroom. Actually, it's a lot easier than HabitRPG since I'm interested mainly in managing the score part of the game. I'd like the kids to have a character (no images for the moment, just a name), and scores for Health Points, Experience, Level, Gold Coins) and according to their achievements in class, the scores improve and so on. The idea is that I'd need a tool quite handy to manage because I have many pupils in classes and no time in class to manage all this. Let's see an example : All kids did their homework. They all get +3 experience and 5 gold coins. I don't want to spend 10 minutes going over each pupil's name and adding their numbers... I thought of the Skyscrapers demo site for a start : yes, I could manage students this way, having field for XP, HP, GC and so on (this is what I started doing actually). But then,I can't manage pupils' results 1 by 1 going through the Admin page in PW. So I thought of using Javascript to avoid having to validate a page on which I would have 120 fields to update according to the task succeeded. That's when I started thinking trying to continue learning AngularJS, but I was unable to make it work along with PW... (I get a 403 error when routing to the view template_ I put everything in /site directory, maybe that's not a good way). Anyway, this is quite a mess in my head at this time even though I would like to try and do something this way. If anyone here could give me a possible thought about this to give it a start : could PW be useful for such a task? To be honest, I would love to use PW for this since I would like to be able to merge this score thing with my site already using PW (and why not imagine 'users' being able to log in to see their scores and so on...?) I'm afraid I'm being extremely complicated on that. Let me rephrase it : - Could I have such a system for scores management using PW ? - Could I have a user interface quite handy to update scores easily using PW? In brief, what do you think? I hope reading this was not too much of a burden. Thanks for your help! Celfred.
-
Well, I guess it's just because you really deserve being thanked (and liked) by many people on this forum! I wish I could be more helpful myself but I have to admit I have a long way to go before being close to many of you concerning developping skills. I'm saying this not for my own merit, of course, but just so I could allow people like you focusing on higher skilled matters. Anyway, being around this forum is great and it's just because there are many persons like you, Soma, willing to help the others, quick in answering their problems, and patient enough to repeat some 'beginner' talk to guys like me. So THANKS to you, but also THANKS to many others for your kind help and the way you're involved here. Congratulations!
-
That makes sense ;-)
-
Waow! That was quick! Well, what can I say except THANKS! Why did you exclude 'guest' role in the list? I guess I can understand that the Login Notifier module's point is to notify the 'guests' login actions, but why not let people decide? i can imagine someone interested in receiving mails only if a paricular role logs in (but not 'guest'). Anyway, that's just a supposition from my side. Your work is just fine for my use as it is so thank you very much. Now that I don't have to try and do that myself (which would have taken me a lot more time, definitely!), I'll look at your code to see what i should have done ;-) Thanks in advance for the lesson !
-
Hi there, I've just come across this module and it worked as expected. Thanks a lot. I changed a little thing though, for my personal use, and I don't know if this could be of any interest for someone else. (It's the very first time I look inside a module...) Line 72 : if(!$user) return; I changed to : if(!$user || $user->isSuperuser()) return; My point was that I received emails even when I was logging in my site and since it's a very little amateur site with _let's admit_ no traffic (for the moment ;-) ), I kept receiving mails indicating I logged in... Now, with my little tweak, I get emails only when other members log in which is what I wanted ;-) Now here's my thought : I thought some kind of list of roles (or users?) could be added to the settings page of the module so one could only check (or uncheck) some roles to be ignored from keeping a record (either mail or log entries) without actually touching the module code. I don't know if I'm being very clear there... and actually I have no idea if this kind of idea is shared... But if it is, I would be glad to try and see what I can do to include such a feature in the module, even though I'm starting from very low considering my developer skills (but I'm eager to learn and improve). Thanks for letting me know if you think that would be a loss of time ! (Or if I did a mistake changing my little line 72).
-
See... Again something I would never have thought about by myself... Thanks !
-
Well... Thanks again for such a great explanation ;-)
-
Well, that was a lot more technical than I thought it would be! Anyway, I understand a little better now. I actually didn't even notice my 'Le p'tit' search was not 1 word but 2 words... Looking at the links above was quite helpful and enlightening. In the PW documentation, I didn't see the line concerning %= : Still, I can't understand the $= issue : ie vs. die : 1 result vs. 0 result ? Anyway, this was just a test, I don't need it (now)... Thanks a lot for your help and explanations!