![]() |
| |||||||
| Support (Version 2) Here is where we provide limited support for version 2. If you are seeking support for version 3 please post in the phpLD 3.0 Support Forum. |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| Join Date: Jun 2005 Posts: 13 | Where is the link data inserted into the PLD_LINK table? I am trying to add fields to the link submit page and cannot seem to find where the data is inserted into the table. Any help would be appreciated. __________________ Marshall |
| |
| | #2 |
| Administrator phpLD Administrator Supporter Join Date: Jan 2005 Posts: 11,667 | Hi, I moved this topic over to General Support, but if you finish your mod, I hope you will submit the code. I'm pretty sure you will find what you need in includes/functions.php |
| |
| | #3 |
| Join Date: Jun 2005 Posts: 13 | You must know how to add fields to your database table to use this process for adding fields. Where you see CHANGE_ME_LABEL, change to the label of the field as seen in the browser. Where you see CHANGE_ME_FIELD, change this to the name of the field created in the database. Create a new field in your database after all other fields (at the end of the table) ************************************************** *********************************** // ADD to include/tables.php // FIND: $tables['link'] = array( 'name' => TABLE_PREFIX.'LINK', 'fields' => array( 'ID' => 'I KEY AUTO', 'TITLE' => 'C(100) NOTNULL', 'DESCRIPTION' => 'C(255)', 'URL' => 'C(255) NOTNULL', 'CATEGORY_ID' => 'I NOTNULL', 'RECPR_URL' => 'C(255)', 'RECPR_REQUIRED' => 'L NOTNULL DEFAULT 0', 'STATUS' => 'I NOTNULL DEFAULT 0', 'VALID' => 'L NOTNULL DEFAULT 0', 'RECPR_VALID' => 'L NOTNULL DEFAULT 0', 'OWNER_NAME' => 'C(100)', 'OWNER_EMAIL' => 'C(100)', 'IPADDRESS' => 'C(15) NOTNULL', 'DATE_MODIFIED' => 'T DEFDATE', 'DATE_ADDED' => 'T DEFDATE', 'HITS' => 'I NOTNULL DEFAULT 0', 'LAST_CHECKED' => 'T', 'RECPR_LAST_CHECKED' => 'T', 'PAGERANK' => 'I NOTNULL DEFAULT -1', 'RECPR_PAGERANK' => 'I NOTNULL DEFAULT -1', // ADD THIS 'CHANGE_ME_FIELD' => '', // END ADD THIS ), ************************************************** ******************** {* ADD to templates/submit.tpl *} {* This will add the text box to the submit form *} <tr> <td class="label">{l}CHANGE_ME_LABEL{/l}:</td> <td class="field"> <input type="text" name="CHANGE_ME_FIELD" value="{$CHANGE_ME_FIELD}" size="40" maxlength="100" class="text"/> </td> </tr> ************************************************** *********************************** // INSERT INTO admin/dir_approve_links.php // This adds the extra column when you are approving links // Find: $tpl->assign('columns', array ('TITLE' => _L('Title'), 'URL' => _L('URL'), 'DESCRIPTION' => _L('Description'), 'CATEGORY' => _L('Category'), 'RECPR_URL' => _L('Recpr. Link URL'), 'DATE_ADDED' => _L('Date Added'))); // Insert 'CHANGE_ME_FIELD' => _L('CHANGE_ME_LABEL') // where you want it to display. If you want it to display a column // between title and url... insert the above code like this: $tpl->assign('columns', array ('TITLE' => _L('Title'), 'CHANGE_ME_FIELD' => _L('CHANGE_ME_LABEL'), 'URL' => _L('URL'), 'DESCRIPTION' => _L('Description'), 'CATEGORY' => _L('Category'), 'RECPR_URL' => _L('Recpr. Link URL'), 'DATE_ADDED' => _L('Date Added'))); ************************************************** ******************** {* Insert into templates/admin/link_details.tpl *} {* Insert: *} <tr><td>{l}CHANGE_ME_LABEL{/l}:</td><td> {$row.CHANGE_ME_FIELD}</td></tr> {* where ever you want it to be displayed when hovering over the link title *} {* when approving links or viewing links in admin *} ************************************************** ********************* {* Insert into templates/admin/dir_links_edit.tpl *} {* This will add the extra fields where you edit links in the admin panel *} {* INSERT where you need the additional field displayed *} <tr> <td class="label">{l}CHANGE_ME_LABEL{/l}:</td> <td class="smallDesc"> <input type="text" name="CHANGE_ME_FIELD" value="{$CHANGE_ME_FIELD}" size="20" maxlength="40" class="text"/> </td> </tr> __________________ Marshall |
| |
| | #4 |
| Administrator phpLD Administrator Supporter Join Date: Jan 2005 Posts: 11,667 | I really appreciate you taking the time to post this. It will be a good reference. Thanks, David |
| |
| | #5 |
| Supporter Join Date: Oct 2005 Posts: 50 | Thank You... Thank You... Thank You! This worked really slick. I was able to add phone number fields, and city, state, country fields to the links database. After adding the new fields to the database using my SQL admin tool, I modified these three files (as per your instructions): - include/tables.php (to add the new field to the program array) - templates/submit.tpl (modify the end-user submit screen) - templates/admin/dir_links_edit.tpl (modify admin submit/edit screen) These files are purely optional: - admin/dir_approve_links.php (optional, for admin approval list) - templates/admin/link_details.tpl (optional, for popup details window) |
| |
| | #6 |
| Join Date: Oct 2005 Location: Polar Regions Posts: 254 | That is some excellent info! If there were a rep system on this board, I'd give you some. |
| |
| | #7 |
| Join Date: Jan 2006 Posts: 1 | Hi all, Let me start by saying this seems to be a great script. I downloaded it and am trying to customize it for my needs. Currently running this at home network before I can roll it out. This is a wonderful post mgiroir. It was very helpful when I added a few fields to the database, 7 to be exact. One field holds a 4 digit year and was set as a varchar(4) default 0000 This was presented in the submit page as a drop down select menu populated with a range of years. The other 6 were set up as a tinyint with a default value 0 to be presented as check boxes, the submitter would check all that applies. Now, I'm not very familiar with the smarty engine and tried to add a validation and capture for those fields but nothing worked. My question is: How can I add validation and capture to the submit.php/tpl Validation: 1- user has to select a value from the drop down year menu. 2- user has to select at least one of the 6 check boxes corresponding to 6 different fields. Capture: If the form submit produces an error, the entered values of both drop down menu and check boxes stay selected. Same goes for Admin, when editing and validating submitted links Any help is greatly appreciated, Hardy |
| |
| | #8 |
| Join Date: Feb 2006 Posts: 6 | This is an nice add-on, but i have a small question. I have made all the stepts above and it's working nicely. But how to insert this field in my pages.... I have the field country and i will like to add it to the description page. How to insert it there? |
| |
| | #9 |
| Join Date: Mar 2006 Location: Norway Posts: 2 | I follow the instruction above and it works fine when submitting links, but inputs from new fields are gone when i try to edit the link from adminpanel. Inputs also disipeer from database when editing a link. What must i do to correct this? |
| |
| | #10 |
| Join Date: Sep 2005 Posts: 678 | I added a field on my submit page so that it requests an optional button image for the visitors site, I would like this button to display next to their link, how do I do this? __________________ Please check your sig links |
| |
| | #11 |
| Supporter Join Date: Mar 2006 Posts: 114 | I went into detail.tpl and copied this into it <tr> <td class="label">{l}Country{/l}:</td> <td class="smallDesc" align="left">{$Country|escape}>{$State|escape}>{$City|escape}</td> </tr> <tr> <td class="label">{l}Phone{/l}:</td> <td class="smallDesc" align="left">{$Phone|escape}</td> </tr> But for some reason the database does not insert the fields. e.g where it says $state it does not show and comes out blank Anyone, otherwise this is a great bit of code which will allow me to do a lot of stuff. __________________ Get your Aussie site listed at Australian Web Directory |
| |
| | #12 |
| Join Date: Jul 2006 Posts: 44 | Ok, I suppose my answer will come too late for minute and bobby but don't forget to add in, for example, detail.php the CHANGE_ME_FIELD with : Code: $data['CHANGE_ME_FIELD'] = $rdata['CHANGE_ME_FIELD']; |
| |
| | #13 |
| Join Date: Mar 2006 Posts: 416 | using the info from mgiroir exept the admin parts (added the edit link admin part only) added this to detail.tpl <tr> <td class="label">{l}Phone{/l}:</td> <td class="smallDesc" align="left">{$PHONE|escape|trim}</b></td> </tr> as much as everything seems to be done right (i think) i still dont see the entered information alongside the label names in detail i can see them within admin when someone submits so it must be something in between any help pleeeeease al Last edited by discover; 07-16-2006 at 10:14 PM. |
| |
| | #14 |
| Join Date: Jul 2006 Posts: 44 | In detail.php, you should add this Code: $data['PHONE'] = $rdata['PHONE']; Code: $data['META_DESCRIPTION'] = $rdata['META_DESCRIPTION']; Code: <tr>
<td class="label">{l}Phone{/l}:</td>
<td class="smallDesc" align="left">{$PHONE|escape|trim}</b></td>
</tr> |
| |
| | #15 |
| Join Date: Mar 2006 Posts: 416 | thanks man worked perfectly appreciate it al |
| |
| | #16 |
| Join Date: Jul 2006 Posts: 44 | you're welcome |
| |
| | #17 |
| Join Date: Apr 2006 Posts: 16 | Thanks Perrine for the info but I am having trouble trying to put the data that was submitted placed into a URL. For example I want the data that I collected in the submit page to be at the end of a url in a link. This URL would also be placed under the PR Bar just so you get a barring on where I will be placing this URL. Example: <a href="www.domainname.com/something/{$ID}">click here</a> |
| |
| | #18 |
| Join Date: Apr 2006 Posts: 16 | I got it working with help over at DP. I had to use {$link.ID} and it worked great |
| |
| | #19 | |
| Supporter Join Date: Mar 2006 Posts: 114 | Quote:
__________________ Get your Aussie site listed at Australian Web Directory | |
| |
| | #20 |
| Join Date: Aug 2005 Posts: 10 | i can't figure this out. i want another URL field. the current URL field was duplicated in mysql with a new field name (URL2) that field shows up in EDIT and SUBMIT and the date is stored into mysql ![]() however, i can't call that data into the link details page. i am able to dup the URL field so that it deplays twice. when i change the field value from URL to URL2 i get blank on the front end :( why can't i call data out of mysql? i fed the data into it.. but ... can't .. get.. it... out.. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|