Forums

Post registration and sending form as an article

cmatte 02 May, 2009
Hi there,
I'm new to the Joomla and ChronoForms and I'm finally working for a serious website!
Seeing the infinite😲 possibilities given by CF 8) I've tried all day long, yesterday, to understand and get to a solution to use ChronoForms to make a telephone operator login to the website and compile a form with answers got from the users. Users phone to propose topics to talk about or problems noticed. The form logs various informations about the user and the operator asks the user if s/he wants to register to the website too (radio button), using a chosen username, to let s/he come to the website and participate. All this would have been easier if we had Joomla alone but we have a phpbb3 forum where users can pose problems in the way they want and also any article is put there by a bot to incentive this. Phone operators would be useful to let also non-internet-friendly users get in touch with us, eventually recontacting the user if s/he doesn't use the website. We are using the component JFusion to integrate Joomla and phpbb3. It basically works disabling Joomla registration and making it possible only by phpbb3(which is the master) and synchronizing both the user databases on registration/login.

Oh my god, how long I am, sorry, I go straight to the point!!

What I would want to do with Chronoform is:
[list=1]1)provide the form to be completed to the phone operator (done), letting operators (authors of Joomla) only see and compile them (I think about the watchman plugin, I've read there should be a fixed version soon, right?);[/list:o]
[list=2]2)if users want, let them be registered to the system, using username, name and birth date as password. I can't do this with the Joomla registration plugin because registration MUST be disabled due to a JFusion's requirement. Is it possible to get this by sending post datas to the forum registration page? This way everything should go right, I think about a possible double nickname and about email verification.[/list:o]
[list=3]3)in any case, send -some- of the data (I want to toggle strictly personal ones) to an article we have to approve for publishing, with as author the operator logged in and with created_by_alias the name of the user and[/list:o]
[list=4]4)send -all- the data by email to a container(done)[/list:o]

Could you help with point 2 and 3?
About point 3, I've worked hard with the submitcontent file in the download area, it works as it is, but trying to modifying it I don't get to understand how text data are sent. I managed to get a first page with the form and a second confirmation page with the wysiwyg editor already containing the previous well-formatted data to be sent as an article and letting the operator write the text of the problem. All the final content in the editor of the confirmation page is an isolated form and I see with FireBug there are all the hidden forms of the previous page. If I go on and submit the correct message comes but no article is added. I see the autogenerated code is completely different (includes all the hidden fields that aren't needed for the article), and I've also seen it can't be modified by the gui. I've managed to modify it by phpmyadmin and rendered it the 'old' submitcontent one with no lucky results (nothing added)...

SORRY for this poem...and thanks for your help and great work!
GreyHead 03 May, 2009
Hi cmatte,

A big project yu have there!

1) There's a bug-fixed version of Watchman in the RC5.0 release of ChronoForms out today. But Watchman may be overkill for your needs - you can just put a couple of lines of PHP at the start of the form html to check the user->gid.

2) I have no idea - doubtless it's possible but the PHPBB3 forums are probably the place to start. Or, if it's not too late you could switch to RokBridge (used here I think) which allows bi-directional registration syncing.

3) You can do with the submitcontent.cfbak form which is in the Downloads area. You'll need to write the code to aggregate your data into the standard article content format.

Good luck

Bob
cmatte 03 May, 2009
Thanks GreyHead.
How lucky I was, a new version just today :mrgreen:

I'm trying the watchmen plugin and I still have some problems.
It seems to work (ie redirect on wrong user) but:
I see a strange
date("w"): 0
writing on the beginning of the form.
When it is active, all the website layout goes mad (mainly all the website goes under the form!?).
I don't get any redirection message (I set it) if the user is the wrong one, just the silent redirect. I'm using JA Purity and I don't see any section that let me enable system messages...

Some ideas?

About the sumbitcontent application, I thought to add
$user = JFactory::getUser();
$_POST['created_by'] = $user->id;
under the php part of "On Submit code - after sending email", would this actually set the userid to the Joomla one?

About registration, I think jfusion too provides bidirectional sync, the problem is I get the Joomla message about a disabled page, is it because the registration is disabled, or does the plugin work with the db directly?
I also see there's a new CURL plugin, I think that could solve some of my problems. Let me understand, could I get article sending by it, letting it "compile" the joomla form? Then I could work on registering an user @ phpbb3 with db connection...correct me if I'm wrong.

Many thanks for your efforts.
Max_admin 03 May, 2009
Hi cmatte,

for the watchman questions, please wait for Bob's answer, he is the author of Watchman and knows more than me about it!🙂

regarding changing the created by, this code is fine, you can also use:

JRequest::setVar('created_by', $user_id);
instead of your 2nd line!

I didn't try JFusion, we use rokbrodge and it has a serious problem, not all users are on the Joomla users table and not all of them are on the forums users table, so Rokbridge syncs logins but not the real users accounts, which may be a problem if you need all the users in one place, please do your research, I may be wrong or missed something, feel free to let me know about any ideas!

the Joomla registration plugin uses the JUser class and the Joomla global settings to add a new user not only writing to the users table a new record!

