Functions to manipulate the DB

Post Reply
momo
Ssr. Bludit
Posts: 12
Joined: Thu Jul 06, 2017 9:43 pm

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
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
momo
Ssr. Bludit
Posts: 12
Joined: Thu Jul 06, 2017 9:43 pm

for example if i would like to create some kind of subscription option, where visitors could enter their email to recieve a newsletter
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
momo
Ssr. Bludit
Posts: 12
Joined: Thu Jul 06, 2017 9:43 pm

alright, i will try to build a mailchimp plugin, what i would like to know how i could load a class into a plugin
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
momo
Ssr. Bludit
Posts: 12
Joined: Thu Jul 06, 2017 9:43 pm

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?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply