Results 1 to 6 of 6

Thread: Category Jump Hack/Mod

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Category Jump Hack/Mod

    Build the select statement yourself. Go to the search links screen in the admin control panel. Use your browser to view the page source and you will see all your categories already built in a select statement.

    Copy and paste them between the following:

    Code:
    <!-- dropdown -->
    <form action="browse.php" method="POST">
    <select name=cat>
    ...select statements go here
    ...select statements go here
    ...select statements go here
    ...select statements go here
    <input type="submit" value="Go!">
    </form>
    for example, in the Hack/MODs forum:
    Code:
    <!-- dropdown -->
    <form action="browse.php" method="POST">
    <select name=cat>
    <option value='1'>Add-On's</option>
    <option value='2'>Admin Tools</option>
    <option value='3'>Security</option>
    <option value='4'>Syndication</option>
    <option value='5'>Templates</option>
    <option value='6'>Miscellaneous</option>
    <option value='7'>Connecticut </option>
    <input type="submit" value="Go!">
    </form>
    If you just paste it in from the link search screen, it will be easy

    I wanted to add
    Code:
    <option value='---'>---</option>
    But that will give you an error ( since the $cat varible is empty ) so I just left it out. Maybe someone can take the time to figure it out.

    Then just paste all of the code into your browse.html where ever you want it to appear.
    Last edited by esm; 06-23-2003 at 03:43 PM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #2
    Join Date
    Jul 2002
    Posts
    189

    Default

    Hello esm,

    why don't you just call the function DisplayCategoryListBox?

    paste this lines into your index.php or browse.php

    Code:
      // generate category quick select
      
      $category_obj = new clsCategory;
      $category_obj->InitDB($dbServer,$dbHostname,$dbUsername,$dbPassword,$dbName);
      $category_obj->table_name = "idx_category";
      $category_obj->separator = $category_separator;
      $quickselect = $category_obj->DisplayCategoryListBox(-1);
    the quickselect has to be passed forward to the template file by adding it to the list of variables e.g.
    Code:
    DisplayTemplate($theme_path."header.html","\$title,\$cat,\$quickselect");
    finaly edit your template file wÃ*th the form tags:

    Code:
    <form action="browse.php?cat=<%cat%>" method="get">
    <%quickselect%> <input type="submit" name="submit" value="go" border="0"></form>
    greets

    Joerg
    Last edited by tjoerg; 06-25-2003 at 03:57 AM.
    --------- applying hacks require a knack ---------

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    now why didn't I think of that!

    I'll give that a try...

    Just a couple of things:
    • Should the method be POST or GET? ( showing my ignorance here ).
    • If you have a concern about server resources, doing it manually does eliminate the query to the database and therefore use less server resources.
    I like it!
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  4. #4
    Join Date
    Jul 2002
    Posts
    189

    Default

    ...yes, a better form method is POST (doesn't show up in url). I've done that with an editor and didn't change the standard method.

    To get rid of the empy field which causes an error edit category.class.php about line 792 and set a value and text:

    Code:
    else $category_list .= "<OPTION VALUE='0'>home</OPTION>";
    greets

    Joerg
    --------- applying hacks require a knack ---------

  5. #5
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    here you go Frank...

    Either will work ( well, I didn't test what tjoerg did but it should work )

    Personally, I still like the "static" approach...
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  6. #6
    Join Date
    Jan 2004
    Posts
    31

    Default

    A variation to this can be made to make the jump for adding in a specific main category. For example, I have the jump box in the add_form template. I added this in the template for the dropbox:
    Code:
    <FORM method="post" action="add.php?cat="value">
    <INPUT type="hidden" name="pflag" value="add">
    cat="value" is the value set in <option value=. The only thing is that when it jumps again to the add form, though it shows the correct category selection, a message shows requiring the title of the site. A minor annoyance. Maybe someone could fix this.

    Manuel

Similar Threads

  1. keywords for category
    By Hart_House in forum v3.2
    Replies: 1
    Last Post: 04-29-2004, 11:39 AM
  2. category revert
    By aladdin in forum v3.2
    Replies: 4
    Last Post: 12-06-2003, 07:49 PM
  3. Replies: 2
    Last Post: 08-05-2003, 02:16 AM
  4. Category Jump Hack/Mod ??
    By ideavirus in forum v3.2
    Replies: 9
    Last Post: 06-27-2003, 10:11 AM
  5. Category formating
    By Rob Picken in forum v5.x
    Replies: 0
    Last Post: 03-13-2003, 12:00 PM

Posting Permissions

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