Author |
Message |
twinjet
New Member


Joined: Jan 17, 2005
Posts: 22
|
Posted:
Mon Jan 17, 2005 11:11 pm |
|
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Tue Jan 18, 2005 6:27 am |
|
hard to tell what your doing wrong,or is going wrong...
but i send you a pm. |
|
|
|
 |
BobMarion
Former Admin in Good Standing

Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)
|
Posted:
Tue Jan 18, 2005 11:40 am |
|
Did you run nsnst_ip2country.php in hte root directory?
If you did run it to install the IP2C tables did it report any errors?
If you did not run it and let us know if it reports any errors. |
_________________ Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! |
|
|
 |
twinjet

|
Posted:
Tue Jan 18, 2005 5:05 pm |
|
|
|
 |
twinjet

|
Posted:
Tue Jan 18, 2005 5:22 pm |
|
Its not like i dont know nothing about computers, i know perfectly html and flash and networking and windows programing. Something is wrong with nukesentinel ip2c on install for 7.5.And yet still no one has seen anything wrong with the install so that means that they are the correct steps and we end up again at problem with the install itself.
Maybe all of you are using now phpnuke 7.6 and nueksentinel for 7.6 and havent really taken the time to check 7.5 but it doesnt really work.
The very first time i isntalled it it gave me succesfull answers, and some others failed!, it makes no diference were it fails and where it doesnt, anyway its failing. (It fails after dumping .csv files after line 25999) its a very big file for remotely hosted phpmyadmins where u cant go into to mod codes)
p.s. dont take me wrong but with ur guys knowledge in php it just a matter of 5 mins identifying the wrong part of coding, i think the problem relies on certain permissions chmoding them and also in the big dump that is atempted. i tried to plit the files but dont really know how to import them in mysql. |
|
|
|
 |
twinjet

|
Posted:
Wed Jan 19, 2005 11:37 pm |
|
I have been testing my site without nukesentinel for 2 days now it runs perfectly, i wish you guys could make a clean 7.5 install and try nukesentinel 2.1.3 then ip to country to simulate my problem. |
|
|
|
 |
BobMarion

|
Posted:
Thu Jan 27, 2005 9:37 am |
|
The reason it's failing on the csv file is it's size and your site is timing out thus causing the failure. The install script is setup to increase your timeout period but on some servers this increase isn't enough as the sql server runs so much slower. I have tested it time and time again on my local server with PHP-Nuke's 6.5 thru 7.6 and it never fails but then again my sql server is running fast enough on hte queries it's not timing out. |
|
|
|
 |
twinjet

|
Posted:
Thu Jan 27, 2005 3:01 pm |
|
thx BobMarion, i am still waiting to get a good install but since i ruined several fresh installs i wanted to be shure it works, is it posible to split the large file into 4 separate files or 6 and the installer.php to import 6 small files instead of 1 big one, almost all people have hosts like mine most users do not run on local networks and my hosting is very fast but it still times out. |
|
|
|
 |
twinjet

