Results 1 to 8 of 8

Thread: 3 or 4 columns in INDEXU LITE

  1. #1
    Join Date
    Feb 2003
    Location
    Saudi Arabia - Jeddah
    Posts
    141

    Lightbulb 3 or 4 columns in INDEXU LITE

    for Indexu LITE :

    How can I modify the scripts, so it shows 3 or 4 columns on the frontpage ,

    thanx

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

    Default

    the following should work but no guarantees...

    change $num_cols as needed to 3, 4, 5, etc

    Code:
    <?php
    
    include("application.php");
    
    // ---------------
    //  functions
    // ---------------
    
    function ShowMainPage() {
    global $template_path,$number_of_links;
    global $category;
    global $cat_table_width,$cat_cellspacing,$cat_font_face,
    $cat_font_size,$cat_link_style,$subcat_font_face,
    $subcat_font_size,$subcat_link_style;
    
    // ----- display categories in 2 columns -----
    
    $category = "<table width=$cat_table_width cellspacing=$cat_cellspacing>";
    $category .= "<tr>";
    
    // get main category
    
    $query = "select category_id, name from category where parent_id = 0 order by name";
    $result = mysql_query($query);
    $num_cats = mysql_num_rows($result);
    
    // loop for 2 columns
    $category .= "<td valign=top>";
    
    // mod
    $num_cols=3;
    $break = number_format(($num_cats  )/$num_cols);
    $i=1;
    $k=1;
    $m=1;
    while($i < $num_cats){
    $cat_id = mysql_result($result,$i,"category_id");
    $cat_name = mysql_result($result,$i,"name");
    
    $get_number_of_links = GetNumberOfLinks($cat_id);
    $html_number_of_links = str_replace("<%number_of_links%>",$get_number_of_links,$number_of_links);
    
    $cat_url = "browse.php?cat=$cat_id";
    $category .= "<p><FONT FACE=$cat_font_face SIZE=$cat_font_size>";
    $category .= "<B><A HREF=\"$cat_url\" style=\"$cat_link_style\">$cat_name</A></B> $html_number_of_links \n";
    $category .= "<BR>\n";
    
    // get sub category
    
    $query = "select category_id, name from category where parent_id=\"$cat_id\" order by name";
    $result_sub = mysql_query($query);
    $num_subs = mysql_num_rows($result_sub);
    
    $j = 0;
    
    while(($j < $num_subs) && ($j < 3)){
    $sub_id = mysql_result($result_sub,$j,"category_id");
    $sub_name = mysql_result($result_sub,$j,"name");
    
    $sub_url = "browse.php?cat=$sub_id";
    $category .= "<FONT FACE=$subcat_font_face SIZE=$subcat_font_size>\n";
    $category .= "<A HREF=\"$sub_url\" style=\"$subcat_link_style\">$sub_name</A> ";
    
    $j++;
    
    if(($j==3)&&($j < $num_subs)) {
    $category .= "...\n";
    }
    }
    if ($break == $k and $m <> $num_cols){
    $category .= "</td><td valign=top>\n\n";
    $k=0;
    $m++;
    }
    $i++;
    $k++;
    
    }
    
    $category .= "</td></tr></table>";
    
    DisplayTemplate($template_path."index.html","\$category,\$cat,\$ma");
    }
    
    // ---------------
    //  main program
    // ---------------
    
    ConnectDB();
    $title = $title_1101;
    DisplayTemplate($template_path."header.html","\$title,\$cat,\$ma");
    ShowMainPage();
    DisplayTemplate($template_path."footer.html","\$cat,\$ma");
    
    ?>
    Last edited by esm; 08-23-2003 at 02:45 AM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    Join Date
    Aug 2005
    Posts
    8

    Default It works

    Thanks for the reply and just to say that works fine
    Many Thanks

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

    Default

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

    .

  5. #5
    Join Date
    Mar 2005
    Posts
    7

    Default

    this will work woth index page, i want to display sub categories in 3 coloumn in browse.php page.

    can you please give a mod for browse.php to display categories in 3 columns

    thanks in advance

  6. #6
    Join Date
    Mar 2006
    Posts
    26

    Default

    Does this code work also for 5.1.0 ? Do I have to place it in category.class.php ?
    Thanks in advance

  7. #7
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    for version 5

    themes/Kosmos/settings.php

    change this line :
    $cat_columns = 2;
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  8. #8
    Join Date
    Mar 2006
    Posts
    26

    Default

    sorry, I was thinking of smth. else. I will open a new thread, if I don't find the issue I'm interested in.

Similar Threads

  1. Indexu Lite Edition (FREE!)
    By Hart_House in forum Customer Reviews
    Replies: 10
    Last Post: 07-01-2005, 01:54 AM
  2. no mail is send by Indexu Lite...
    By ms70 in forum v5.x
    Replies: 0
    Last Post: 04-01-2004, 09:44 AM
  3. INDEXU (lite) Installation
    By Lucideye in forum v5.x
    Replies: 2
    Last Post: 09-16-2002, 06:55 PM
  4. trying INDEXU lite
    By cafepharma in forum Pre-Sales Questions
    Replies: 4
    Last Post: 08-17-2002, 09:30 AM
  5. Replies: 2
    Last Post: 06-21-2002, 10:21 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
  •