|
Create new.php
|
| Vyper69 |
Posted on 16-07-2012 17:08
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
Ok what I am trying to do is create a new .php, so when registration is finished, I can redirect them to this page, instead of the main page, then once they submit this info, they can redirect to the main page. but I have no idea where to start. The idea is to be like the contact page, but different. I don't know if I can use the contact page and then change the name and the info on it, and how would i add in new fields to it. or if i need to create something new still how do i do that.
Here are the fields I need:
Business Name:
Business Hours:
Business Contact:
Business Email:
Business Phone:
Business Fax:
Toll Free Number (optional)
Business Address:
City:
State:
Zipcode:
County:
Website (optional)
Business Description (give detailed description) This field needs to be large
I have tried creating a html form, but cant see the boxes and it sends the info all scrambled up.
Can somebody help please
Merged on Jul 16 2012 at 12:22:43:
In reality, these are fields that should be added to the userfields. This way it can be geared to business that want to use php-fusion. I really makes since.
Edited by Vyper69 on 16-07-2012 17:22
|
| |
|
|
| gh0st2k |
Posted on 16-07-2012 21:20
|

Member

Posts: 134
Joined: 23/11/2008
|
Yes... you should add those fields aus userfields... they can be marked as required. There are tons of examples in the core package / addon db, you have just to rename a field (name / variable names / fiel names) of the same type.
Example: Location -> string, Business Name -> string.
Just try it, attach your work and someone can check it...
Ex Senior Dev.
|
| |
|
|
| Vyper69 |
Posted on 17-07-2012 00:57
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
Ok lets take this for example.
Code<?php
$locale['uf_msn'] = "MSN";
$locale['uf_msn_desc'] = "MSN Messenger";
$locale['uf_msn_error'] = "MSN can not be left empty.";
?>
Where does this referance to.
Can I just say:
Code<?php
$locale['uf_business name'] = "Business Name";
$locale['uf_business name_desc'] = "Business Name";
$locale['uf_business name_error'] = "Business Name can not be left empty.";
?>
Or is there more to it. Or am i even right. If right do i just save it as user_ business_name.php. i am trying to understand it.
Edited by Vyper69 on 17-07-2012 07:14
|
| |
|
|
| Vyper69 |
Posted on 17-07-2012 15:08
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
So am I right or am i wrong with how i did this, or are there other files to edit. |
| |
|
|
| Ankur |
Posted on 18-07-2012 08:14
|

Admin

Posts: 1291
Joined: 02/11/2010
|
ghost2k is right. You can simply achieve this by modifying some Userfields yourself.
Also, try editing the includes/user_fields/user_msn_include.php and user_msn_include_var.php...
|
| |
|
|
| Vyper69 |
Posted on 18-07-2012 14:42
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
So with this I would either edit all three .php's or create 3 new ones based on the same format |
| |
|
|
| Ankur |
Posted on 18-07-2012 16:22
|

Admin

Posts: 1291
Joined: 02/11/2010
|
Vyper69 wrote:
So with this I would either edit all three .php's or create 3 new ones based on the same format
Just create copies of these files and name them something else, say, user_business_include etc
Also, dontt forget to make changes inside the file too...
|
| |
|
|
| Vyper69 |
Posted on 18-07-2012 16:40
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
ok so i am creating a new contact form, with a different name, then i have 3 files i have to create a new name for. This has to be done for each field. So if there are 10 fields I need 30 new files. Am i going in the right direction. Then link each one to the new contact page.
I am just curious if it would be easier to create new bbcodes to add in the registration form.
Tell me if i am right on the first one, and your opinion on the second one.
I am trying to grasp all this. so after registration it redirects to the new page, but any other time it goes to the main page
Here is what I am looking at. I am using the Name field as an example:
Code$locale['402'] = "Name:";
ok so $locale is telling me that it is in the locale directory in the English sub-directory I got this.
Now what is the ['402'] is that the order, or does it refer to a specific place in another directory/file.
"Name" where is this located? within the user_php, or another directory/file.
Edited by Vyper69 on 18-07-2012 16:58
|
| |
|
|
| Ankur |
Posted on 18-07-2012 17:27
|