you can use the CURL plugin to post data to any URL, including a Chronoforms URL to do some routine you have!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
cmatte 03 May, 2009
Thanks, I managed to get article posting work with a first page asking all the data and a confirmation one putting them together in (another) editor for publishing only the ones I want to, written in a different layout! Wow, I didn't think I could get this working :mrgreen:
Thanks for your suggestion, that's another interesting way to do things I know now! In case it helps someone else, I also changed date(..) to gmdate(..) as it saves the correct gmt date, otherwise Joomla applies the fuse two times.

Well, so now I've got to work with registering.

About the bridge, I had seen and tried rokbridge before on another website, as many posts on the net suggest it, but on the go I didn't like it. I remember I've read somewhere it doesn't do things very cleanly. I've read it had problems with the Joomla/forum licenses, because it went to hack their code somehow not fair, and they had to change its fundamentals. JFusion instead points on the fact it doesn't modify any code, and it actually creates and syncs users on both the tables (I've just checked for sure😀 ) together with all their data. It has a well-done login checker which shows this, and many kind of configuration for the master and slave software(mainly master has reg on and slave hasn't) and some plugins to use other softwares like galleries etc too, everything synced! It does dual login both the ways (one can log into phpbb3 OR joomla and get always logged in on the other one) and so is with the logout. When I tried rokbridge instead I remember it wasn't 100% dually working. JFusion also has some modules I like so much, as another user_activity one which sends the user to the correct pages and shows the avatar, one to show last forum posts on the portal, one to send&update articles from the portal to the forum, and so on. Well, I feel like an AD now lol :mrgreen:

Let's go back to the registration problem. Well, I can't use Joomla so, JFusion obliges me get its registration closed if I want to use the phpbb3 one which I like a lot more. But I could use CURL to do the post within the phpbb3 reg page. The only problem is the image verification...and I wouldn't want to disable it. Is there some way to get the image in the form and let the operator give the code?

P.S. Three problems I found in the new Chronoforms (premise: watchman is OFF, I'm only using confirmation page actually):
*there's some kind of problem with the email settings, in some cases they prevent you to save/apply changes! It could be it has something to do with the email template. I was trying to blank it to get it generated again and every time I couldn't get to save the blank template. One time I tried to add a simple "!" in the template and immediately the buttons worked again. Unfortunately they also got the name of the form BLANK, and I had to change it within the db to work with it again :?
*I sometimes get a

You are not allowed to access this URL

message on the chronoform, randomly, I'm worried this will prevent operators to accept calls sometimes. Why does it do so?
*If I open chronoforms component from the home with no options, not only it gives the normal message saying there's no form with that name, but it also generates a RED line before the message, saying

LOADING FAILED::Plugins Class

don't know what it is!

Thanks.
Sorry again, when I start writing is a pain, I know...

p.s.s. your code for the userid doesn't work, I went back to my one, don't do this joke again please hehehe :mrgreen:
Max_admin 06 May, 2009
Hi cmatte,

Its good to know that JFusion works better than the rokbridge when adding the users to the system, I should look at it!

regarding the registration/CURL/phpbb3 problem, may be you can get hack phpbb to get the image code somehow ? you have the code so you sure can hack it!

Regarding your 3 problems:

#1- how can I reproduce this one ?
#2- I'm already looking into a fix!
#3- what do you mean by loading it from the "home with no options" ?

Regards,
Max

P.S: my code should work, I was not joking 😀 I will try it!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
cmatte 06 May, 2009
Thanks Max.
I think for now I've postponed the registration idea.
I'll see if I can simply add users to the phpbb3 table with another chronoform called from the first one, with the curl.
The fact with phpbb3 is I can't get it to work. I always get the registration page from the form, the one with the contract to accept, and I can't let it go on. The fact is the page is the same, it only sends a (post?) when one accepts the contract and I can't let it work.
By now sending an article the way I've done is enough, operators could do the registration thing by themselves for example, that's what they're payed to do, work :mrgreen:
We'll see what we can do.

About
1) you can simply do a form with no email settings with 'Email the results ?' in the general tab set to yes. Then you save and open it again and you add the email settings (to,from,name,subject). You apply, you go to the email template which is empty, and you will not be able to apply nor save now!
2) thanks! I didn't see it again anyway! And I added some personal code to check the gid and let not allowed users not see anything :mrgreen:
3) it's a stupid and non-useful thing, exactly I meant opening index.php?option=com_chronocontact.

Another problem I have is described in another thread, it's about a


        * LOADING FAILED::CustomCode Class

appearing on the beginning of my form if I load the editor, which I changed to JCE and not the included one tiny_mce.

P.S. the code doesn't work, for real! Don't ask me why, I don't really know, but I simply didn't find the right uid after using that code for sending an article!
Gatsu000 07 May, 2009
I am having this same problem when trying to save a blank email template the apply and save buttons simply dont work
GreyHead 07 May, 2009
Hi cmatte, Gatsu000,

I can't replicate the 'blank template' problem. Both buttons work Ok and I get a new default template created.

Bob
Max_admin 08 May, 2009
Hi cmatte, Gatsu000,

