php NEWBIE tries [unsuccessfully] to use ocf_make_member API.
Hello! I have tried to write my very first PHP script that create users in the ocPortal database utilizing the ocf_make_member function (included in sources/ocf_members.php) and am getting nowhere. bleh. Well, I did manage to figure out how to pull the user info I currently have from a cvs file but when I call the ocf_make_member function the script just stops. No message. Nothing. Below is a copy of the script and I am hoping someone - anyone - out there might show me the way (to do this correctly) because I definitely don't want to manually input nearly a thousand accounts.
ocPortal has a lot of start up code that needs to run before anything else, so it's not as simple as just requiring the file that contains the function. The easiest thing to do is to remove the first include line, and put the lines of PHP code into the only function in data_custom/execute_temp.php. Then call up that script by URL. That script's designed for running temporary code into an initialised ocPortal environemnt.
If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
If so, please let others know about ocPortal whenever you see the opportunity.
If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.