IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Item Search
oogabooga
post Dec 15 2009, 12:35 AM
Post #1


Il san
Group Icon

Group: Nobles
Posts: 184
Joined: 18-July 06
Member No.: 419



Nexustk.net used to have an item search where when you searched for the item it showed in descending order who had the most to the least of that particular item. Possible to add that to nexusatlas?
Go to the top of the page
 
+Quote Post
Sarphendon
post Dec 15 2009, 07:42 AM
Post #2


Ee san
Group Icon

Group: Nobles
Posts: 511
Joined: 29-September 06
From: Nova Scotia, Canada
Member No.: 960
Characters: Sarphendon, Tzeentch, Glow, FedX





--------------------
I am Sarphendon, Sa san Do.
Go to the top of the page
 
+Quote Post
oogabooga
post Dec 15 2009, 09:38 AM
Post #3


Il san
Group Icon

Group: Nobles
Posts: 184
Joined: 18-July 06
Member No.: 419



I heard that reading a whole sentence is actually beneficial before replying.
Go to the top of the page
 
+Quote Post
AllyGator
post Dec 15 2009, 12:49 PM
Post #4


Map Goddess
Group Icon

Group: Retired Administrator
Posts: 4,622
Joined: 3-July 06
From: Buya
Member No.: 3



QUOTE (oogabooga @ Dec 14 2009, 11:35 PM) *
Nexustk.net used to have an item search where when you searched for the item it showed in descending order who had the most to the least of that particular item. Possible to add that to nexusatlas?


We don't have that, code it for us?


--------------------
The hair says it all!
Go to the top of the page
 
+Quote Post
oogabooga
post Dec 15 2009, 04:47 PM
Post #5


Il san
Group Icon

Group: Nobles
Posts: 184
Joined: 18-July 06
Member No.: 419



QUOTE (AllyGator @ Dec 15 2009, 12:49 PM) *
We don't have that, code it for us?


I have no idea where to start but I figured I should just suggest it. tongue.gif
Go to the top of the page
 
+Quote Post
Sarphendon
post Dec 15 2009, 08:14 PM
Post #6


Ee san
Group Icon

Group: Nobles
Posts: 511
Joined: 29-September 06
From: Nova Scotia, Canada
Member No.: 960
Characters: Sarphendon, Tzeentch, Glow, FedX



QUOTE (AllyGator @ Dec 15 2009, 01:49 PM) *
We don't have that, code it for us?


Well since stataddict uses alot of that stuff for its main function, maybe...just maybe...we can cohearce aceostar to add something like that to stataddict, or make the code for us? *puppy dog eyes*


--------------------
I am Sarphendon, Sa san Do.
Go to the top of the page
 
+Quote Post
AllyGator
post Dec 16 2009, 11:47 AM
Post #7


Map Goddess
Group Icon

Group: Retired Administrator
Posts: 4,622
Joined: 3-July 06
From: Buya
Member No.: 3



also *puppy dog eyes*


--------------------
The hair says it all!
Go to the top of the page
 
+Quote Post
Interstate
post Dec 19 2009, 03:38 AM
Post #8


Sam san
Group Icon

Group: Nobles
Posts: 905
Joined: 24-June 07
From: California
Member No.: 2,663



QUOTE (oogabooga @ Dec 15 2009, 04:47 PM) *
I have no idea where to start but I figured I should just suggest it. tongue.gif



Start here:

CODE
<?php

require_once("config.php");
set_time_limit(0);

$letters_int = 0;
$letters_char;

while($letters_int < 26)
{
    switch($letters_int)
    {
        case 0: $letters_char="a"; break;
        case 1: $letters_char="b"; break;
        case 2: $letters_char="c"; break;
        case 3: $letters_char="d"; break;
        case 4: $letters_char="e"; break;
        case 5: $letters_char="f"; break;
        case 6: $letters_char="g"; break;
        case 7: $letters_char="h"; break;
        case 8: $letters_char="i"; break;
        case 9: $letters_char="j"; break;
        case 10: $letters_char="k"; break;
        case 11: $letters_char="l"; break;
        case 12: $letters_char="m"; break;
        case 13: $letters_char="n"; break;
        case 14: $letters_char="o"; break;
        case 15: $letters_char="p"; break;
        case 16: $letters_char="q"; break;
        case 17: $letters_char="r"; break;
        case 18: $letters_char="s"; break;
        case 19: $letters_char="t"; break;
        case 20: $letters_char="u"; break;
        case 21: $letters_char="v"; break;
        case 22: $letters_char="w"; break;
        case 23: $letters_char="x"; break;
        case 24: $letters_char="y"; break;
        case 25: $letters_char="z"; break;
    }

    $url = "http://users.nexustk.com/userfiles/".$letters_char.".html";
    $contents  = file_get_contents($url);

    $string_start ='<a href="http://users.nexustk.com/?name=';
    $string_end ='">';
        
    $name_start  = strpos($contents, $string_start);
        while($name_start !== false)
    {
        $name_start  = $name_start+40;
        $name_end    = strpos($contents, $string_end, $name_start);
        $name_length = $name_end-$name_start;

        $name = substr($contents, $name_start, $name_length);
    
        $name_start  = strpos($contents, $string_start, $name_end);

        $query = "SELECT COUNT(*) FROM nexususers WHERE name='$name'";
        $usr = mysql_query($query);
        if(!$usr) exit("Error - ".mysql_error());
        $total = mysql_result($usr, 0);
        if($total < 1)
        {
            $query= "INSERT INTO nexususers VALUES(
                NULL,
                '$name',
                CURDATE(),
                NULL)";

            if(mysql_query($query))
            {
                echo $name."<br>";
            }
            else exit("Errior adding data - " . mysql_error());
        }
    }    

    //increase letter page loop
        $letters_int = $letters_int+1;

                            
}

