Support Forums

Ad Title From Extra Fields Upon Save/Edit

This is a discussion on Ad Title From Extra Fields Upon Save/Edit within the Modules / Plugins / Modifications forums, part of the Developer Forums category; I need to know what to modify to make the ad's title an auto-construct based on the user's input into ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 07-24-2008, 03:03 PM   #1
Senior Member
 
bgordon's Avatar
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 170
Rep Power: 17
bgordon is on a distinguished road
Question Ad Title From Extra Fields Upon Save/Edit

I need to know what to modify to make the ad's title an auto-construct based on the user's input into a few of my extra fields. The extra fields in question are category-wide and mandatory so they would always be the same.

I need to capture the data from the ad/update forms, combine it and have the script save/update the title based on those form inputs...

I want to discard the user's title input (or not even show it as an option) and upon save have it auto-populated/replaced with my format (year make model).

Thanks
bgordon is offline   Reply With Quote
Old 07-24-2008, 03:43 PM   #2
Coder
 
Join Date: Mar 2006
Posts: 4,982
Rep Power: 121
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

What version of 68C are you using and is it developer or designer?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 07-24-2008, 03:44 PM   #3
Senior Member
 
bgordon's Avatar
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 170
Rep Power: 17
bgordon is on a distinguished road
Default

Sorry...

4.0.4 Developer
bgordon is offline   Reply With Quote
Old 07-24-2008, 04:03 PM   #4
Coder
 
Join Date: Mar 2006
Posts: 4,982
Rep Power: 121
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

If, as you say, all the extra fields are used in all of the categories then run through the process of placing a test ad and stop at step 3 where you enter values into the extra fields you have created.

Look at the html source to get the names of the html fields, they are likely something like opt1, opt2 etc etc. Since this is an html form its being posted to the server and the html field values should be contained in post variables that can be used by step3submit.php.

With the above in mind, open /includes/core/checkout/step3submit.php and aound line 86 you should see where the POST value for the title is assigned to the value that is placed in the database. It should look like this....

Code:
$data['title'] = isset( $_POST['title'] ) ? $format->inputSQL($_POST['title'], 'string') : '';
Since you want to use 3 extra fields you should be able to use those names and concat them and assign them to a new variable an use that variable to create your title, something like this.

Code:
$customtitle = $_POST['opt1'] . " " . $_POST['opt2'] . " " . $_POST['opt3'] 
$data['title'] = isset( $customtitle ) ? $format->inputSQL($customtitle, 'string') : '';
I havent tested it but it should get you on the ight track.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 07-24-2008, 04:06 PM   #5
Senior Member
 
bgordon's Avatar
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 170
Rep Power: 17
bgordon is on a distinguished road
Default

This is what I was looking for... I will mess about with it. Thanks..

Will this apply to the ad if someone goes in and modifies it later, maybe chooses a new optional field value... does this section that file look after the update function too?
bgordon is offline   Reply With Quote
Old 07-24-2008, 04:23 PM   #6
Coder
 
Join Date: Mar 2006
Posts: 4,982
Rep Power: 121
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by bgordon
This is what I was looking for... I will mess about with it. Thanks..

Will this apply to the ad if someone goes in and modifies it later, maybe chooses a new optional field value... does this section that file look after the update function too?
I havent looked into it that closely but probably not. You would likely need to do a similar change tothe file usermodifylisting.php
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra fields not searchable even though it is set to searchable fendter Technical Support 5 07-22-2008 03:42 PM
Extra User Fields in Registration signup "Pull Down Menus" LittleRascal v3.1 Modules & Modifications 3 11-10-2007 11:04 AM
How To Create A Dynamic Ad Title From Ad Fields? bgordon v3.1 Questions & Support 5 04-16-2007 07:33 PM
Extra fields bug? Sinisa v3.1 Questions & Support 8 01-24-2007 04:20 PM


All times are GMT -4. The time now is 12:12 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0