What the steps to update to new version and how to put username and email of logged user on the form?
Thanks!
Thanks!
To update, you backup the old forms data like HTMl..etc your self then uninstall then reinstall and redo all configs, sorry but no easier way yet!!
To show logged user data you need this code :
Max
To show logged user data you need this code :
<?php
global $my;
echo $my->username;
echo $my ->email;
?>
Max
Ok!!
Just one more thing, there's a way to only registed users access the form?
Just one more thing, there's a way to only registed users access the form?
Hi Paolo,
The easiest way to make a form 'registered only ' is probably to embed it in a content page and use the standard Joomla! publish controls.
You could do it in ChronoForms - I think - by using some php around your form code like:
This isn't ideal as the form tags that ChronoForms provides will still be output - though not visible. You could perhaps do a neater job using the OnSubmit code boxes.
Bob<br><br>Post edited by: GreyHead, at: 2007/06/26 17:58
The easiest way to make a form 'registered only ' is probably to embed it in a content page and use the standard Joomla! publish controls.
You could do it in ChronoForms - I think - by using some php around your form code like:
<?php
global $my;
if ( !$my->id ) {
echo "Sorry you can't access this form";
} else {
/* Insert your form code here */
}
?>
This isn't ideal as the form tags that ChronoForms provides will still be output - though not visible. You could perhaps do a neater job using the OnSubmit code boxes.
Bob<br><br>Post edited by: GreyHead, at: 2007/06/26 17:58
Allright!
Thankyou very much!!
Sure this is an incredible extension!
Thankyou very much!!
Sure this is an incredible extension!
To update, you backup the old forms data like HTMl..etc your self then uninstall then reinstall and redo all configs, sorry but no easier way yet!!
To show logged user data you need this code :
<?php
global $my;
echo $my->username;
echo $my ->email;
?>
Max
Hi Max,
I tried this, username and name work fine to me, but when it come to email, it give me this...
<script language='JavaScript' type='text/javascript'>
this is what it show in the box rather then the user's email
@.@
got any idea??
Franky
Hi Franky,
In the example I think that Max has an extra space in the email line (I can't find an authoritative answer to the question though).
Try echo $my->email; (no space after $my).
Bob
In the example I think that Max has an extra space in the email line (I can't find an authoritative answer to the question though).
Try echo $my->email; (no space after $my).
Bob
Hi Bob,
I realised that as well... I try both and the result is the same =.=
very very strange...
did I ran over a black cat or something
?.?
Franky
I realised that as well... I try both and the result is the same =.=
very very strange...
did I ran over a black cat or something
?.?
Franky
Hi Franky,
Just to catch up. Where are you putting the $my->email code. I'll try and replicate it on my system here.
Have you looked in the database to make sure that the user has a valid e-mail address (they should have but mistakes can slip through).
Bob
Just to catch up. Where are you putting the $my->email code. I'll try and replicate it on my system here.
Have you looked in the database to make sure that the user has a valid e-mail address (they should have but mistakes can slip through).
Bob
Franky,
You can use this :
Now use $useremail to show the current logged in user's email.
Max
You can use this :
<?php
global $database,$my;
if($my){
$database->setQuery("SELECT email from #__users WHERE id ='".$my->id."'"«»);
$useremail = $database->loadResult();
}
?>
Now use $useremail to show the current logged in user's email.
Max
Hi Bob,
Thx for your reply,
I try to put that bit of php on top and it still doesnt work... but strangely it work if the form is stand alone. I mean when I click the form link in form manager, it will open the form in a new window without my pic which can be open by multithumb, it work just fine... is there some crash between them???
here is the code I put it.
Franky
Thx for your reply,
I try to put that bit of php on top and it still doesnt work... but strangely it work if the form is stand alone. I mean when I click the form link in form manager, it will open the form in a new window without my pic which can be open by multithumb, it work just fine... is there some crash between them???
here is the code I put it.
Franky
<style type="text/css">
@import url(templates/css/template_css.css);
</style>
<?php
global $database,$my;
if($my){
$database->setQuery("SELECT email from #__users WHERE id ='".$my->id."'"«»);
$useremail = $database->loadResult();
}
?>
<div class="cformbg">
<div class="cform">
<div class="cform">
<span class="cforml">Name:</span>
<span class="cformr">
<input name="name" type="text" value="<?php echo $my->name; ?>" id="name" size="30" maxlength="100">
</span></div>
<div class="cform">
<span class="cforml">eMail Address:</span>
<span class="cformr">
<input name="email" type="text" value="<?php echo $useremail; ?>" id="email" size="30" maxlength="100">
</span></div>
<div class="cform">
<span class="cforml">Business:</span>
<span class="cformr">
<input name="business" type="text" id="business" size="30" maxlength="100">
</span></div>
<div class="cform">
<span class="cforml">Address:</span>
<span class="cformr">
<input name="address" type="text" id="address" size="30" maxlength="100">
</span></div>
<div class="cform">
<span class="cforml">Town:</span>
<span class="cformr">
<input name="town" type="text" id="town" size="30" maxlength="100">
</span></div>
<div class="cform">
<span class="cforml">State: </span>
<span class="cformr">
<input name="state" type="text" id="state" size="5" maxlength="10">
</span></div>
<div class="cform">
<span class="cforml">Postal Code: </span>
<span class="cformr">
<input name="postcode" type="text" id="postcode" size="5" maxlength="10">
</span></div>
<div class="cform">
<span class="cforml">Country: </span>
<span class="cformr">
<input name="country" type="text" id="country" size="15" maxlength="30">
</span></div>
<div class="cform">
<span class="cforml">Contact Phone No: </span>
<span class="cformr">
<input name="contact no" type="text" size="10" maxlength="15">
</span></div>
<div class="cform">
<span class="cforml">Model Name or No: </span>
<span class="cformr">
<input name="model" type="text" id="model" size="30" maxlength="50">
</span></div>
<div class="cform">
<span class="cforml">Enquiry/ Question: </span>
<span class="cformr">
<textarea name="enquiry" cols="30" rows="5" id="enquiry"></textarea>
</span></div>
<div class="cform">
<span class="cforml">Enter Code: </span>
<span class="cformr">
<?php if(!$my->id) ?>
{imageverification}
</span></div>
<div class="cform">
<span class="cformbtn"><input type="submit" name="Submit" value="Send">
</span></div>
</div></div>
Hi Franky,
Actually that last reply was Max late last night.
So it works OK from the link - that's just a Joomla page with the form in it.
How are you using the form when it doesn't work - with the mambot?
Can you let me have access to the form pages to look at the source code - you have my e-mail.
Bob
Actually that last reply was Max late last night.
So it works OK from the link - that's just a Joomla page with the form in it.
How are you using the form when it doesn't work - with the mambot?
Can you let me have access to the form pages to look at the source code - you have my e-mail.
Bob
Hi Bob,
I changed your group to admin, you should able to login now
thx buddy
Franky
I changed your group to admin, you should able to login now
thx buddy
Franky
Hi Franky,
Now I can see what's happening. There's a JavaScript e-mail protector that is replacing the e-mail address with a script. What's showing in the field is this:
Later: this is coming from the mosemailcloak mambot. I've turned it off on your site and the e-mail now shows up correctly.
Bob<br><br>Post edited by: GreyHead, at: 2007/07/10 17:43
Now I can see what's happening. There's a JavaScript e-mail protector that is replacing the e-mail address with a script. What's showing in the field is this:
<script language='JavaScript' type='text/javascript'>
<!-- var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '=';
var addy47319 = 'bob' + '@';
addy47319 = addy47319 + 'bobjanes' + '.' + 'com';
document.write( '<a ' + path + '\'' + prefix + ':' + addy47319 + '\'>' ); document.write( addy47319 );
document.write( '<\/a>' ); //-->\n
</script>
<script language='JavaScript' type='text/javascript'>
<!--
document.write( '<span style=\'display: none;\'>' );
//-->
</script>
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
<script language='JavaScript' type='text/javascript'>
<!-- document.write( '</' );
document.write( 'span>' );
//--> </script>
Later: this is coming from the mosemailcloak mambot. I've turned it off on your site and the e-mail now shows up correctly.
Bob<br><br>Post edited by: GreyHead, at: 2007/07/10 17:43
Thank you Bob!!!
:lol:
:lol:
This topic is locked and no more replies can be posted.