|
Posted:
Thu Jan 27, 2005 3:40 pm |
|
I dont really know how to code correctly.
I have allready split ip-to-country in 6 files which can be downloaded here:
http://www.ncsnetworksolutions.com/raven/ip-to-country-1-of-6.csv
http://www.ncsnetworksolutions.com/raven/ip-to-country-2-of-6.csv
http://www.ncsnetworksolutions.com/raven/ip-to-country-3-of-6.csv
http://www.ncsnetworksolutions.com/raven/ip-to-country-4-of-6.csv
http://www.ncsnetworksolutions.com/raven/ip-to-country-5-of-6.csv
http://www.ncsnetworksolutions.com/raven/ip-to-country-6-of-6.csv
Please help me with nsnst_ip2country.php:
Code:
<?php
/********************************************************/
/* NukeSentinel(tm) Universal */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2005 by NukeScripts Network */
/********************************************************/
/* CLIKE, UNION, & Email elements from HackAlert */
/* HTTPAuth element */
/* CGI AdminAuth element */
/* By: Raven PHP Scripts */
/* http://www.ravenphpscripts.com */
/* Copyright © 2004 by Raven PHP Scripts */
/********************************************************/
/* Scripting Blocker elements */
/* By: ChatServ */
/* http://www.nukeresources.com */
/* Copyright © 2004 by Nuke Resources */
/********************************************************/
include("mainfile.php");
set_time_limit( 600 );
if (is_admin($admin)) {
if(!is_array($admin)) {
$adm = base64_decode($admin);
$adm = explode(":", $adm);
$aname = "$adm[0]";
} else {
$aname = "$admin[0]";
}
}
$index=1;
$pagename = "NukeSentinel™ IP to Country";
$csv_filename1 = "countries.csv"; //_Provided by NSN
$csv_filename2 = "ip-to-country-1-of-6.csv"; //_added by twinjet
$csv_filename3 = "ip-to-country-2-of-6.csv"; //_added by twinjet
$csv_filename4 = "ip-to-country-3-of-6.csv"; //_added by twinjet
$csv_filename5 = "ip-to-country-4-of-6.csv"; //_added by twinjet
$csv_filename6 = "ip-to-country-5-of-6.csv"; //_added by twinjet
$csv_filename7 = "ip-to-country-6-of-6.csv"; //_added by twinjet
$adm_info = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_authors WHERE aid='$aname'"));
if ($adm_info['radminsuper']==1 OR $adm_info['super_user']==1) {
switch($op) {
default:
$pagetitle = $pagename;
include("header.php");
title("$pagetitle");
OpenTable();
echo "<table align='center' border='0' cellpadding='2' cellspacing='2'>\n";
echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
if(!file_exists($csv_filename1)) { echo "<tr><td><b>$csv_filename1 is missing! Step 2 can not be performed!</b></td></tr>\n"; }
if(!file_exists($csv_filename2)) { echo "<tr><td><b>$csv_filename2 is missing! Step 3 can not be performed!</b></td></tr>\n"; }
if(!file_exists($csv_filename3)) { echo "<tr><td><b>$csv_filename2 is missing! Step 4 can not be performed!</b></td></tr>\n"; } //_added by twinjet
if(!file_exists($csv_filename4)) { echo "<tr><td><b>$csv_filename2 is missing! Step 5 can not be performed!</b></td></tr>\n"; } //_added by twinjet
if(!file_exists($csv_filename5)) { echo "<tr><td><b>$csv_filename2 is missing! Step 6 can not be performed!</b></td></tr>\n"; } //_added by twinjet
if(!file_exists($csv_filename6)) { echo "<tr><td><b>$csv_filename2 is missing! Step 7 can not be performed!</b></td></tr>\n"; } //_added by twinjet
if(!file_exists($csv_filename7)) { echo "<tr><td><b>$csv_filename2 is missing! Step 8 can not be performed!</b></td></tr>\n"; } //_added by twinjet
echo "<tr><td>This script will install the IP to Country table for the $pagetitle.<br />This is a 8 step process. 1st Create the tables, 2nd import the country data, & 3rd - 8th import the ip2country data separated in 6 files.</td></tr>\n"; //_added by twinjet
/* After this point i dont know what to modify and what not to move */
/* but someone that knows coding can do it in 3-5 minutes */
echo "<tr><td><b>Backup data tables before going on!</b></td></tr>\n";
echo "<tr><td><select name='op'>\n";
echo "<option value=''>---- Install Options ----</option>\n";
echo "<option value='install'>$pagename Install</option>\n";
echo "<option value=''>---- Upgrade Options ----</option>\n";
echo "<option value='up210-211'>$pagename Upgrade 2.1.0 to 2.1.1</option>\n";
echo "<option value='up211-212'>$pagename Upgrade 2.1.1 to 2.1.2</option>\n";
echo "<option value='up212-213'>$pagename Upgrade 2.1.2 to 2.1.3</option>\n";
echo "<option value=''>---- $pagename Destall Options ----</option>\n";
echo "<option value='destall'>Destall $pagename</option>\n";
echo "</select> <input type='submit' value='COMMIT'></td></tr>\n";
echo "<tr><td><b>Once you have finished with this script, delete it from your server!</b></td></tr>\n";
echo "</form>";
echo "</table><br />\n";
echo "<table border='0' cellpadding='0' cellspacing='0' align='center'>\n";
echo "<tr><td width='100%' align='center'><b>Help Support NukeSentinel™</b></td></tr>\n";
echo "<tr><td width='100%' align='center'><a href='http://www.nukescripts.net/modules.php?name=Donations'><img src='https://www.paypal.com/en_US/i/btn/x-click-but21.gif' border='0' alt='Make donations with PayPal!' align='center'></a></td></tr>\n";
echo "</table>\n";
CloseTable();
include("footer.php");
break;
case "install":
$pagetitle = $pagename.": Install";
include("header.php");
title("$pagetitle");
OpenTable();
echo "Operation Status!<br />\n";
echo "<hr>\n";
$result = $db->sql_query("CREATE TABLE ".$prefix."_nsnst_ip2country (ip_lo int(10) unsigned NOT NULL default '0', ip_hi int(10) unsigned NOT NULL default '0', c2c char(2) NOT NULL default '', country varchar(60) NOT NULL default '', KEY code (ip_lo, ip_hi, c2c))");
if (!$result) { echo "- Create ".$prefix."_nsnst_ip2country failed<br />\n"; } else { echo "- Create ".$prefix."_nsnst_ip2country succeeded<br />\n"; }
echo "<hr>\n";
echo "Operation Complete!<br />\n";
if(file_exists($csv_filename1)) {
echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
echo "<input type='hidden' name='op' value='import1'>\n";
echo "<input type='submit' value='Goto $pagename: Import Countries Data'>\n";
echo "</form>\n";
} else {
echo "$csv_filename1 is missing. No futher action can be taken.\n";
}
CloseTable();
include("footer.php");
break;
case "import1":
$pagetitle = $pagename.": Import Countries Data";
include("header.php");
title("$pagetitle");
OpenTable();
echo "Operation Status!<br />\n";
echo "<hr>\n";
//echo "Importing IP-To-Country CSV File........<br>\n";
$fp = fopen( $csv_filename1, 'r' );
$i = 0;
while( !feof( $fp ) ) {
$row = fgets( $fp, 4096 );
$row = str_replace("\r\n", "", $row);
$row = str_replace("\"", "", $row);
$data = explode(",", $row );
$c2c = $data[0];
$c2c = strtolower( $c2c );
$country = $data[1];
$country = strtolower( $country );
$country = ucwords( $country );
$country = addslashes( $country );
if($row!="") {
$result = $db->sql_query("INSERT INTO ".$prefix."_nsnst_countries VALUES ('$c2c', '$country')");
if (!$result) { echo "- Insert into ".$prefix."_nsnst_countries failed<br />\n"; } else { echo "- Insert into ".$prefix."_nsnst_countries succeeded<br />\n"; }
}
$i++;
}
fclose( $fp );
echo "<hr>\n";
echo "Operation Complete!<br />\n";
if(file_exists($csv_filename2)) {
echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
echo "<input type='hidden' name='op' value='import2'>\n";
echo "<input type='submit' value='Goto $pagename: Import IP2Country Data'>\n";
echo "</form>\n";
} else {
echo "$csv_filename2 is missing. No futher action can be taken.\n";
}
CloseTable();
include("footer.php");
break;
case "import2":
$pagetitle = $pagename.": Import IP2Country Data";
include("header.php");
title("$pagetitle");
OpenTable();
echo "Operation Status!<br />\n";
echo "<hr>\n";
//echo "Importing IP-To-Country CSV File........<br>\n";
$fp = fopen( $csv_filename2, 'r' );
$i = 0;
while( !feof( $fp ) ) {
$row = fgets( $fp, 4096 );
$row = str_replace("\r\n", "", $row);
$row = str_replace("\"", "", $row);
$data = explode(",", $row );
$ip_lo = $data[0];
$ip_hi = $data[1];
$c2c = $data[2];
$c2c = strtolower( $c2c );
$c3c = $data[3];
$country = $data[4];
$country = strtolower( $country );
$country = ucwords( $country );
$country = addslashes( $country );
if($row!="") {
$result = $db->sql_query("INSERT INTO ".$prefix."_nsnst_ip2country VALUES ('$ip_lo', '$ip_hi', '$c2c', '$country')");
if (!$result) { echo "- Insert into ".$prefix."_nsnst_ip2country failed<br />\n"; } else { echo "- Insert into ".$prefix."_nsnst_ip2country succeeded<br />\n"; }
}
$i++;
}
fclose( $fp );
echo "<hr>\n";
echo "Operation Complete!<br />\n";
echo "Goto <a href=\"admin.php?op=ABMain\">NukeSentinel™ Admin</a>\n";
CloseTable();
include("footer.php");
break;
|
Also correct me but i think below here no mods are require in code. |
|
|
|
 |
twinjet

|
Posted:
Thu Jan 27, 2005 3:49 pm |
|
or is it just as simple as:
Code:
set_time_limit( 6000 );
|
Add one zero at time out???
Which brings me to one time i could half install it and only around 45000 entries were able to be inserted server doesnt accept those big dumps neither. |
|
|
|
 |
BobMarion

|
Posted:
Thu Jan 27, 2005 7:35 pm |
|
If your server allows you to set set_time_limit( 1200 ); which is twice what it is set in the script to start with. If your getting around 45,000 lines inserted the time out is almost high enougn since the csv file contains around 58,000 entries.
For 2.2.0 I will work on making a multi-stage read and insert. I just have to dig out my old NSN Weather installer to retrieve the code from it  |
|
|
|
 |
twinjet

|
Posted:
Thu Jan 27, 2005 11:06 pm |
|
Roger thanks  |
|
|
|
 |
|