Author Topic: Addtional Cat Fields  (Read 5535 times)

0 Members and 1 Guest are viewing this topic.

Offline anrob

  • Pre-Newbie
  • Posts: 6
    • View Profile
Addtional Cat Fields
« on: December 12, 2002, 12:33:16 AM »
I have looked and cant find the answer for this one.

How can i add more fields to the categories in the admin.

I have been able to find everything but that.

It doesnt seem to be as easy as adding fields to the user section.


any ideas?
Also has anyone found out how to add more then 1 random image to the front page.  I have tried everything i can find here and all i have is 3 of the same random images.


Thanks

anrob

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: Addtional Cat Fields
« Reply #1 on: December 12, 2002, 12:49:16 AM »
Quote from: anrob
How can i add more fields to the categories in the admin.

Do you mean additional fields for the images?  It is not currently possible to add new fields to the categories themselves, only to user and image fields may be added.

Open includes/db_field_definitions.php and read the instructions there.

Offline anrob

  • Pre-Newbie
  • Posts: 6
    • View Profile
Addtional Cat Fields
« Reply #2 on: December 12, 2002, 02:31:41 AM »
Ok, I was able to add the table to the admin and also the database.

So when i add the new info it saves to the database.  The only thing that i can get is how to pull that info into the site.

i.e.  I added a field to the database called cat_age

It has all the info that i need i just need to get that info  to show up on the category page when you goto that cat.


Any Ideas?

Thanks Again

Anrob

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Nope
« Reply #3 on: December 12, 2002, 05:49:00 AM »
Sorry, no ideas.  You're now talking about making custom edits to the 4images php code and you're on your own (which is only to say that I don't know)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Addtional Cat Fields
« Reply #4 on: December 12, 2002, 09:27:58 AM »
First see the code in global.php after this line:
Code: [Select]
if (defined("GET_CACHES")) {
Add the new field to the sql query. All category data will be saved to the $cat_cache array. From this you can register the value to the template engine.

For example in categories.php

Add after
Code: [Select]
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
this
Code: [Select]
"cat_age" => $cat_cache[$cat_id]['cat_age'],
Now you can use {cat_age} in the categories.html template.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search