Results 1 to 5 of 5

Thread: category revert

  1. #1
    aladdin Guest

    Default category revert

    Hello,

    Hack request!!. From the category table "getting" the full category path. In idx_category one got the parent category as well as the category name. I am working on an update of my site, it will now have 2200 categories and I need the full path of each category /from my Indexu directory/parent/category/child category/grand child category/grand grand child category/ etc. Creating a new field in idx_category for this data would be nice but not necessary, being able to copy and paste should works. How much for such hack?

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

    Default

    there is a category function that returns the categpry path ( well, sort of ). It could probably be mofified.

    what format do you need it?

    how and where do you plan to use it?
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    aladdin Guest

    Default

    I want to use it for title tag. As for the format, I am not sure, I can always edit what is given to me.
    Go to:
    http://www.scriptsandstuffs.com/Indexu/
    Look at the source after clickin on any category and yu will have a better idea about what I want to do. I did get my category path using MS Access but it is time consuming and not very efficient.
    Last edited by aladdin; 12-05-2003 at 12:49 PM.

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

    Default

    Originally posted by aladdin
    I want to use it for title tag. As for the format, I am not sure, I can always edit what is given to me.
    the reason I ask is, in order get the path, I need the catetory ID. So this would be all sub-categories.

    I'll do one later this evening.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

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

    Default

    in category.class.php, make the following change in red

    Code:
      function GetCleanCategoryPath($cat) { 
    
        $parent_id = 10;
        while($parent_id) {
          $query = "select parent_id, name from $this->table_name where category_id=$cat";
          $result = $this->db_connect->Execute($query);
          if ($result){
            $name = $result->Fields("name");
            if ($parent_id != 10) $name .= ", " ;
            $path = $name . $path;
            $parent_id = $result->Fields("parent_id");
            $cat = $parent_id;
          }
        }
    
        return $path;
      }  
    
    }
    ?>

    in browse.php toward the top make the following change in red:

    $category_obj = new clsCategory;
    $category_obj->InitDB($dbServer, $dbHostname, $dbUsername, $dbPassword, $dbName);
    $category_obj->table_name = "idx_category";
    $category_obj->separator = $category_separator;
    $cat_path = $msg["10011"].$category_separator.$category_obj->GetCategoryPath($cat);
    $cat_path2 = $category_obj->GetCategoryPath($cat);
    $cat_path_clean = $category_obj->GetCleanCategoryPath($cat);


    in browse.php toward the top make the following change in red:

    DisplayTemplate($theme_path."cat_header.html", "\$page_title, \$cat, \$cat_path_clean, $meta_keywords,\$meta_description,\$login_box");

    then in browse.html use <%cat_path_clean%>

    you can see it here:
    http://www.indexuhelp.com/indexu/browse.php?cat=119
    Last edited by esm; 12-06-2003 at 08:01 PM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Replies: 0
    Last Post: 05-28-2004, 04:12 AM
  2. Replies: 2
    Last Post: 08-05-2003, 02:16 AM
  3. Category Jump Hack/Mod ??
    By ideavirus in forum v3.2
    Replies: 9
    Last Post: 06-27-2003, 10:11 AM
  4. 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
  •