PK's MovieDB Release.V3.0 (Dynamic PHP View)
Image Errors
Hello,
First of all, I am new user.. However, I would like to say that your template is very good, modern look and nice arrangement.
I have followed all steps you have had lists, everything works fine, except showing image. Some images are shown, but somes are not. I don't understand what the problem is, can you please advise-???
Just for information about image files, all image is jpg file. All of them is same size.
Thanks in advance for your kindly advise.
This is the link for my movies...
http://dvrinfo.awardspace.com/
First of all, I am new user.. However, I would like to say that your template is very good, modern look and nice arrangement.
I have followed all steps you have had lists, everything works fine, except showing image. Some images are shown, but somes are not. I don't understand what the problem is, can you please advise-???
Just for information about image files, all image is jpg file. All of them is same size.
Thanks in advance for your kindly advise.
This is the link for my movies...
http://dvrinfo.awardspace.com/
Re: Image Errors
clyde2006 wrote:Hello,
First of all, I am new user.. However, I would like to say that your template is very good, modern look and nice arrangement.
I have followed all steps you have had lists, everything works fine, except showing image. Some images are shown, but somes are not. I don't understand what the problem is, can you please advise-???
Just for information about image files, all image is jpg file. All of them is same size.
Thanks in advance for your kindly advise.
This is the link for my movies...
http://dvrinfo.awardspace.com/
Thats odd.. are you sure all the images uploaded ok.. eg some of the ones that are not showing are
movies_1788.jpg
movies_1784.jpg
movies_1785.jpg
are these in the ANTEXPORT directory?
try also clearing out the cache files in Templates/default/cache
Kazgor, I understand your numbering bug completely. As to why its doing this, I have no clue. Because it's working on my end, its near impossible to track down. Perhaps sometime we can chat about this on AIM, and I can have you run through some minor debugging.
----------
A quick explanation as to how I calculate the numbers. Because I take into account comma separated variables, as well as have the special "_OTHER" category, I must make two passes through the database to calculate the numbers shown on the panels.
FIRST PASS: I simply run a standard query selecting ALL movies in the database (this would be equivalent to all filters on "_ALL"), to generate the initial counts. This first pass simply lets me know what options should be placed in _OTHER and what should not.
SECOND PASS: I run another query, but this time I know what groups should be in the _OTHER section, I also can apply all the filters. This way if there is a count of zero, I still know I need to display it (because it was not zero in the first pass).
I know this is a bit confusing. It almost sounds somehow the second pass to recount those values is not happening.
----------
A quick explanation as to how I calculate the numbers. Because I take into account comma separated variables, as well as have the special "_OTHER" category, I must make two passes through the database to calculate the numbers shown on the panels.
FIRST PASS: I simply run a standard query selecting ALL movies in the database (this would be equivalent to all filters on "_ALL"), to generate the initial counts. This first pass simply lets me know what options should be placed in _OTHER and what should not.
SECOND PASS: I run another query, but this time I know what groups should be in the _OTHER section, I also can apply all the filters. This way if there is a count of zero, I still know I need to display it (because it was not zero in the first pass).
I know this is a bit confusing. It almost sounds somehow the second pass to recount those values is not happening.
MJS: its very weird init and worse if you can't reproduce it, it seem to do the same thing locally using EasyPHP server and on Awardspace.
Now to make matters ever stranger i just saw that Blog post by Lul2x and that one works how it should be doing.
I notice you have a function called recount_categories in mdb_panel.inc but for i can't seem to find where or how this gets called. also fetch_all_categories(). (found it in mdb3.php)
are these the two function you call to calculate the panel values? if you can point me to how you call panel values i can add some debugging in.
Sorry not not got Aim... at work tomorrow im going to try from a complete blank database and do a fresh import to see if that may help.
ta for looking though.
Now to make matters ever stranger i just saw that Blog post by Lul2x and that one works how it should be doing.
I notice you have a function called recount_categories in mdb_panel.inc but for i can't seem to find where or how this gets called. also fetch_all_categories(). (found it in mdb3.php)
are these the two function you call to calculate the panel values? if you can point me to how you call panel values i can add some debugging in.
Sorry not not got Aim... at work tomorrow im going to try from a complete blank database and do a fresh import to see if that may help.
ta for looking though.
What version of PHP are you running on. Perhaps its some weird condition with that.kazgor wrote:MJS: its very weird init and worse if you can't reproduce it, it seem to do the same thing locally using EasyPHP server and on Awardspace.
Now to make matters ever stranger i just saw that Blog post by Lul2x and that one works how it should be doing.
I notice you have a function called recount_categories in mdb_panel.inc but for i can't seem to find where or how this gets called. also fetch_all_categories(). (found it in mdb3.php)
are these the two function you call to calculate the panel values? if you can point me to how you call panel values i can add some debugging in.
Sorry not not got Aim... at work tomorrow im going to try from a complete blank database and do a fresh import to see if that may help.
ta for looking though.
fetch_all_categoies is called from the constructor of a panel. I can't recount all categories until all the panels are constructed. Therefore, recount_categories is called after I first create all panels in mdb3._fetch_panels(). Make sense?
Hey,
Someone browsing my movie database made a suggestion that could be a pretty cool addition. The suggestion was to have check-boxes beside each movie title (most likely in "list" mode) so that one could check movies as they go through them and then when they are finished, hit some sort of "Finished" button and then be given a list of all the movies they've selected.
For example, if I have 100 movies on 10 pages, I go through each page, checking (like an html button) all the movies I want to watch. At any time, I can click the "Finish" button (which may be at the bottom of the page) which will display all the movies I've chosen.
Any idea what kind of code this would require, and how hard it would be to implement? Thanks.
Someone browsing my movie database made a suggestion that could be a pretty cool addition. The suggestion was to have check-boxes beside each movie title (most likely in "list" mode) so that one could check movies as they go through them and then when they are finished, hit some sort of "Finished" button and then be given a list of all the movies they've selected.
For example, if I have 100 movies on 10 pages, I go through each page, checking (like an html button) all the movies I want to watch. At any time, I can click the "Finish" button (which may be at the bottom of the page) which will display all the movies I've chosen.
Any idea what kind of code this would require, and how hard it would be to implement? Thanks.
This could be done with a cookie or session variable and not be too bad. However, for version 3 I simply wanted to keep it simple. Two reasons:Lul2x wrote:Hey,
Someone browsing my movie database made a suggestion that could be a pretty cool addition. The suggestion was to have check-boxes beside each movie title (most likely in "list" mode) so that one could check movies as they go through them and then when they are finished, hit some sort of "Finished" button and then be given a list of all the movies they've selected.
For example, if I have 100 movies on 10 pages, I go through each page, checking (like an html button) all the movies I want to watch. At any time, I can click the "Finish" button (which may be at the bottom of the page) which will display all the movies I've chosen.
Any idea what kind of code this would require, and how hard it would be to implement? Thanks.
- Writing too much code at once is bad.. bugs won't be caught / fixed.
- I have other projects in my freelance I need to move onto.
That said, don't expect it anytime soon from me.. but it is a CC license and adding this feature could be anyone's game.
EDIT: that sounds a bit mean, but I really am just trying to say I'm getting too busy at the moment.
Hey, don't worry about it at all. You have already done so much with this great project! I was just wondering what it would take, I can't expect you to meet my personal wants, . I definitely understand what it's like to be busy and what you've done is appreciated. Keep up the great workmjs7231 wrote:
EDIT: that sounds a bit mean, but I really am just trying to say I'm getting too busy at the moment.
It's not just a personal want for yourself. I thought about this too, and think it would be awesome to somehow 'star' the movies for whatever purpose you please. Perhaps with a simple little ajax engine it could be done without too much hassle. I'll keep thinking about it.Lul2x wrote:Hey, don't worry about it at all. You have already done so much with this great project! I was just wondering what it would take, I can't expect you to meet my personal wants, . I definitely understand what it's like to be busy and what you've done is appreciated. Keep up the great workmjs7231 wrote:
EDIT: that sounds a bit mean, but I really am just trying to say I'm getting too busy at the moment.
@MJS..
Hi,
I've added a couple of PRINT lines into the RECOUNT_CATEGORIES function and it looks like it doing what its suppose to be doing.
if you go to http://brunes-movies.awardspace.com/index.php you can see it in action..
Basically if you click on say YEAR 2002 it has 5 movies to it.. now if you look at the debug you can see that in 2002 there are 2 action films 1 Adventure film etc.. and for Country they are 5 USA films. So that bit looks all fine?!?
I then printed out all the Values in the CATEGORIES array, so it all looks fine in this function.
anyway heres that function so you can see when i added the debugs, hope it helps!
*edit*
ok i can get it kinda of working, but ALL and OTHERS dont recalculate, but what i've done is a hack job.
in mdb_panel.inc i've tweaked _templates_categories() and added a call to recount_categories before the FOREACH loop ( $this->categories = $this->recount_categories(); )
and in the recount_categories function i've added a return categories;
so it sort of works.. but is it just me thats getting this odd bug?
any way i not sure how to debug the proper function in fetch_panels()
# SECOND RUN: Recount all values based on _OTHERS
foreach($this->panels as $panel) {
$panel->recount_categories();
}
need to debug $PANEL to see if it is remembering the values from recount_cageories?
hmmm.. hope it helpful? im just grasping now.
Hi,
I've added a couple of PRINT lines into the RECOUNT_CATEGORIES function and it looks like it doing what its suppose to be doing.
if you go to http://brunes-movies.awardspace.com/index.php you can see it in action..
Basically if you click on say YEAR 2002 it has 5 movies to it.. now if you look at the debug you can see that in 2002 there are 2 action films 1 Adventure film etc.. and for Country they are 5 USA films. So that bit looks all fine?!?
I then printed out all the Values in the CATEGORIES array, so it all looks fine in this function.
anyway heres that function so you can see when i added the debugs, hope it helps!
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";
}
debug here--> print "| value=".$value." count=".$count." | ";
# Add the Value to the Categories
if (isset($categories[$value])) {
$categories[$value] += $count;
debug here--> print "here1 <br/>";
} else {
$categories["_OTHER"] += $count;
debug here--> print "here2 <br/>";
}
}
}
# Finish Up.. Save the Categories
$this->categories = $categories;
foreach ($categories as $myvals) {
print $myvals."<br>";
}
}
*edit*
ok i can get it kinda of working, but ALL and OTHERS dont recalculate, but what i've done is a hack job.
in mdb_panel.inc i've tweaked _templates_categories() and added a call to recount_categories before the FOREACH loop ( $this->categories = $this->recount_categories(); )
and in the recount_categories function i've added a return categories;
so it sort of works.. but is it just me thats getting this odd bug?
any way i not sure how to debug the proper function in fetch_panels()
# SECOND RUN: Recount all values based on _OTHERS
foreach($this->panels as $panel) {
$panel->recount_categories();
}
need to debug $PANEL to see if it is remembering the values from recount_cageories?
hmmm.. hope it helpful? im just grasping now.
I'll takie a deeper look at this tonight..
---
Here is a VERY handy function for debugging. Just place it someplace in the global scope (not in a class). Call it when you want to visually see the contents of anything.
Now take out all your debugging, and put this line at the very end of the function..
print_r_html($this->categories);
Is it correct? If so, goto the function.. MDB3.php/_fetch_panels and place these lines inside the second foreach loop at the end.. (the exit will just stop your app after processing the first panel)
print_r_html($panel)
exit();
My guess right now is that the second print statement will not be correct.
---
Here is a VERY handy function for debugging. Just place it someplace in the global scope (not in a class). Call it when you want to visually see the contents of anything.
Code: Select all
#----------------------------------------------------------
# FUNCTION: print_r_html($Array)
# PURPOSE: Same as print_r, but in HTML Format.
#----------------------------------------------------------
function print_r_html($Array, $return=FALSE) {
$myStr = str_replace("\n", "<br>", print_r($Array, TRUE));
$myStr = str_replace(" ", " ", $myStr);
if ($return) { return $myStr; }
print $myStr;
}
print_r_html($this->categories);
Is it correct? If so, goto the function.. MDB3.php/_fetch_panels and place these lines inside the second foreach loop at the end.. (the exit will just stop your app after processing the first panel)
print_r_html($panel)
exit();
My guess right now is that the second print statement will not be correct.
Thanks MJS thats a nice debugging function.
I've done the debug in both area's mentioned and attached a copy of the file, could you pls havea loook and see if it makes sense, to me it looks like its working in those two functions so it could be somewhere later on that its failing.
http://www.mytempdir.com/1161807
cheers.
I've done the debug in both area's mentioned and attached a copy of the file, could you pls havea loook and see if it makes sense, to me it looks like its working in those two functions so it could be somewhere later on that its failing.
http://www.mytempdir.com/1161807
cheers.
Hmm, they both look fine to me too. The only thing to do is keep going down the code path to see where it gets switched back.. You can make the second printout a bit smaller if you "print_r_html($this->panels->categories)" then you won't see the whole rest of the object.kazgor wrote:Thanks MJS thats a nice debugging function.
I've done the debug in both area's mentioned and attached a copy of the file, could you pls havea loook and see if it makes sense, to me it looks like its working in those two functions so it could be somewhere later on that its failing.
http://www.mytempdir.com/1161807
cheers.
hi,mjs7231 wrote:Hmm, they both look fine to me too. The only thing to do is keep going down the code path to see where it gets switched back.. You can make the second printout a bit smaller if you "print_r_html($this->panels->categories)" then you won't see the whole rest of the object.kazgor wrote:Thanks MJS thats a nice debugging function.
I've done the debug in both area's mentioned and attached a copy of the file, could you pls havea loook and see if it makes sense, to me it looks like its working in those two functions so it could be somewhere later on that its failing.
http://www.mytempdir.com/1161807
cheers.
ok.. Recount_categories and _fetch_panels both have the correct values in categories.. but when it gets to _main_template() function which calls _panel_templates() a this stage Categories is back to the ALL values state.
what do u get when you debug the _main_template/_panel_templates() functions?
ta
ok still getting the problem both locally and on awardspace
from what i can tell from the debugging, the Categories is calculated correctly in the MD3() function which calls _fetch_panel(), before inside and on it return Categories is correct.
Next GET_HTML() is called, now if i debug all of $THIS at this stage before it calls $maintpl = $this->_main_template(); Categories is now incorrect.
So when it goes into _templates_categories() the $This->Categories array now contains the old ALL value states.
very confused now..
the botch is to do a call to _recount_categories inside the templates_categories function, but this means that the Recount will run an SQL state for per panel.. so if you have 7 panels visable its goingto do the same function7 times.. even though the first time its worked out the values for all 7 panels. so ideally i would need createa new function.
allwell but this will obviously break my version ages any future releases.
mmm.. at a stop now.. not sure what to do next?
from what i can tell from the debugging, the Categories is calculated correctly in the MD3() function which calls _fetch_panel(), before inside and on it return Categories is correct.
Next GET_HTML() is called, now if i debug all of $THIS at this stage before it calls $maintpl = $this->_main_template(); Categories is now incorrect.
So when it goes into _templates_categories() the $This->Categories array now contains the old ALL value states.
very confused now..
the botch is to do a call to _recount_categories inside the templates_categories function, but this means that the Recount will run an SQL state for per panel.. so if you have 7 panels visable its goingto do the same function7 times.. even though the first time its worked out the values for all 7 panels. so ideally i would need createa new function.
allwell but this will obviously break my version ages any future releases.
mmm.. at a stop now.. not sure what to do next?