+ Reply to Thread
Results 1 to 6 of 6

Thread: stuck in middle of modification

  1. #1

    stuck in middle of modification

    I added a column to the listings table using phpMyAdmin called Category_Type (listings, services, jobs, etc.)

    My issue is I've been trying to call on that value when I edit or add a listing. What I am attempting to do is for the purposes of a business with more than one location. I have everything else in place except for the edit location and add location. both of which will start the process from the my listings screen with an edit listing and add location link.

    My question is...between the template>tpl>controllers>add_listing>step_form.tpl , template>tpl>controllers>edit_listing>step_form.tp l, includes>classes>rlListings.class.php files...how do I call on myDB_listings_Category_Type (which is the column I added in the db)

  2. #2
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    Hi,

    If you need to add a new field to the add-listing form it will not work

    because you should also add the field to the listing_fields table and put it to your listing form + a phrase for your field to lang_keys table

    why don't you use the listing fields manager and then do manipulations with your field in the code?

  3. #3
    Quote Originally Posted by Rudi View Post
    Hi,

    If you need to add a new field to the add-listing form it will not work

    because you should also add the field to the listing_fields table and put it to your listing form + a phrase for your field to lang_keys table

    why don't you use the listing fields manager and then do manipulations with your field in the code?
    I don't need to add a field. What I did was added a column in "mydatabase_listings" called category_type. When a listing is added it stores the "listing, services, jobs, etc".

    So what I need to do now is when a user edits a current listing or adds a listing from their multiple listing package, I want to manipulate the form to hide/disable (but keep the values assigned to) certain fields in the form such as 'Title" (this way they don't have to fill in duplicate information for every single listing of their package). Having said that, I do not want to manipulate the form by account type/package because this is specific to the "category type" of the initial listing (meaning listings, services, jobs, motors, etc).

    I should also mention that the value for "mydatabase_listings_category_type" comes from "mydatabase_categories_Type" when the initial listing is added. I did this through a slight code modification.
    Last edited by Ray Moser; March 6, 2021 at 10:19 AM. Reason: added extra info

  4. #4
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    Ok,

    see these files:

    classes > AddListing.php > init() > implement a solution anologically to restoreFromIncompete() method, see line $this->restoreFromIncompete($_GET['incomplete'], $account_info);

    classes > EditListing.php > modify getListingData() method

  5. #5
    Quote Originally Posted by Rudi View Post
    Ok,

    see these files:

    classes > AddListing.php > init() > implement a solution anologically to restoreFromIncompete() method, see line $this->restoreFromIncompete($_GET['incomplete'], $account_info);

    classes > EditListing.php > modify getListingData() method
    Thanks Rudi for pointing me in the right direction. It took some figuring out but I made it for for what I needed to do.

  6. #6
    Hi Rudi,
    Turns out I'm having an issue with AddListing.php. You mentioned init().....is there something specific I need to do with that?
    When I use this code:
    Code:
    Only registered members can view the code.
    I get this showing up:
    error_page.jpeg
    It does not show the error page if I comment out the code...but obviously won't call on the function.
    My link shows the proper variable - vars="addlocation" with a proper value.
    Last edited by Ray Moser; March 13, 2021 at 11:06 PM.

+ Reply to Thread