Results 1 to 7 of 7

Thread: Removing the additional category fields

  1. #1
    Join Date
    Jan 2009
    Posts
    10

    Default Removing the additional category fields

    I'm creating a directory where I don't want listings to be in more than one category, so I'm trying to remove the "Additional category" fields from the add/modify link forms.

    I've removed the fields from the add form, modified add.php to remove the references to the additional categories.

    I've also changed ajax.js as below:

    Code:
    //    AjaxRequest('ajax.php?cmd=fetch_pricing&cat=' + cat + "&cat1=" + cat1 + "&cat2=" + cat2 + "&periodprice=" + periodprice, 'UpdatePricing');
        AjaxRequest("ajax.php?cmd=fetch_pricing&cat=" + cat + "&periodprice=" + periodprice, 'UpdatePricing');
    and removed the lines referring to additional categories from the top of categories.enables.js.php and altered onchangeCategoties to just return without doing anything.

    Now when I load the page and try to add a link, the "Listing Type" field isn't populated, it just changes to be blank. I can see the following AJAX requests when I change categories:

    Code:
    POST /ajax.php?cmd=fetch_sub_category&cat=4&selected_cat=cat&div_tag=cat_div
    POST /ajax.php?cmd=fetch_pricing&cat=0&periodprice=Please%20select%20category%20first%20!
    POST /ajax.php?cmd=fetch_pricing&cat=0&periodprice=%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0
    POST /ajax.php?cmd=fetch_sub_category&cat=5&selected_cat=-1&div_tag=cat_div
    I'm also seeing the following JavaScript error, but the json.js file is beyond my JS knowledge:

    Code:
    Error: too much recursion
    Source File: /themes/worldex/json.js
    Line: 71
    Any ideas?

  2. #2
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    You might want to talk to mpdaddy... He created a plugin for me that limits the categories a listing can choose based upon the listing type they choose. I'm sure with a quick tweek you could make it so that additional categories are not an option
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  3. #3
    Join Date
    Nov 2007
    Posts
    227

    Default

    I could do that and I would love to help you out right now, but I am not at home. When I get home tomorrow morning, I will check it out. I will then post the solution here.

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  4. #4
    Join Date
    Jan 2009
    Posts
    10

    Default

    Excellent, thanks!

  5. #5
    Join Date
    Nov 2007
    Posts
    227

    Default

    Sorry it took me so long to reply, I don't have internet at home until the end of the week.

    Starting with a fresh install of IndexU 1.3, here is what you would do to remove the extra category selections and make all listings free.

    First, follow the instructions in the post at http://www.nicecoder.com/community/f...239/#post38748.

    Next, find this code in your add_form.html file (Example taken from the kosmos theme):
    Code:
            <div>
              <label><%t%>Additional Category 1<%/t%></label>
              <label id="add_cat1_div"><%$add_cat1%></label>
              <br style="clear:both;">
            </div>
            
            <div>
              <label><%t%>Additional Category 2<%/t%></label>
              <label id="add_cat2_div"><%$add_cat2%></label>
              <br style="clear:both;">
            </div>
    Replace it with this code:
    Code:
            <input type="hidden" name="add_cat1" value="0">
            <input type="hidden" name="add_cat2" value="0">
    You are done. That is all there is to it. No need to edit the ajax files or any other files.

    Let me know how it works.

    Regards
    Wayne
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

  6. #6
    Join Date
    Jan 2009
    Posts
    10

    Default

    Excellent, thank you. I'll give it a go. I want to keep the pricing for the category but that should be easy to work out.

  7. #7
    Join Date
    Nov 2007
    Posts
    227

    Default

    If you want to keep the pricing, you should just have to do as I said above without the edits in the other post I referred to.

    Regards
    mp
    For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com

Similar Threads

  1. Removing Display subcats <%$category%>
    By echo@ in forum INDEXU DELUXE v1.x
    Replies: 5
    Last Post: 11-08-2008, 06:13 PM
  2. Replies: 38
    Last Post: 11-16-2007, 03:48 PM
  3. Removing Additional Categorys Problem
    By prowler in forum Blocks and Modification
    Replies: 4
    Last Post: 07-11-2007, 03:49 AM
  4. Replies: 1
    Last Post: 04-22-2007, 12:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •