Page 3 of 29
Posted: 2007-01-07 13:45:33
by r32
No. Nothing happens with the "All"-value.
Its the same number. no decrease.
Image Errors
Posted: 2007-01-07 19:43:57
by clyde2006
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/
Re: Image Errors
Posted: 2007-01-07 20:26:52
by kazgor
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
Posted: 2007-01-07 21:40:22
by clyde2006
Hi Kazgor,
Thanks for your reply... Now I found out, you were correct, I made mistake on placing image files.. As I made test several time. so i missed to take thenm in correct places.. Thanks so much again for help.. Now it seems working well!
Regards,
Clyde
Posted: 2007-01-07 23:35:13
by mjs7231
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.
Posted: 2007-01-07 23:50:13
by kazgor
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.
Posted: 2007-01-08 00:45:17
by mjs7231
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.
What version of PHP are you running on. Perhaps its some weird condition with that.
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?
Posted: 2007-01-08 05:22:06
by mjs7231
DOWNLOAD NOTE:
I moved the location of /moviedb3 to just /moviedb on my server, this fits better with my page layouts.. I believe I fixed all links on this site.
(And yes, Im pretty anal)
Posted: 2007-01-08 07:16:28
by kazgor
actually thought about posting the PHP/SQL version after i went bed like you said it could be something funky in the recount_categories function it doesnt like.
EasyPHP (local server)
PHP 4.3.10
MySQL 4.1.20-community
Awardspace
PHP 4.4.1
MySQL 4.0.24
Posted: 2007-01-08 23:16:23
by Lul2x
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.
Posted: 2007-01-09 01:42:55
by mjs7231
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.
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:
- 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.
Posted: 2007-01-09 05:26:46
by Lul2x
mjs7231 wrote:
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 work
Posted: 2007-01-09 06:14:03
by mjs7231
Lul2x wrote:mjs7231 wrote:
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 work
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.
Posted: 2007-01-09 16:16:22
by kazgor
@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!
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.
Posted: 2007-01-11 01:06:48
by mjs7231
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.
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;
}
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.
Posted: 2007-01-12 00:07:36
by kazgor
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.
Posted: 2007-01-12 03:21:44
by mjs7231
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.
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.
Posted: 2007-01-12 23:23:20
by cobracio
Hi all,
i've some problems, what else
!
How can i use PHP in the template files??
I'd like to script some things.
Sorry for my BAD english.
So long ...
Big thanks
Posted: 2007-01-13 00:23:57
by kazgor
mjs7231 wrote: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.
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.
hi,
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
Posted: 2007-01-14 23:28:39
by kazgor
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?