Page 1 of 1

Functions to manipulate the DB

Posted: Mon Jul 31, 2017 7:23 pm
by momo
I would like to know what functions i can use to make for example a list of emails or statistics. There is no documentation about this as far as i found. And it is really a pain to search through the kernel on how the DB works, I didnt search very neat to find the DB class anywhere. would be nice to get some explanation about the DB

Re: Functions to manipulate the DB

Posted: Mon Jul 31, 2017 10:07 pm
by Edi
momo wrote: Mon Jul 31, 2017 7:23 pm I would like to know what functions i can use to make for example a list of emails or statistics.
A list of emails... Which emails?

Statistics about what?

Can you please give examples.

Re: Functions to manipulate the DB

Posted: Mon Jul 31, 2017 11:14 pm
by momo
for example if i would like to create some kind of subscription option, where visitors could enter their email to recieve a newsletter

Re: Functions to manipulate the DB

Posted: Mon Jul 31, 2017 11:43 pm
by Edi
Bludit uses different database files. For example for posts and pages or tags. You can find them in the directory /bl-content/databases.

There is no plugin to collect data like email addresses for a newsletter at the moment. But it should be possible to extend the plugin for contact forms.

Anyway, instead of only collect email addresses I would use an external service like MailChimp. With this you do not have to take care of email verification, unsubscribing etc.

Re: Functions to manipulate the DB

Posted: Tue Aug 01, 2017 7:21 pm
by momo
alright, i will try to build a mailchimp plugin, what i would like to know how i could load a class into a plugin

Re: Functions to manipulate the DB

Posted: Tue Aug 01, 2017 8:18 pm
by Edi
You don't need a plugin, you can use a snippet. There is a lot about forms and how to add them in the Knowledge Base of MailChimp:

http://kb.mailchimp.com/signup-forms

Concerning classes it depends... Some classes are set as global, some can be set as global.

The easiest way to make a plugin is to adapt an existing one. There you can see how things can be made.

Re: Functions to manipulate the DB

Posted: Tue Aug 01, 2017 8:43 pm
by momo
i mean what if i try to use an already usable libary within the plugin, is there some kind of autoload? or how can I include a certain framework?

Re: Functions to manipulate the DB

Posted: Tue Aug 01, 2017 9:24 pm
by Edi
I really don't know what you try to do... Please give an example.

By the way, there is a documentation for Bludit at

https://docs.bludit.com