hi all..
Thermal.. ta for popping in here and helping out.. you been doing a good job
Also nice job in replicating the FILM Strip side bars.. doing it in a table was the easiest way i could think of doing it.
It can be done in CSS but i need to experiement on exactly how, 2ways i've seen it done.
1. use a 600pixel width image with filmstrip logo on the left & right side of the image with the middle filled in with the colour u want. now do a Y repeat to make the image scroll down the page.
2. use a 3 column css layout... column 1 on 3 would be where the filmstrip image goes with column 2 being the main movie. I'll have to see if i can get an example to try out.
Doing the IMDB trivia wasnt so easy, i needed to first actived the Comment field (see ealier posts on howto) now i only use the field for trivia so i did not have to worry about stripping it out from the normal IMDB user comments.
Now Trivia when imported into ANTP all start with - (hyphen) so i wrote some php code to change these into <LI> tags so you get the nice bullet effect u see in my page.
Here the code to look at, you wouldnt be able to use it though as there are other bits you need to update before it can be activated and viewed, just thought you might want to see what was involved.
Code: Select all
function _callback_comments($args=NULL) {
# Set Default Arguments & Description
$maxchars = (($args == NULL) ? 400 : $args[0]);
$comm = $this->data['COMMENTS'];
$comm = substr($comm, 0, $maxchars);
# Check we want to include the "..." signifying (more)
$trivia_start = strpos($comm, "IMDB TRIVIA");
$trivia_end = strpos($comm, "|-", $trivia_start);
if ($trivia_start !== false) {
$comm_front = "<div class='imdbtrivia'>";
$comm_front .= substr($comm, $trivia_start, $trivia_end - 2);
$comm_front .= "</div>";
$comm_front .= substr($comm, $trivia_end-2, $maxchars);
$comm = $comm_front;
}
$firstdash = strpos($comm, "|-");
if ($firstdash !== false) { $comm=substr($comm, 0, ($firstdash)-2)."<ul><li>".substr($comm, ($firstdash)+2, $maxchars); }
if (strlen($comm) < strlen($this->data['COMMENTS'])) {
$comm = substr($comm, 0, strrpos($comm, " "));
$comm .= "...";
}
# Add the return lines
$comm = trim(str_replace("|- ", "</li><li>", $comm))."</li></ul>";
$comm = trim(str_replace("|", "<br/>\n", $comm));
return $comm;
}
its abit messy.. never got round to cleaning it up.
for the final part ie about Zero Categories mod. the easiest way i can explain it is to do the following.
edit
MDB_PANEL.INC find
function recount_categories() and replace it that function with this version.
Code: Select all
function recount_categories() {
# Sort what we have & Reset all counts to 0.
$categories = $this->sort_categories($this->categories);
foreach ($categories as $key => $val) {
$categories[$key] = 0;
}
# Recount all values, this time we know the _OTHER fields :)
$query = "SELECT ".$this->dbfield.",count(*) FROM ".$this->mdb->mysql_table;
$query .= $this->mdb->sqlwhere($this->dbfield);
$query .= " GROUP BY ".$this->dbfield;
$query .= " ORDER BY ".$this->dbfield;
$dbres = $this->mdb->db->query($query);
# Loop throught the MySQL Resource rows..
while ($row = $dbres->fetch_assoc()) {
$values = array($row[$this->dbfield]);
$count = $row['count(*)'];
$categories["_ALL"] += $row['count(*)'];
# Split the values, if its comma seperated
if (in_array($this->dbfield, $this->mdb->config['options']['comma_seperated'])) {
$values = explode(",", $values[0]);
}
# Count all the subvalues..
foreach($values as $value) {
# Get the correct Value
$value = trim($value);
if (in_array($value, $this->_BLANKvalues) and (sizeof($values) == 1)) {
$value = "_OTHER";
}
# Add the Value to the Categories
if (isset($categories[$value])) {
$categories[$value] += $count;
} else {
$categories["_OTHER"] += $count;
}
}
}
# Finish Up.. Save the Categories
if ($this->mdb->config['options']['empty_categories'] == FALSE) {
$categories = $this->blank_categories($categories);
}
$this->categories = $categories;
}
/** -------------------------------------------------------------------------------------------
* Remove any categories that are blank
* -----------------------------------------------------------------------------------------*/
function blank_categories($categories) {
foreach ($categories as $value => $count ) {
if (($value != "_ALL") and ($count == 0) ) {
unset($categories[$value]);
}
}
return $categories;
}
With V3 working differently to V2 i dont think you can do that ALPHABET box, besides V3 as better filters now that you narrow you film selection quick that just Jumping to film Y.
I've been waiting for PK to release version 3.0.4 as that as a few fixes and changes that would mean i have to re-add all my changes to it again but i may just release my MOD once at somepoint.