Results 1 to 3 of 3

Thread: Using a file in the category header field

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

    Default Using a file in the category header field

    Currently, indexu has a category header field that allows you to replace the cat_head.html file with your own custom category header information.

    But this is just a field of limited width making it hard to edit if you want to do anything significant.

    This hack allows you to either enter the text as before or a file name. If you enter a file name, indexu will call the file which contains all the html code for that category header.

    What it does is to look at the length of the data in the field. If the length is small, it assumes the info is a file. The variable max_header_length is set at 25 and is used to determine whether or not the field contains a file name or actual heml code for the category hearder. If the field is less than 25, it assumes the data is a filename and will look for it in the themes filder.

    $ma = 1;

    // mod for cat header file in $header
    $max_header_length=25;


    // mod for misc - online, hot, stats
    include("misc.php");


    if(empty($header))

    // mod for misc - online, hot, stats
    // DisplayTemplate($theme_path."cat_header.html","\$p age_title,\$cat,\$meta_keywords,\$meta_description ,\$login_box");

    DisplayTemplate($theme_path."cat_header.html","".
    "\$page_title,\$cat,\$meta_keywords," .
    "\$meta_description,\$hot_links,\$login_box," . // this should be on line above
    "\$total_online,\$members_online,\$guess_onlin e," . // online
    "\$username_online,\$total_link,\$total_hits," . // online and stats
    "\$total_category,\$total_member,\$total_milis "); // stats


    // mod for cat header file in $header
    elseif (strlen($header) < $max_header_length)
    DisplayTemplate($theme_path.$header,"".
    "\$page_title,\$cat,\$meta_keywords," .
    "\$meta_description,\$hot_links,\$login_box," .
    "\$total_online,\$members_online,\$guess_onlin e," .
    "\$username_online,\$total_link,\$total_hits," .
    "\$total_category,\$total_member,\$total_milis ");


    else
    print $header;

    ShowCategoryPage();

    if(empty($footer))
    DisplayTemplate($theme_path."footer.html","\$cat,\ $ma");
    else
    print $footer;
    ?>
    The above code includes the hack to allow the hot, stats, online, etc to be used in the header file. I've included the misc1.txt file ( vBulletin will not allow me to upload the same file more than once ). Rename it to misc.php and upload it to the same folder as the browse.php

    If you don't use that hack, the DisplayTemplate will look like:

    // mod for cat header file in $header
    elseif (strlen($header) < $max_header_length)
    DisplayTemplate($theme_path."$header","\$page_titl e,\$cat,\$meta_keywords,\$meta_description");
    You will need to create the category header file and place it in the themes/default folder. Then enter the file name in the header field on the edit category page.

    I have also set the max_header_length at 25. Change it to whatever you need.
    Attached Files Attached Files
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Very nice hack esm! It's close with what I'm thinking.

    If you see indexu templating around, indexu can't retrieve information from one page to other page, such as login box in index.html can't be used in browse.html. I'm thinking how to make them easily to be called by other page. I plan to use &lt;php>, but your idea is beyond of this. Good work!

  3. #3
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    1,180

    Default

    Hello,

    did you that also for a new linkdetail-template-header ?

    What I want is also special Title-Tag and something else for the detail pages, to give Google & co some more important content

    Greetings
    Frank

Similar Threads

  1. Replies: 3
    Last Post: 06-29-2004, 04:12 AM
  2. Replies: 2
    Last Post: 05-12-2004, 10:18 PM
  3. Getting full control of image uploader
    By dody in forum Tutorials, Hints & Tips
    Replies: 2
    Last Post: 08-20-2003, 05:14 PM
  4. Category formating
    By Rob Picken in forum v5.x
    Replies: 0
    Last Post: 03-13-2003, 12:00 PM
  5. Add a new category field
    By magnus in forum v5.x
    Replies: 6
    Last Post: 09-14-2002, 10:35 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
  •