?>


That'll get you all unique names listed on the user pages. Next step:

- open user pages based on names collected the same way you opened user list in above code
- find unique string_start and string_end values for item names and counts
- parse out item information and insert in new database just like done in above code with names
- display items however you want with whatever sorting/organizing functions you care to use

Example for how to display items, may want to order by count in your case though:

CODE
<?php

require_once("config.php");

$results = mysql_query("SELECT * FROM nexusitems ORDER BY name")
or die(mysql_error());

echo "<table border='1'>";
echo "<tr><th>Id</th> <th>Name</th> <th>Price</th> <th>User</th> <th>Date</th </tr>";

while($row=mysql_fetch_array($results))
{
    echo "<tr><td>";
    echo $row['id'];
    echo "</td><td>";
        echo $row['name'];
    echo "</td><td>";
        echo $row['price'];
    echo "</td><td>";
        echo $row['user'];
    echo "</td><td>";
        echo $row['date'];
    echo "</td></tr>";
}
echo "</table>";
?>


Now you know where to start =)

Aceostar or Berig shouldn't have any problem with this, it is pretty basic web programming.
The above code should also make it very easy for someone who hasn't done it before but has basic web scripting knowledge to do this and other similar things.


--------------------
Vicious Circle
Hater of haters
Anti-elitist elitist

http://www.youtube.com/watch?v=BwL65cvzK0s...feature=related
Go to the top of the page
 
+Quote Post
AllyGator
post Dec 19 2009, 03:53 PM
Post #9


Map Goddess
Group Icon

Group: Retired Administrator
Posts: 4,622
Joined: 3-July 06
From: Buya
Member No.: 3




http://www.nexusatlas.com/search1.html
http://www.nexusatlas.com/search2.html

I never know where to start!


--------------------
The hair says it all!
Go to the top of the page
 
+Quote Post
Interstate
post Dec 19 2009, 06:47 PM
Post #10


Sam san
Group Icon

Group: Nobles
Posts: 905
Joined: 24-June 07
From: California
Member No.: 2,663




You need to design and add database tables that make logical sense first, like so:

CODE
<?php

require_once("config.php");

mysql_query("CREATE TABLE nexusitems(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
name TEXT,
gif  TEXT,
price TEXT,
user TEXT,
date TEXT
)")
or die(mysql_error());

echo "Table Created!";

?>




Also, the config.php file that is required in these is what I usually do to include mysql connection configuration, like so:

CODE
<?

$dblocation = "127.0.0.1";
$dbname = "skynet";
$dbuser = "root";
$dbpasswd = "";
$dbcnx = mysql_connect($dblocation, $dbuser, $dbpasswd);

if (!dbcnx)
{
    exit ("MySQL server is not available: ".mysql_error());
}

if(!@mysql_select_db($dbname, $dbcnx))
{
    exit ("Database is not available: ".mysqlerror());
}

?>


--------------------
Vicious Circle
Hater of haters
Anti-elitist elitist

http://www.youtube.com/watch?v=BwL65cvzK0s...feature=related
Go to the top of the page
 
+Quote Post
AllyGator
post Dec 20 2009, 10:40 AM
Post #11


Map Goddess
Group Icon

Group: Retired Administrator
Posts: 4,622
Joined: 3-July 06
From: Buya
Member No.: 3



I don't want to make a database that pulls from the user pages. neener!

Didn't nexus wiki have that? Maybe you can ask them to put it up again.


--------------------
The hair says it all!
Go to the top of the page
 
+Quote Post
Excaliber
post Aug 19 2010, 04:45 PM
Post #12


Il san
Group Icon

Group: Retired Staff
Posts: 180
Joined: 7-July 06
From: St. Louis, MO
Member No.: 196



This is the website I use to do item searches. Not sure if it'll be helpful to anyone or not.

http://users.nexustk.com/search/

It searches the user pages for both items and names of players. Sometimes it's helpful, others not. Remember to use " " in order to refine searches.


--------------------


Excaliber Yasuraka
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 23rd September 2017 - 07:58 AM
Nexus Forums is part of: Nexus Atlas © all rights reserved.