You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 67 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Building a Link Database [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jun 30, 2003 8:25 pm Reply with quoteBack to top

Hello Smile

I own a gaming site that is starting to get a lot of traffic, and one problem I am having is managing the Map Downloads section.

My map downloads are stored on a remote server that I link to, so I basically have to manually enter every link, which is starting to become a pain as the map database grows. I am using the standard Downloads section that comes with phpNuke.

Is there a module that will read the contents of a remote folder, and build a list of links in my phpsite? This would save me a ton of time, all I would have to do is upload the maps to the remote server, then my site could grab them with no effort.

Thanks for listening Smile

Paulxb
www.NinjaVsPirates.com
Find all posts by PaulxbView user's profileSend private message
allevon
Site Mod
Site Mod


Joined: Nov 22, 2002
Posts: 716

Location: New Jersey

PostPosted: Tue Jul 01, 2003 4:19 am Reply with quoteBack to top

Honestly Paul,

Up until now, I have never heard of a module that can read the contents of a remote server for you to create a list with. If it did exist, I would use it. Also, it would be a great time saver for future work I have to do as well like yourself.

_________________
"Give Me Liberty, Or Give Hackerz Death!!!"
Patrick Henry Revised for 21st century.
Let The Bodies Hit The Floor! Let The Bodies Hit The Floor!
Find all posts by allevonView user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Tue Jul 01, 2003 9:34 am Reply with quoteBack to top

Well it has to be possible for it to work on the same server, the Blocks manager can read its own folder. If you can do it on the same server, I'm sure it can be done remotely some how.
Find all posts by PaulxbView user's profileSend private message
snarfies3
Nuke Soldier
Nuke Soldier


Joined: May 24, 2003
Posts: 22


PostPosted: Tue Jul 01, 2003 2:02 pm Reply with quoteBack to top

Paulxb wrote:
Well it has to be possible for it to work on the same server, the Blocks manager can read its own folder. If you can do it on the same server, I'm sure it can be done remotely some how.


As to doing it locally, the upcoming 2.0 version of Nukestyle's download module is supposed to be able to do that, and thank goodness SOMEBODY has finally done it. Makes my life so much easier.
Find all posts by snarfies3View user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jul 07, 2003 4:25 pm Reply with quoteBack to top

Hey, after some snooping, I found this:

http://www.onlinetools.org/tools/easyfilebrowse.php

This little file will display the files in a folder as a searchable database, which rocks. Smile

seems to do what I want, now I just need to figure out how to display a remote page within my phpnuke site. Is that possible??

An example would be player game stats. The normal stats can be seen here:

http://ws6-2.wickedservers.com/stats/

I'd like to have a link to that in the content menu, and have it show in the main site, not open in a new window.
Find all posts by PaulxbView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Jul 07, 2003 4:50 pm Reply with quoteBack to top

In general, to screen scrape pages with PHP, use the file_get_contents() function. It will pull back the raw HTML. You can then use various other PHP functions to extract exactly what you want/need and display it on your page Wink

Exanple
Code:
$page_to_scrape = file_get_contents("http://ws6-2.wickedservers.com/stats/
");
echo $page_to_scrape;
I will let you figure out the rest Smile

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jul 07, 2003 7:37 pm Reply with quoteBack to top

Ugh! I'm a total newbie at this, and I can't get it to work in the Content section of the site. I want the original page (stats) to show within my site. Using your php I got nothing Sad

I tried it with and without the .php open and close on it :

Code:
<?php

$page_to_scrape = file_get_contents("http://ws6-2.wickedservers.com/stats/
");
echo $page_to_scrape;

?>


Any help?
Find all posts by PaulxbView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Jul 07, 2003 7:44 pm Reply with quoteBack to top

Try building it as a module instead. Content is just for HTML.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jul 07, 2003 8:05 pm Reply with quoteBack to top

Sad I am really bad at this...

Here's the "sample" .php module:

Code:
<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

function one() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"one\"<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}

function two() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"two\"";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}


function AddonSample() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php)<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&file=index&func=one\">Function One</a>";
    echo "<li><a href=\"modules.php?name=$module_name&file=index&func=two\">Function Two</a>";
    echo "<li><a href=\"modules.php?name=$module_name&file=f2\">Call to file f2.php</a>";
    echo "</ul>";
    echo "You can now use Administration interface to activate or deactivate any module. As an Admin you can always "
         ."access to your Inactive modules for testing purpouses.";
    CloseTable();
    include("footer.php");
}

switch($func) {

    default:
    AddonSample();
    break;
   
    case "one":
    one();
    break;

    case "two":
    two();
    break;

}

?>


...and then your sample

Code:
$page_to_scrape = file_get_contents("http://ws6-2.wickedservers.com/stats/
");
echo $page_to_scrape;


*sigh* 1+1 is equaling 4 right now Sad
Find all posts by PaulxbView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Jul 07, 2003 8:10 pm Reply with quoteBack to top

Code:
<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$index = 1;
include("header.php");
OpenTable();

$page_to_scrape = file_get_contents("http://ws6-2.wickedservers.com/stats/
");
echo $page_to_scrape;

CloseTable();
include("footer.php");
?>

Not tested but should work Wink

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jul 07, 2003 8:20 pm Reply with quoteBack to top

Quote:
Sorry, such file doesn't exist...


Sad Thanks for trying Smile
Find all posts by PaulxbView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Jul 07, 2003 8:28 pm Reply with quoteBack to top

Works perfectly for me. Make sure you have installed the module correctly.

Create a folder like Link_DB and place it in the modules folder. Then, save this code to Link_DB/index.php
Code:
<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$index = 1;
include("header.php");
OpenTable();

$page_to_scrape = file_get_contents("http://ws6-2.wickedservers.com/stats/");
echo $page_to_scrape;

CloseTable();
include("footer.php");
?>

Then goto Admin modules and activate it. I can show you on my site where it works if you need to see it Wink

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Paulxb
Nuke Cadet
Nuke Cadet


Joined: Jul 01, 2003
Posts: 7


PostPosted: Mon Jul 07, 2003 8:37 pm Reply with quoteBack to top

Oh, lol I didn't name it index.php. I realised it while I was reading your next post Sad

Thanks for the help, but it doesn't appear to call it as it actually exists with the graphics, etc. This is a module that is probably wanted by all the CS Clans out there, but nobody has tackled it yet Sad

It brings up a partial page, but no images or working links.
Find all posts by PaulxbView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Jul 07, 2003 8:41 pm Reply with quoteBack to top

Work with it. You have the framework Wink

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.462 Seconds - 256 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::