Forums

Display data from one record on a webpage

Bandola 12 Feb, 2008
I am thinking of using Chronoforms (excellent component!) to display ads. I have a collection of job candidates registrered at our site, we use Commuity Builder.

Now I want employers to post their ads with a form. When we see an ad that we think might be suitable for some of our members we want to show submitted information on a webpage. Then we can send the URL to the candidate(s).

Something like this:
Mail to candidate: There is a job that might be interesting for you. Read more here (url)

When they click on this link the should be able to see the ad on a webpage within our site.
- Heading
- Text
- Contact
- etc.


This page is built on the data from one of the records in the database.

I would be very happy if this was possible!πŸ™‚
Max_admin 12 Feb, 2008
Hi Bandola,

Yes, this is possible with the new profile plugin, here are the steps for you :

#1- create a form which will be the template for your candidate, I guess it should be something like this :
Job Title : {job_title}
Job desc. : {job_desc}
as you can see, text inside {} is the table columns names, you will need to know them by looking at your table structure at the database!

now for the configuration of the profile plugin, save the form, then at the forms management page, check the form checkbox and click the Profile page icon at the top right, you will have 3 fields to fill in:

#1- Table name : select the table which will be queried to get the data!

#2- REQUEST Parameter name : enter the parameter name which will come at the URL of your candidate, I guess you will send a link to your candidate with something like this :
http://www.chronoengine.com/index.php?option=com_fireboard&func=view&id=5646

as you can see above there is a parameter called id to define the number, so in your case you will add the parameter name, in the url above its "id"

#3- Target field name: this is the field name at the database, like the table primary column or whatever uniques the database record to be selected!

Sincerely,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandola 12 Feb, 2008
Thank you Max!

Since I am a beginner to Chornoforms I need to have a little more explanation...

Do I first create a input form that collects the data and then this "output"?

Do I add "Job Title : {job_title} etc" under the From Code/Form HTML-tag? Or where else? I am used to copy/paste forms from my HTML-editor so this is a little confusing.

The only way to find the column names in the database is by phpAdmin?

If you could please explain all this I would be very glad.:)
GreyHead 12 Feb, 2008
Hi Bandola,

I'm pretty certain that what you want is possible.

Max has replied using the new PlugIn feature in ChronoForms 2.3.8 which you probably don't have installed. I'm not yet clear enough about how this works to knwo if its a good answer for you though.

You can create a link that includes the job id, then you'd use a ChronoForms Form to read the id, look up the database table and display the results.

Bob
Bandola 12 Feb, 2008
Hi Greyhead!

Thanks. I can struggle with the plugin. I found the 3 parameters he was mentioning.

What confuses me is that Max wants me to create a form : Job Title : {job_title}, Job desc. : {job_desc}. Can you explain this a little better? I thought I only could use < >-elements here.
Maybe this is basic stuff, but I don't understand really.

I need
- one form for the employers to use for posting a job
- one template that will display the results from one record
Right?:dry:

If you could give me a simple example that would be very helpful!<br><br>Post edited by: Bandola, at: 2008/02/12 16:46
GreyHead 12 Feb, 2008
Hi Bandola,

I don't know either - perhaps it's a way to build a new PlugIn; I haven't had time to look at the mew release properly yet.

Bob
Bandola 12 Feb, 2008
Ok, thank you anyway.

Hopefully Max will reply on this and clearify his example earlier in this thread.
Max_admin 13 Feb, 2008
Hi,

I was talking about the template only, didn't mention anything about the form to store the jobs which should be very easy, just a normal form and a table created using the built in "create table"!!πŸ™‚

So my steps above is for you to create the template with the plugin which is the new thing recently, the job posting is just a simple form, do it after watching the tutorials!πŸ˜‰

Cheers,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandola 13 Feb, 2008
Hi Max. I think I am close to a solution now. But I need some more help. This is what I have done so far.

I have created a simple form (Post_AD) with two input fields:
Headline and Description. I have create a table with these two fields.

I have posted and ad from the frontend:
Headline = Ad 1, Description = Description 1
I have checked in the backend and this record is saved.

I created a new form - Template, for showing the data.
In the Form Code field I wrote:
Headline : {Headline}<br />
Description : {Description}


I checked the form Template and clicked on Profile Page-icon.
1, I selected the correct db table, (checked that with myphpadmin)
2. REQUEST parameter name. This is tricky. I just typed in "ID" here
3. I entered the primary key here. "cf_id". I got that from the database, phpadmin again.

