RuneTrack Forums
It is currently Tue Sep 02, 2014 8:28 pm

All times are UTC [ DST ]




Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Jan 30, 2012 5:01 pm 
Offline

Joined: Mon Jan 30, 2012 4:52 pm
Posts: 11
I'm trying to place the graph for my account on my personal website. It is just a website that I use as a homepage and it would make it much more easily accessible for me. I will be using it constantly once I get it working correctly.

I have gotten the couple graphs I want to show up there up, the only issue is that the graphs have the individual numbers and not the numbers to be updated. I don't know how to do a website enough to set it up to update automatically like this site does and frankly I don't have any interest learning. I'd like to use these guys's hard work and give them the credit for it rather than attempt to make one of my own.

I need to figure out a way to get my graph to load up the numbers directly from the RuneTrack page that way it is always correctly updated. Would any of you guys know how I could do this?

Also, if possible, I would like to put up a suggestion to create an html button to allow people to easily copy/paste their personal stat set onto their website for ease of access like I am trying to do currently. I will post that in the suggestions thread as well.


Top
 Profile  
 
PostPosted: Tue Jan 31, 2012 2:58 am 
Offline
Site Admin

Joined: Sat Jun 06, 2009 12:38 am
Posts: 521
Hi Chrislorious,

By "graph", I'm assuming you mean this graph: http://runetrack.com/progress.php?user=Chrislorious

Follow these steps to display the graph on your site:

Download swfobject.js:
Attachment:
swfobject.js.txt [9.53 KiB]
Downloaded 35 times

Download open-flash-chart.swf:
Attachment:
open-flash-chart.swf.txt [269.71 KiB]
Downloaded 34 times

(Note: These two files are contained in a larger package at http://teethgrinder.co.uk/open-flash-ch ... nloads.php if you want to download them from there instead.)

Remove the .txt at the end of the file names after downloading. Then, upload swfobject.js in ASCII mode and upload open-flash-chart.swf in Binary mode to your public_html folder.

Then, add this code to a file in your public_html folder where you want your user chart to display:

Code:
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
   swfobject.embedSWF(
   "open-flash-chart.swf", "progress_chart",
   "750", "300", "9.0.0", "expressInstall.swf",
   {"data-file":"http://runetrack.com/includes/progress_chart.php?user=Chrislorious@0"} );
</script>
<div id="progress_chart"></div>


It will display your user progress chart line graph, and will always be up-to-date. :)

Edit: Re-reading your post I don't know if you meant "chart" instead of "graph" (as in, the tabular data, not the visual data) so let me know if you need other info.

_________________
ImageImage


Top
 Profile  
 
PostPosted: Tue Jan 31, 2012 3:10 pm 
Offline

Joined: Mon Jan 30, 2012 4:52 pm
Posts: 11
Yes, this is definitely what I wanted. I'm having issues getting it to work. It may be because I'm using webs.com and I don't really have great access to the resources on there but I was able to get the pictures and everything to load up on the non-updating chart after messing with it for ages. I can't seem to get anything to even show up here where I am placing the HTML code box. What about the ExpressInstall.swf? Is that a file I should have in there somewhere?


Top
 Profile  
 
PostPosted: Wed Feb 01, 2012 12:02 am 
Offline
Site Admin

Joined: Sat Jun 06, 2009 12:38 am
Posts: 521
Chrislorious wrote:
Yes, this is definitely what I wanted. I'm having issues getting it to work. It may be because I'm using webs.com and I don't really have great access to the resources on there but I was able to get the pictures and everything to load up on the non-updating chart after messing with it for ages. I can't seem to get anything to even show up here where I am placing the HTML code box. What about the ExpressInstall.swf? Is that a file I should have in there somewhere?

ExpressInstall.swf isn't a necessary file. However, I think I figured out the issue - the above code snippet will only work for pages on the runetrack.com domain (which is why it worked in my testing). However, you can make it work on an external domain by doing the following:

Create a file called chart.php with the contents:
Code:
<?php
echo file_get_contents
("http://runetrack.com/includes/progress_chart.php?user=Chrislorious@0");
?>


Remove the old code on your display page, and instead use this code to display your chart:
Code:
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
   swfobject.embedSWF(
   "open-flash-chart.swf", "progress_chart",
   "750", "300", "9.0.0", "expressInstall.swf",
   {"data-file":"chart.php"} );
</script>
<div id="progress_chart"></div>


That should do the trick. :)

Few things to check if it doesn't:
-chart.php and swfobject.js must be uploaded in ASCII mode
-open-flash-chart.swf must be uploaded in Binary mode
-All files must reside in the same directory

_________________
ImageImage


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 6:13 pm 
Offline

Joined: Mon Jan 30, 2012 4:52 pm
Posts: 11
It's still not working correctly. It is actually loading up a white box with this error.

Code:
Open Flash Chart

JSON Parse Error [Syntax Error]
Error at character 0, line 1:

0: <?php


I don't know if the files are uploaded in ASCII or not though because the website doesn't give me that option. It's just a straight upload.

Image


Top
 Profile  
 
PostPosted: Wed Feb 08, 2012 12:40 am 
Offline
Site Admin

Joined: Sat Jun 06, 2009 12:38 am
Posts: 521
Chrislorious wrote:
It's still not working correctly. It is actually loading up a white box with this error.

Code:
Open Flash Chart

JSON Parse Error [Syntax Error]
Error at character 0, line 1:

0: <?php


I don't know if the files are uploaded in ASCII or not though because the website doesn't give me that option. It's just a straight upload.

Two things to try:

1. Make sure there are no stray spaces in the chart.php file before or after the PHP tags. I think that could cause an error. The best way to do this may be to just have the contents of chart.php be:
Code:
<?php echo file_get_contents("http://runetrack.com/includes/progress_chart.php?user=Chrislorious@0"); ?>

And make sure there there is absolutely nothing (not even hidden white space) before the <?php or after the ?>.

2. If this doesn't work, could you navigate via a browser to the URL of chart.php, and then copy/paste what the browser displays? It should display a series of chart data values - if not, then you know the issue is in the chart.php file.

I've tried this on an external server so I know this method works - unfortunately there's probably just some small thing on your end which is causing the issue. But it should become apparent pretty soon.

_________________
ImageImage


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group