Admin

Posts: 1291
Joined: 02/11/2010
|
It depends on where you are going to Store that Information.
If you are going to store a field value, say, Business Name in the Users table, i.e as a userfield in the site, then you can simply create Userfield as ghost2k suggested and can simply enable them on the registration form.
If you are going to create a custom contact form, then the question comes : Where do you want the data to be stored ? Of course, whatever the user will input in the new contact form, will be stored somewhere in Database... Please mention that...!
|
| |
|
|
| Vyper69 |
Posted on 18-07-2012 19:23
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
Ok I think I am getting it.
So if I take user_msn.php I change the name and save it as user_businessname.php
and convert this:
Code<?php
$locale['uf_msn'] = "MSN";
$locale['uf_msn_desc'] = "MSN Messenger";
$locale['uf_msn_error'] = "MSN can not be left empty.";
?>
to this
Code<?php
$locale['uf_msn'] = "Business Name";
$locale['uf_msn_desc'] = "Business Name";
$locale['uf_msn_error'] = "Business Name can not be left empty.";
?>
Now i will take user_msn_include_var.php and change the name to user_businessname_include_var.php and save it.
now take this
Codeif (!defined("IN_FUSION")) { die("Access Denied"); }
// Version of the user fields api
$user_field_api_version = "1.01.00";
$user_field_name = $locale['uf_msn'];
$user_field_desc = $locale['uf_msn_desc'];
$user_field_dbname = "user_msn";
$user_field_group = 1;
$user_field_dbinfo = "VARCHAR(100) NOT NULL DEFAULT ''";
?>
and change to this
Codeif (!defined("IN_FUSION")) { die("Access Denied"); }
// Version of the user fields api
$user_field_api_version = "1.01.00";
$user_field_name = $locale['uf_businessname'];
$user_field_desc = $locale['uf_businessname_desc'];
$user_field_dbname = "user_businessname";
$user_field_group = 1;
$user_field_dbinfo = "VARCHAR(100) NOT NULL DEFAULT ''";
?>
I am assuming these are the only ones i need to change for each of the new user fields. or is there something else. I assume i do not need to change anything in user_fields.php |
| |
|
|
| Craig |
Posted on 18-07-2012 19:45
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
user_msn_include.php for the input and display form.
|
| |
|
|
| Vyper69 |
Posted on 18-07-2012 19:54
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
ok so anywhere it says user_msn like in example below.
Codeecho "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_msn")."'><label for='user_msn'>".$locale['uf_msn'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_msn")."'>";
echo "<input type='text' id='user_msn' name='user_msn' value='".$user_msn."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
I would change to this
Codeecho "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_businessname")."'><label for='user_businessname'>".$locale['uf_businessname'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_businessname")."'>";
echo "<input type='text' id='user_businessname' name='user_businessname' value='".$user_businessname."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
and save as user_businessname_include.php
am i on the right track.
Merged on Jul 18 2012 at 14:55:09:
feel like i am back in school. :o
Merged on Jul 18 2012 at 14:58:53:
Ok I am going to use a field named Business Description. where would i go to change character length. that is the only field that would require let's say 1000 characters
Merged on Jul 18 2012 at 19:56:04:
Thanks guys. Got it. Created my first one, and am working on the others.
Merged on Jul 18 2012 at 22:05:15:
Ok got a question. On this line of code.
Codeecho "<input type='text' id='user_fax' name='user_fax' value='".$user_fax."' maxlength='50' class='textbox' style='width:200px;' />";
maxlength='50' does that mean the maximum number of characters.
if i was to change to this for example
Codeecho "<input type='text' id='user_fax' name='user_fax' value='".$user_fax."' maxlength='1000' class='textbox' style='width:200px;' />";
would that mean a thousand characters are allowed
Merged on Jul 18 2012 at 23:15:50:
Ok I have run into an issue that I can not figure out. I wish to have the person when they register input a short description of their business and it will show up in their profile. All my other modified user fields work perfect except this one. I am using the code used for msn modified to my own user fields, but this i changed the code and added in some from the sig, in order to get a larger box for more text. Can someone help me correct this so it will display. don't know what is wrong.
Codeif (!defined("IN_FUSION")) { die("Access Denied"); }
// Display user field input
if ($profile_method == "input") {
$user_businessdescription = isset($user_data['user_businessdescription']) ? $user_data['user_businessdescription'] : "";
if ($this->isError()) { $user_businessdescription = isset($_POST['user_businessdescription']) ? stripinput($_POST['user_businessdescription']) : $user_businessdescription; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_businessdescription")."'><label for='user_businessdescription'>".$locale['uf_businessdescription'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_businessdescription")."'>";
echo "<textarea id='user_businesslocation' name='user_businesslocation' cols='60' rows='5' class='textbox' style='width:295px'>".$user_businesslocation."</textarea><br />\n";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_businessdescription", $locale['uf_businessdescription_error']); }
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_businessdescription']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_businessdescription']."</td>\n";
echo "<td align='right' class='tbl1'>".hide_email($user_data['user_businessdescription'])."</td>\n";
echo "</tr>\n";
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_businessdescription']) && ($_POST['user_businessdescription'] != "" || $this->_isNotRequired("user_businessdescription"))) {
// Set update or insert user data
$this->_setDBValue("user_businessdescription", stripinput(trim($_POST['user_businessdescription'])));
} else {
$this->_setError("user_businessdescription", $locale['uf_businessdescription_error'], true);
}
}
?>
I replaced this
Codeecho "<input type='text' id='user_businessdescription' name='user_businessdescription' value='".$businessdescription."' maxlength='50' class='textbox' style='width:200px;' />";
with this
Codeecho "<textarea id='user_businesslocation' name='user_businesslocation' cols='60' rows='5' class='textbox' style='width:295px'>".$user_businesslocation."</textarea><br />\n";
i did see a bigger box at registration, and was able to type in many characters, but it will not show up in the profile.
Help Please
Edited by Vyper69 on 19-07-2012 04:15
|
| |
|
|
| Ankur |
Posted on 19-07-2012 11:56
|

Admin

Posts: 1291
Joined: 02/11/2010
|
Vyper69 wrote:
i did see a bigger box at registration, and was able to type in many characters, but it will not show up in the profile.
Help Please
It looks like you are going great... ;)
You forgot to make changes in this code :
// Display in profile
Code} elseif ($profile_method == "display") {
if ($user_data['user_businessdescription']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_businessdescription']."</td>\n";
echo "<td align='right' class='tbl1'>".hide_email($user_data['user_businessdescription'])."</td>\n";
echo "</tr>\n";
}
Remove the hide_email function from the Code... say :
Change :
Code echo "<td align='right' class='tbl1'>".hide_email($user_data['user_businessdescription'])."</td>\n";
echo "</tr>\n";
to :
Code echo "<td align='right' class='tbl1'>".$user_data['user_businessdescription']."</td>\n";
echo "</tr>\n";
|
| |
|
|
| Vyper69 |
Posted on 19-07-2012 15:40
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
ok i will try that. thanks
Merged on Jul 19 2012 at 11:08:25:
crap i didn't see that. means i have to modify the code on all those files.
Merged on Jul 19 2012 at 17:09:35:
I have updated the code on that line and resubmitted it. But I am still having issues with my Business Description field. I have tried using the user_sig files and removed the bbcode, but it still will not show up. Using the user_msn files i can get it to show up, but it places the description across the screen, and makes the profile wide. I am wanting to keep it to the right and for it to have several lines. I am at a loss with configuring this one. Any help would be great.
Merged on Jul 19 2012 at 20:03:17:
Now sticking with user fields, i am trying to implement may fields on one file, Here is what i got. I used test, test1, and test2 so basically i made 3 user fields on one file. Uploaded it to my ftp and placed in correct directories. upon logging out and selecting registration I can see the 3 fields. But once registration is complete the fields do not show in the profile. Any Ideas. Here is the code:
user_test
Code<?php
$locale['uf_test'] = "Test";
$locale['uf_msn_desc'] = "Test";
$locale['uf_msn_error'] = "Test can not be left empty.";
$locale['uf_test1'] = "Test1";
$locale['uf_test1_desc'] = "Test1";
$locale['uf_test1_error'] = "Test1 can not be left empty.";
$locale['uf_test2'] = "Test2";
$locale['uf_test2_desc'] = "Test2";
$locale['uf_test2_error'] = "Test2 can not be left empty.";
?>
user_test_include
Codeif (!defined("IN_FUSION")) { die("Access Denied"); }
// Display user field input
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test_error']); }
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test1'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test1_error']); }
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test2'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test2_error']); }
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test1']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test2']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test_error'], true);
}
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test1_error'], true);
}
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test2_error'], true);
}
}
?>
user_test_include_var
Codeif (!defined("IN_FUSION")) { die("Access Denied"); }
// Version of the user fields api
$user_field_api_version = "1.01.00";
$user_field_name = $locale['uf_test'];
$user_field_desc = $locale['uf_test_desc'];
$user_field_name = $locale['uf_test1'];
$user_field_desc = $locale['uf_test1_desc'];
$user_field_name = $locale['uf_test2'];
$user_field_desc = $locale['uf_test2_desc'];
$user_field_dbname = "user_test";
$user_field_group = 1;
$user_field_dbinfo = "VARCHAR(100) NOT NULL DEFAULT ''";
?>
Like I said before the fields are viewable in registration, and also under edit profile, They just do not display once saved or updated and can not be view in the members profile.
Merged on Jul 19 2012 at 20:43:15:
Ok i did notice if i select edit profile again, the information is still there. just the display issue in the profile. Not Visible
Edited by Vyper69 on 20-07-2012 01:43
|
| |
|
|
| Craig |
Posted on 20-07-2012 12:14
|

Fusioneer

Posts: 3980
Joined: 27/09/2005
|
Is al lthis in the same file?
Code
if (!defined("IN_FUSION")) { die("Access Denied"); }
// Display user field input
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test_error']); }
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test1'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test1_error']); }
if ($profile_method == "input") {
$user_test = isset($user_data['user_test']) ? $user_data['user_test'] : "";
if ($this->isError()) { $user_test = isset($_POST['user_test']) ? stripinput($_POST['user_test']) : $user_test; }
echo "<tr>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'><label for='user_test'>".$locale['uf_test2'].$required."</label></td>\n";
echo "<td class='tbl".$this->getErrorClass("user_test")."'>";
echo "<input type='text' id='user_test' name='user_test' value='".$user_test."' maxlength='50' class='textbox' style='width:200px;' />";
echo "</td>\n</tr>\n";
if ($required) { $this->setRequiredJavaScript("user_test", $locale['uf_test2_error']); }
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test1']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Display in profile
} elseif ($profile_method == "display") {
if ($user_data['user_test']) {
echo "<tr>\n";
echo "<td class='tbl1'>".$locale['uf_test2']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_test']."</td>\n";
echo "</tr>\n";
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test_error'], true);
}
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test1_error'], true);
}
}
// Insert and update
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
// Get input data
if (isset($_POST['user_test']) && ($_POST['user_test'] != "" || $this->_isNotRequired("user_test"))) {
// Set update or insert user data
$this->_setDBValue("user_test", stripinput(trim($_POST['user_test'])));
} else {
$this->_setError("user_test", $locale['uf_test2_error'], true);
}
}
?>
|
| |
|
|
| Vyper69 |
Posted on 20-07-2012 14:48
|

Senior Member

Posts: 367
Joined: 25/05/2012
|
Yes it is. where it says // Display in profile and // Insert and update, i edited last night so it only said it one time. In each section. Like I said, the items show up on the registration page, They also stay in their fields under edit profile, but when you look at the profile, they are not there.
Merged on Jul 20 2012 at 10:04:56:
I am just looking at the idea creating one file instead of many different files. All the factors are there except the view. Also I was thinking if i needed to add these strings to the .var file.
Code$user_field_dbname = "user_test1";
$user_field_dbname = "user_test2";
I am looking at trying to create groups that go together.
Edited by Vyper69 on 20-07-2012 15:04
|
| |
|