need to edit this php file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lembi2001
Forum Newbie
Posts: 2
Joined: Thu Feb 09, 2012 7:22 am

need to edit this php file

Post by lembi2001 »

Hi all

as per my intoduction post this is my first expreience with PHP.

I need to edit this php to display just the info I need. The php is free from http://www.goldgoldprice.com and features widgets which you can out on your site.

I need to remove the last 2 lines of the table it renders as they are not required.

Code: Select all

var trate_time='2012,01,09,07,48(New York)';var tttime=new Date(2012,01,09,07,48);var tttime2='(New York)';var tformat=1;          

var trate_vvv=document.getElementById("goldus_link"),trate_ok=false;if(typeof(trate_vvv)=="object")if((trate_vvv.getAttribute("href")).toLowerCase().indexOf("goldgold")!=-1)trate_ok=true;if(trate_ok==false)alert("link error, please get full code from http://www.goldgold"+"price.com");if(typeof(tttime)=="object"){mytype=tformat;var clock_hours=tttime.getHours(),clock_minutes=tttime.getMinutes(),clock_seconds=tttime.getSeconds(),nday=tttime.getDay();if(nday==0)nday="Sun";else if(nday==1)nday="Tue";else if(nday==2)nday="Tue";else if(nday==3)nday="Wed";else if(nday==4)nday="Thu";else if(nday==5)nday="Fri";else if(nday==6)nday="Sat";var nmonth=tttime.getMonth(),ntoday=tttime.getDate(),nyear=tttime.getYear();if(nyear<=99)nyear="19"+nyear;if((nyear>99)&&(nyear<2000))nyear+=1900;var nmonth_f="";if(nmonth==0)nmonth_f="Jan";else if(nmonth==1)nmonth_f="Feb";else if(nmonth==2)nmonth_f="Mar";else if(nmonth==3)nmonth_f="Apr";else if(nmonth==4)nmonth_f="May";else if(nmonth==5)nmonth_f="Jun";else if(nmonth==6)nmonth_f="Jul";else if(nmonth==7)nmonth_f="Aug";else if(nmonth==8)nmonth_f="Sep";else if(nmonth==9)nmonth_f="Oct";else if(nmonth==10)nmonth_f="Nov";else if(nmonth==11)nmonth_f="Dec";nmonth=nmonth+1;var tmp="",chi_day=" "+""+"",chi_month=" "+""+"",chi_year=" "+""+"";if(mytype==1)tmp=nmonth_f+" "+ntoday+chi_day+" "+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==2)tmp=ntoday+chi_day+""+nmonth_f+" "+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==3)tmp=nmonth+"/"+ntoday+"/"+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==4)tmp=ntoday+"/"+nmonth+"/"+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==5)tmp=nyear+"/"+nmonth+"/"+ntoday+" "+clock_hours+":"+clock_minutes;else if(mytype==6)tmp=nyear+"-"+nmonth+"-"+ntoday+" "+clock_hours+":"+clock_minutes;else if(mytype==7)tmp=nmonth_f+" "+ntoday+chi_day+""+nyear+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==8)tmp=ntoday+chi_day+""+nmonth_f+" "+nyear+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==9)tmp=nmonth+"/"+ntoday+"/"+nyear+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==10)tmp=ntoday+"/"+nmonth+"/"+nyear+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==11)tmp=nyear+"/"+nmonth+"/"+ntoday+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==12)tmp=nyear+"-"+nmonth+"-"+ntoday+" "+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==13)tmp=nyear+chi_year+""+nmonth+chi_month+""+ntoday+chi_day+""+nday+" "+clock_hours+":"+clock_minutes;else if(mytype==14)tmp=nday+", "+nmonth_f+" "+ntoday+chi_day+""+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==15)tmp=nday+", "+ntoday+chi_day+""+nmonth_f+" "+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==16)tmp=nday+" "+nmonth_f+" "+ntoday+chi_day+""+nyear+" "+clock_hours+":"+clock_minutes;else if(mytype==17)tmp=nday+" "+ntoday+chi_day+""+nmonth_f+" "+nyear+" "+clock_hours+":"+clock_minutes;trate_time=tmp+tttime2}var xxxyyy_pcount=60;function xxxyyy_pic($){document.getElementById("xxxyyy"+xxxyyy_pcount).className="moreout";document.getElementById("xxxyyy"+$).className="morein";document.getElementById("xxxyyy_chart").src="wwwwww-charts-show.php?curr=yyyyyyy&days="+$+"s";xxxyyy_pcount=$;return true}document.write("<table style='background-color:#ffffff;color:#333333;font-size:12px;width:100%' border=0 cellspacing=0 width=100%><tr id='xcolors1_3' style='align:center;text-align:center;background-color:#94abf0;'><td colspan=2>"+trate_time+" </td></tr><tr  style='background-color:#fff'><td align=right>Symbol</td><td align=right>Price</td></tr><tr  style='background-color:#eeeeee;font-size:12px;font-family:arial;'><td align=right>Gold</td><td align=right>1732.90</td></tr><tr  style='background-color:#ffffff;font-size:12px;font-family:arial;'><td align=right>Platinum</td><td align=right>1661.00</td></tr><tr  style='background-color:#eeeeee;font-size:12px;font-family:arial;'><td align=right>Silver</td><td align=right>33.96</td></tr><tr  style='background-color:#ffffff;font-size:12px;font-family:arial;'><td align=right>Palladium</td><td align=right>716.00</td></tr><tr  style='background-color:#eeeeee;font-size:12px;font-family:arial;'><td align=right>Crude Oil</td><td align=right>98.71</td></tr></table>")
I know I can remove the last two lines in the bit of HTML at the end of the code however if i save this file and open it i get whole host of the code rendered on screen and i don't know how to edit it.

The widget code is:

[text]<!--copy begin here:-->
<div style="width:150px;text-align:center;"><div id="xcolors1_1" style="border:1px solid #000;background-color:#94abf0;padding: 0px 0px;margin: 0px 0px;align:center;overflow:hidden;"><div id="xcolors1_2" style="font-size:12px;color:#183a00;line-height:16px;font-family: arial; font-weight:bold;background:#94abf0;padding: 3px 1px;text-align:center;"><a href="http://goldgoldprice.com/" alt="Gold Price,Silver Price" title="Gold Price,Silver Price" id="goldus_link" style="color:#000000;font-size:14px;text-decoration:none;line-height:16px;font-family: arial;" >Gold Price(USD/Ounce)</a></div><script src="http://goldgoldprice.com/z.php?z=goldus ... </div><div style="text-align:center;"><a href="http://goldgoldprice.com/" style="font-size:12px;">Gold Price</a></div></div>
<!--copy end here:-->
[/text]

If I can get the php to render the way i want i was wondering if i could host the php file myself on my server and reference it using the sane variables.

for example

[text]<script src="\z.php?z=goldus&c=94abf0&tz=America/New_York&tf=1"></script>[/text]

Thanks
Post Reply