Forums

[ok finish]user connect

stylo 13 Oct, 2010
Hello,
I look good on your forum but nothing works. Here I use version 3.1 of ChronoForms. Here is my problem:
I have a joomla site, and a form accessible to people connected. And I want without asking the name of the person, retrieve this information in the email sent me the form. I found a lot of code but I never understand where to put it in ChronoForms. Often noted to put at the beginning of html, so I open my form and that's what I do, but it does not work. Have you a solution, perhaps with a print screen because I speak English and it is not easy even with the translation button to find the answer to my problem. That is the code I found the closest to my problem http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=17112&p=46999&hilit=user+connect # p46999 or search with the words ...
I also found the code of one of your tutorial but nothing works
<?php $user =& JFactory::getUser();
?>
<input type= 'hidden' name='id' value='<?php echo $user->id; ?>' />

or
$user=JUser::getuser() ;
$username= $user->username ;

Thank you very much p
stylo 13 Oct, 2010
I also did lots of research GetUser but I find only answers for chronoconnectivity. I recall what I want is to get my form ChronoForms in the name of the person logged instead of the question again. Thank you
GreyHead 13 Oct, 2010
Hi stylo,

The code you have here should work OK. When you say it doesn't work what happens exactly?

Try this in the OnSubmit Before Box:
<?php
$user =& JFactory::getUser();
if ( $user->id = 0 ) {
  $name = 'guest';
} else {
  $name = $user->name;
}
JRequest::setVar('name', $name);
?>
Then add {name} in your email template like:
Dear {name},


Bob
stylo 13 Oct, 2010
you're the best, I finally saw where to add the 2 codes.
Thank you thank you thank you
stylo 14 Oct, 2010
Hello,
in fact I still have a problem to access this form, individuals must be logged into the extranet joomla, she completed the form and sending. The problem is that when it also wants to go to the forum Kunena also accessible to people connected, well it said, only accessible to registered, please register to access it, while the account is created. So I try to disconnect me, and I can not either. What it may come from. Whereas if I delete the code that you gave me everything works fine?
"Members Only
This forum is open only to registered and connected.
If you are already registered, login first."

Thank you in advance.
GreyHead 14 Oct, 2010
Hi stylo,

Sorry, I've read your post several times but I still don't understand the problem :-(

Bob
stylo 14 Oct, 2010
when I put the codes you gave me in the right place, I receive my good name in the mail, but I can not disconnect from my frontend. When I click logout, it does not do anything.
Is this clearer?
Thank you for your help
GreyHead 14 Oct, 2010
Hi stylo,

Thanks, I understand . . . but there is nothing in the code I posted that will affect your ability to logout (or anything else much at all).

Bob
stylo 14 Oct, 2010
ah, yet I'm testing on several sites and it does not work. once
<? Php
$ User = & JFactory:: getUser ();
if ($ user-> id = 0) {
  $ Name = 'guest';
Else {}
  $ Name = $ user-> name;
}
JRequest:: setvar ('name', $ name);
?>

in "On Submit code - before Sending email:
(May contain PHP code with Tags) "as soon as I send a test form I can not log in anymore

Of course I put {name} in the "email template"
GreyHead 14 Oct, 2010
Hi stylo,

My apologies :-( This line
if ( $user->id = 0 ) {
should be
if ( $user->id == 0 ) {


Bob
stylo 14 Oct, 2010
I have no luck still does not ca
Now even before sending the form I just do not disconnect me
stylo 14 Oct, 2010
AC does not change despite all the tests as soon as I go once on the page containing the form ChronoForms then sent, without the little I do I log out.
GreyHead 14 Oct, 2010
Hi stylo,

Please copy and paste the code you are now using here so that I can see it.

Bob
stylo 14 Oct, 2010
<?php
$user =& JFactory::getUser();
if ( $user->id == 0 ) {
  $name = 'guest';
} else {
  $name = $user->name;
}
JRequest::setVar('name', $name);
?>


and
vient de {name},
stylo 15 Oct, 2010
i have only my problem
I don't anderstand
GreyHead 15 Oct, 2010
Hi stylo,

I don't understand either. That looks OK.

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
stylo 15 Oct, 2010
send mp
Thank
GreyHead 15 Oct, 2010
Hi stylo,

Fixed: there was a copy of my code including the error in the Form JavaScript box.

Bob
stylo 15 Oct, 2010
it works great, but you qu'appels the javascript box?
Thank you very much for your help
stylo 15 Oct, 2010
it's good I just had the answer by my manager, was the js code in email template.
So a big thank you
Good weekends
Stylo
This topic is locked and no more replies can be posted.