Add user to database?

16 years 10 months ago #944 by ravage
Hello Emir,

First of all, thanks for Vodes.
I use Vodes on my site and it's working like a charm :)
And although I am a php newbie, most of the vodes code was clear to me.


However, I am struggling with 1 thing.
When a new user does a signup, I want to add him automatically to vodes_credits (with 10 credits) , but cant figure out how to do this.
I looked through the vodes.php millions of times and think that it must be there somewhere between line 248 and 277.
(All I get is empty database fields with that piece of code, it's working perfect with paypal though))

I know the purpose of Vodes is to implement it yourself, but I hope you can give me a hint?

Thanks,
Ravage

Please Log in or Create an account to join the conversation.

16 years 10 months ago #951 by Saka
Well if you want to add credits to users on signup you would have to trigger it from the core registration component.

So just add the code to add credits somewhere in registration.php

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

16 years 10 months ago #952 by ravage
Hello Emir,

Thanks for your reply.

I am trying just that.
But maybe I was not clear with my previous message.

A new user does a signup on my site.. ( I use Community builder for that).
After that signup, the user isnt added to the vodes_credits table by default.
I can add that user manually in the backend, but want to add new users automatically in the _vodes_credits table.

I know that vodes can do it with a paypal payment, so I looked at this part
in vodes.php and concluded that it must be this part?
} else {
                            $query = "INSERT INTO #__vode_credits VALUES (
                                '',
                                '$row2->id',
                                '$credit'
                                )";
                            $database->setQuery($query);
                            $database->query();
                        }

But when I add (and more from the paypal part) this to the registration core, only an empty field is added.
So now I hope you can give me a hint about what I am doing wrong.

(btw , when I just add the code to add credits, No user is made in vodes_credits)

Thanks,
Ravage

Please Log in or Create an account to join the conversation.

16 years 10 months ago #953 by Saka
Then you are doing something wrong. That's the hint and the way it should work.
I can't give you exact code and debug it for you, no time for that. It something that's done on custom bases for a fee, sorry.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

16 years 10 months ago #956 by ravage
Hello Emir,

Well thanks anyway, I will try harder.

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch