English > Development
PK's MovieDB dynamic website template
botez:
I've been messing with this script once again (http://botez.byethost9.com/index.php) and am trying to find a way to sort by last names for fields like Director, Actor, etc. Currently, you can only sort by the first letter of the first name.
I figure there has to be a way to do this, either via a SQL command on the existing database or some kind of regular expression on the export out of PVD. Or perhaps it all has to be done in the PHP, like the "period" function from a few posts above.
Does anyone have any ideas on this?
mgpw4me@yahoo.com:
It will be difficult to sort by last name when the database keeps the entire name in a single field. Without first separating surnames from given names manually, you can't really tell where the last name starts. There's also an issue with groups of people (bands, comedy groups, whatever) being listed in the database.
Examples follow:
Lee Van Cleef
Anthony Michael Frederick
Miou-Miou
Bjork
4 Out of 5 Doctors (a band)
Ana LĂșcia da Rocha Franco
botez:
Thanks mgpw4me. That makes perfect sense. I'll just let that one go for now :)
Two other things I'd love to get some tips on, both regarding side panels:
1) First off, I want to get them to sort by count, instead of by name. Thus a director panel would be ordered by number of movies in my database instead of alphabetically. I swear this should be a simple tweak of the panel template code and how the keys/values are sorted, but I've yet to be able to get it to work.
EDIT: I finally figured this one out -- needed to edit the mdp_panel.inc and change the following line in the sort_categories function:
$keys = array_keys($categories);
sort($categories);
to
ksort($categories);
arsort($categories);
$keys = array_keys($categories);
I then create a second function and a second class that allows the panel to be sorted this way. Yippee.
2) When you select a subset of data, say showing all the films that have the genre of "horror", the side panel for directors stays with the same set of names that it has for the entire movie collection. So, if I have 10 James Cameron films in my database and then select "horror", instead of showing me the directors with the most horror movies, it would just keep Cameron on there with a "0" next to his name, since he has no horror movies. You can click on my database if this makes no sense (http://botez.byethost9.com/index.php?genre=Horror) to see what I'm talking about.
I'd like to find a way to be able to get the side panel to update when you drill down into genres/years/etc.
Thanks for any help anyone can provide.
afrocuban:
How we can block guests? We have spam here.
Ivek23:
--- Quote from: afrocuban on December 20, 2023, 08:54:41 pm ---How we can block guests? We have spam here.
--- End quote ---
Thanks for the warning, I didn't see it, I would have removed it earlier, so I removed it now. Obviously, as an admin, I will have to disable guests from continuing to post on the forum.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version