Author |
Message |
fmanjo
New Member


Joined: Feb 09, 2004
Posts: 7
|
Posted:
Mon Feb 09, 2004 11:04 pm |
|
I'm having problems with the table in which the historical data is displayed. It is messed up. I know the problem is in this piece of code:
Code: for ($i=0;$i<$cnt;$i++) {
$j++;
if ($j%6==0) {
$j++;
$history .= "<td>".substr($read[$i],0,6)."</td></tr>";
if (substr($read[$i],7,1)==0) $pos=8;else $pos=7;
$history .= "<tr><td>".substr($read[$i],$pos)."</td>";
}
else $history .= "<td>".$read[$i]."</td>";
|
I have changed if ($j%6==0) for if ($j%7==0) but this is not sufficient. The adjusted close shows up messed with dates. Some other number on this piece has to be changed but I don't know too much php. Can anyone help me? |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Feb 09, 2004 11:40 pm |
|
I fixed it about 2 weeks ago and am testing it on my site. Try it on mine and let me know if it works. Yahoo changed their feed. |
|
|
|
 |
fmanjo

|
Posted:
Tue Feb 10, 2004 7:09 am |
|
It is working very well on your site. Can you provide me with the fix? |
|
|
|
 |
Raven

|
Posted:
Tue Feb 10, 2004 7:10 am |
|
I will be releasing it shortly. |
|
|
|
 |
fmanjo

|
Posted:
Tue Feb 10, 2004 9:18 am |
|
By the way, very good job you have done. Very good module. I have a few suggestions about calculations of portfolio but i will post another topic about that.
and hope you provide us soon with the modifications for the data like in your site, since this is an excellent feature of the script. |
|
|
|
 |
Raven

|
Posted:
Tue Feb 10, 2004 9:58 am |
|
|
|
 |
fmanjo

|
Posted:
Tue Feb 10, 2004 10:54 am |
|
Now the table is displaying correctly like at your site. But there is still one thing that I think can be corrected. The data retrieved from yahoo generally is from one month later than the date you requested. I've looked at yahoo historical quotes and I noticed that when you put the month, for example, may, which corresponds to 5 in this case, if you look at the addrees bar on your browser it shows 4 on the month. The variable $month must be redefined to month-1 or something like this in order to retrieve the data correctly. If this can be corrected on the script, it will be perfect. |
|
|
|
 |
Raven

|
Posted:
Tue Feb 10, 2004 11:18 am |
|
WHOA! That used to work afaik. Something else has changed. I'll get right on that. Thanks! |
|
|
|
 |
Raven

|
Posted:
Tue Feb 10, 2004 1:08 pm |
|
Another change by Yahoo somewhere along the line . I have updated the modules/Stock_Quote/index.php file in the downloads as of 13:05 today. On or about line 143 you should see this line of codeCode:$showHistoryFromDate = empty($HTTP_POST_VARS[showHistoryFromDate])?explode('/',$defHistoryDate):explode('/',$HTTP_POST_VARS[showHistoryFromDate]);
| Add this line after it so it looks like thisCode:$showHistoryFromDate = empty($HTTP_POST_VARS[showHistoryFromDate])?explode('/',$defHistoryDate):explode('/',$HTTP_POST_VARS[showHistoryFromDate]);
$showHistoryFromDate[0] = $showHistoryFromDate[0]-1;
|
|
|
|
|
 |
fmanjo

|
Posted:
Tue Feb 10, 2004 1:38 pm |
|
Now it is perfect. Great job and thanks for the help. |
|
|
|
 |
|