Different Way of Displaying Categories - MOD Different Way of Displaying Categories - MOD
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Different Way of Displaying Categories - MOD

Started by Dr Preacox, May 31, 2006, 07:55:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr Preacox

=Okay basically this mod is a substitute for the /catlist/ feature which you set in the config and displays your categories on the gallery home page, basically using drop down lists, this is extremely handy when you have hundreds of catergories and albums.

Go here to see a DEMO

Still interested? then read on.....

First thing you need to do is enable anycontent.php in your admin settings, and hopefully it will show on the top of your board, if not then your going to have to edit your theme.php and make anycontent.php display where ever you want the drop down lists to appear.

Now for the code which you need to copy into /gallery/anycontent.php

<div align="center" class="tableh1">Browse Art</div><br>
<br>
Please choose a category.
<div align="center">
<script language="javascript" type="text/javascript">
function Go() {
if (document.artform.artlinks[document.artform.artlinks.selectedIndex].value != "") {
location = document.artform.artlinks[document.artform.artlinks.selectedIndex].value
}
}//--></script>
<form name="artform">
<select name="artlinks" class="nav">
<option value="#">All Categories</option>

<option value="http://www.URLTOYOURGALLERY.com/gallery/index.php?cat=10" class="navbold">Category Name</option>
        <option value="http://www.URLTOYOURGALLERY.com/gallery/thumbnails.php?album=" class="nav"> --> Album Name</option>
                <option value="http://www.URLTOYOURGALLERY.com/gallery/thumbnails.php?album=" class="nav"> --> Album 2 Name</option>

</select>
<input type="button" value="Go!" onClick="Go()" class="nav">
</form>
</div>


Now to edit the code above, since unfortuantly this script doesn't do everything for you yet, you need to customize the option values as you choose. I'v given some examples, you just need to paste your Category and Album links inside.

Now for the CSS styles which you copy to /gallery/themes/YOURTHEME/styles.css

select.nav {
background-color: #444444;
font-size: 12px;
color: #ffffff;
}

option.navbold {
background-color: #222222;
font-weight: bold;
font-size: 12px;
color: #ffa51e;
}

input.nav {
border: 1px solid #1b1c1c;
background: #444444;
color: #8A8E95;
}


Done!!

Im building a plugin version of this code which does everything for you, but untill then here's this, its hard to implent for Newbs, but we where all ones once.

If you have any troubles please feel free to ask. The Devs probably wont approve of this since its so damn ugly and probably buggy, so use at your own risk.

Samuel Freeman~
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

cgc0202

Quote from: Dr Preacox on May 31, 2006, 07:55:15 PM
=Okay basically this mod is a substitute for the /catlist/ feature which you set in the config and displays your categories on the gallery home page, basically using drop down lists, this is extremely handy when you have hundreds of catergories and albums.
Samuel Freeman~

Hi Samuel,

Actually, some of the applications I plan to use the Coppermine Photo Gallery (CPG) would involve not hundreds but more like tens of thousands of categories and albums, once it is complete -- if such numbers would result in a very slow presentation of photos in the gallery.  Examples would include taxonomic classifications of animals, plants, fungi, etc. Animals taxonomy, for example would involve more than 40,000 categories (and more ones the albums are included).

Your mod would be very useful for such galleries.

In the demo, two drop down menus  were shown in the main gallery page.  A CPG with tens of thousands of categories and albums (e.g., taxonomic classifications) would require more dropdown menus.  I was thinking of creating an A-Z index of links of such dropdown menus for the major categories -- preferrably appearing in a separate page, rather than in the main photogallery page.  Clicking a major category link in the A-Z index page  would lead to another page containing the dropdown menu of the major category much like your Demo.  I wonder how your script may be modified to achieve this.

There are other applications of your Mod that I could think of, e.g., interfacing it would create category, create albums, etc. -- to  avoid the "mile-length", slow and confusing  category, albums, etc. lists that will result with the current CPG.

cgc0202

Dr Preacox

40.000 albums ay? well I would suggest putting them into around 40 or less catergories, and then you can do this, you can have a drop down on list on the left which chooses the Main catergory, then another besides it which chooses a sub catergory which then will change the one on the right of that which will display the Albums

so from left to right you have three drop down boxes, and by choosing a selection on the left it will change the contents of the next one, so you would use a code such as following to change the contents of each drop down box, it would be a lot of work,


<!--select id="browse-category-select" name="category" onchange="BrowseCategorySelect(this);">
                <!--select id="browse-category-select" name="category" onchange="BrowseCategorySelect(this);">
                <option value="">All Categories</option>
                                </select-->


but I think 40,000 it excessive, especially for one databse, I mean backups of that would be almost impossible, maybe try downsizing your amount of albums? Im sure you have thought of this, but I can see a lot of errors which could occur from such over use :)

Sam~
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

cgc0202

Thanks Sam,

Quote from: Dr Preacox on June 07, 2006, 08:27:39 AM
40.000 albums ay? well I would suggest putting them into around 40 or less catergories, and then you can do this, you can have a drop down on list on the left which chooses the Main catergory, then another besides it which chooses a sub catergory which then will change the one on the right of that which will display the Albums

so from left to right you have three drop down boxes, and by choosing a selection on the left it will change the contents of the next one, so you would use a code such as following to change the contents of each drop down box, it would be a lot of work,

Actually, it is more than 40,000 categories and subcategories, as you can see for example in this link:

http://www.itis.usda.gov/itis_phy.html

for the taxonomic classification of animals, for example (i.e., phylum -> genus).  The number of albums would even be larger.  Unfortunately, the number of dropdown menus cannot be arbitrarily subdivided, as you suggested -- because this will be dependent on the way the taxonomic classification have been specified.  Moreover, in scientific taxonomy, the names of the categories-subcategories are almost identical as you go deeper into the subcategories within each major category. 

As a result, it is imperative that certain categories would have their own drop down menus.  It is for this reason that I suggested  the A-Z indexing of the categories in a separate page, and inquired whether that could be done in the existing CPG

Quote from: Dr Preacox on June 07, 2006, 08:27:39 AM
but I think 40,000 it excessive, especially for one databse, I mean backups of that would be almost impossible, maybe try downsizing your amount of albums? Im sure you have thought of this, but I can see a lot of errors which could occur from such over use :)

Sam~

You are correct, this is the reason why I decided to create related multigalleries (with each gallery having its own database) because as I stated above, after you add the albums, the hypothetical number would even be greater.  For example, the more popular major taxonomic categories would have their own gallery and linked to a master introductory gallery that will include all the major taxonomic groups. 

If you examine the ITIS taxonomy database (see link above) for example, there will be three major introductory galleries (as a start) for animals, plants, fungi -- each with its own set of related multigalleries.

This multigalleries approach has its own drawbacks -- each Coppermine Photogallery  code is more than 10MB, and they will add up.  More importantly, if there are too many galleries, it will be a pain to upgrade each of them.  [It is not germane to this thread, but the solution to that would be a  Coppermine Photogallery  code that will be able to control multiple galleries. I believe there is such a feature already.  I have just not implemented it.]

cgc0202


Gephri

This tweak is close to what I need to easily navigate to one of several categories > albums ...except that it must have the information hard coded.  Has anyone figured a way to dynamically create a menu system like this - that pulls info from the CPG database?

OzButcher

The DEMO site seems to be down. If anyone has another site where I can see a demo please post it, thanks :)

Hein Traag

QuoteIm building a plugin version of this code which does everything for you, but untill then here's this, its hard to implent for Newbs, but we where all ones once.

Any update on that part :)