Which browser ?

@cmatte,

I think that there is some code to do some phpbb3 functions at the phpbb3 site, like inserting posts or users but you need to include some classes!

#1- I tested this and got the same results as Bob, its working fine, I had no form code though!
#3- I see this, the class was not behaving correctly when no form name is loaded, I fixed this in the coming version!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bullfn33 25 Jul, 2009

In case it helps someone else, I also changed date(..) to gmdate(..) as it saves the correct gmt date, otherwise Joomla applies the fuse two times.



I'm getting the same thing with the watchmen plugin but where do you change this? I'm seeing this in my date field setting:

Date Fields Settings
Date Format: d/m/Y

Date Fields names:
E.g: date_1,date_2

Date Fields extras: classes: ['dashboard']

GreyHead 26 Jul, 2009
Hi Bullfn33,

Sorry, I can't tell from this what problems you are having.

The Watchman plugin has no particular link to the DateField settings?

Bob
Bullfn33 26 Jul, 2009
Bob,

Sorry. A post from cmatte in this thread above.
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=14153&p=37827#p31323
[quote]I'm trying the watchmen plugin and I still have some problems.
It seems to work (ie redirect on wrong user) but:
I see a strange
    date("w"): 0

writing on the beginning of the form.[/quote]

cmatte's next post provided an answer.
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=14153&p=37827#p31356

In case it helps someone else, I also changed date(..) to gmdate(..) as it saves the correct gmt date, otherwise Joomla applies the fuse two times.



I'm getting the same little code appearing on the top of my form:
[code] date("w"): 0[/code]

I'm trying to understand, where did he change date(..) to gmdate(..) to get rid of it? I thought it might be in the Date Fields Settings.

thanks
cmatte 27 Jul, 2009

Bob,

Sorry. A post from cmatte in this thread above.
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=14153&p=37827#p31323
[quote]I'm trying the watchmen plugin and I still have some problems.
It seems to work (ie redirect on wrong user) but:
I see a strange

    date("w"): 0

writing on the beginning of the form.[/quote]

cmatte's next post provided an answer.
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=14153&p=37827#p31356

In case it helps someone else, I also changed date(..) to gmdate(..) as it saves the correct gmt date, otherwise Joomla applies the fuse two times.



I'm getting the same little code appearing on the top of my form:
[code] date("w"): 0[/code]

I'm trying to understand, where did he change date(..) to gmdate(..) to get rid of it? I thought it might be in the Date Fields Settings.

thanks


Hi Bullfn33,
I'm receiving the notifies of the updates of this thread so I hope I can help, for what I still remember about the problems mentioned.
Well, I think the problems are separate.
The workaround I describe about substituting the date function with the gmdate function is because of a problem with the fuses that added another +1h making the final date of the form compilation wrong. To be sincere, I don't remember where I did the substitution right now and I see your problem is different, but if you need to know this too, let me know so I can check out what I've done in my code.

Well, about the code appearing on the top of the form, I think I could have simply solved in two ways:
*don't using the user redirection option. I simply manually added a php function containing all the code which disallows the access at the form by wrong user groups (you can do the same with precise users by getting their ids);
*calling the form only by an "external link" in Joomla, i.e. /index.php?option=com_chronocontact&chronoformname=formname and not with the options created by Chronoforms.

Hope one of these helps :wink:
GreyHead 27 Jul, 2009
Hi all,

The code at the top of the form is a bug (I left in a debug line). I've posted a fixed version before and have added it to this post.

The other - separate - issue is about time zone adjustment. If I understand correctly cmatte is saying that using date() in the Watchman means that Joomla applies a double time-zone correction and that using gmdate() in place of date() fixes that. gmdate() gives the date in GMT instead of the server time.

TimeZones are messy at the best and I've no idea which is better or how they interact with the Joomla time-zone setting.

If you want to make this change date() is used three time between rows 260 and 266 of the plugin file. The first two are used to check the day of the week and the third to check the open and closing time.

Bob
cmatte 27 Jul, 2009

The other - separate - issue is about time zone adjustment. If I understand correctly cmatte is saying that using date() in the Watchman means that Joomla applies a double time-zone correction and that using gmdate() in place of date() fixes that. gmdate() gives the date in GMT instead of the server time.

TimeZones are messy at the best and I've no idea which is better or how they interact with the Joomla time-zone setting.

If you want to make this change date() is used three time between rows 260 and 266 of the plugin file. The first two are used to check the day of the week and the third to check the open and closing time.



Well, that's exactly the problem, but I doubted I did change something in the Chronoforms source code, in fact I've just checked and I was referring to the variables I've put in "On Submit code - after sending email: (PHP code with tags)", precisely
$_POST['created'] = gmdate("Y-m-d H:i:s");
that I use to save the form as a Joomla! article. So, no need to change Chronoforms code, don't do it, the "bug" (if we can call it this way) lives only in this particular situation, so it has nothing to do with the rest of the code!
GreyHead 27 Jul, 2009
Hi cmatte,

Excellent - I understand that perfectly. :-)

Thanks
Bob
This topic is locked and no more replies can be posted.