Jump to content

Doc

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by Doc

  1. Hi, Just landed here through "namespace" keyword search. Do I need to add "<?php namespace ProcessWire;" at the beginning of my template or include files ? I don't have any php classes but maybe I will add some modules which use them... Thanks
  2. Hi, I'm playing with my first "fields". I have accented characters : é, è,... to display. I don't really understand how to handle this. Previously I stored them html encoded in my own DB tables, example : "&eacute;v&egrave;nement" (means 'event' in french). Now I want to replace my own PDO SQL queries by PW fields. Do I need to paste html encoded content only within the fields in the admin or will it be encoded on the fly ? Until now I didn't success to view html encoded version of my data through the view source page in the browser, it's displayed as 'é', 'è', I was waiting for "&eacute;" ... I've tried CKEditor and the textarea, I've played with the markup/html - html entity encoder functions with no more success. Any idea ? Thanks
  3. Thanks for your input @owzim, I'm not sure that module is still compliant with PW 3.x but I'm going to see what it proposes (http://modules.processwire.com/modules/template-data-providers/).
  4. Hi, I'm making my first steps with PW, as a training session I'm rewriting an old website -> PW. I used to have a 'lib' directory where I put stuff to include to my php pages (connection file, general application info, etc.), what is the best practice here ? Include that stuff in _general_app_info.php, _other_stuff_to_include.php,... in the template directory ? Thanks
  5. Thanks for the detailed answer @BitPoet ! I'm going to get my hands dirty right away and see how things go. The journey begins
  6. Hi guys, I've just discovered Processwire and I'd like to build my new project on it. It seems PW is the tool I was looking for. It's my first post and I guess many others are coming A few words about me : I live in France, I used to be a php dev (looong time ago), became a MySQL DBA during a few years and now a little less hands-on (except on that project). Speaking of the project, it's the complete rewrite of a game related to motorcycle races (you have to guess the podium in different categories). I have players who sign up, record a prediction for the next Grand Prix, get a ranking according to the precision of their prediction (vs real results). They have a profile page, etc. The frontend is based on data which is updated each Grand Prix (through some pure croned php scripts). The website sends automatically newsletters according to the date (vs the races calendar) and the same goes for the email which warns players their score was updated. It runs for years now. My goal is to reach thousands of players on this new version. I'm not anxious about speed here, I guess it will be ok, and I'll probably be a future client of ProCache and ProdevTools (yes I saw the coupon code :). That also will be my way to support the work which has been done here. Actually I'm rewriting the whole stuff (based on pure Php) and I will host more races next year (more categories, more players, more... everything). I'm interested in PW because I'm looking a modern way to rebuild my website without reinvent the wheel : using all the built-in stuff from PW (routing system, session/authentication, and all what the other modules can offer !). OK, enough for the project Although I've been through some different tutorials and read tons of thread on this forum for the last 3 days... I didn't yet make my mind on the solution to choose : "pure" SQL queries or use the API/pages. As I said before, I'm a DBA, I'm ok with queries and I've already wrote most of them. Actually, I see how to import my tables into the PW's database, so I can directly connect to my old tables (you call that custom tables I think) with the db handler which is passed to every page. I see how to create a template, I see how to choose the ouput strategy, but I have some difficulties to see how to add content to each page. I don't know if I need all this actually. I've read this very useful thread : https://processwire.com/talk/topic/18-how-do-i-import-lots-of-data-into-pages/ from @ryan, who answered a very good question from @jbroussia Technically speaking I understand the stuff but perhaps it's overkill for me. I'm looking for the easiest/quickest solution (I have so many things to code before launch :-/). According to you, can I survive without importing all my data in PW fields by using this way : $result = $db->query("SELECT id, name, data FROM some_table"); while($row = $result->fetch_array()) print_r($row); As I said the DB is updated frequently (each Grand Prix) and each player's score is updated in the same time, that goes for the different categories, well a lot of stuff is moving at each Grand Prix. According to me it should work with template + page using that template but without filling the fields... ? Moreover I'm afraid of losing some PW functionnalities here : Accross my readings I've picked up some quotes which I haven't completely understood, perhaps you can help me on that. - "If you want to present your data at unique URLs, then pages is the way to go.... " (from https://processwire.com/talk/topic/5325-database-table-versus-pages/) - "While it's there and ready for you to use, it's always preferable (not to mention easier and safer) to use ProcessWire's API for accessing any of it's data." - "If you went the pages route, you can also harness the extended power of templates, e.g. using templates to control page access..." (from https://processwire.com/talk/topic/17-functionsmethods-to-access-the-db/ -> I understand it's "easier" to use the API, but why is it "safer" than my own SQL queries ? I still have to sanitize myself any user entries in both case for example no ? -> Won't I be able to control page access if I'm not using the API ? I didn't dig into control access yet, please forgive me if the question is a nonsense. -> What about the uniqueness of URL that is mentionned in my first link ? Well, I think that's enough for a first post and thanks in advance for your answers.
×
×
  • Create New...