Capturing text

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Capturing text
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
Using PHP how would you get text from another page. See I want to make a block that displays info from other page. How would I do this? I was told by another person to use get_file_contents and then parse the file whatever that means. Thanks.



Back to top Reply with quote
#2   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
If the feed is in xml then yes you can capture it you just need to use a rss or rdf to script to get the information. PHP Nuke has one built right in, under the blocks section. You could probably use that to get the information if they are using xml for a feed.

Telli




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
But what if the file doesn't have a rss or rdf file? See I am going to try and make my own BabStats block, that shows the top ten plp. (BabStats keep stats on a server, and then orders the plp on a webpage, based on everything, kills, deaths, shots fired... ) This block has been made before by many plp, but I thought that I would rather make one by myself. Thanks.



Back to top Reply with quote
#4   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Get a copy of the block and look through it see how they getting the feed then take that information to build your own block.

Telli




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
I would want it to do what the chat block on this site does, get the number of people in the room, except thats not what I want it to do.



Back to top Reply with quote
#6   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
new_Eyecrazy.gif

You lost me there try to be specific and if you can include the files in question and maybe an example of what your trying to do.

Telli




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#7   
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
The only real way I guess to find out what I am talking about is by downloading babstats. I want to list the top 10 players. See babstats records stats for a specific game server, it orders the players from bested to worst based on many things. Too see this though a babstats page must be installed at a site. It shows all the recorded stats at the site, and ranks the all the players that played on the server from best to worst. What I want to do is display the 10 ten people that played on the server baed on their stats in a block. Just displaying their game name would be fine. I hope that was enough information for you to help me. Thanks.



Back to top Reply with quote
#8   
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
For an example of what I want go here to the bottom of the page [ Register or login to view links on this board. ]



Back to top Reply with quote
#9   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
That guy is supposed to send me a copy of the block we will see.

Telli




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#10   
Othic
CZ Super Newbie
Othic has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 31, 2003
0.00 posts per day
Posts: 32
Points: 1,831
   
Ok, thanks for all of the support. I have looked at the code before. He gets the stats from the thing itself, he calls the information from a sql table or sql file. So I guess that isn't the best example since he isn't just capturing it, but I did find some code that someone gave me at nukecops:

<?php
if (eregi("block-outside_link.php",$_SERVER['PHP_SELF'])) {
   Header("Location: index.php");
   die();
}

$pagetitle="Open OutSide";

$content = "
<center> <table bgcolor=\"#000000\" cellspacing=0 cellpadding=1 border=0><tr><td> <table bgcolor=\"#f0f0df\" cellspacing=0 cellpadding=6 border=0> <tr><td colspan=2 align=center><small> <b>";

ob_start();
include("http://www.yoursite.com/text_or_html_file.(txt or html)");
$output = ob_get_contents();
ob_end_clean();
$content .= $output;

$content .= "<br></b></small></td></tr></table></td></tr></table> </center>";

?>



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum