Forums

Need help for creating content with a form

casperb71 19 Aug, 2010
I'm trying to solve the following problem.
I'm trying to build a form that makes normal content.

I build a form on a testsite
http://www.fr-design-testdomein.nl/index.php?option=com_chronocontact&Itemid=56

The data is going to the DB jos_content and that is correct.
However the section and category are not correct and also activating the article is not working.

I'm almost there but I need for the last piece a little bit of help.

If you want to help me, I can make you a adminstrator account for this testsite.

With regards

Fred
GreyHead 19 Aug, 2010
Hi Fred,

Please download the submit_content form from the Downloads area here (it in the Applications folder) and adapt that to do what you need. It has the basic code to set up sections and categories in the OnSubmit box.

Bob
casperb71 19 Aug, 2010
Thanks for your answer and help.
I did already used this form and I configurated into wat I need.
Just missing someone for the finishing touch.

Fred
casperb71 25 Aug, 2010
Is there any one to help me? Just for the finishing touch.
GreyHead 25 Aug, 2010
Hi casperb71,

Here is the code from the OnSubmit After box of the submit-content form. You can set the category & section ids here and, if you want to auto-publish, I think you need to set state to 1
<p><span style="color: #0000ff;"><strong>Thank you for submitting your story, we will review it shortly and if approved it will be published!</strong></span></p>
<p><strong>Cheers</strong></p>
<p><span style="text-decoration: underline;"><strong>ChronoEngine.com team!</strong></span></p>
<?php
$_POST['catid'] = '32';
$_POST['id'] = '';
$_POST['sectionid'] = '9';
$_POST['state'] = '0';
$_POST['created'] = date("Y-m-d H:i:s");
?>


Bob
casperb71 25 Aug, 2010
Hi Bob,

Thanks for your answer and support (I was desperate...)

The code you gave me is not the solution. I set the code in the after mail box.
The mail was already coming in correctly. That was no problem, but the connection from the sections and category's to the database is the problem.

If you want, I can give you a account in the testsite so you can see it your self.
Would you help me?

Wit regards.

Fred
GreyHead 25 Aug, 2010
Hi casperb71 ,

What **exactly** is the problem. (BTW My post has nothing to do with emails.)

Bob
casperb71 25 Aug, 2010
Bob,

The problem is:

I build the form that can make content as a Joomla article.
The fields head, introtext, fulltext are correctly set into the database jos_content.
In Joomla you find that article but somethings are missing:
- the sections and category are not automatic set into the database
- I don't know how to get the pictures into the article.

Fred
GreyHead 25 Aug, 2010
Hi Fred,

The answer to setting the sections and categories is in my earlier post.

Inserting images is not so straightforward but there are posts here telling you how to do it.

Bob
casperb71 25 Aug, 2010
Bob that is my problem. I don't see it. There for I asked for some help.
GreyHead 25 Aug, 2010
Hi Fred,

What don't you see?

Bob
casperb71 25 Aug, 2010
Bob I don't see how to solve this problem. The answer you gave me is not doing what I expected.
Probably is my vision not correct and I need someone who can help me on the correct way.
I think that the most simple way to solve this problem is to give you a account than you can see your self what I did wrong en correct the form. Then you tell me what went wrong and I try to build a new form.
GreyHead 25 Aug, 2010
Hi casperb71,

I'm doing my best here in the time I have. If you aren't able to tell me exactly what the problem is then I'm not going to be able take the time to help you fix it.

I don't see how to solve this problem.

does not help. I need to know what code you've used where, exactly what is happening and what the errors are.


Bob
casperb71 25 Aug, 2010
Hi Bob. No offend bu I explained the situation.

The problem is:

I build the form that can make content as a Joomla article.
The fields head, introtext, fulltext are correctly set into the database jos_content.
In Joomla you find that article but somethings are missing:
- the sections and category are not automatic set into the database
- I don't know how to get the pictures into the article.

GreyHead 25 Aug, 2010
Hi Fred,

Let's just stay with this one
the sections and category are not automatic set into the database
I answered this already today. What have you tried from my post? Exactly what code are you using? Exactly what errors do you get?

Bob
GreyHead 25 Aug, 2010
Hi casperb71,

You go no errors - so everything is OK now?

Bob
casperb71 25 Aug, 2010
No Bob. Thera are no errors, but stil having the mainproblem.

The form dosn't makes the connection with the fields section and category. That is the problem!
GreyHead 25 Aug, 2010
Hi casperb71,

So what values is it setting for the Section and Category Ids?

Bob
casperb71 25 Aug, 2010
Bob,

The fields are named like the field in the DB and also in the table (see picture 2 in http://www.fr-design-testdomein.nl/index.php?option=com_content&view=article&id=49&Itemid=60

However when I save al the green fields in the table, I got the following messages:

Error while creating table :Table 'jos_content' already exists SQL=CREATE TABLE `jos_content` (`cf_id` INT(11) NOT NULL auto_increment, `uid` VARCHAR(255) NOT NULL, `recordtime` VARCHAR(255) NOT NULL, `ipaddress` VARCHAR(255) NOT NULL, `cf_user_id` VARCHAR(255) NOT NULL, `title` VARCHAR(255) NOT NULL, `introtext` VARCHAR(255) NOT NULL, `omschrijving` VARCHAR(255) NOT NULL, `afspraken` VARCHAR(255) NOT NULL, `fulltext` VARCHAR(255) NOT NULL, `foto01` VARCHAR(255) NOT NULL, `foto02` VARCHAR(255) NOT NULL, `foto03` VARCHAR(255) NOT NULL, `foto04` VARCHAR(255) NOT NULL, `sectionid` VARCHAR(255) NOT NULL, `catid` VARCHAR(255) NOT NULL, PRIMARY KEY (`cf_id`)) ENGINE = MYISAM ;

The message that he can't create the table I dont't understand because the form correctly makes a new article with "head" "introtext" and "fulltext" Only those section and category.

The values of the section is 7
The value for the category is 34

We are coming closer.
GreyHead 27 Aug, 2010
Hi casperb71,

Hmmm . . . jos_content is a standard Joomla table (where all the articles are stored). You don't want to be messing with it.

And . . . as it already exists you don't need to create it.

Bob
casperb71 27 Aug, 2010
Bob,

I know how to deal with the database jos_content.
Still I have no answer for the problem.
Do you think you can support me with this problem?
We are communication for some weeks now.

Fred
GreyHead 27 Aug, 2010
Hi Fred,

I still have no idea what the problem is except that something is wrong with the sections and categories. I posted the code to set the section and category ids much earlier in this thread.

I'm sorry, but we can't help you if you can't clearly describe the problem; what code you are using and what results you get.

Bob
casperb71 05 Sep, 2010
The problem is solved.

I don't know what the course was, but I deleted all the old forms, build a new one, and that is working now. The connection with the category, section and state are working. Thanks for your help and I'm closing this thread and going on to expand the form to what I want.
This topic is locked and no more replies can be posted.