I saved these settings and opened the Template form:
http://www.mysite.com/index.php?option=com_chronocontact&chronoformname=Template
and added "ID" and "1" cause I want to display the first record.
http://www.mysite.com/index.php?option=com_chronocontact&chronoformname=Template&ID=1

The result:
Headline : {Headline}
Description : {Description}


Why isn't the values displayed here? Any ideas?
GreyHead 13 Feb, 2008
Hi Bandola,

No consolation but I just followed through the steps and get the same result as you do. We're missing an important step here . . .

Bob
Bandola 13 Feb, 2008
Yes Bob. I hope Max will lead us to the lightπŸ˜‰ He was sure this would work.
Max_admin 13 Feb, 2008

I created a new form - Template, for showing the data.
In the Form Code field I wrote:
Headline : {Headline}<br />
Description : {Description}

I checked the form Template and clicked on Profile Page-icon.



Between those 2 steps, you will need to open the "plugins" tab at the template form and check the "profile" plugin, this way the plugin will load on the form startup!!πŸ˜‰

So you need now to do this and re save the form then all should be fine!

Sincerely,

MAx
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandola 13 Feb, 2008
It Works!!!πŸ™‚

I can't tell you how happy I am for this. Thanks Bob and Max!
This feature will be perfect for our (and others websites).
jimboyr 15 Feb, 2008
Hi,

Does this plugin exist in the 1.5 version? I am having trouble following along here. Thanks to your help yesterday I solved the verification issue and the upload file type - although the admin interface still displays "array" in file type field

The last thing I need to be able to show in my prototype is the ability to display the info entered in the form as a confirmation page. I can see from the auotgenerated code that I could use the SQL and change it from INSERT to SELECT - but I don't have a way of getting at "last update" for the record IDand therefore i can't pass a record ID via the statement.

How does this work in 1.5?

James
GreyHead 15 Feb, 2008
Hi James,

Not yet, the 1.5 version is still a couple of releases behind. Max is working on a new release now that should bring the two back into line. (There were some code problems with Joomla 1.5 that have been particularly tricky to resolve.)

There is a code hack to fix the Array problem, let me know if you need me to find it for you.

To show form info in a confirmation page you can put the page html into the OnSubmit after email box and use <?php echo $_POST['field_name']; ?> to show the info.

Note: some field values may need more complex code than this but it's still possible.

Bob<br><br>Post edited by: GreyHead, at: 2008/02/15 15:35
Bokis 16 Feb, 2008
I want to do this dynamically. When a user log in I want to get the user details from chronoform table.
Is that possible?
GreyHead 16 Feb, 2008
Hi Bokis,

Yes sure is. Just make sure that you can identify the user. Probably easiest is to put there userid into a hidden field on the form and store this in the database table.

Bob
Bokis 25 Feb, 2008
I'm sorry if I sound stupid, but where can I get the userdi?
GreyHead 25 Feb, 2008
Hi Bokis,

<?php
global $my;
if ( $my->id ) {
 $userid = $my->id;
}
?>
NB if $my->id is not true then the user isn't logged in.

Bob
Bokis 26 Feb, 2008
Thank you Bob,

How do I get the relation right between $userid and the Chrono Form table?

I use Chrono Form for registrations.
GreyHead 26 Feb, 2008
Hi Bokis,

If you are using ChronoForms for registrations to your Joomla site then use the new Joomla Registration PlugIn. You just need to tell it which fields on your form match up with the Joomla registration fields.

I'd set the form up like this
<?php
global $my;
if ( $my->id ) {
 echo "You are already logged in";
} else {
 . . . show registration form here . . .
?>
Bob
Bokis 26 Feb, 2008
Yes I've done that. But how can I show the rest of the values from the ChronoForm table based on "$my->id" ?
GreyHead 26 Feb, 2008
Hi Bokis,

You can use the Profile plugin to link to the table.

Or write a little SQL to read the table

Or, if it's data from the Joomla registration table then use $my->name $my->email etc.

Sorry if this sounds vague, there are three or so similar conversations at the moment and I lose track of whose said what exactly.

Bob
Bokis 26 Feb, 2008
I'll go with the SQL thing ;-) and it works great!

But now I recognized another thing.

In the registration plugin I put email as username. When it is stored in joomla_users-table it cut's off the last letters. It seems to accept 25 letters. Has this something to do with the registration plugin?
This topic is locked and no more replies can be posted.