Skip to content

Bug fixes and removal of jQuery #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,22 @@ Ship.js is a simple javascript library, to easily add ship fits to pages, where

It depends on a php page to decode the ship dna into a useable form, which can be called from anywhere. A copy runs on my personal server, and I'm not planning on taking it down any time soon.



Installing this into wordpress:


This was the initial reason for writing this code.

In your theme header:
Ensure the following exists.


<?php wp_enqueue_script("jquery"); ?>
<?php wp_enqueue_script("ship.js","http://www.fuzzwork.co.uk/ships/ship.js"); ?>
<?php wp_head(); ?>



If any don't, make sure to add them. (the ship.js one almost certainly won't.)


Then, to use it:

<div id="ship"></div>
<script type="text/javascript">insertship('ship','638:19739;6:22291;5:1952;2:2024;1:2281;3:25948;3:2185;5::');
</script>



The ship in the insert ship call refers to the div before it. you can have multiple ships, by naming them differently. The long string is the ship DNA, as from http://wiki.eveonline.com/en/wiki/Ship_DNA
The ship in the insert ship call refers to the div before it. you can have multiple ships, by naming them differently. The long string is the ship DNA, as from http://wiki.eveonline.com/en/wiki/Ship_DNA
9 changes: 8 additions & 1 deletion db.inc.php.example
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
<?php $dbh = new PDO('mysql:host=localhost;dbname=evesde', 'eveusername', 'evepassword'); ?>
<?php
$dbUsername = 'dbUsername';
$dbPassword = "dbPassword";
$databaseName = "dbName";
$host = "localhost";

$dbh = new PDO('mysql:host='.$host.';dbname='.$databaseName, $dbUsername, $dbPassword);
?>
42 changes: 21 additions & 21 deletions dnagen.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<html>
<head>
<title>DNA generator</title>
</head>
<body bgcolor="lightgrey" style="padding:10px">
<h1>Ship DNA generator</h1>
<form action="/ships/eftconverter.php" method="POST">
<p>Ship fitting goes here, in eft fitting form</p>
<textarea name="fitting" rows=30 cols=50>[Ibis, Bob Smith's Ibis]
[empty low slot]
<head>
<title>DNA generator</title>
</head>
<body bgcolor="lightgrey" style="padding:10px">
<h1>Ship DNA generator</h1>
<form action="/ships/eftconverter.php" method="POST">
<p>Ship fitting goes here, in eft fitting form</p>
<textarea name="fitting" rows="30" cols="50">
[Ibis, Bob Smith's Ibis]
[empty low slot]

[empty mid slot]
[empty mid slot]

Civilian Gatling Railgun
Civilian Miner
Civilian Gatling Railgun
Civilian Miner

[empty rig slot]
[empty rig slot]



</textarea><br>
<input type=submit value="submit ship">
</form><hr>
<a href="http://www.fuzzwork.co.uk/">Back to main menu</a>

</body>
</textarea><br>
<input type=submit value="submit ship">
</form>
<hr>
<a href="http://www.fuzzwork.co.uk/">Back to main menu</a>
</body>
</html>
Loading