Committing the current version

This version works and has been tested in a full game with over 50
players however there isn’t as yet a proper admin backend and many
activities require the admin to fiddle with html or SQL at the moment.
This commit is contained in:
jcreek
2014-08-21 13:57:55 +01:00
commit 0a7943162d
107 changed files with 14365 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=http://www.html5webtemplates.co.uk/
+14
View File
@@ -0,0 +1,14 @@
Thanks for downloading this template from HTML5WebTemplates.co.uk
I hope that it suits your needs.
If you wish to remove the footer link (to http://www.html5webtemplates.co.uk) I ask that you make a donation of £15. Please make all donations here (also provided as a shortcut in the zip file):
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HXTDPXW8VUZQL
Also, if you have any questions please feel free to e-mail me at contact@html5webtemplates.co.uk
Happy web designing!
Chuck Anderson
HTML5WebTemplates.co.uk
@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
URL=https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HXTDPXW8VUZQL
IDList=
+75
View File
@@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_7</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>simplestyle<a href="#">_7</a></h1>
<div class="slogan">Cool slogan goes here!</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
<li><a href="index.html">Home</a></li>
<li><a href="examples.html">Examples</a></li>
<li><a href="page.html">A Page</a></li>
<li class="current"><a href="another_page.html">Another Page</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>What's the News?</h4>
<h5>1st July 2011</h5>
<p>Put your latest news item here, or anything else you would like in the sidebar!<br /><a href="#">Read more</a></p>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Newsletter</h3>
<p>If you would like to receive our newletter, please enter your email address and click 'Subscribe'.</p>
<form method="post" action="#" id="subscribe">
<p style="padding: 0 0 9px 0;"><input class="search" type="text" name="email_address" value="your email address" onclick="javascript: document.forms['subscribe'].email_address.value=''" /></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Subscribe" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Latest Blog</h3>
<h4>Website Goes Live</h4>
<h5>1st July 2011</h5>
<p>We have just launched our new website. Take a look around, we'd love to know what you think.....<br /><a href="#">read more</a></p>
</div>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>Another Page</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
</div>
</div>
<div id="footer">
<p>Copyright &copy; simplestyle_7 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">design from HTML5webtemplates.co.uk</a></p>
</div>
</div>
</body>
</html>
+79
View File
@@ -0,0 +1,79 @@
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_7</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>simplestyle<a href="#">_7</a></h1>
<div class="slogan">Cool slogan goes here!</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
<li><a href="index.html">Home</a></li>
<li><a href="examples.html">Examples</a></li>
<li><a href="page.html">A Page</a></li>
<li><a href="another_page.html">Another Page</a></li>
<li class="current"><a href="contact.html">Contact Us</a></li>
</ul>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>What's the News?</h4>
<h5>1st July 2011</h5>
<p>Put your latest news item here, or anything else you would like in the sidebar!<br /><a href="#">Read more</a></p>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Newsletter</h3>
<p>If you would like to receive our newletter, please enter your email address and click 'Subscribe'.</p>
<form method="post" action="#" id="subscribe">
<p style="padding: 0 0 9px 0;"><input class="search" type="text" name="email_address" value="your email address" onclick="javascript: document.forms['subscribe'].email_address.value=''" /></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Subscribe" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Latest Blog</h3>
<h4>Website Goes Live</h4>
<h5>1st July 2011</h5>
<p>We have just launched our new website. Take a look around, we'd love to know what you think.....<br /><a href="#">read more</a></p>
</div>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>Contact Us</h1>
<p>Below is an example of how a contact form might look with this template:</p>
<form action="#" method="post">
<div class="form_settings">
<p><span>Name</span><input class="contact" type="text" name="your_name" value="" /></p>
<p><span>Email Address</span><input class="contact" type="text" name="your_email" value="" /></p>
<p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="your_enquiry"></textarea></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p>
</div>
</form>
<p><br /><br />NOTE: A contact form such as this would require some way of emailing the input to an email address.</p>
</div>
</div>
<div id="footer">
<p>Copyright &copy; simplestyle_7 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">design from HTML5webtemplates.co.uk</a></p>
</div>
</div>
</body>
</html>
+135
View File
@@ -0,0 +1,135 @@
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_7</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>simplestyle<a href="#">_7</a></h1>
<div class="slogan">Cool slogan goes here!</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
<li><a href="index.html">Home</a></li>
<li class="current"><a href="examples.html">Examples</a></li>
<li><a href="page.html">A Page</a></li>
<li><a href="another_page.html">Another Page</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>What's the News?</h4>
<h5>1st July 2011</h5>
<p>Put your latest news item here, or anything else you would like in the sidebar!<br /><a href="#">Read more</a></p>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Newsletter</h3>
<p>If you would like to receive our newletter, please enter your email address and click 'Subscribe'.</p>
<form method="post" action="#" id="subscribe">
<p style="padding: 0 0 9px 0;"><input class="search" type="text" name="email_address" value="your email address" onclick="javascript: document.forms['subscribe'].email_address.value=''" /></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Subscribe" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Latest Blog</h3>
<h4>Website Goes Live</h4>
<h5>1st July 2011</h5>
<p>We have just launched our new website. Take a look around, we'd love to know what you think.....<br /><a href="#">read more</a></p>
</div>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>Examples</h1>
<p>This page contains examples of all the styled elements available as part of this design. Use this page for reference, whilst you build your website.</p>
<h2>Headings</h2>
<p>These are the different heading formats:</p>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<h2>Text</h2>
<p>The following examples show how the text (within '&lt;p&gt;&lt;/p&gt;' tags) will appear:</p>
<p><strong>This is an example of bold text</strong></p>
<p><i>This is an example of italic text</i></p>
<p><a href="#">This is a hyperlink</a></p>
<h2>Lists</h2>
<p>This is an unordered list:</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
<p>This is an ordered list:</p>
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ol>
<h2>Images</h2>
<p>images can be placed on the left, in the center or on the right:</p>
<span class="left"><img src="style/graphic.png" alt="example graphic" /></span>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum.
</p>
<span class="center"><img src="style/graphic.png" alt="example graphic" /></span>
<span class="right"><img src="style/graphic.png" alt="example graphic" /></span>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
</p>
<h2>Tables</h2>
<p>Tables should be used to display data and not used for laying out your website:</p>
<table style="width:100%; border-spacing:0;">
<tr><th>Item</th><th>Description</th></tr>
<tr><td>Item 1</td><td>Description of Item 1</td></tr>
<tr><td>Item 2</td><td>Description of Item 2</td></tr>
<tr><td>Item 3</td><td>Description of Item 3</td></tr>
<tr><td>Item 4</td><td>Description of Item 4</td></tr>
</table>
<h2>Form Elements</h2>
<form action="#" method="post">
<div class="form_settings">
<p><span>Form field example</span><input type="text" name="name" value="" /></p>
<p><span>Textarea example</span><textarea rows="8" cols="50" name="name"></textarea></p>
<p><span>Checkbox example</span><input class="checkbox" type="checkbox" name="name" value="" /></p>
<p><span>Dropdown list example</span><select id="id" name="name"><option value="1">Example 1</option><option value="2">Example 2</option></select></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="name" value="button" /></p>
</div>
</form>
</div>
</div>
<div id="footer">
<p>Copyright &copy; simplestyle_7 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">design from HTML5webtemplates.co.uk</a></p>
</div>
</div>
</body>
</html>
+82
View File
@@ -0,0 +1,82 @@
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_7</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>simplestyle<a href="#">_7</a></h1>
<div class="slogan">Cool slogan goes here!</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
<li class="current"><a href="index.html">Home</a></li>
<li><a href="examples.html">Examples</a></li>
<li><a href="page.html">A Page</a></li>
<li><a href="another_page.html">Another Page</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>What's the News?</h4>
<h5>1st July 2011</h5>
<p>Put your latest news item here, or anything else you would like in the sidebar!<br /><a href="#">Read more</a></p>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Newsletter</h3>
<p>If you would like to receive our newletter, please enter your email address and click 'Subscribe'.</p>
<form method="post" action="#" id="subscribe">
<p style="padding: 0 0 9px 0;"><input class="search" type="text" name="email_address" value="your email address" onclick="javascript: document.forms['subscribe'].email_address.value=''" /></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Subscribe" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Latest Blog</h3>
<h4>Website Goes Live</h4>
<h5>1st July 2011</h5>
<p>We have just launched our new website. Take a look around, we'd love to know what you think.....<br /><a href="#">read more</a></p>
</div>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>Welcome to the simplestyle_7 template</h1>
<p>This standards compliant, simple, fixed width website template is released as an 'open source' design (under a <a href="http://creativecommons.org/licenses/by/3.0">Creative Commons Attribution 3.0 Licence</a>), which means that you are free to download and use it for anything you want (including modifying and amending it). All I ask is that you leave the 'design from HTML5webtemplates.co.uk' link in the footer of the template, but other than that...</p>
<p>This template is written entirely in <strong>HTML5</strong> and <strong>CSS</strong>, and can be validated using the links in the footer.</p>
<p>You can view more free HTML5 web templates <a href="http://www.html5webtemplates.co.uk">here</a>.</p>
<p>This template is a fully functional 5 page website, with an <a href="examples.html">examples</a> page that gives examples of all the styles available with this design.</p>
<h2>Browser Compatibility</h2>
<p>This template has been tested in the following browsers:</p>
<ul>
<li>Internet Explorer 8</li>
<li>Internet Explorer 7</li>
<li>FireFox 3.5</li>
<li>Google Chrome 6</li>
<li>Safari 4</li>
</ul>
</div>
</div>
<div id="footer">
<p>Copyright &copy; simplestyle_7 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">design from HTML5webtemplates.co.uk</a></p>
</div>
</div>
</body>
</html>
+75
View File
@@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<html>
<head>
<title>simplestyle_7</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>simplestyle<a href="#">_7</a></h1>
<div class="slogan">Cool slogan goes here!</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
<li><a href="index.html">Home</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="current"><a href="page.html">A Page</a></li>
<li><a href="another_page.html">Another Page</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>What's the News?</h4>
<h5>1st July 2011</h5>
<p>Put your latest news item here, or anything else you would like in the sidebar!<br /><a href="#">Read more</a></p>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Newsletter</h3>
<p>If you would like to receive our newletter, please enter your email address and click 'Subscribe'.</p>
<form method="post" action="#" id="subscribe">
<p style="padding: 0 0 9px 0;"><input class="search" type="text" name="email_address" value="your email address" onclick="javascript: document.forms['subscribe'].email_address.value=''" /></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Subscribe" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Latest Blog</h3>
<h4>Website Goes Live</h4>
<h5>1st July 2011</h5>
<p>We have just launched our new website. Take a look around, we'd love to know what you think.....<br /><a href="#">read more</a></p>
</div>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>A Page</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui.</p>
</div>
</div>
<div id="footer">
<p>Copyright &copy; simplestyle_7 | <a href="http://validator.w3.org/check?uri=referer">HTML5</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.html5webtemplates.co.uk">design from HTML5webtemplates.co.uk</a></p>
</div>
</div>
</body>
</html>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

+326
View File
@@ -0,0 +1,326 @@
html
{ height: 100%;}
*
{ margin: 0;
padding: 0;}
body
{ font: normal .80em 'trebuchet ms', arial, sans-serif;
background: #F7F7F7 url(pattern.png) fixed;
color: #555;}
p
{ padding: 0 0 20px 0;
line-height: 1.5em;
font-size: 107%;}
img
{ border: 0;}
h1, h2, h3, h4, h5, h6
{ font: normal 250% 'Yanone Kaffeesatz', arial, sans-serif;
color: #444;
margin: 0 0 15px 0;
padding: 5px 0 5px 0;}
h2
{ font: normal 170% 'Yanone Kaffeesatz', arial, sans-serif;
color: #F14E23;
margin: 0;
padding: 0 0 8px 0;}
h3
{ font-size: 200%;
margin: 0 0 9px 0;
color: #444;}
h4, h5, h6
{ margin: 0;
padding: 0 0 5px 0;
font: normal 100% arial, sans-serif;
color: #F14E23;
line-height: 1em;}
h5, h6
{ font: italic 95% arial, sans-serif;
color: #888;
padding-bottom: 15px;}
h6
{ color: #362C20;}
a, a:hover
{ outline: none;
text-decoration: none;
color: #35BDF5;}
a:hover
{ text-decoration: underline;}
.left
{ float: left;
width: auto;
margin-right: 10px;}
.right
{ float: right;
width: auto;
margin-left: 10px;}
.center
{ display: block;
text-align: center;
margin: 20px auto;}
ul
{ margin: 2px 0 22px 17px;}
ul li
{ list-style-type: circle;
margin: 0 0 0 0;
padding: 0 0 4px 5px;}
ol
{ margin: 8px 0 22px 20px;}
ol li
{ margin: 0 0 11px 0;}
#main, #header, #logo, #menubar, #site_content, #footer
{ margin-left: auto;
margin-right: auto;}
#main
{ width: 950px;
margin: 20px auto;}
#header
{ width: 952px;
height: 145px;}
#logo
{ width: 950px;
float: left;
height: 100px;
background: transparent;
padding: 0 0 0px 10px;}
#logo h1
{ font: normal 350% 'Yanone Kaffeesatz', arial, sans-serif;
padding: 5px 0 0 17px;
color: #555;
float: left;}
#logo h1 a
{ color: #35BDF5;
text-decoration: none;}
#logo h1 a:hover
{ color: #555;
text-decoration: none;}
.slogan
{ float: right;
padding-right: 25px;
text-align: right;
font: 500% 'tangerine', arial;
color: #111;}
#menubar
{ height: 46px;
width: 700px;
margin: 0px auto -1px auto;
float: right;
padding: 0px 0 0 0;}
ul#menu
{ float: right;}
ul#menu li
{ float: left;
padding: 0 0 0px 0px;
list-style: none;
margin: 2px 0 0 0;
background: transparent;}
ul#menu li a
{ font: normal 170% 'Yanone Kaffeesatz', sans-serif;
text-decoration: none;
color: #444;
display: block;
float: left;
height: 20px;
padding: 7px 23px 15px 23px;
text-align: center;}
ul#menu li.current a
{ height: 20px;
padding: 6px 22px 15px 22px;}
ul#menu li.current a
{ background: #fff;
border: 1px solid #ddd;
border-bottom: 0;
color: #F14E23;}
ul#menu li a:hover
{ color: #F14E23;}
#site_content
{ width: 950px;
overflow: hidden;
margin: 0 auto 0 auto;
padding: 0;
background: #fff;
border: 1px solid #E7E7E7;}
#sidebar_container
{ float: right;
width: 250px;
margin: 25px 0;}
.sidebar
{ float: right;
width: 200px;
margin: 0 24px 27px 0;
background: #FBFBFB;
border: 1px solid #eee;
padding: 0 15px 15px 15px;}
.sidebar h3, .content h1
{ padding: 10px 15px;
margin: 0 1px;}
.sidebar h1
{ padding: 5px 0 0 0;}
.paperclip
{ float: left;
position: relative;
z-index: 0;
vertical-align: middle;
margin: -27px 0 -60px -30px;}
#content
{ text-align: left;
width: 630px;
padding: 25px 0 5px 25px;
margin: 0;}
#content ul
{ margin: 2px 0 22px 0px;}
#content ul li
{ list-style-type: none;
background: url(bullet.png) no-repeat;
margin: 0 0 6px 0;
padding: 0 0 4px 25px;
line-height: 1.5em;}
#footer
{ clear: both;
width: 100%;
font: normal 150% 'yanone kaffeesatz', arial, sans-serif;
height: 85px;
padding: 20px 0 5px 0;
text-align: center;
color: #555;
background: transparent;
margin-bottom: 20px;}
#footer p
{ padding: 0 0 10px 0;}
#footer a, #footer a:hover
{ color: #555;
text-decoration: none;}
#footer a:hover
{ color: #35BDF5;
text-decoration: none;}
.gallery img
{ position:absolute;}
.form_settings
{ margin: 5px 0 0 0;}
.form_settings p
{ padding: 0 0 10px 0;}
.form_settings span
{ padding: 5px 0;
float: left;
width: 170px;
text-align: left;}
.form_settings input, .form_settings textarea
{ width: 252px;
font: 100% 'trebuchet ms', arial;
border: 0;
border: 1px solid #eee;
padding: 5px 10px;
background: #fff;
color: #FFF;}
.form_settings .submit
{ border: 0;
width: auto;
margin: 0 0 0 200px;
cursor: pointer;
color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 15px;
background: #fff;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
.form_settings textarea, .form_settings select
{ font: 100% 'trebuchet ms', arial;
border: 1px solid #eee;
padding: 5px 10px;
background: #fff;
width: 252px;
overflow: auto;}
.form_settings select
{ width: 274px;}
.form_settings .checkbox
{ margin: 4px 0;
padding: 0;
width: 14px;
border: 0;
background: none;}
.search
{ color: #666;
border: 1px solid #eee;
margin: 0;
padding: 10px 5px;
width: 189px;
color: #F14E23;}
.subscribe
{ color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 10px;
background: #fff;
float: right;
cursor: pointer;
margin: 0;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
table
{ margin: 10px 0 30px 0;}
table tr th, table tr td
{ background: #F5F5F5;
color: #111;
padding: 7px 4px;
text-align: left;}
table tr td
{ background: #FBFBFB;
color: #111;
border-top: 1px solid #FFF;}
+504
View File
@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+218
View File
@@ -0,0 +1,218 @@
/*******************************************************************
* The http://phpmailer.codeworxtech.com/ website now carries a few *
* advertisements through the Google Adsense network. Please visit *
* the advertiser sites and help us offset some of our costs. *
* Thanks .... *
********************************************************************/
PHPMailer
Full Featured Email Transfer Class for PHP
==========================================
Version 5.0.0 (April 02, 2009)
With the release of this version, we are initiating a new version numbering
system to differentiate from the PHP4 version of PHPMailer.
Most notable in this release is fully object oriented code.
We now have available the PHPDocumentor (phpdocs) documentation. This is
separate from the regular download to keep file sizes down. Please see the
download area of http://phpmailer.codeworxtech.com.
We also have created a new test script (see /test_script) that you can use
right out of the box. Copy the /test_script folder directly to your server (in
the same structure ... with class.phpmailer.php and class.smtp.php in the
folder above it. Then launch the test script with:
http://www.yourdomain.com/phpmailer/test_script/index.php
from this one script, you can test your server settings for mail(), sendmail (or
qmail), and SMTP. This will email you a sample email (using contents.html for
the email body) and two attachments. One of the attachments is used as an inline
image to demonstrate how PHPMailer will automatically detect if attachments are
the same source as inline graphics and only include one version. Once you click
the Submit button, the results will be displayed including any SMTP debug
information and send status. We will also display a version of the script that
you can cut and paste to include in your projects. Enjoy!
Version 2.3 (November 08, 2008)
We have removed the /phpdoc from the downloads. All documentation is now on
the http://phpmailer.codeworxtech.com website.
The phpunit.php has been updated to support PHP5.
For all other changes and notes, please see the changelog.
Donations are accepted at PayPal with our id "paypal@worxteam.com".
Version 2.2 (July 15 2008)
- see the changelog.
Version 2.1 (June 04 2008)
With this release, we are announcing that the development of PHPMailer for PHP5
will be our focus from this date on. We have implemented all the enhancements
and fixes from the latest release of PHPMailer for PHP4.
Far more important, though, is that this release of PHPMailer (v2.1) is
fully tested with E_STRICT error checking enabled.
** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
APPRECIATED.
We have now added S/MIME functionality (ability to digitally sign emails).
BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
The "Signed Emails" functionality adds the Sign method to pass the private key
filename and the password to read it, and then email will be sent with
content-type multipart/signed and with the digital signature attached.
A quick note on E_STRICT:
- In about half the test environments the development version was subjected
to, an error was thrown for the date() functions (used at line 1565 and 1569).
This is NOT a PHPMailer error, it is the result of an incorrectly configured
PHP5 installation. The fix is to modify your 'php.ini' file and include the
date.timezone = America/New York
directive, (for your own server timezone)
- If you do get this error, and are unable to access your php.ini file, there is
a workaround. In your PHP script, add
date_default_timezone_set('America/Toronto');
* do NOT try to use
$myVar = date_default_timezone_get();
as a test, it will throw an error.
We have also included more example files to show the use of "sendmail", "mail()",
"smtp", and "gmail".
We are also looking for more programmers to join the volunteer development team.
If you have an interest in this, please let us know.
Enjoy!
Version 2.1.0beta1 & beta2
please note, this is BETA software
** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
INTENDED STRICTLY FOR TESTING
** NOTE:
As of November 2007, PHPMailer has a new project team headed by industry
veteran Andy Prevost (codeworxtech). The first release in more than two
years will focus on fixes, adding ease-of-use enhancements, provide
basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility
features. A new release is planned before year-end 2007 that will provide
full compatiblity with PHP4 and PHP5, as well as more bug fixes.
We are looking for project developers to assist in restoring PHPMailer to
its leadership position. Our goals are to simplify use of PHPMailer, provide
good documentation and examples, and retain backward compatibility to level
1.7.3 standards.
If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer
and indicate your interest.
**
http://phpmailer.sourceforge.net/
This software is licenced under the LGPL. Please read LICENSE for information on the
software availability and distribution.
Class Features:
- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
- Redundant SMTP servers
- Multipart/alternative emails for mail clients that do not read HTML email
- Support for 8bit, base64, binary, and quoted-printable encoding
- Uses the same methods as the very popular AspEmail active server (COM) component
- SMTP authentication
- Native language support
- Word wrap, and more!
Why you might need it:
Many PHP developers utilize email in their code. The only PHP function
that supports this is the mail() function. However, it does not expose
any of the popular features that many email clients use nowadays like
HTML-based emails and attachments. There are two proprietary
development tools out there that have all the functionality built into
easy to use classes: AspEmail(tm) and AspMail. Both of these
programs are COM components only available on Windows. They are also a
little pricey for smaller projects.
Since I do Linux development Ive missed these tools for my PHP coding.
So I built a version myself that implements the same methods (object
calls) that the Windows-based components do. It is open source and the
LGPL license allows you to place the class in your proprietary PHP
projects.
Installation:
Copy class.phpmailer.php into your php.ini include_path. If you are
using the SMTP mailer then place class.smtp.php in your path as well.
In the language directory you will find several files like
phpmailer.lang-en.php. If you look right before the .php extension
that there are two letters. These represent the language type of the
translation file. For instance "en" is the English file and "br" is
the Portuguese file. Chose the file that best fits with your language
and place it in the PHP include path. If your language is English
then you have nothing more to do. If it is a different language then
you must point PHPMailer to the correct translation. To do this, call
the PHPMailer SetLanguage method like so:
// To load the Portuguese version
$mail->SetLanguage("br", "/optional/path/to/language/directory/");
That's it. You should now be ready to use PHPMailer!
A Simple Example:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@example.com";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@example.net", "Josh Adams");
$mail->AddAddress("ellen@example.com"); // name is optional
$mail->AddReplyTo("info@example.com", "Information");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
CHANGELOG
See ChangeLog.txt
Download: http://sourceforge.net/project/showfiles.php?group_id=26031
Andy Prevost
+169
View File
@@ -0,0 +1,169 @@
<html>
<head>
<style>
body, p, li, td {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
ul {
margin:0 0px 0 15px;
padding:0;
}
div.width {
width: 760px;
text-align: left;
}
</style>
<script>
<!--
var popsite="http://phpmailer.codeworxtech.com"
var withfeatures="width=960,height=760,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
var once_per_session=0
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('popsite')=='') {
loadpopsite()
document.cookie="popsite=yes"
}
}
function loadpopsite(){
win2=window.open(popsite,"",withfeatures)
win2.blur()
window.focus()
}
if (once_per_session==0) {
loadpopsite()
} else {
loadornot()
}
-->
</script>
</head>
<body>
<center>
<div class="width">
<hr>
The http://phpmailer.codeworxtech.com/ website now carries a few
advertisements through the Google Adsense network to help offset
some of our costs.<br />
Thanks ....<br />
<hr>
<p>PHPMailer is the world's leading email transport class and downloaded an
average of more than 32,000 each month. In March 2009, PHPMailer was downloaded
more than 31,000 times -- that's an average of 1,000 downloads daily. Our thanks
to our new users and loyal users. We understand you have many choices available
to select from and we thank you for select our fast and stable tool for your
website and projects.</p>
<p>Credits:<br>
PHPMailer's original founder is Brent Matzelle. The current team is:<br>
Project Administrator: Andy Prevost (codeworxtech),
<a href="mailto:codeworxtech@users.sourceforge.net">
codeworxtech@users.sourceforge.net</a><br>
Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net<br>
Author: Marcus Bointon (coolbru) <a href="mailto:coolbru@users.sourceforge.net">
coolbru@users.sourceforge.net</a></p>
<p>PHPMailer is used in many projects ranging from Open Source to commercial
packages. Our LGPL licensing terms are very flexible and allow for including
PHPMailer to enhance projects of all types. If you discover PHPMailer being used
in a project, please let us know about it.</p>
<p><strong>WHY USE OUR TOOLS &amp; WHAT&#39;S IN IT FOR YOU?</strong></p>
<p>A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.</p>
<p>Now, here's our team:</p>
<table width="100%" cellpadding="5" style="border-collapse: collapse" border="1">
<tr>
<th><b>About Andy Prevost, AKA "codeworxtech".</b></th>
<th><b>About Marcus Bointon, AKA "coolbru".</b></th>
</tr>
<tr>
<td width="50%" valign="top">
<p><a href="http://www.codeworxtech.com">www.codeworxtech.com</a> for more information.<br>
Web design, web applications, forms: <a href="http://www.worxstudio.com">WorxStudio.com</a><br />
</p>
<p>Our company, <strong>Worx International Inc.</strong>, is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer.
We have staff and offices in the United States, Caribbean, the Middle
East, and our primary development center in Canada. Our company is represented by
agents and resellers globally.</p>
<p><strong>Worx International Inc.</strong> is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While <strong>Worx International Inc.</strong> can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we&#39;re the team to get it done right at a reasonable price.</p>
<p>Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.</p>
<p>Our developer tools are all Open Source. Here&#39;s a brief description:</p>
<ul>
<li><span style="background-color: #FFFF00"><strong>PHPMailer</strong></span>. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than
26000 times each and every month by developers looking for a fast, stable, simple email solution. We used it ourselves for years as our favorite tool. It&#39;s always been small (the entire footprint is
less than 100 Kb), stable, and as complete a solution as you can find.
Other tools are nowhere near as simple. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at
<a href="http://phpmailer.codeworxtech.com/">http://phpmailer.codeworxtech.com/</a>. <br />
Please note: <strong>all of our focus is now on the PHPMailer for PHP5.</strong><br />
<span style="background-color: #FFFF00">PS. While you are at it, please visit our sponsor&#39;s sites, click on their ads.
It helps offset some of our costs.</span><br />
Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer
for PHP5. If you are interested, let us know.<br />
<br />
</li>
<li><strong><span style="background-color: #FFFF00">QuickCache</span></strong>. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at
<a href="http://quickcache.codeworxtech.com/">http://quickcache.codeworxtech.com/</a>.<br />
<br />
</li>
<li><strong><span style="background-color: #FFFF00">QuickSkin</span></strong>. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It&#39;s a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at
<a href="http://quickskin.codeworxtech.com/">http://quickskin.codeworxtech.com/</a>.<br />
<br />
</li>
</ul>
<p>We're committed to PHP and to the Open Source community.</p>
<p>Opportunities with <strong>Worx International Inc.</strong>:</p>
<ul>
<li><span style="background-color: #FFFF00">Resellers/Agents</span>: We're always interested in talking with companies that
want to represent
<strong>Worx International Inc.</strong> in their markets. We also have private label programs for our commercial products (in certain circumstances).</li>
<li>Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with
<strong>Worx International Inc.</strong>, we would be pleased to hear from you.<br />
A few things to note:<br />
<ul>
<li>experience level does not matter: from fresh out of college to multi-year experience - it&#39;s your
creative mind and a positive attitude we want</li>
<li>if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation</li>
<li>if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.</li>
<li>any contact that ignores any of these points will be discarded</li>
</ul></li>
<li>Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let&#39;s talk.</li>
</ul>
Regards,<br />
Andy Prevost (aka, codeworxtech)<br />
<a href="mailto:codeworxtech@users.sourceforge.net">codeworxtech@users.sourceforge.net</a><br />
<br />
We now also offer website design. hosting, and remote forms processing. Visit <a href="http://www.worxstudio.com/" target="_blank">WorxStudio.com</a> for more information.<br />
</td>
<td width="50%" valign="top">
<p>Marcus is the technical director of <a href="http://www.synchromedia.co.uk/">Synchromedia Limited</a>, a UK-based company providing online business services. Synchromedia's main services are:</p>
<h2>Smartmessages.net</h2>
<p><a href="https://www.smartmessages.net/"><img src="http://www.synchromedia.co.uk/uploads/images/smlogo.gif" width="292" height="48" alt="Smartmessages.net logo" /><br />Smartmessages.net</a> is Synchromedia's large-scale mailing list management system, providing email delivery services for a wide range of businesses, from sole traders to corporates.
We pride ourselves on personal service, and realise that every one of your subscribers is a precious asset to be handled with care.
We provide fast, reliable, high-volume delivery (some of our customers have lists of more than 1,000,000 subscribers) with fine-grained tracking while ensuring you stay fully compliant with UK, EC and US data protection laws. Smartmessages of course uses PHPMailer at its heart!</p>
<h2>info@hand</h2>
<p><a href="http://www.synchromedia.co.uk/what-we-do/info-at-hand-crm/"><img src="http://www.synchromedia.co.uk/uploads/images/infoathand-large.png" width="250" height="40" alt="info@hand logo" /></a><br />Synchromedia is the official UK distributor of <a href="http://www.thelongreach.com/">info@hand</a>, a class-leading open-source web-based CRM system. We provide licenses, hosting, planning, support and training for this very fully-featured system at very competitive prices. info@hand also uses PHPMailer!</p>
<h2>How can we help you?</h2>
<p>In addition to our headline services, we also provide consulting, development, hosting and sysadmin services, so if you just need a simple web hosting package, we can do that too. Not surprisingly, we know rather a lot about email, so you can talk to us about that too.</p>
<p>Please <a href="http://www.synchromedia.co.uk/about-us/contact-us/">contact us</a> if you'd like to know more.</p>
<p>Marcus is a regular attendee at <a href="http://www.phplondon.org/">PHP London</a>, and occasionally speaks on email at technical conferences.</p>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>
+408
View File
@@ -0,0 +1,408 @@
ChangeLog
NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6.
IT WILL NOT WORK WITH PHP4.
Version 5.1 (October 20, 2009)
* fixed filename issue with AddStringAttachment (thanks to Tony)
* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in
addition to PHP mail()
* added DKIM digital signing functionality
New properties:
- DKIM_domain (sets the domain name)
- DKIM_private (holds DKIM private key)
- DKIM_passphrase (holds your DKIM passphrase)
- DKIM_selector (holds the DKIM "selector")
- DKIM_identity (holds the identifying email address)
* added callback function support
- callback function parameters include:
result, to, cc, bcc, subject and body
* see the test/test_callback.php file for usage.
* added "auto" identity functionality
- can automatically add:
- Return-path (if Sender not set)
- Reply-To (if ReplyTo not set)
- can be disabled:
- $mail->SetFrom('yourname@yourdomain.com','First Last',false);
- or by adding the $mail->Sender and/or $mail->ReplyTo properties
Note: "auto" identity added to help with emails ending up in spam
or junk boxes because of missing headers
Version 5.0.2 (May 24, 2009)
* Fix for missing attachments when inline graphics are present
* Fix for missing Cc in header when using SMTP (mail was sent,
but not displayed in header -- Cc receiver only saw email To:
line and no Cc line, but did get the email (To receiver
saw same)
Version 5.0.1 (April 05, 2009)
* Temporary fix for missing attachments
Version 5.0.0 (April 02, 2009)
* With the release of this version, we are initiating a new version numbering
system to differentiate from the PHP4 version of PHPMailer.
* Most notable in this release is fully object oriented code.
class.smtp.php:
* Refactored class.smtp.php to support new exception handling
code size reduced from 29.2 Kb to 25.6 Kb
* Removed unnecessary functions from class.smtp.php:
public function Expand($name) {
public function Help($keyword="") {
public function Noop() {
public function Send($from) {
public function SendOrMail($from) {
public function Verify($name) {
class.phpmailer.php:
* Refactored class.phpmailer.php with new exception handling
* Changed processing functionality of Sendmail and Qmail so they cannot be
inadvertently used
* removed getFile() function, just became a simple wrapper for
file_get_contents()
* added check for PHP version (will gracefully exit if not at least PHP 5.0)
class.phpmailer.php enhancements
* enhanced code to check if an attachment source is the same as an embedded or
inline graphic source to eliminate duplicate attachments
New /test_script
* We have written a test script you can use to test the script as part of your
installation. Once you press submit, the test script will send a multi-mime
email with either the message you type in or an HTML email with an inline
graphic. Two attachments are included in the email (one of the attachments
is also the inline graphic so you can see that only one copy of the graphic
is sent in the email). The test script will also display the functional
script that you can copy/paste to your editor to duplicate the functionality.
New examples
* All new examples in both basic and advanced modes. Advanced examples show
Exception handling.
PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0
* all new documentation
Please note: the website has been updated to reflect the changes in PHPMailer
version 5.0.0. http://phpmailer.codeworxtech.com/
Version 2.3 (November 06, 2008)
* added Arabic language (many thanks to Bahjat Al Mostafa)
* removed English language from language files and made it a default within
class.phpmailer.php - if no language is found, it will default to use
the english language translation
* fixed public/private declarations
* corrected line 1728, $basedir to $directory
* added $sign_cert_file to avoid improper duplicate use of $sign_key_file
* corrected $this->Hello on line 612 to $this->Helo
* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user
if default is not acceptable
* removed trim() from return results in EncodeQP
* /test and three files it contained are removed from version 2.3
* fixed phpunit.php for compliance with PHP5
* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg);
* We have removed the /phpdoc from the downloads. All documentation is now on
the http://phpmailer.codeworxtech.com website.
Version 2.2.1 () July 19 2008
* fixed line 1092 in class.smtp.php (my apologies, error on my part)
Version 2.2 () July 15 2008
* Fixed redirect issue (display of UTF-8 in thank you redirect)
* fixed error in getResponse function declaration (class.pop3.php)
* PHPMailer now PHP6 compliant
* fixed line 1092 in class.smtp.php (endless loop from missing = sign)
Version 2.1 (Wed, June 04 2008)
** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
APPRECIATED.
* added S/MIME functionality (ability to digitally sign emails)
BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
The "Signed Emails" functionality adds the Sign method to pass the private key
filename and the password to read it, and then email will be sent with
content-type multipart/signed and with the digital signature attached.
* fully compatible with E_STRICT error level
- Please note:
In about half the test environments this development version was subjected
to, an error was thrown for the date() functions used (line 1565 and 1569).
This is NOT a PHPMailer error, it is the result of an incorrectly configured
PHP5 installation. The fix is to modify your 'php.ini' file and include the
date.timezone = America/New York
directive, to your own server timezone
- If you do get this error, and are unable to access your php.ini file:
In your PHP script, add
date_default_timezone_set('America/Toronto');
- do not try to use
$myVar = date_default_timezone_get();
as a test, it will throw an error.
* added ability to define path (mainly for embedded images)
function MsgHTML($message,$basedir='') ... where:
$basedir is the fully qualified path
* fixed MsgHTML() function:
- Embedded Images where images are specified by <protocol>:// will not be altered or embedded
* fixed the return value of SMTP exit code ( pclose )
* addressed issue of multibyte characters in subject line and truncating
* added ability to have user specified Message ID
(default is still that PHPMailer create a unique Message ID)
* corrected unidentified message type to 'application/octet-stream'
* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al).
* added check for added attachments
* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny")
Version 2.1.0beta2 (Sun, Dec 02 2007)
* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon)
* finished all testing, all known bugs corrected, enhancements tested
- note: will NOT work with PHP4.
please note, this is BETA software
** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
INTENDED STRICTLY FOR TESTING
Version 2.1.0beta1
please note, this is BETA software
** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
INTENDED STRICTLY FOR TESTING
Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release
* implements new property to control VERP in class.smtp.php
example (requires instantiating class.smtp.php):
$mail->do_verp = true;
* POP-before-SMTP functionality included, thanks to Richard Davey
(see class.pop3.php & pop3_before_smtp_test.php for examples)
* included example showing how to use PHPMailer with GMAIL
* fixed the missing Cc in SendMail() and Mail()
******************
A note on sending bulk emails:
If the email you are sending is not personalized, consider using the
"undisclosed-recipient:;" strategy. That is, put all of your recipients
in the Bcc field and set the To field to "undisclosed-recipients:;".
It's a lot faster (only one send) and saves quite a bit on resources.
Contrary to some opinions, this will not get you listed in spam engines -
it's a legitimate way for you to send emails.
A partial example for use with PHPMailer:
$mail->AddAddress("undisclosed-recipients:;");
$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com");
Many email service providers restrict the number of emails that can be sent
in any given time period. Often that is between 50 - 60 emails maximum
per hour or per send session.
If that's the case, then break up your Bcc lists into chunks that are one
less than your limit, and put a pause in your script.
*******************
Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release
* dramatically simplified using inline graphics ... it's fully automated and requires no user input
* added automatic document type detection for attachments and pictures
* added MsgHTML() function to replace Body tag for HTML emails
* fixed the SendMail security issues (input validation vulnerability)
* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address
* removed the need to use the AltBody method (set from the HTML, or default text used)
* set the PHP Mail() function as the default (still support SendMail, SMTP Mail)
* removed the need to set the IsHTML property (set automatically)
* added Estonian language file by Indrek P&auml;ri
* added header injection patch
* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc.
example of use:
$mail->set('X-Priority', '3');
$mail->set('X-MSMail-Priority', 'Normal');
* fixed warning message in SMTP get_lines method
* added TLS/SSL SMTP support
example of use:
$mail = new PHPMailer();
$mail->Mailer = "smtp";
$mail->Host = "smtp.example.com";
$mail->SMTPSecure = "tls"; // option
//$mail->SMTPSecure = "ssl"; // option
...
$mail->Send();
* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)
* Works with PHP installed as a module or as CGI-PHP
- NOTE: will NOT work with PHP5 in E_STRICT error mode
Version 1.73 (Sun, Jun 10 2005)
* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
* Now has a total of 20 translations
* Fixed alt attachments bug: http://tinyurl.com/98u9k
Version 1.72 (Wed, May 25 2004)
* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
* Received: Removed this method because spam filter programs like
SpamAssassin reject this header.
* Fixed error count bug.
* SetLanguage default is now "language/".
* Fixed magic_quotes_runtime bug.
Version 1.71 (Tue, Jul 28 2003)
* Made several speed enhancements
* Added German and Italian translation files
* Fixed HELO/AUTH bugs on keep-alive connects
* Now provides an error message if language file does not load
* Fixed attachment EOL bug
* Updated some unclear documentation
* Added additional tests and improved others
Version 1.70 (Mon, Jun 20 2003)
* Added SMTP keep-alive support
* Added IsError method for error detection
* Added error message translation support (SetLanguage)
* Refactored many methods to increase library performance
* Hello now sends the newer EHLO message before HELO as per RFC 2821
* Removed the boundary class and replaced it with GetBoundary
* Removed queue support methods
* New $Hostname variable
* New Message-ID header
* Received header reformat
* Helo variable default changed to $Hostname
* Removed extra spaces in Content-Type definition (#667182)
* Return-Path should be set to Sender when set
* Adds Q or B encoding to headers when necessary
* quoted-encoding should now encode NULs \000
* Fixed encoding of body/AltBody (#553370)
* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
* Multiple bug fixes
Version 1.65 (Fri, Aug 09 2002)
* Fixed non-visible attachment bug (#585097) for Outlook
* SMTP connections are now closed after each transaction
* Fixed SMTP::Expand return value
* Converted SMTP class documentation to phpDocumentor format
Version 1.62 (Wed, Jun 26 2002)
* Fixed multi-attach bug
* Set proper word wrapping
* Reduced memory use with attachments
* Added more debugging
* Changed documentation to phpDocumentor format
Version 1.60 (Sat, Mar 30 2002)
* Sendmail pipe and address patch (Christian Holtje)
* Added embedded image and read confirmation support (A. Ognio)
* Added unit tests
* Added SMTP timeout support (*nix only)
* Added possibly temporary PluginDir variable for SMTP class
* Added LE message line ending variable
* Refactored boundary and attachment code
* Eliminated SMTP class warnings
* Added SendToQueue method for future queuing support
Version 1.54 (Wed, Dec 19 2001)
* Add some queuing support code
* Fixed a pesky multi/alt bug
* Messages are no longer forced to have "To" addresses
Version 1.50 (Thu, Nov 08 2001)
* Fix extra lines when not using SMTP mailer
* Set WordWrap variable to int with a zero default
Version 1.47 (Tue, Oct 16 2001)
* Fixed Received header code format
* Fixed AltBody order error
* Fixed alternate port warning
Version 1.45 (Tue, Sep 25 2001)
* Added enhanced SMTP debug support
* Added support for multiple ports on SMTP
* Added Received header for tracing
* Fixed AddStringAttachment encoding
* Fixed possible header name quote bug
* Fixed wordwrap() trim bug
* Couple other small bug fixes
Version 1.41 (Wed, Aug 22 2001)
* Fixed AltBody bug w/o attachments
* Fixed rfc_date() for certain mail servers
Version 1.40 (Sun, Aug 12 2001)
* Added multipart/alternative support (AltBody)
* Documentation update
* Fixed bug in Mercury MTA
Version 1.29 (Fri, Aug 03 2001)
* Added AddStringAttachment() method
* Added SMTP authentication support
Version 1.28 (Mon, Jul 30 2001)
* Fixed a typo in SMTP class
* Fixed header issue with Imail (win32) SMTP server
* Made fopen() calls for attachments use "rb" to fix win32 error
Version 1.25 (Mon, Jul 02 2001)
* Added RFC 822 date fix (Patrice)
* Added improved error handling by adding a $ErrorInfo variable
* Removed MailerDebug variable (obsolete with new error handler)
Version 1.20 (Mon, Jun 25 2001)
* Added quoted-printable encoding (Patrice)
* Set Version as public and removed PrintVersion()
* Changed phpdoc to only display public variables and methods
Version 1.19 (Thu, Jun 21 2001)
* Fixed MS Mail header bug
* Added fix for Bcc problem with mail(). *Does not work on Win32*
(See PHP bug report: http://www.php.net/bugs.php?id=11616)
* mail() no longer passes a fifth parameter when not needed
Version 1.15 (Fri, Jun 15 2001)
[Note: these changes contributed by Patrice Fournier]
* Changed all remaining \n to \r\n
* Bcc: header no longer writen to message except
when sent directly to sendmail
* Added a small message to non-MIME compliant mail reader
* Added Sender variable to change the Sender email
used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode
* Changed boundary setting to a place it will be set only once
* Removed transfer encoding for whole message when using multipart
* Message body now uses Encoding in multipart messages
* Can set encoding and type to attachments 7bit, 8bit
and binary attachment are sent as is, base64 are encoded
* Can set Encoding to base64 to send 8 bits body
through 7 bits servers
Version 1.10 (Tue, Jun 12 2001)
* Fixed win32 mail header bug (printed out headers in message body)
Version 1.09 (Fri, Jun 08 2001)
* Changed date header to work with Netscape mail programs
* Altered phpdoc documentation
Version 1.08 (Tue, Jun 05 2001)
* Added enhanced error-checking
* Added phpdoc documentation to source
Version 1.06 (Fri, Jun 01 2001)
* Added optional name for file attachments
Version 1.05 (Tue, May 29 2001)
* Code cleanup
* Eliminated sendmail header warning message
* Fixed possible SMTP error
Version 1.03 (Thu, May 24 2001)
* Fixed problem where qmail sends out duplicate messages
Version 1.02 (Wed, May 23 2001)
* Added multiple recipient and attachment Clear* methods
* Added Sendmail public variable
* Fixed problem with loading SMTP library multiple times
Version 0.98 (Tue, May 22 2001)
* Fixed problem with redundant mail hosts sending out multiple messages
* Added additional error handler code
* Added AddCustomHeader() function
* Added support for Microsoft mail client headers (affects priority)
* Fixed small bug with Mailer variable
* Added PrintVersion() function
Version 0.92 (Tue, May 15 2001)
* Changed file names to class.phpmailer.php and class.smtp.php to match
current PHP class trend.
* Fixed problem where body not being printed when a message is attached
* Several small bug fixes
Version 0.90 (Tue, April 17 2001)
* Intial public release
File diff suppressed because it is too large Load Diff
+407
View File
@@ -0,0 +1,407 @@
<?php
/*~ class.pop3.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.codeworxtech.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP POP Before SMTP Authentication Class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id: class.pop3.php 444 2009-05-05 11:22:26Z coolbru $
*/
/**
* POP Before SMTP Authentication Class
* Version 5.0.0
*
* Author: Richard Davey (rich@corephp.co.uk)
* Modifications: Andy Prevost
* License: LGPL, see PHPMailer License
*
* Specifically for PHPMailer to allow POP before SMTP authentication.
* Does not yet work with APOP - if you have an APOP account, contact Richard Davey
* and we can test changes to this script.
*
* This class is based on the structure of the SMTP class originally authored by Chris Ryan
*
* This class is rfc 1939 compliant and implements all the commands
* required for POP3 connection, authentication and disconnection.
*
* @package PHPMailer
* @author Richard Davey
*/
class POP3 {
/**
* Default POP3 port
* @var int
*/
public $POP3_PORT = 110;
/**
* Default Timeout
* @var int
*/
public $POP3_TIMEOUT = 30;
/**
* POP3 Carriage Return + Line Feed
* @var string
*/
public $CRLF = "\r\n";
/**
* Displaying Debug warnings? (0 = now, 1+ = yes)
* @var int
*/
public $do_debug = 2;
/**
* POP3 Mail Server
* @var string
*/
public $host;
/**
* POP3 Port
* @var int
*/
public $port;
/**
* POP3 Timeout Value
* @var int
*/
public $tval;
/**
* POP3 Username
* @var string
*/
public $username;
/**
* POP3 Password
* @var string
*/
public $password;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $pop_conn;
private $connected;
private $error; // Error log array
/**
* Constructor, sets the initial values
* @access public
* @return POP3
*/
public function __construct() {
$this->pop_conn = 0;
$this->connected = false;
$this->error = null;
}
/**
* Combination of public events - connect, login, disconnect
* @access public
* @param string $host
* @param integer $port
* @param integer $tval
* @param string $username
* @param string $password
*/
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
$this->host = $host;
// If no port value is passed, retrieve it
if ($port == false) {
$this->port = $this->POP3_PORT;
} else {
$this->port = $port;
}
// If no port value is passed, retrieve it
if ($tval == false) {
$this->tval = $this->POP3_TIMEOUT;
} else {
$this->tval = $tval;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
// Refresh the error log
$this->error = null;
// Connect
$result = $this->Connect($this->host, $this->port, $this->tval);
if ($result) {
$login_result = $this->Login($this->username, $this->password);
if ($login_result) {
$this->Disconnect();
return true;
}
}
// We need to disconnect regardless if the login succeeded
$this->Disconnect();
return false;
}
/**
* Connect to the POP3 server
* @access public
* @param string $host
* @param integer $port
* @param integer $tval
* @return boolean
*/
public function Connect ($host, $port = false, $tval = 30) {
// Are we already connected?
if ($this->connected) {
return true;
}
/*
On Windows this will raise a PHP Warning error if the hostname doesn't exist.
Rather than supress it with @fsockopen, let's capture it cleanly instead
*/
set_error_handler(array(&$this, 'catchWarning'));
// Connect to the POP3 server
$this->pop_conn = fsockopen($host, // POP3 Host
$port, // Port #
$errno, // Error Number
$errstr, // Error Message
$tval); // Timeout (seconds)
// Restore the error handler
restore_error_handler();
// Does the Error Log now contain anything?
if ($this->error && $this->do_debug >= 1) {
$this->displayErrors();
}
// Did we connect?
if ($this->pop_conn == false) {
// It would appear not...
$this->error = array(
'error' => "Failed to connect to server $host on port $port",
'errno' => $errno,
'errstr' => $errstr
);
if ($this->do_debug >= 1) {
$this->displayErrors();
}
return false;
}
// Increase the stream time-out
// Check for PHP 4.3.0 or later
if (version_compare(phpversion(), '5.0.0', 'ge')) {
stream_set_timeout($this->pop_conn, $tval, 0);
} else {
// Does not work on Windows
if (substr(PHP_OS, 0, 3) !== 'WIN') {
socket_set_timeout($this->pop_conn, $tval, 0);
}
}
// Get the POP3 server response
$pop3_response = $this->getResponse();
// Check for the +OK
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
}
/**
* Login to the POP3 server (does not support APOP yet)
* @access public
* @param string $username
* @param string $password
* @return boolean
*/
public function Login ($username = '', $password = '') {
if ($this->connected == false) {
$this->error = 'Not connected to POP3 server';
if ($this->do_debug >= 1) {
$this->displayErrors();
}
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
$pop_username = "USER $username" . $this->CRLF;
$pop_password = "PASS $password" . $this->CRLF;
// Send the Username
$this->sendString($pop_username);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
// Send the Password
$this->sendString($pop_password);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* Disconnect from the POP3 server
* @access public
*/
public function Disconnect () {
$this->sendString('QUIT');
fclose($this->pop_conn);
}
/////////////////////////////////////////////////
// Private Methods
/////////////////////////////////////////////////
/**
* Get the socket response back.
* $size is the maximum number of bytes to retrieve
* @access private
* @param integer $size
* @return string
*/
private function getResponse ($size = 128) {
$pop3_response = fgets($this->pop_conn, $size);
return $pop3_response;
}
/**
* Send a string down the open socket connection to the POP3 server
* @access private
* @param string $string
* @return integer
*/
private function sendString ($string) {
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
return $bytes_sent;
}
/**
* Checks the POP3 server response for +OK or -ERR
* @access private
* @param string $string
* @return boolean
*/
private function checkResponse ($string) {
if (substr($string, 0, 3) !== '+OK') {
$this->error = array(
'error' => "Server reported an error: $string",
'errno' => 0,
'errstr' => ''
);
if ($this->do_debug >= 1) {
$this->displayErrors();
}
return false;
} else {
return true;
}
}
/**
* If debug is enabled, display the error message array
* @access private
*/
private function displayErrors () {
echo '<pre>';
foreach ($this->error as $single_error) {
print_r($single_error);
}
echo '</pre>';
}
/**
* Takes over from PHP for the socket warning handler
* @access private
* @param integer $errno
* @param string $errstr
* @param string $errfile
* @param integer $errline
*/
private function catchWarning ($errno, $errstr, $errfile, $errline) {
$this->error[] = array(
'error' => "Connecting to the POP3 server raised a PHP warning: ",
'errno' => $errno,
'errstr' => $errstr
);
}
// End of class
}
?>
+814
View File
@@ -0,0 +1,814 @@
<?php
/*~ class.smtp.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.codeworxtech.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP SMTP email transport class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2008 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $
*/
/**
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
* commands except TURN which will always return a not implemented
* error. SMTP also provides some utility methods for sending mail
* to an SMTP server.
* original author: Chris Ryan
*/
class SMTP {
/**
* SMTP server port
* @var int
*/
public $SMTP_PORT = 25;
/**
* SMTP reply line ending
* @var string
*/
public $CRLF = "\r\n";
/**
* Sets whether debugging is turned on
* @var bool
*/
public $do_debug; // the level of debug to perform
/**
* Sets VERP use on/off (default is off)
* @var bool
*/
public $do_verp = false;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $smtp_conn; // the socket to the server
private $error; // error if any on the last call
private $helo_rply; // the reply the server sent to us for HELO
/**
* Initialize the class so that the data is in a known state.
* @access public
* @return void
*/
public function __construct() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;
$this->do_debug = 0;
}
/////////////////////////////////////////////////
// CONNECTION FUNCTIONS
/////////////////////////////////////////////////
/**
* Connect to the server specified on the port specified.
* If the port is not specified use the default SMTP_PORT.
* If tval is specified then a connection will try and be
* established with the server for that number of seconds.
* If tval is not specified the default is 30 seconds to
* try on the connection.
*
* SMTP CODE SUCCESS: 220
* SMTP CODE FAILURE: 421
* @access public
* @return bool
*/
public function Connect($host, $port = 0, $tval = 30) {
// set the error val to null so there is no confusion
$this->error = null;
// make sure we are __not__ connected
if($this->connected()) {
// already connected, generate error
$this->error = array("error" => "Already connected to a server");
return false;
}
if(empty($port)) {
$port = $this->SMTP_PORT;
}
// connect to the smtp server
$this->smtp_conn = @fsockopen($host, // the host of the server
$port, // the port to use
$errno, // error number if any
$errstr, // error message if any
$tval); // give up after ? secs
// verify we connected properly
if(empty($this->smtp_conn)) {
$this->error = array("error" => "Failed to connect to server",
"errno" => $errno,
"errstr" => $errstr);
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
}
return false;
}
// SMTP server can take longer to respond, give longer timeout for first read
// Windows does not have support for this timeout function
if(substr(PHP_OS, 0, 3) != "WIN")
socket_set_timeout($this->smtp_conn, $tval, 0);
// get any announcement
$announce = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
}
return true;
}
/**
* Initiate a TLS communication with the server.
*
* SMTP CODE 220 Ready to start TLS
* SMTP CODE 501 Syntax error (no parameters allowed)
* SMTP CODE 454 TLS not available due to temporary reason
* @access public
* @return bool success
*/
public function StartTLS() {
$this->error = null; # to avoid confusion
if(!$this->connected()) {
$this->error = array("error" => "Called StartTLS() without being connected");
return false;
}
fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 220) {
$this->error =
array("error" => "STARTTLS not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Begin encrypted connection
if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
return false;
}
return true;
}
/**
* Performs SMTP authentication. Must be run after running the
* Hello() method. Returns true if successfully authenticated.
* @access public
* @return bool
*/
public function Authenticate($username, $password) {
// Start authentication
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "AUTH not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded username
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "Username not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded password
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 235) {
$this->error =
array("error" => "Password not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Returns true if connected to a server otherwise false
* @access public
* @return bool
*/
public function Connected() {
if(!empty($this->smtp_conn)) {
$sock_status = socket_get_status($this->smtp_conn);
if($sock_status["eof"]) {
// the socket is valid but we are not connected
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
}
$this->Close();
return false;
}
return true; // everything looks good
}
return false;
}
/**
* Closes the socket and cleans up the state of the class.
* It is not considered good to use this function without
* first trying to use QUIT.
* @access public
* @return void
*/
public function Close() {
$this->error = null; // so there is no confusion
$this->helo_rply = null;
if(!empty($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
$this->smtp_conn = 0;
}
}
/////////////////////////////////////////////////
// SMTP COMMANDS
/////////////////////////////////////////////////
/**
* Issues a data command and sends the msg_data to the server
* finializing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being seperated by and additional <CRLF>.
*
* Implements rfc 821: DATA <CRLF>
*
* SMTP CODE INTERMEDIATE: 354
* [data]
* <CRLF>.<CRLF>
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 552,554,451,452
* SMTP CODE FAILURE: 451,554
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Data($msg_data) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Data() without being connected");
return false;
}
fputs($this->smtp_conn,"DATA" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 354) {
$this->error =
array("error" => "DATA command not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
/* the server is ready to accept data!
* according to rfc 821 we should not send more than 1000
* including the CRLF
* characters on a single line so we will break the data up
* into lines by \r and/or \n then if needed we will break
* each of those into smaller lines to fit within the limit.
* in addition we will be looking for lines that start with
* a period '.' and append and additional period '.' to that
* line. NOTE: this does not count towards limit.
*/
// normalize the line breaks so we know the explode works
$msg_data = str_replace("\r\n","\n",$msg_data);
$msg_data = str_replace("\r","\n",$msg_data);
$lines = explode("\n",$msg_data);
/* we need to find a good way to determine is headers are
* in the msg_data or if it is a straight msg body
* currently I am assuming rfc 822 definitions of msg headers
* and if the first field of the first line (':' sperated)
* does not contain a space then it _should_ be a header
* and we can process all lines before a blank "" line as
* headers.
*/
$field = substr($lines[0],0,strpos($lines[0],":"));
$in_headers = false;
if(!empty($field) && !strstr($field," ")) {
$in_headers = true;
}
$max_line_length = 998; // used below; set here for ease in change
while(list(,$line) = @each($lines)) {
$lines_out = null;
if($line == "" && $in_headers) {
$in_headers = false;
}
// ok we need to break this line up into several smaller lines
while(strlen($line) > $max_line_length) {
$pos = strrpos(substr($line,0,$max_line_length)," ");
// Patch to fix DOS attack
if(!$pos) {
$pos = $max_line_length - 1;
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos);
} else {
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos + 1);
}
/* if processing headers add a LWSP-char to the front of new line
* rfc 822 on long msg headers
*/
if($in_headers) {
$line = "\t" . $line;
}
}
$lines_out[] = $line;
// send the lines to the server
while(list(,$line_out) = @each($lines_out)) {
if(strlen($line_out) > 0)
{
if(substr($line_out, 0, 1) == ".") {
$line_out = "." . $line_out;
}
}
fputs($this->smtp_conn,$line_out . $this->CRLF);
}
}
// message data has been sent
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "DATA not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the HELO command to the smtp server.
* This makes sure that we and the server are in
* the same known state.
*
* Implements from rfc 821: HELO <SP> <domain> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500, 501, 504, 421
* @access public
* @return bool
*/
public function Hello($host = '') {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
return false;
}
// if hostname for HELO was not specified send default
if(empty($host)) {
// determine appropriate default to send to server
$host = "localhost";
}
// Send extended hello first (RFC 2821)
if(!$this->SendHello("EHLO", $host)) {
if(!$this->SendHello("HELO", $host)) {
return false;
}
}
return true;
}
/**
* Sends a HELO/EHLO command.
* @access private
* @return bool
*/
private function SendHello($hello, $host) {
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => $hello . " not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
$this->helo_rply = $rply;
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command.
*
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,421
* @access public
* @return bool
*/
public function Mail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Mail() without being connected");
return false;
}
$useVerp = ($this->do_verp ? "XVERP" : "");
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "MAIL not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the quit command to the server and then closes the socket
* if there is no error or the $close_on_error argument is true.
*
* Implements from rfc 821: QUIT <CRLF>
*
* SMTP CODE SUCCESS: 221
* SMTP CODE ERROR : 500
* @access public
* @return bool
*/
public function Quit($close_on_error = true) {
$this->error = null; // so there is no confusion
if(!$this->connected()) {
$this->error = array(
"error" => "Called Quit() without being connected");
return false;
}
// send the quit command to the server
fputs($this->smtp_conn,"quit" . $this->CRLF);
// get any good-bye messages
$byemsg = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
}
$rval = true;
$e = null;
$code = substr($byemsg,0,3);
if($code != 221) {
// use e as a tmp var cause Close will overwrite $this->error
$e = array("error" => "SMTP server rejected quit command",
"smtp_code" => $code,
"smtp_rply" => substr($byemsg,4));
$rval = false;
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
}
}
if(empty($e) || $close_on_error) {
$this->Close();
}
return $rval;
}
/**
* Sends the command RCPT to the SMTP server with the TO: argument of $to.
* Returns true if the recipient was accepted false if it was rejected.
*
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
*
* SMTP CODE SUCCESS: 250,251
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Recipient($to) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Recipient() without being connected");
return false;
}
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250 && $code != 251) {
$this->error =
array("error" => "RCPT not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the RSET command to abort and transaction that is
* currently in progress. Returns true if successful false
* otherwise.
*
* Implements rfc 821: RSET <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500,501,504,421
* @access public
* @return bool
*/
public function Reset() {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
return false;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "RSET failed",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command. This command
* will send the message to the users terminal if they are logged
* in and send them an email.
*
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,502,421
* @access public
* @return bool
*/
public function SendAndMail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called SendAndMail() without being connected");
return false;
}
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "SAML not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* This is an optional command for SMTP that this class does not
* support. This method is here to make the RFC821 Definition
* complete for this class and __may__ be implimented in the future
*
* Implements from rfc 821: TURN <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 502
* SMTP CODE ERROR : 500, 503
* @access public
* @return bool
*/
public function Turn() {
$this->error = array("error" => "This method, TURN, of the SMTP ".
"is not implemented");
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
}
return false;
}
/**
* Get the current error
* @access public
* @return array
*/
public function getError() {
return $this->error;
}
/////////////////////////////////////////////////
// INTERNAL FUNCTIONS
/////////////////////////////////////////////////
/**
* Read in as many lines as possible
* either before eof or socket timeout occurs on the operation.
* With SMTP we can tell if we have more lines to read if the
* 4th character is '-' symbol. If it is a space then we don't
* need to read anything else.
* @access private
* @return string
*/
private function get_lines() {
$data = "";
while($str = @fgets($this->smtp_conn,515)) {
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
}
$data .= $str;
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
}
// if 4th character is a space, we are done reading, break the loop
if(substr($str,3,1) == " ") { break; }
}
return $data;
}
}
?>
@@ -0,0 +1,17 @@
NEW CALLBACK FUNCTION:
======================
We have had requests for a method to process the results of sending emails
through PHPMailer. In this new release, we have implemented a callback
function that passes the results of each email sent (to, cc, and/or bcc).
We have provided an example that echos the results back to the screen. The
callback function can be used for any purpose. With minor modifications, the
callback function can be used to create CSV logs, post results to databases,
etc.
Please review the test.php script for the example.
It's pretty straight forward.
Enjoy!
Andy
+55
View File
@@ -0,0 +1,55 @@
CREATE DKIM KEYS and DNS Resource Record:
=========================================
To create DomainKeys Identified Mail keys, visit:
http://dkim.worxware.com/
... read the information, fill in the form, and download the ZIP file
containing the public key, private key, DNS Resource Record and instructions
to add to your DNS Zone Record, and the PHPMailer code to enable DKIM
digital signing.
/*** PROTECT YOUR PRIVATE & PUBLIC KEYS ***/
You need to protect your DKIM private and public keys from being viewed or
accessed. Add protection to your .htaccess file as in this example:
# secure htkeyprivate file
<Files .htkeyprivate>
order allow,deny
deny from all
</Files>
# secure htkeypublic file
<Files .htkeypublic>
order allow,deny
deny from all
</Files>
(the actual .htaccess additions are in the ZIP file sent back to you from
http://dkim.worxware.com/
A few notes on using DomainKey Identified Mail (DKIM):
You do not need to use PHPMailer to DKIM sign emails IF:
- you enable DomainKey support and add the DNS resource record
- you use your outbound mail server
If you are a third-party emailer that works on behalf of domain owners to
send their emails from your own server:
- you absolutely have to DKIM sign outbound emails
- the domain owner has to add the DNS resource record to match the
private key, public key, selector, identity, and domain that you create
- use caution with the "selector" ... at least one "selector" will already
exist in the DNS Zone Record of the domain at the domain owner's server
you need to ensure that the "selector" you use is unique
Note: since the IP address will not match the domain owner's DNS Zone record
you can be certain that email providers that validate based on DomainKey will
check the domain owner's DNS Zone record for your DNS resource record. Before
sending out emails on behalf of domain owners, ensure they have entered the
DNS resource record you provided them.
Enjoy!
Andy
PS. if you need additional information about DKIM, please see:
http://www.dkim.org/info/dkim-faq.html
@@ -0,0 +1,23 @@
If you are having problems connecting or sending emails through your SMTP server, please note:
1. The new rewrite of class.smtp.php provides more information about the processing/errors taking place
2. Use the debug functionality of class.smtp.php. To do that, in your own script add the debug level you wish to use. An example of that is:
$mail->SMTPDebug = 1;
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 26; // set the SMTP port
$mail->Host = "mail.yourhost.com"; // SMTP server
$mail->Username = "name@yourhost.com"; // SMTP account username
$mail->Password = "your password"; // SMTP account password
Notes on this:
$mail->SMTPDebug = 0; ... will disable debugging (you can also leave this out completely, 0 is the default
$mail->SMTPDebug = 1; ... will echo errors and messages
$mail->SMTPDebug = 2; ... will echo messages only
... and finally, the options are 0, 1, and 2 ... any number greater than 2 will be interpreted as 2
And finally, don't forget to disable debugging before going into production.
Enjoy!
Andy
+148
View File
@@ -0,0 +1,148 @@
<html>
<head>
<title>Examples using phpmailer</title>
</head>
<body bgcolor="#FFFFFF">
<h2>Examples using phpmailer</h2>
<h3>1. Advanced Example</h3>
<p>
This demonstrates sending out multiple email messages with binary attachments
from a MySQL database with multipart/alternative support.<p>
<table cellpadding="4" border="1" width="80%">
<tr>
<td bgcolor="#CCCCCC">
<pre>
require("class.phpmailer.php");
$mail = new phpmailer();
$mail->From = "list@example.com";
$mail->FromName = "List manager";
$mail->Host = "smtp1.example.com;smtp2.example.com";
$mail->Mailer = "smtp";
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("my_company");
$query  = "SELECT full_name, email, photo FROM employee WHERE id=$id";
$result = @MYSQL_QUERY($query);
while ($row = mysql_fetch_array ($result))
{
// HTML body
$body = "Hello &lt;font size=\"4\"&gt;" . $row["full_name"] . "&lt;/font&gt;, &lt;p&gt;";
$body .= "&lt;i&gt;Your&lt;/i&gt; personal photograph to this message.&lt;p&gt;";
$body .= "Sincerely, &lt;br&gt;";
$body .= "phpmailer List manager";
// Plain text body (for mail clients that cannot read HTML)
$text_body = "Hello " . $row["full_name"] . ", \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($row["email"], $row["full_name"]);
$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "&lt;br&gt;";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
</pre>
</td>
</tr>
</table>
<p>
<h3>2. Extending phpmailer</h3>
<p>
Extending classes with inheritance is one of the most
powerful features of object-oriented
programming. It allows you to make changes to the
original class for your
own personal use without hacking the original
classes. Plus, it is very
easy to do. I've provided an example:
<p>
Here's a class that extends the phpmailer class and sets the defaults
for the particular site:<br>
PHP include file: <b>mail.inc.php</b>
<p>
<table cellpadding="4" border="1" width="80%">
<tr>
<td bgcolor="#CCCCCC">
<pre>
require("class.phpmailer.php");
class my_phpmailer extends phpmailer {
// Set default variables for all new objects
var $From = "from@example.com";
var $FromName = "Mailer";
var $Host = "smtp1.example.com;smtp2.example.com";
var $Mailer = "smtp"; // Alternative to IsSMTP()
var $WordWrap = 75;
// Replace the default error_handler
function error_handler($msg) {
print("My Site Error");
print("Description:");
printf("%s", $msg);
exit;
}
// Create an additional function
function do_something($something) {
// Place your new code here
}
}
</td>
</tr>
</table>
<br>
Now here's a normal PHP page in the site, which will have all the defaults set
above:<br>
Normal PHP file: <b>mail_test.php</b>
<p>
<table cellpadding="4" border="1" width="80%">
<tr>
<td bgcolor="#CCCCCC">
<pre>
require("mail.inc.php");
// Instantiate your new class
$mail = new my_phpmailer;
// Now you only need to add the necessary stuff
$mail->AddAddress("josh@example.com", "Josh Adams");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip"); // optional name
if(!$mail->Send())
{
echo "There was an error sending the message";
exit;
}
echo "Message was sent successfully";
</pre>
</td>
</tr>
</table>
</p>
</body>
</html>
+67
View File
@@ -0,0 +1,67 @@
<html>
<head>
<title>PHPMailer FAQ</title>
<style>
body, p {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
div.width {
width: 500px;
text-align: left;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<center>
<div class="width">
<h2>PHPMailer FAQ</h2>
<ul>
<li><b style="background-color: #FFFF00">Q:</b> <b>I&#039;m using the SMTP mailer and I keep on getting a timeout message
well before the X seconds I set it for. What gives?</b><br />
<b style="background-color: #FFFF00">A:</b> PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout
early. You can fix this by re-compiling PHP 4.0.4pl1 with this fix:
<a href="timeoutfix.diff">timeoutfix.diff</a>. Otherwise you can wait for the new PHP release.<br /><br /></li>
<li><b style="background-color: #FFFF00">Q:</b> <b>I am concerned that using include files will take up too much
processing time on my computer. How can I make it run faster?</b><br />
<b style="background-color: #FFFF00">A:</b> PHP by itself is very fast. Much faster than ASP or JSP running on
the same type of server. This is because it has very little overhead compared
to its competitors and it pre-compiles all of
its code before it runs each script (in PHP4). However, all of
this compiling and re-compiling can take up a lot of valuable
computer resources. However, there are programs out there that compile
PHP code and store it in memory (or on mmaped files) to reduce the
processing immensely. Two of these: <a href="http://apc.communityconnect.com">APC
(Alternative PHP Cache)</a> and <a href="http://bwcache.bware.it/index.htm">Afterburner</a>
(<a href="http://www.mm4.de/php4win/mod_php4_win32/">Win32 download</a>)
are excellent free tools that do just this. If you have the money
you might also try <a href="http://www.zend.com">Zend Cache</a>, it is
even faster than the open source varieties. All of these tools make your
scripts run faster while also reducing the load on your server. I have tried
them myself and they are quite stable too.<br /><br /></li>
<li><b style="background-color: #FFFF00">Q:</b> <b>What mailer gives me the best performance?</b><br />
<b style="background-color: #FFFF00">A:</b> On a single machine the <b>sendmail (or Qmail)</b> is fastest overall.
Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.
If you have you have your mail server on a another machine then
SMTP is your only option, but you do get the benefit of redundant mail servers.<br />
If you are running a mailing list with thousands of names, the fastest mailers in order are: SMTP, sendmail (or Qmail), mail().<br /><br /></li>
<li><b style="background-color: #FFFF00">Q:</b> <b>When I try to attach a file with on my server I get a
"Could not find {file} on filesystem error". Why is this?</b><br />
<b style="background-color: #FFFF00">A:</b> If you are using a Unix machine this is probably because the user
running your web server does not have read access to the directory in question. If you are using Windows,
then the problem probably is that you have used single backslashes to denote directories (\).
A single backslash has a special meaning to PHP so these are not
valid. Instead use double backslashes ("\\") or a single forward
slash ("/").<br /><br /></li>
</ul>
</div>
</center>
</body>
</html>
+39
View File
@@ -0,0 +1,39 @@
This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented.
With that noted, here is how to implement it:
Install the class file
I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer-1.72 directory:
[geshi lang=php] require 'phpmailer-1.72/class.phpmailer.php'; require 'phpmailer-1.72/class.pop3.php'; [/geshi]
When you need it, create your POP3 object
Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:
[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]
The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are Connect, Logon and Disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.
The Parameters
The Authorise parameters are as follows:
[geshi lang=php]$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);[/geshi]
1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)
2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)
3. 30 - A connection time-out value (in seconds)
4. mailer - The POP3 Username required to logon
5. password - The POP3 Password required to logon
6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)
Final Comments + the Download
1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me.
2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time.
3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead.
4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with.
Download
Here is the full class file plus my test script: POP_before_SMTP_PHPMailer.zip (4 KB) - Please note that it does not include PHPMailer itself.
My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)
+45
View File
@@ -0,0 +1,45 @@
<?php
// example on using PHPMailer with GMAIL
include("class.phpmailer.php");
include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded
$mail = new PHPMailer();
$body = $mail->getFile('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = "yourname@gmail.com"; // GMAIL username
$mail->Password = "password"; // GMAIL password
$mail->From = "replyto@yourdomain.com";
$mail->FromName = "Webmaster";
$mail->Subject = "This is the subject";
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body
$mail->WordWrap = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");
$mail->AddAttachment("/path/to/file.zip"); // attachment
$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
$mail->AddAddress("username@domain.com","First Last");
$mail->IsHTML(true); // send as HTML
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
?>
+20
View File
@@ -0,0 +1,20 @@
<body style="margin: 10px;">
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
<br>
&nbsp;This is a test of PHPMailer.<br>
<br>
This particular example uses <strong>HTML</strong>, with a &lt;div&gt; tag and inline<br>
styles.<br>
<br>
Also note the use of the PHPMailer logo above with no specific code to handle
including it.<br />
Included are two attachments:<br />
phpmailer.gif is an attachment and used inline as a graphic (above)<br />
phpmailer_mini.gif is an attachment<br />
<br />
PHPMailer:<br />
Author: Andy Prevost (codeworxtech@users.sourceforge.net)<br />
Author: Marcus Bointon (coolbru@users.sourceforge.net)<br />
</div>
</body>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+49
View File
@@ -0,0 +1,49 @@
This release of PHPMailer (v5.0.0) sets a new milestone in the development
cycle of PHPMailer. First, class.phpmailer.php has a small footprint (65.7 Kb),
while class.smtp.php is even smaller than before (at only 25.0 Kb).<br />
<br />
We have maintained all functionality and added Exception handling unique to
PHP 5/6.<br />
<br />
There is only one function that has been removed: that is getFile(). The reason
for this is that getFile() became a wrapper for the PHP function 'file_get_contents()'
and nothing more. Rather than burden the class with a function already available
in PHP, we decided to remove it.<br />
<br />
Our new Exception handling provides your own scripts far more power than ever.<br />
<br />
We have also enhanced the "packaging" of PHPMailer with an entirely new set of
examples. Included are both basic and advanced examples showing how you can take
advantage of PHP Exception handling to improve your own scripts.<br />
<br />
A few things to note about PHPMailer:
<ul>
<li>the use of $mail-&gt;AltBody is completely optional. If not used, PHPMailer
will use the HTML text with htmlentities().<br />
We also highly recommend using HTML2Text authored by Jon Abernathy. The class description
and download can be viewed at: http://www.chuggnutt.com/html2text.php.
</li>
<li>there is no specific code to define image or attachment types ... that is handled
automatically by PHPMailer when it parses the images</li>
</ul>
A note to users that want to use SMTP with PHPMailer. The most common problems are:
<ul>
<li>wrong port ... most ISP (Internet Service Providers) will not allow relaying through
their servers. If that's the case with your ISP, try using port 26.
</li>
<li>wrong authentication information (username and/or password) ... don't forget that
many servers require the account name to be in the format of the full email address.
</li>
<li>... if these tips do not get your SMTP settings working, we have a debug mode
for helping you determine the problem. Insert this after $mail->IsSMTP();<br />
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)<br />
note that a setting of 2 will display all errors and messages generated by the SMTP
server<br />
</li>
</ul>
Our examples all use an HTML file in the /examples folder. To see what the email SHOULD
look like in your HTML compatible email viewer: <a href="contents.html">click here</a><br>
<br />
From the PHPMailer team:<br />
Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net (and Project Administrator)<br />
Author: Marcus Bointon (coolbru) coolbru@users.sourceforge.net<br />
@@ -0,0 +1,58 @@
<html>
<head>
<title>PHPMailer - MySQL Database - SMTP basic test with authentication</title>
</head>
<body>
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp1.site.com;smtp2.site.com";
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent
$mail->Host = "mail.yourdomain.com"; // sets the SMTP server
$mail->Port = 26; // set the SMTP port for the GMAIL server
$mail->Username = "yourname@yourdomain"; // SMTP account username
$mail->Password = "yourpassword"; // SMTP account password
$mail->SetFrom('list@mydomain.com', 'List manager');
$mail->AddReplyTo('list@mydomain.com', 'List manager');
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("my_company");
$query = "SELECT full_name, email, photo FROM employee WHERE id=$id";
$result = @MYSQL_QUERY($query);
while ($row = mysql_fetch_array ($result)) {
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress($row["email"], $row["full_name"]);
$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send()) {
echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br />';
} else {
echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br />';
}
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
?>
</body>
</html>
@@ -0,0 +1,31 @@
<html>
<head>
<title>PHPMailer - Mail() advanced test</title>
</head>
<body>
<?php
require_once '../class.phpmailer.php';
$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
try {
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,43 @@
<html>
<head>
<title>PHPMailer - Mail() basic test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->Subject = "PHPMailer Test Subject via mail(), basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,40 @@
<html>
<head>
<title>POP before SMTP Test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
require_once('../class.pop3.php'); // required for POP before SMTP
$pop = new POP3();
$pop->Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1);
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP();
try {
$mail->SMTPDebug = 2;
$mail->Host = 'pop3.yourdomain.com';
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,49 @@
<html>
<head>
<title>POP before SMTP Test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
require_once('../class.pop3.php'); // required for POP before SMTP
$pop = new POP3();
$pop->Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1);
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP();
$mail->SMTPDebug = 2;
$mail->Host = 'pop3.yourdomain.com';
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via POP before SMTP, basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,34 @@
<html>
<head>
<title>PHPMailer - Sendmail advanced test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSendmail(); // telling the class to use SendMail transport
try {
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,45 @@
<html>
<head>
<title>PHPMailer - Sendmail basic test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$mail->IsSendmail(); // telling the class to use SendMail transport
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->Subject = "PHPMailer Test Subject via Sendmail, basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,43 @@
<html>
<head>
<title>PHPMailer - SMTP advanced test with authentication</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.yourdomain.com"; // sets the SMTP server
$mail->Port = 26; // set the SMTP port for the GMAIL server
$mail->Username = "yourname@yourdomain"; // SMTP account username
$mail->Password = "yourpassword"; // SMTP account password
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,37 @@
<html>
<head>
<title>PHPMailer - SMTP advanced test with no authentication</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,58 @@
<html>
<head>
<title>PHPMailer - SMTP basic test with authentication</title>
</head>
<body>
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.yourdomain.com"; // sets the SMTP server
$mail->Port = 26; // set the SMTP port for the GMAIL server
$mail->Username = "yourname@yourdomain"; // SMTP account username
$mail->Password = "yourpassword"; // SMTP account password
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,53 @@
<html>
<head>
<title>PHPMailer - SMTP basic test with no authentication</title>
</head>
<body>
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with no authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,43 @@
<html>
<head>
<title>PHPMailer - SMTP (Gmail) advanced test</title>
</head>
<body>
<?php
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "yourusername@gmail.com"; // GMAIL username
$mail->Password = "yourpassword"; // GMAIL password
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
@@ -0,0 +1,59 @@
<html>
<head>
<title>PHPMailer - SMTP (Gmail) basic test</title>
</head>
<body>
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "yourusername@gmail.com"; // GMAIL username
$mail->Password = "yourpassword"; // GMAIL password
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
</body>
</html>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Arabic Version, UTF-8
* by : bahjat al mostafa <bahjat983@hotmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: ';
$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : ';
$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: ';
$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: ';
$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : ';
$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
//$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' .
'فشل في الارسال لكل من : ';
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Portuguese Version
* By Paulo Henrique Garcia - paulo@controllerweb.com.br
*/
$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados não aceitos.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
$PHPMAILER_LANG['from_failed'] = 'Os endereços de rementente a seguir falharam: ';
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.';
$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Catalan Version
* By Ivan: web AT microstudi DOT com
*/
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s\'hapogut autenticar.';
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
$PHPMAILER_LANG['execute'] = 'No es pot executar: ';
$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l\'arxiu: ';
$PHPMAILER_LANG['file_open'] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: ';
$PHPMAILER_LANG['instantiate'] = 'No s\'ha pogut crear una instància de la funció Mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
$PHPMAILER_LANG['provide_address'] = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Chinese Version
* By LiuXin: www.80x86.cn/blog/
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = '未知编码:';
$PHPMAILER_LANG['execute'] = '不能执行: ';
$PHPMAILER_LANG['file_access'] = '不能访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Czech Version
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentikace.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data nebyla pøijata';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
$PHPMAILER_LANG['file_access'] = 'Soubor nenalezen: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Nelze otevøít soubor pro ètení: ';
$PHPMAILER_LANG['from_failed'] = 'Následující adresa From je nesprávná: ';
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvoøit instanci emailové funkce.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.';
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou správné ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* German Version
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
$PHPMAILER_LANG['empty_message'] = 'E-Mail Inhalt ist leer.';
$PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
$PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
$PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.';
$PHPMAILER_LANG['invalid_email'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.';
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: ';
$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Danish Version
* Author: Mikael Stokkebro <info@stokkebro.dk>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: ';
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Spanish version
* Versión en español
*/
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No se pudo autentificar.';
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No puedo conectar al servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
$PHPMAILER_LANG['execute'] = 'No puedo ejecutar: ';
$PHPMAILER_LANG['file_access'] = 'No puedo acceder al archivo: ';
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No puede abrir el archivo: ';
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
$PHPMAILER_LANG['instantiate'] = 'No pude crear una instancia de la función Mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destinatario.';
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinatarios fallaron: ';
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Estonian Version
* By Indrek Päri
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Tundmatu Unknown kodeering: ';
$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: ';
$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: ';
$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: ';
$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Finnish Version
* By Jyry Kuukanen
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-virhe: data on virheellinen.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
$PHPMAILER_LANG['execute'] = 'Suoritus epäonnistui: ';
$PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
$PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
$PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: ';
$PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Faroese Version [language of the Faroe Islands, a Danish dominion]
* This file created: 11-06-2004
* Supplied by Dávur Sørensen [www.profo-webdesign.dk]
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.';
$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: ';
$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: ';
$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* French Version
*/
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : Echec de l\'authentification.';
$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : Données incorrects.';
$PHPMAILER_LANG['empty_message'] = 'Corps de message vide';
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : ';
$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
$PHPMAILER_LANG['file_open'] = 'Erreur Fichier : ouverture impossible : ';
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échouée : ';
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : Les destinataires suivants sont en erreur : ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Hungarian Version
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Hiba: Sikertelen autentikáció.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hiba: Nem elfogadható adat.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Ismeretlen kódolás: ';
$PHPMAILER_LANG['execute'] = 'Nem tudtam végrehajtani: ';
$PHPMAILER_LANG['file_access'] = 'Nem sikerült elérni a következõ fájlt: ';
$PHPMAILER_LANG['file_open'] = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
$PHPMAILER_LANG['from_failed'] = 'Az alábbi Feladó cím hibás: ';
$PHPMAILER_LANG['instantiate'] = 'Nem sikerült példányosítani a mail funkciót.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Meg kell adnod legalább egy címzett email címet.';
$PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hiba: Az alábbi címzettek hibásak: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Italian version
* @package PHPMailer
* @author Ilias Bartolini <brain79@inwind.it>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: ';
$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: ';
$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: ';
$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Japanese Version
* By Mitsuhiro Yoshida - http://mitstek.com/
*/
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: ';
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Dutch Version
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Fout: authenticatie mislukt.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Fout: Kon niet verbinden met SMTP host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fout: Data niet geaccepteerd.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
$PHPMAILER_LANG['file_open'] = 'Bestandsfout: Kon bestand niet openen: ';
$PHPMAILER_LANG['from_failed'] = 'De volgende afzender adressen zijn mislukt: ';
$PHPMAILER_LANG['instantiate'] = 'Kon mail functie niet initialiseren.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fout: De volgende ontvangers zijn mislukt: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Norwegian Version
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke authentisere.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Data ble ikke akseptert.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Ukjent encoding: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
$PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende Fra feilet: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke instantiate mail funksjonen.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Du må ha med minst en mottager adresse.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Polish Version
*/
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić autentykacji.';
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest jest nieprawidłowy: ';
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Romanian Version
* @package PHPMailer
* @author Catalin Constantin <catalin@dazoot.ro>
*/
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.';
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
$PHPMAILER_LANG['execute'] = 'Nu pot executa: ';
$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: ';
$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,25 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Russian Version by Alexey Chumakov <alex@chumakov.ru>
*/
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: ';
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: ';
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.';
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Swedish Version
* Author: Johan Linnér <johan@linner.biz>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,27 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Turkish version
* Türkçe Versiyonu
* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatasý: Doðrulanamýyor.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatasý: Veri kabul edilmedi.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen þifreleme: ';
$PHPMAILER_LANG['execute'] = 'Çalýþtýrýlamýyor: ';
$PHPMAILER_LANG['file_access'] = 'Dosyaya eriþilemiyor: ';
$PHPMAILER_LANG['file_open'] = 'Dosya Hatasý: Dosya açýlamýyor: ';
$PHPMAILER_LANG['from_failed'] = 'Baþarýsýz olan gönderici adresi: ';
$PHPMAILER_LANG['instantiate'] = 'Örnek mail fonksiyonu yaratýlamadý.';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatasý: alýcýlara ulaþmadý: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Traditional Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = '未知編碼: ';
$PHPMAILER_LANG['file_access'] = '無法訪問文件:';
$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:';
$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
$PHPMAILER_LANG['execute'] = '無法執行:';
$PHPMAILER_LANG['instantiate'] = '未知函數調用。';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
@@ -0,0 +1,26 @@
<?php
/**
* PHPMailer language file: refer to English translation for definitive list
* Simplified Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = '未知编码: ';
$PHPMAILER_LANG['execute'] = '无法执行:';
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
?>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Email test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Here is a test HTML email</p>
</body>
</html>
+670
View File
@@ -0,0 +1,670 @@
<?php
/**
* PHPMailer - PHP email transport unit tests
* Before running these tests you need to install PHPUnit 3.3 or later through pear, like this:
* pear install "channel://pear.phpunit.de/PHPUnit"
* Then run the tests like this:
* phpunit phpmailerTest
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @version $Id: phpmailerTest.php 444 2009-05-05 11:22:26Z coolbru $
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
*/
require 'PHPUnit/Framework.php';
$INCLUDE_DIR = "../";
require $INCLUDE_DIR . 'class.phpmailer.php';
error_reporting(E_ALL);
/**
* PHPMailer - PHP email transport unit test class
* Performs authentication tests
*/
class phpmailerTest extends PHPUnit_Framework_TestCase {
/**
* Holds the default phpmailer instance.
* @private
* @type object
*/
var $Mail = false;
/**
* Holds the SMTP mail host.
* @public
* @type string
*/
var $Host = "";
/**
* Holds the change log.
* @private
* @type string array
*/
var $ChangeLog = array();
/**
* Holds the note log.
* @private
* @type string array
*/
var $NoteLog = array();
/**
* Run before each test is started.
*/
function setUp() {
global $INCLUDE_DIR;
@include './testbootstrap.php'; //Overrides go in here
$this->Mail = new PHPMailer();
$this->Mail->Priority = 3;
$this->Mail->Encoding = "8bit";
$this->Mail->CharSet = "iso-8859-1";
if (array_key_exists('mail_from', $_REQUEST)) {
$this->Mail->From = $_REQUEST['mail_from'];
} else {
$this->Mail->From = 'unit_test@phpmailer.sf.net';
}
$this->Mail->FromName = "Unit Tester";
$this->Mail->Sender = "";
$this->Mail->Subject = "Unit Test";
$this->Mail->Body = "";
$this->Mail->AltBody = "";
$this->Mail->WordWrap = 0;
if (array_key_exists('mail_host', $_REQUEST)) {
$this->Mail->Host = $_REQUEST['mail_host'];
} else {
$this->Mail->Host = 'mail.example.com';
}
$this->Mail->Port = 25;
$this->Mail->Helo = "localhost.localdomain";
$this->Mail->SMTPAuth = false;
$this->Mail->Username = "";
$this->Mail->Password = "";
$this->Mail->PluginDir = $INCLUDE_DIR;
$this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");
$this->Mail->Sender = "unit_test@phpmailer.sf.net";
if(strlen($this->Mail->Host) > 0) {
$this->Mail->Mailer = "smtp";
} else {
$this->Mail->Mailer = "mail";
$this->Sender = "unit_test@phpmailer.sf.net";
}
if (array_key_exists('mail_to', $_REQUEST)) {
$this->SetAddress($_REQUEST['mail_to'], 'Test User', 'to');
}
if (array_key_exists('mail_cc', $_REQUEST) and strlen($_REQUEST['mail_cc']) > 0) {
$this->SetAddress($_REQUEST['mail_cc'], 'Carbon User', 'cc');
}
}
/**
* Run after each test is completed.
*/
function tearDown() {
// Clean global variables
$this->Mail = NULL;
$this->ChangeLog = array();
$this->NoteLog = array();
}
/**
* Build the body of the message in the appropriate format.
* @private
* @returns void
*/
function BuildBody() {
$this->CheckChanges();
// Determine line endings for message
if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)
{
$eol = "<br/>";
$bullet = "<li>";
$bullet_start = "<ul>";
$bullet_end = "</ul>";
}
else
{
$eol = "\n";
$bullet = " - ";
$bullet_start = "";
$bullet_end = "";
}
$ReportBody = "";
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "Unit Test Information" . $eol;
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "phpmailer version: " . PHPMailer::VERSION . $eol;
$ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
if(strlen($this->Mail->Host) > 0)
$ReportBody .= "Host: " . $this->Mail->Host . $eol;
// If attachments then create an attachment list
$attachments = $this->Mail->GetAttachments();
if(count($attachments) > 0)
{
$ReportBody .= "Attachments:" . $eol;
$ReportBody .= $bullet_start;
foreach($attachments as $attachment) {
$ReportBody .= $bullet . "Name: " . $attachment[1] . ", ";
$ReportBody .= "Encoding: " . $attachment[3] . ", ";
$ReportBody .= "Type: " . $attachment[4] . $eol;
}
$ReportBody .= $bullet_end . $eol;
}
// If there are changes then list them
if(count($this->ChangeLog) > 0)
{
$ReportBody .= "Changes" . $eol;
$ReportBody .= "-------" . $eol;
$ReportBody .= $bullet_start;
for($i = 0; $i < count($this->ChangeLog); $i++)
{
$ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" .
$this->ChangeLog[$i][1] . "]" . $eol;
}
$ReportBody .= $bullet_end . $eol . $eol;
}
// If there are notes then list them
if(count($this->NoteLog) > 0)
{
$ReportBody .= "Notes" . $eol;
$ReportBody .= "-----" . $eol;
$ReportBody .= $bullet_start;
for($i = 0; $i < count($this->NoteLog); $i++)
{
$ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
}
$ReportBody .= $bullet_end;
}
// Re-attach the original body
$this->Mail->Body .= $eol . $eol . $ReportBody;
}
/**
* Check which default settings have been changed for the report.
* @private
* @returns void
*/
function CheckChanges() {
if($this->Mail->Priority != 3)
$this->AddChange("Priority", $this->Mail->Priority);
if($this->Mail->Encoding != "8bit")
$this->AddChange("Encoding", $this->Mail->Encoding);
if($this->Mail->CharSet != "iso-8859-1")
$this->AddChange("CharSet", $this->Mail->CharSet);
if($this->Mail->Sender != "")
$this->AddChange("Sender", $this->Mail->Sender);
if($this->Mail->WordWrap != 0)
$this->AddChange("WordWrap", $this->Mail->WordWrap);
if($this->Mail->Mailer != "mail")
$this->AddChange("Mailer", $this->Mail->Mailer);
if($this->Mail->Port != 25)
$this->AddChange("Port", $this->Mail->Port);
if($this->Mail->Helo != "localhost.localdomain")
$this->AddChange("Helo", $this->Mail->Helo);
if($this->Mail->SMTPAuth)
$this->AddChange("SMTPAuth", "true");
}
/**
* Adds a change entry.
* @private
* @returns void
*/
function AddChange($sName, $sNewValue) {
$cur = count($this->ChangeLog);
$this->ChangeLog[$cur][0] = $sName;
$this->ChangeLog[$cur][1] = $sNewValue;
}
/**
* Adds a simple note to the message.
* @public
* @returns void
*/
function AddNote($sValue) {
$this->NoteLog[] = $sValue;
}
/**
* Adds all of the addresses
* @public
* @returns void
*/
function SetAddress($sAddress, $sName = "", $sType = "to") {
switch($sType)
{
case "to":
return $this->Mail->AddAddress($sAddress, $sName);
case "cc":
return $this->Mail->AddCC($sAddress, $sName);
case "bcc":
return $this->Mail->AddBCC($sAddress, $sName);
}
}
/////////////////////////////////////////////////
// UNIT TESTS
/////////////////////////////////////////////////
/**
* Try a plain message.
*/
function test_WordWrap() {
$this->Mail->WordWrap = 40;
$my_body = "Here is the main body of this message. It should " .
"be quite a few lines. It should be wrapped at the " .
"40 characters. Make sure that it is.";
$nBodyLen = strlen($my_body);
$my_body .= "\n\nThis is the above body length: " . $nBodyLen;
$this->Mail->Body = $my_body;
$this->Mail->Subject .= ": Wordwrap";
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Try a plain message.
*/
function test_Low_Priority() {
$this->Mail->Priority = 5;
$this->Mail->Body = "Here is the main body. There should be " .
"a reply to address in this message.";
$this->Mail->Subject .= ": Low Priority";
$this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Simple plain file attachment test.
*/
function test_Multiple_Plain_FileAttachment() {
$this->Mail->Body = "Here is the text body";
$this->Mail->Subject .= ": Plain + Multiple FileAttachments";
if(!$this->Mail->AddAttachment("test.png"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
if(!$this->Mail->AddAttachment(__FILE__, "test.txt"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Simple plain string attachment test.
*/
function test_Plain_StringAttachment() {
$this->Mail->Body = "Here is the text body";
$this->Mail->Subject .= ": Plain + StringAttachment";
$sAttachment = "These characters are the content of the " .
"string attachment.\nThis might be taken from a ".
"database or some other such thing. ";
$this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Plain quoted-printable message.
*/
function test_Quoted_Printable() {
$this->Mail->Body = "Here is the main body";
$this->Mail->Subject .= ": Plain + Quoted-printable";
$this->Mail->Encoding = "quoted-printable";
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
//Check that a quoted printable encode and decode results in the same as went in
$t = substr(file_get_contents(__FILE__), 0, 1024); //Just pick a chunk of this file as test content
$this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQP($t)), 'QP encoding round-trip failed');
//$this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQPphp($t)), 'Native PHP QP encoding round-trip failed'); //TODO the PHP qp encoder is quite broken
}
/**
* Try a plain message.
*/
function test_Html() {
$this->Mail->IsHTML(true);
$this->Mail->Subject .= ": HTML only";
$this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
"Go to <a href=\"http://phpmailer.sourceforge.net/\">" .
"http://phpmailer.sourceforge.net/</a> for new versions of " .
"phpmailer. <p/> Thank you!";
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Simple HTML and attachment test
*/
function test_HTML_Attachment() {
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
$this->Mail->Subject .= ": HTML + Attachment";
$this->Mail->IsHTML(true);
if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* An embedded attachment test.
*/
function test_Embedded_Image() {
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
"Here is an image!</a>";
$this->Mail->Subject .= ": Embedded Image";
$this->Mail->IsHTML(true);
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
"base64", "image/png"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
//For code coverage
$this->Mail->AddEmbeddedImage('thisfiledoesntexist', 'xyz'); //Non-existent file
$this->Mail->AddEmbeddedImage(__FILE__, '123'); //Missing name
}
/**
* An embedded attachment test.
*/
function test_Multi_Embedded_Image() {
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
"Here is an image!</a>";
$this->Mail->Subject .= ": Embedded Image + Attachment";
$this->Mail->IsHTML(true);
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
"base64", "image/png"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
if(!$this->Mail->AddAttachment(__FILE__, "test.txt"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Simple multipart/alternative test.
*/
function test_AltBody() {
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
$this->Mail->AltBody = "Here is the text body of this message. " .
"It should be quite a few lines. It should be wrapped at the " .
"40 characters. Make sure that it is.";
$this->Mail->WordWrap = 40;
$this->AddNote("This is a mulipart alternative email");
$this->Mail->Subject .= ": AltBody + Word Wrap";
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
/**
* Simple HTML and attachment test
*/
function test_AltBody_Attachment() {
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
$this->Mail->AltBody = "This is the text part of the email.";
$this->Mail->Subject .= ": AltBody + Attachment";
$this->Mail->IsHTML(true);
if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt"))
{
$this->assertTrue(false, $this->Mail->ErrorInfo);
return;
}
$this->BuildBody();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
if (is_writable('.')) {
file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody());
} else {
$this->assertTrue(false, 'Could not write local file - check permissions');
}
}
function test_MultipleSend() {
$this->Mail->Body = "Sending two messages without keepalive";
$this->BuildBody();
$subject = $this->Mail->Subject;
$this->Mail->Subject = $subject . ": SMTP 1";
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
$this->Mail->Subject = $subject . ": SMTP 2";
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
function test_SendmailSend() {
$this->Mail->Body = "Sending via sendmail";
$this->BuildBody();
$subject = $this->Mail->Subject;
$this->Mail->Subject = $subject . ": sendmail";
$this->Mail->IsSendmail();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
function test_MailSend() {
$this->Mail->Body = "Sending via mail()";
$this->BuildBody();
$subject = $this->Mail->Subject;
$this->Mail->Subject = $subject . ": mail()";
$this->Mail->IsMail();
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
function test_SmtpKeepAlive() {
$this->Mail->Body = "This was done using the SMTP keep-alive.";
$this->BuildBody();
$subject = $this->Mail->Subject;
$this->Mail->SMTPKeepAlive = true;
$this->Mail->Subject = $subject . ": SMTP keep-alive 1";
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
$this->Mail->Subject = $subject . ": SMTP keep-alive 2";
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
$this->Mail->SmtpClose();
}
/**
* Tests this denial of service attack:
* http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
*/
function test_DenialOfServiceAttack() {
$this->Mail->Body = "This should no longer cause a denial of service.";
$this->BuildBody();
$this->Mail->Subject = str_repeat("A", 998);
$this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
}
function test_Error() {
$this->Mail->Subject .= ": This should be sent";
$this->BuildBody();
$this->Mail->ClearAllRecipients(); // no addresses should cause an error
$this->assertTrue($this->Mail->IsError() == false, "Error found");
$this->assertTrue($this->Mail->Send() == false, "Send succeeded");
$this->assertTrue($this->Mail->IsError(), "No error found");
$this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo);
$this->Mail->AddAddress($_REQUEST['mail_to']);
$this->assertTrue($this->Mail->Send(), "Send failed");
}
function test_Addressing() {
$this->assertFalse($this->Mail->AddAddress('a@example..com'), 'Invalid address accepted');
$this->assertTrue($this->Mail->AddAddress('a@example.com'), 'Addressing failed');
$this->assertFalse($this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed');
$this->assertTrue($this->Mail->AddCC('b@example.com'), 'CC addressing failed');
$this->assertFalse($this->Mail->AddCC('b@example.com'), 'CC duplicate addressing failed');
$this->assertFalse($this->Mail->AddCC('a@example.com'), 'CC duplicate addressing failed (2)');
$this->assertTrue($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed');
$this->assertFalse($this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed');
$this->assertFalse($this->Mail->AddBCC('a@example.com'), 'BCC duplicate addressing failed (2)');
$this->assertTrue($this->Mail->AddReplyTo('a@example.com'), 'Replyto Addressing failed');
$this->assertFalse($this->Mail->AddReplyTo('a@example..com'), 'Invalid Replyto address accepted');
$this->Mail->ClearAddresses();
$this->Mail->ClearCCs();
$this->Mail->ClearBCCs();
$this->Mail->ClearReplyTos();
}
/**
* Test language files for missing and excess translations
* All languages are compared with English
*/
function test_Translations() {
$this->Mail->SetLanguage('en');
$definedStrings = $this->Mail->GetTranslations();
foreach (new DirectoryIterator('../language') as $fileInfo) {
if($fileInfo->isDot()) continue;
$matches = array();
//Only look at language files, ignore anything else in there
if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) {
$lang = $matches[1]; //Extract language code
$PHPMAILER_LANG = array(); //Language strings get put in here
include $fileInfo->getPathname(); //Get language strings
$missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG));
$extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings));
$this->assertTrue(empty($missing), "Missing translations in $lang: ". implode(', ', $missing));
$this->assertTrue(empty($extra), "Extra translations in $lang: ". implode(', ', $extra));
}
}
}
/**
* Encoding tests
*/
function test_Encodings() {
$this->Mail->Charset = 'iso-8859-1';
$this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'text'), 'Q Encoding (text) failed');
$this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'comment'), 'Q Encoding (comment) failed');
$this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'phrase'), 'Q Encoding (phrase) failed');
}
/**
* Signing tests
*/
function test_Signing() {
$this->Mail->Sign('certfile.txt', 'keyfile.txt', 'password'); //TODO this is not really testing signing, but at least helps coverage
}
/**
* Miscellaneous calls to improve test coverage and some small tests
*/
function test_Miscellaneous() {
$this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf') , 'MIME TYPE lookup failed');
$this->Mail->AddCustomHeader('SomeHeader: Some Value');
$this->Mail->ClearCustomHeaders();
$this->Mail->ClearAttachments();
$this->Mail->IsHTML(false);
$this->Mail->IsSMTP();
$this->Mail->IsMail();
$this->Mail->IsSendMail();
$this->Mail->IsQmail();
$this->Mail->SetLanguage('fr');
$this->Mail->Sender = '';
$this->Mail->CreateHeader();
$this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded');
$this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed');
$this->Mail->getFile(__FILE__);
}
}
/**
* This is a sample form for setting appropriate test values through a browser
* These values can also be set using a file called testbootstrap.php (not in svn) in the same folder as this script
* which is probably more useful if you run these tests a lot
<html>
<body>
<h3>phpmailer Unit Test</h3>
By entering a SMTP hostname it will automatically perform tests with SMTP.
<form name="phpmailer_unit" action=__FILE__ method="get">
<input type="hidden" name="submitted" value="1"/>
From Address: <input type="text" size="50" name="mail_from" value="<?php echo get("mail_from"); ?>"/>
<br/>
To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>
<br/>
Cc Address: <input type="text" size="50" name="mail_cc" value="<?php echo get("mail_cc"); ?>"/>
<br/>
SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>
<p/>
<input type="submit" value="Run Test"/>
</form>
</body>
</html>
*/
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+84
View File
@@ -0,0 +1,84 @@
<html>
<head>
<title>PHPMailer Lite - DKIM and Callback Function test</title>
</head>
<body>
<?php
/* This is a sample callback function for PHPMailer Lite.
* This callback function will echo the results of PHPMailer processing.
*/
/* Callback (action) function
* bool $result result of the send action
* string $to email address of the recipient
* string $cc cc email addresses
* string $bcc bcc email addresses
* string $subject the subject
* string $body the email body
* @return boolean
*/
function callbackAction ($result, $to, $cc, $bcc, $subject, $body) {
/*
this callback example echos the results to the screen - implement to
post to databases, build CSV log files, etc., with minor changes
*/
$to = cleanEmails($to,'to');
$cc = cleanEmails($cc[0],'cc');
$bcc = cleanEmails($bcc[0],'cc');
echo $result . "\tTo: " . $to['Name'] . "\tTo: " . $to['Email'] . "\tCc: " . $cc['Name'] . "\tCc: " . $cc['Email'] . "\tBcc: " . $bcc['Name'] . "\tBcc: " . $bcc['Email'] . "\t" . $subject . "<br />\n";
return true;
}
$testLite = false;
if ($testLite) {
require_once '../class.phpmailer-lite.php';
$mail = new PHPMailerLite();
} else {
require_once '../class.phpmailer.php';
$mail = new PHPMailer();
}
try {
$mail->IsMail(); // telling the class to use SMTP
$mail->SetFrom('you@yourdomain.com', 'Your Name');
$mail->AddAddress('another@yourdomain.com', 'John Doe');
$mail->Subject = 'PHPMailer Lite Test Subject via Mail()';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->action_function = 'callbackAction';
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
function cleanEmails($str,$type) {
if ($type == 'cc') {
$addy['Email'] = $str[0];
$addy['Name'] = $str[1];
return $addy;
}
if (!strstr($str, ' <')) {
$addy['Name'] = '';
$addy['Email'] = $addy;
return $addy;
}
$addyArr = explode(' <', $str);
if (substr($addyArr[1],-1) == '>') {
$addyArr[1] = substr($addyArr[1],0,-1);
}
$addy['Name'] = $addyArr[0];
$addy['Email'] = $addyArr[1];
$addy['Email'] = str_replace('@', '&#64;', $addy['Email']);
return $addy;
}
?>
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/
require '../class.phpmailer.php';
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$body = file_get_contents('contents.html');
$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->Username = "name@domain.com"; // SMTP server username
$mail->Password = "password"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AddReplyTo("name@domain.com","First Last");
$mail->From = "name@domain.com";
$mail->FromName = "First Last";
$to = "someone@example...com";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>
+24
View File
@@ -0,0 +1,24 @@
<?php include "base.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="main">
<form method="post" action="startgame.php" name="startgame" id="startgame">
<fieldset>
<input type="submit" name="startgame" id="startgame" value="StartGame" />
</fieldset>
</form>
</div>
</body>
</html>
File diff suppressed because one or more lines are too long
+137
View File
@@ -0,0 +1,137 @@
CREATE TABLE `users` (
`UserID` INT(25) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`AssassinID` INT(25) NOT NULL ,
`TargetID` INT(25) NOT NULL ,
`Username` VARCHAR(65) NOT NULL ,
`Password` VARCHAR(32) NOT NULL ,
`FullName` VARCHAR(255) NOT NULL ,
`YearGroup` VARCHAR(65) NOT NULL ,
`Subject` VARCHAR(65) NOT NULL ,
`Societies` text NOT NULL ,
`RegularHaunts` text NOT NULL ,
`Ninjaness` int NOT NULL ,
`Address` VARCHAR(255) NOT NULL ,
`Kills` int NOT NULL ,
`Status` VARCHAR(65) NOT NULL
);
INSERT INTO users
(AssassinID, TargetID)
VALUES
($assassinID, $targetID);
FOR SELECTING TARGETS:
http://stackoverflow.com/questions/5612656/generating-unique-random-numbers-within-a-range-php
for each user give them their own userID-1 position in the random array. If it's their own userID then i'm screwed. Does this even work? Would it not just create small circles? It would wouldn't it? Damn.
Gemma suggests to randomise their userIDs and then allocate targets based on those numbers. This is an excellent idea and proves that Gemma is a genius.
function UniqueRandomNumbersWithinRange($min, $max, $quantity) {
$numbers = range($min, $max);
shuffle($numbers);
return array_slice($numbers, 0, $quantity);
}
Then for each position in the array apply the shuffled number at that position to the user at that position in the table as a column 'AssassinNumber'.
Then when the game begins just allocate everyone the user with the assassin number after theirs.
When a user successfully kills a player mark that play as dead, void their target column and increment the number in the killer's target column.
Two new columns:
- AssassinID
- TargetID
When sign-up is closed simply rename the register.php page and replace it with one saying that sign-up has closed and giving details of the society's fb page.
Code to count SQL rows:
<?php
$con = mysql_connect("server.com","user","pswd");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
$result = mysql_query("select count(1) FROM table");
$row = mysql_fetch_array($result);
$total = $row[0];
echo "Total rows: " . $total;
mysql_close($con);
?>
TODO:
- Set the index page to display the target information
- Set the index page to display the total number of players
- Set the index page to display the total number of deaths
- Implement the kill submission system
- Give the assassin the targetID field of the deceased
- Remove the targetID field from the deceased
- Set the Status field of the deceased to 'Dead'
- Increment the Kill field of the assassin
- Increment the total number of deaths
- If a user is dead hide the 'Target' and 'Submit Kill' areas
- Add address to register page
- Enable Twitter feed
- Email us the kill details
- Email the assassin
- Email the deceased
- Add photo to register page
- Link twitter to facebook (NEEDS TO BE DONE ON FB?!)
- Notify when there are only three left, two left and when there is a winner!
- List the number of kills held by the top 5 killers
- List the number of people with zero kills
- Automatically release addresses of current targets to all still alive (by email)
TELL PEOPLE THEY MUST CONFIRM THE IDENTITY OF THE PERSON THEY KILLED BEFORE SUBMITTING THE KILL OTHERWISE THEY WILL BE KICKED.
Things end user must be able to do before registering:
• Input information about themselves
o Name
o Year group
o Subject studied
o Societies
o Regular haunts
o 0-10 scale of ninjaness
• Upload their photograph
• Sign up using their university email address
o N.B. This will be their username
Things end user must be able to do once registered:
• View information on current target
o Name
o Year group
o Subject studied
o Photograph
o Societies
o Regular haunts
• Submit details of a successful kill
o Click a button
o Confirm further by ticking a box or similar so no accidental submission of kill
• View number of total own kills
• View total number of assassins killed
• View total number of assassins left alive
Things admin must be able to do:
• Manually kill an assassin
• Change the details of an assassin
o Including the photograph
• Add an assassin including all their details and photograph
o N.B. Could use the same system new assassins use to register
• View the identities and numbers of all assassins left alive and their targets
Things the system must be able to do:
• Register a kill made by an assassin
• Send a confirmation email to the person killed to check they have been killed (and the manner by which they have been killed?)
http://net.tutsplus.com/tutorials/php/user-membership-with-php/
+18
View File
@@ -0,0 +1,18 @@
<?php
session_start();
$dbhost = "localhost"; // this will ususally be 'localhost', but can sometimes differ
$dbname = "assassinsdb"; // the name of the database that you are going to use for this project
$dbuser = "root"; // the username that you created, or were given, to access your database
$dbpass = "Passwords1"; // the password that you created, or were given, to access your database
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
?>
+11
View File
@@ -0,0 +1,11 @@
<?php
session_start();
$dbhost = "db381141882.db.1and1.com"; // this will ususally be 'localhost', but can sometimes differ
$dbname = "db381141882"; // the name of the database that you are going to use for this project
$dbuser = "dbo381141882"; // the username that you created, or were given, to access your database
$dbpass = "J15h9933"; // the password that you created, or were given, to access your database
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
?>
+11
View File
@@ -0,0 +1,11 @@
<?php
session_start();
$dbhost = "mysql.hostinger.co.uk"; // this will ususally be 'localhost', but can sometimes differ
$dbname = "u231858558_main"; // the name of the database that you are going to use for this project
$dbuser = "u231858558_user"; // the username that you created, or were given, to access your database
$dbpass = "Passwords1"; // the password that you created, or were given, to access your database
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
?>
+72
View File
@@ -0,0 +1,72 @@
codebird-js - changelog
=======================
2.5.0-alpha.1.1 (2014-01-02)
+ #24 Add README section about xAuth
+ #46 Don't force to send base64 media uploads via proxy
+ #23 Support internal API methods
+ #50 Current rate sent back with each call
+ Support custom timelines beta API
- Remove POST geo/place API method, deprecated
+ #52 Don't use proxy for non-browser environments
- #49 Places & Geo API call issue
+ #53 Support AMD module definition syntax
+ #54 Integrate sha1 hash library
+ Add NPM package.json
2.4.3 (2013-07-24)
- #31 HTTP error on multiple oauth_requestToken calls
- #30 HTML-escaping typo in readme code sample
2.4.2 (2013-07-09)
- #21 Typo extra bracket in readme sample code
- #27 Array bad behavior in iOS
2.4.1 (2013-06-23)
+ Pass JSHint validation
+ #15 Allow to assign custom proxy address
- #19 API parameters with escaped characters fail in IE7-9
2.4.0 (2013-06-15)
+ Support multipart file uploads
- Drop unnecessary media format settings ported from PHP getimagesize
- Don't unintendedly overwrite global "url" variable
+ Add contributing guidelines
2.3.3 (2013-05-31)
- oauth2_token doesn't respect _useProxy CORS setting
- #10 setBearerToken was not public
2.3.2 (2013-05-21)
- Sorting the OAuth parameter list in IE incorrectly
- Undefined function c for debug logging
+ Correctly detect templated methods and insert their parameters
2.3.1 (2013-04-26)
- Wrong OAuth signature generation for POST requests with oauth_callback
- Wrong _ksort implementation
2.3.0 (2013-04-26)
- Bug in _detectMultipart for statuses/update calls
+ Add Array.indexOf polyfill
+ Circumvent same-origin policy with CORS
+ Make oauth_authenticate and oauth_authorize asynchronous
+ Send GET requests via JSONP for IE7-9 (don't support CORS)
2.2.3 (2012-12-03)
+ Detect HTTP method properly when accessing multi HTTP method endpoint (account/settings)
+ Add friends/list, followers/list API methods
+ Move users/recommendations to GET list
2.2.2 (2012-10-19)
+ Update methods list for API 1.1
+ Add profile banner methods
- Drop separate media upload method
- Remove OAuth token message. 1.1 is always signed.
+ Update endpoints to 1.1 endpoints, add support for old endpoints
2.2.1 (2012-09-17)
+ Update to Twitter API v1.1
2.2.0 (2012-09-17)
+ Port Codebird from PHP to JavaScript
+11
View File
@@ -0,0 +1,11 @@
### Which branch?
- Critical bugs are fixed in the master branch.
- Normal bugs are fixed in the develop branch.
- New features are added to the develop branch, too.
### Code style
- Please use 4 soft spaces per indent level.
- Take a look at the coding style used in codebird.js and apply the same convention to your contributed code.
### License
- Code contributed by you will get the same license as Codebird itself, that is, GPU General Public License V3.
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+563
View File
@@ -0,0 +1,563 @@
codebird-js
===========
*A Twitter library in JavaScript.*
Copyright (C) 2010-2014 Jublo IT Solutions &lt;support@jublo.net&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
### Versions
- JavaScript: https://github.com/jublonet/codebird-js
- PHP: https://github.com/jublonet/codebird-php
0. Including Codebird
---------------------
To include Codebird in your code, add its scripts to your markup:
```html
<script type="text/javascript" src="codebird.js"></script>
<script type="text/javascript">
var cb = new Codebird;
cb.setConsumerKey("YOURKEY", "YOURSECRET");
</script>
```
You may also use a JavaScript module loader of your choice
(such as [RequireJS](http://requirejs.org/) or the one bundled in Node.js)
to load Codebird unobtrusively. In Node.js, loading Codebird looks like this:
```javascript
var Codebird = require("codebird");
// or with leading "./", if the codebird.js file is in your main folder:
// var Codebird = require("./codebird");
var cb = new Codebird;
cb.setConsumerKey("YOURKEY", "YOURSECRET");
```
1. Authentication
-----------------
To authenticate your API requests on behalf of a certain Twitter user
(following OAuth 1.0a), take a look at these steps:
```html
<script type="text/javascript" src="codebird.js"></script>
<script type="text/javascript">
var cb = new Codebird;
cb.setConsumerKey("YOURKEY", "YOURSECRET");
</script>
```
You may either set the OAuth token and secret, if you already have them:
```javascript
cb.setToken("YOURTOKEN", "YOURTOKENSECRET");
```
Or you authenticate, like this:
```javascript
// gets a request token
cb.__call(
"oauth_requestToken",
{oauth_callback: "oob"},
function (reply) {
// stores it
cb.setToken(reply.oauth_token, reply.oauth_token_secret);
// gets the authorize screen URL
cb.__call(
"oauth_authorize",
{},
function (auth_url) {
window.codebird_auth = window.open(auth_url);
}
);
}
);
```
Now you need to add a PIN box to your website.
After the user enters the PIN, complete the authentication:
```javascript
cb.__call(
"oauth_accessToken",
{oauth_verifier: document.getElementById("PINFIELD").value},
function (reply) {
// store the authenticated token, which may be different from the request token (!)
cb.setToken(reply.oauth_token, reply.oauth_token_secret);
// if you need to persist the login after page reload,
// consider storing the token in a cookie or HTML5 local storage
}
);
```
### 1.1. Application-only auth
Some API methods also support authenticating on a per-application level.
This is useful for getting data that are not directly related to a specific
Twitter user, but generic to the Twitter ecosystem (such as ```search/tweets```).
To obtain an app-only bearer token, call the appropriate API:
```javascript
cb.__call(
"oauth2_token",
{},
function (reply) {
var bearer_token = reply.access_token;
}
);
```
I strongly recommend that you store the obtained bearer token in your database.
There is no need to re-obtain the token with each page load, as it becomes invalid
only when you call the ```oauth2/invalidate_token``` method.
If you already have your token, tell Codebird to use it:
```javascript
cb.setBearerToken("YOURBEARERTOKEN");
```
For sending an API request with app-only auth, see the Usage examples section.
### 1.2. Authenticating using a callback URL, without PIN
1. Before sending your user off to Twitter, you have to store the request token and its secret, for example in a cookie.
2. In the callback URL, extract those values and assign them to the Codebird object.
3. Extract the ```oauth_verifier``` field from the request URI.
In Javascript, try extracting the URL parameter like this:
```javascript
var cb = new Codebird;
var current_url = location.toString();
var query = current_url.match(/\?(.+)$/).split("&amp;");
var parameters = {};
var parameter;
cb.setConsumerKey("STUFF", "HERE");
for (var i = 0; i < query.length; i++) {
parameter = query[i].split("=");
if (parameter.length === 1) {
parameter[1] = "";
}
parameters[decodeURIComponent(parameter[0])] = decodeURIComponent(parameter[1]);
}
// check if oauth_verifier is set
if (typeof parameters.oauth_verifier !== "undefined") {
// assign stored request token parameters to codebird here
// ...
cb.setToken(stored_somewhere.oauth_token, stored_somewhere.oauth_token_secret);
cb.__call(
"oauth_accessToken",
{
oauth_verifier: parameters.oauth_verifier
},
function (reply) {
cb.setToken(reply.oauth_token, reply.oauth_token_secret);
// if you need to persist the login after page reload,
// consider storing the token in a cookie or HTML5 local storage
}
);
}
```
2. Usage examples
-----------------
### Heads up
*Because the Consumer Key and Token Secret are available in the code
it is important that you configure your app as read-only at Twitter,
unless you are sure to know what you are doing.*
When you have an access token, calling the API is simple:
```javascript
cb.setToken("YOURTOKEN", "YOURTOKENSECRET"); // see above
cb.__call(
"statuses_homeTimeline",
{},
function (reply) {
console.log(reply);
}
);
```
Tweeting is as easy as this:
```javascript
cb.__call(
"statuses_update",
{"status": "Whohoo, I just tweeted!"},
function (reply) {
// ...
}
);
```
For more complex parameters (see the [Twitter API documentation](https://dev.twitter.com/)),
giving all parameters in an array is supported, too:
```javascript
var params = {
screen_name: "myx"
};
cb.__call(
"users_show",
params,
function (reply) {
// ...
}
);
```
When **uploading files to Twitter**, the array syntax is obligatory,
and the media have to be base64-encoded:
```javascript
var params = {
"status": "The bird is flying high. #larry",
"media[]": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB+0lEQVR42mP8//8/Ay0BEwONwagFoxZQDljI0PP8x7/Z93/e+PxXmpMpXp5dh4+ZgYHh0bd/clxYnMuINaMtfvRLgp3RVZwVU+rkuz+eRz+//wXVxcrEkKnEceXTX0dRlhoNTmKDaOvzXwHHv6x9+gtN/M9/hpjTX+GmMzAw/P7HMOnOj+ff//35x/Ds+z9iLfjPwPDt7//QE1/Sz319/RNh3PkPf+58+Yup/t7Xf9p8zFKcTMRa4CLGCrFm1v2fSjs+pJ/7uuvl7w+//yO7HRkUq3GEyrCREMk+kqy2IiyH3/xhYGD48uf/rPs/Z93/yczIwM3CiFU9Hw5xnD4ouvTt4Tf0AP37n+HTb+w+UOBmIs2CICm2R9/+EZlqGRkYzIVYSLMgRIYtUYGdSAsMBFgUuJhIy2iMDAwt2pysjAwLHv78RcgnOcrs5BQVHEyMG579Imi6Nh9zrBxZFgixMW624pXnwldYcTAzLjDhZmUit7AzE2K54c7fp8eF1QhWRobFptwmgiwkF3b//jMwMjJ8+P3/zPs/yx/9Wvr412+MgBJlZ1xsyuOOrbAibMHH3/87b32fce/nR2ypnpuFMVGevU6TQ5SdqKKeEVez5cuf/7te/j727s+9L/++/v3PzcyowM1kIcTiLs7Kz8pIfNnOONouGrVg1AIGAJ6gvN4J6V9GAAAAAElFTkSuQmCC"
);
cb.__call(
"statuses_updateWithMedia",
params,
function (reply) {
// ...
}
);
```
### Requests with app-only auth
To send API requests without an access token for a user (app-only auth),
add another parameter to your method call, like this:
```javascript
cb.__call(
"search_tweets",
"q=Twitter",
function (reply) {
// ...
},
true // this parameter required
);
```
Bear in mind that not all API methods support application-only auth.
3. Mapping API methods to Codebird function calls
-------------------------------------------------
As you can see from the last example, there is a general way how Twitters API methods
map to Codebird function calls. The general rules are:
1. For each slash in a Twitter API method, use an underscore in the Codebird function.
Example: ```statuses/update``` maps to ```cb.__call("statuses_update", ...)```.
2. For each underscore in a Twitter API method, use camelCase in the Codebird function.
Example: ```statuses/home_timeline``` maps to ```cb.__call("statuses_homeTimeline", ...)```.
3. For each parameter template in method, use UPPERCASE in the Codebird function.
Also dont forget to include the parameter in your parameter list.
Examples:
- ```statuses/show/:id``` maps to ```cb.__call("statuses_show_ID", 'id=12345', ...)```.
- ```users/profile_image/:screen_name``` maps to
```cb.__call("users_profileImage_SCREEN_NAME", "screen_name=jublonet", ...)```.
4. HTTP methods (GET, POST, DELETE etc.)
----------------------------------------
Never care about which HTTP method (verb) to use when calling a Twitter API.
Codebird is intelligent enough to find out on its own.
5. Response codes
-----------------
The HTTP response code that the API gave is included in any return values.
You can find it within the return objects ```httpstatus``` property.
### 5.1 Dealing with rate-limits
Basically, Codebird leaves it up to you to handle Twitters rate limit.
The library returns the response HTTP status code, so you can detect rate limits.
I suggest you to check if the ```reply.httpstatus``` property is ```400```
and check with the Twitter API to find out if you are currently being
rate-limited.
See the [Rate Limiting FAQ](https://dev.twitter.com/docs/rate-limiting-faq)
for more information.
If you allow your callback function to accept a second parameter,
you will receive rate-limiting details in this parameter.
```javascript
cb.__call(
"search_tweets",
"q=Twitter",
function (reply, rate_limit_status) {
console.log(rate_limit_status);
// ...
}
);
```
6. API calls and the same-origin policy
---------------------------------------
Normally, browsers only allow requests being sent to addresses that are on
the same base domain. This is a security feature called the “same-origin
policy.” However, this policy is in your way when you try to access the
(remote) Twitter API domain and its methods.
### 6.1 Cross-domain requests
With Codebird, dont worry about this. We automatically send cross-domain
requests using a secured proxy that sends back the required headers to the
users browser.
This CORS proxy is using an encrypted SSL connection.
*We do not record data sent to or from the Twitter API.
Using Codebirds CORS proxy is subject to the Acceptable use policy.*
If your JavaScript environment is not restricted under the same-origin policy
(for example in node.js), direct connections to the Twitter API are established
automatically, instead of contacting the CORS proxy.
You may also turn off the CORS compatibility manually like this:
```javascript
cb.setUseProxy(false);
```
### 6.2 Support for Internet Explorer 7 to 9
Cross-domain requests work well in any browser except for
Internet Explorer 7-9. Codebird cannot send POST requests in these browsers.
For IE7-9, Codebird works in limited operation mode:
- Calls to GET methods work fine,
- calling POST methods is impossible,
- Application-only auth does not work.
### 6.3 Using your own proxy server
The source code of the CORS proxy is publicly available. If you want to,
set up your own instance on your server. Afterwards, tell Codebird the
address:
```javascript
cb.setProxy("https://example.com/codebird-cors-proxy/");
```
Heads up! Follow the notes in the [codebird-cors-proxy README](https://github.com/jublonet/codebird-cors-proxy/#readme) for details.
7. Using multiple Codebird instances
------------------------------------
By default, each Codebird instance works on its own.
If you need to run requests to the Twitter API for multiple users at once,
Codebird supports this automatically. Just create a new object:
```javascript
var cb1 = new Codebird;
var cb2 = new Codebird;
```
Please note that your OAuth consumer key and secret is shared within
multiple Codebird instances, while the OAuth request and access tokens with their
secrets are *not* shared.
How Do I…?
==========
…get user ID, screen name and more details about the current user?
------------------------------------------------------------------
When the user returns from the authentication screen, you need to trade
the obtained request token for an access token, using the OAuth verifier.
As discussed in the section Usage example, you use a call to
```oauth/access_token``` to do that.
The API reply to this method call tells you details about the user that just logged in.
These details contain the **user ID** and the **screen name.**
Take a look at the returned data as follows:
```javascript
{
oauth_token: "14648265-rPn8EJwfB**********************",
oauth_token_secret: "agvf3L3**************************",
user_id: 14648265,
screen_name: "myx",
httpstatus: 200
}
```
If you need to get more details, such as the users latest tweet,
you should fetch the complete User Entity. The simplest way to get the
user entity of the currently authenticated user is to use the
```account/verify_credentials``` API method. In Codebird, it works like this:
```javascript
cb.__call(
"account_verifyCredentials",
{},
function (reply) {
console.log(reply);
}
);
```
I suggest to cache the User Entity after obtaining it, as the
```account/verify_credentials``` method is rate-limited by 15 calls per 15 minutes.
…walk through cursored results?
-------------------------------
The Twitter REST API utilizes a technique called cursoring to paginate
large result sets. Cursoring separates results into pages of no more than
5000 results at a time, and provides a means to move backwards and
forwards through these pages.
Here is how you can walk through cursored results with Codebird.
1. Get the first result set of a cursored method:
```javascript
cb.__call(
"followers_list",
{},
function (result1) {
// ...
}
);
```
2. To navigate forth, take the ```next_cursor_str```:
```javascript
var nextCursor = result1.next_cursor_str;
```
3. If ```nextCursor``` is not 0, use this cursor to request the next result page:
```javascript
if (nextCursor > 0) {
cb.__call(
"followers_list",
{cursor: nextCursor},
function (result2) {
// ...
}
);
}
```
To navigate back instead of forth, use the field ```resultX.previous_cursor_str```
instead of ```next_cursor_str```.
It might make sense to use the cursors in a loop. Watch out, though,
not to send more than the allowed number of requests to ```followers/list```
per rate-limit timeframe, or else you will hit your rate-limit.
…use xAuth with Codebird?
-------------------------
Codebird supports xAuth just like every other authentication used at Twitter.
Remember that your application needs to be whitelisted to be able to use xAuth.
Heres an example:
```javascript
cb.__call(
"oauth_accessToken",
{
"x_auth_username": "username",
"x_auth_password": "4h3_p4$$w0rd",
"x_auth_mode" : "client_auth"
},
function (reply) {
console.log(reply);
// ...
}
);
```
If everything went fine, you will get an object like this:
```javascript
{
"oauth_token": "14648265-ABLfBFlE*********************************",
"oauth_token_secret": "9yTBY3pEfj*********************************",
"user_id": "14648265",
"screen_name": "myx",
"x_auth_expires": "0",
"httpstatus": 200
}
```
Are you getting a strange error message, an empty error, or status "0"?
If the user is enrolled in login verification, the server will return a
HTTP 401 error with a custom body (that may be filtered by your browser).
You may check the browser web console for an error message.
When this error occurs, advise the user to
[generate a temporary password](https://twitter.com/settings/applications)
on twitter.com and use that to complete signing in to the application.
…access and use undocumented Twitter API methods?
-------------------------------------------------
Besides the well-documented official methods, the Twitter API also contains
undocumented additional methods. They are used by official Twitter clients,
such as Twitter for iPhone and Twitter for Mac.
Access to these methods is restricted: Only white-listed applications
(consumer keys) may access undocumented methods. Codebird supports accessing
internal methods, but that will only work if you provide a white-listed API key.
By reason, the API keys and secrets for official Twitter clients are not
provided within this package, since they should have been kept a secret.
If you provide Codebird with the Twitter for iPhone consumer key and secret,
the following example will get the latest events that happened with you:
```javascript
cb.__call(
"activity_aboutMe",
{},
function (reply) {
console.log(reply);
// ...
}
);
```
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
{
"name": "codebird",
"version": "2.5.0-alpha.1.1",
"description": "A Twitter library in JavaScript.",
"main": "codebird.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/jublonet/codebird-js.git"
},
"keywords": [
"Twitter",
"API",
"networking",
"CORS"
],
"author": "Jublo IT Solutions <support@jublo.net> (http://jublo.net/)",
"license": "GPL-3.0+",
"bugs": {
"url": "https://github.com/jublonet/codebird-js/issues"
}
}
+316
View File
@@ -0,0 +1,316 @@
<?php include "base.php"; ?>
<?php
//get the number of rows in the table *THIS WORKS
function GetNumberOfRows() {
$result = mysql_query( "select count(UserID) as num_rows from users" );
$row = mysql_fetch_object( $result );
$total = $row->num_rows;
return $total;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Alive')
{
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif') || file_exists("upload/".$_SESSION['Username'].'.'.'jpeg') || file_exists("upload/".$_SESSION['Username'].'.'.'jpg') || file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
?>
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<div class="form_settings">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="submit" name="subscribe" type="submit" value="Log Out" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Submit Kill</h3>
<form action="submitkill.php" method="post" name="submitkill" id="submitkill">
<div class="form_settings">
<p><span>Kill Details</span><input type="text" name="killdetails" id="killmethod" value="" maxlength="95"/></p>
<p style="padding: 15px 0 0px 0;"><span>&nbsp;</span><input class="submit" type="submit" name="submitkill" id="submitkill" value="Submit Kill" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Kill anyone on this list</h1>
<h2>These people did not make a single kill in seven days. Kill them. Hunt them down then email the details of their death to jc563@exeter.ac.uk<h2>
<p><a href='users-to-kill.pdf'>Click here</a></p>
<h1>Your Info</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! You are <b><?=$_SESSION['Status']?></b>...</p>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'gif'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpeg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'png'."' class=\"targetphoto\"></li>";
}
?>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
</ul>
<p>
<h1>Your Target</h1>
<h2>Your target's address has been discovered! <b><?=$_SESSION['Addresst']?></b></h2>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'gif'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpeg'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'png'."' class='targetphoto'></li>";
}
?>
<li>Full name: <b><?=$_SESSION['FullNamet']?></b></li>
<li>Year group: <b><?=$_SESSION['YearGroupt']?></b></li>
<li>Email Address: <b><?=$_SESSION['Usernamet']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subjectt']?></b></li>
<li>Societies: <b><?=$_SESSION['Societiest']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHauntst']?></b></li>
<li>Ninjaness Score <b><?=$_SESSION['Ninjanesst']?>/10</b></li>
<li>They have made <b><?=$_SESSION['Killst']?> kills</b></li>
</ul>
<?php
}
else {
?>
<div id="content">
<h1>Upload Photo</h1>
<p>Please <a href="uploadphoto.php">click here to add a photo</a>.</p>
<?php
}
}
elseif(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Dead')
{
?>
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<div class="form_settings">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="submit" name="subscribe" type="submit" value="Log Out" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Anyone on this list is a target</h1>
<h2>These people did not make a single kill in seven days. Kill them. Living players can hunt them down then email the details of their death to jc563@exeter.ac.uk<h2>
<p><a href='users-to-kill.pdf'>Click here</a></p>
<h1>YOU ARE DEAD</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! </p>
<ul>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
<br>
<li>You are <b><?=$_SESSION['Status']?></b></li>
</ul>
<?php
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
//Get the number of players and send it to a session variable
$numberofplayers = GetNumberOfRows();
$_SESSION['NumberOfPlayers'] = $numberofplayers;
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
if(mysql_num_rows($checklogin) == 1)
{
//Set the Assassin's Information
$row = mysql_fetch_array($checklogin);
$assassinid = $row['AssassinID'];
$targetid = $row['TargetID'];
$fullname = $row['FullName'];
$yeargroup = $row['YearGroup'];
$subject = $row['Subject'];
$societies = $row['Societies'];
$regularhaunts = $row['RegularHaunts'];
$ninjaness = $row['Ninjaness'];
$address = $row['Address'];
$kills = $row['Kills'];
$status = $row['Status'];
$_SESSION['AssassinID'] = $assassinid;
$_SESSION['TargetID'] = $targetid;
$_SESSION['Username'] = $username;
$_SESSION['FullName'] = $fullname;
$_SESSION['YearGroup'] = $yeargroup;
$_SESSION['Subject'] = $subject;
$_SESSION['Societies'] = $societies;
$_SESSION['RegularHaunts'] = $regularhaunts;
$_SESSION['Ninjaness'] = $ninjaness;
$_SESSION['Address'] = $address;
$_SESSION['Kills'] = $kills;
$_SESSION['Status'] = $status;
$_SESSION['LoggedIn'] = 1;
//Now set the Target Information
//Query the database for the user with 'AssassinID'=$targetID and then
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$targetid."'");
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$addresst = $rowt['Address'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Addresst'] = $addresst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Start the HTML stuff
echo "<h1>Success</h1>";
echo "<p>We are now redirecting you to the member area.</p>";
echo '<meta content="3;index.php" http-equiv="refresh">';
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
else
{
?>
<div id="content">
<h1>Member Login</h1>
<p>Thanks for visiting! Please either login below, or <a href="register.php">click here to register</a>.</p>
<form action="index.php" method="post" name="loginform" id="loginform">
<div class="form_settings">
<p><span>Username</span><input type="text" name="username" id="username" value="" /></p>
<p><span>Password</span><input type="password" name="password" id="password" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="login" id="login" value="Login" /></p>
</div>
</form>
<?php
}
?>
</div>
</body>
</html>
+315
View File
@@ -0,0 +1,315 @@
<?php include "base.php"; ?>
<?php
//get the number of rows in the table *THIS WORKS
function GetNumberOfRows() {
$result = mysql_query( "select count(UserID) as num_rows from users" );
$row = mysql_fetch_object( $result );
$total = $row->num_rows;
return $total;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Alive')
{
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif') || file_exists("upload/".$_SESSION['Username'].'.'.'jpeg') || file_exists("upload/".$_SESSION['Username'].'.'.'jpg') || file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
?>
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<div class="form_settings">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="submit" name="subscribe" type="submit" value="Log Out" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Submit Kill</h3>
<form action="submitkill.php" method="post" name="submitkill" id="submitkill">
<div class="form_settings">
<p><span>Kill Details</span><input type="text" name="killdetails" id="killmethod" value="" maxlength="95"/></p>
<p style="padding: 15px 0 0px 0;"><span>&nbsp;</span><input class="submit" type="submit" name="submitkill" id="submitkill" value="Submit Kill" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Kill anyone on this list</h1>
<h2>These people did not make a single kill in seven days. Kill them. Hunt them down then email the details of their death to jc563@exeter.ac.uk<h2>
<p><a href='users-to-kill.pdf'>Click here</a></p>
<h1>Your Info</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! You are <b><?=$_SESSION['Status']?></b>...</p>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'gif'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpeg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'png'."' class=\"targetphoto\"></li>";
}
?>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
</ul>
<p>
<h1>Your Target</h1>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'gif'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpeg'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'png'."' class='targetphoto'></li>";
}
?>
<li>Full name: <b><?=$_SESSION['FullNamet']?></b></li>
<li>Year group: <b><?=$_SESSION['YearGroupt']?></b></li>
<li>Email Address: <b><?=$_SESSION['Usernamet']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subjectt']?></b></li>
<li>Societies: <b><?=$_SESSION['Societiest']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHauntst']?></b></li>
<li>Ninjaness Score <b><?=$_SESSION['Ninjanesst']?>/10</b></li>
<li>They have made <b><?=$_SESSION['Killst']?> kills</b></li>
</ul>
<?php
}
else {
?>
<div id="content">
<h1>Upload Photo</h1>
<p>Please <a href="uploadphoto.php">click here to add a photo</a>.</p>
<?php
}
}
elseif(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Dead')
{
?>
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<div class="form_settings">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="submit" name="subscribe" type="submit" value="Log Out" /></p>
</div>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Anyone on this list is a target</h1>
<h2>These people did not make a single kill in seven days. Kill them. Living players can hunt them down then email the details of their death to jc563@exeter.ac.uk<h2>
<p><a href='users-to-kill.pdf'>Click here</a></p>
<h1>YOU ARE DEAD</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! </p>
<ul>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
<br>
<li>You are <b><?=$_SESSION['Status']?></b></li>
</ul>
<?php
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
//Get the number of players and send it to a session variable
$numberofplayers = GetNumberOfRows();
$_SESSION['NumberOfPlayers'] = $numberofplayers;
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
if(mysql_num_rows($checklogin) == 1)
{
//Set the Assassin's Information
$row = mysql_fetch_array($checklogin);
$assassinid = $row['AssassinID'];
$targetid = $row['TargetID'];
$fullname = $row['FullName'];
$yeargroup = $row['YearGroup'];
$subject = $row['Subject'];
$societies = $row['Societies'];
$regularhaunts = $row['RegularHaunts'];
$ninjaness = $row['Ninjaness'];
$address = $row['Address'];
$kills = $row['Kills'];
$status = $row['Status'];
$_SESSION['AssassinID'] = $assassinid;
$_SESSION['TargetID'] = $targetid;
$_SESSION['Username'] = $username;
$_SESSION['FullName'] = $fullname;
$_SESSION['YearGroup'] = $yeargroup;
$_SESSION['Subject'] = $subject;
$_SESSION['Societies'] = $societies;
$_SESSION['RegularHaunts'] = $regularhaunts;
$_SESSION['Ninjaness'] = $ninjaness;
$_SESSION['Address'] = $address;
$_SESSION['Kills'] = $kills;
$_SESSION['Status'] = $status;
$_SESSION['LoggedIn'] = 1;
//Now set the Target Information
//Query the database for the user with 'AssassinID'=$targetID and then
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$targetid."'");
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$addresst = $rowt['Address'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Addresst'] = $addresst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Start the HTML stuff
echo "<h1>Success</h1>";
echo "<p>We are now redirecting you to the member area.</p>";
echo '<meta content="3;index.php" http-equiv="refresh">';
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
else
{
?>
<div id="content">
<h1>Member Login</h1>
<p>Thanks for visiting! Please either login below, or <a href="register.php">click here to register</a>.</p>
<form action="index.php" method="post" name="loginform" id="loginform">
<div class="form_settings">
<p><span>Username</span><input type="text" name="username" id="username" value="" /></p>
<p><span>Password</span><input type="password" name="password" id="password" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="login" id="login" value="Login" /></p>
</div>
</form>
<?php
}
?>
</div>
</body>
</html>
+242
View File
@@ -0,0 +1,242 @@
<?php include "base.php"; ?>
<?php
//get the number of rows in the table *THIS WORKS
function GetNumberOfRows() {
$result = mysql_query( "select count(UserID) as num_rows from users" );
$row = mysql_fetch_object( $result );
$total = $row->num_rows;
return $total;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Alive')
{
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif') || file_exists("upload/".$_SESSION['Username'].'.'.'jpeg') || file_exists("upload/".$_SESSION['Username'].'.'.'jpg') || file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
?>
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Log Out" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Your Info</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! You are <b><?=$_SESSION['Status']?></b>...</p>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'gif'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpeg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'png'."' class=\"targetphoto\"></li>";
}
?>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
</ul>
<?php
}
else {
?>
<div id="content">
<h1>Upload Photo</h1>
<p>Please <a href="uploadphoto.php">click here to add a photo</a>.</p>
<?php
}
}
elseif(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Dead')
{
?>
<div id="content">
<h1>YOU ARE DEAD</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! </p>
<ul>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
<br>
<li>You are <b><?=$_SESSION['Status']?></b></li>
</ul>
<p><a href="logout.php">Click here to log out.</a>
<?php
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
//Get the number of players and send it to a session variable
$numberofplayers = GetNumberOfRows();
$_SESSION['NumberOfPlayers'] = $numberofplayers;
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
if(mysql_num_rows($checklogin) == 1)
{
//Set the Assassin's Information
$row = mysql_fetch_array($checklogin);
$assassinid = $row['AssassinID'];
$targetid = $row['TargetID'];
$fullname = $row['FullName'];
$yeargroup = $row['YearGroup'];
$subject = $row['Subject'];
$societies = $row['Societies'];
$regularhaunts = $row['RegularHaunts'];
$ninjaness = $row['Ninjaness'];
$address = $row['Address'];
$kills = $row['Kills'];
$status = $row['Status'];
$_SESSION['AssassinID'] = $assassinid;
$_SESSION['TargetID'] = $targetid;
$_SESSION['Username'] = $username;
$_SESSION['FullName'] = $fullname;
$_SESSION['YearGroup'] = $yeargroup;
$_SESSION['Subject'] = $subject;
$_SESSION['Societies'] = $societies;
$_SESSION['RegularHaunts'] = $regularhaunts;
$_SESSION['Ninjaness'] = $ninjaness;
$_SESSION['Address'] = $address;
$_SESSION['Kills'] = $kills;
$_SESSION['Status'] = $status;
$_SESSION['LoggedIn'] = 1;
//Now set the Target Information
//Query the database for the user with 'AssassinID'=$targetID and then
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$targetid."'");
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$addresst = $rowt['Address'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Addresst'] = $addresst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Start the HTML stuff
echo "<h1>Success</h1>";
echo "<p>We are now redirecting you to the member area.</p>";
echo '<meta content="3;index.php" http-equiv="refresh">';
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
else
{
?>
<div id="content">
<h1>Member Login</h1>
<p>Thanks for visiting! Please either login below, or <a href="register.php">click here to register</a>.</p>
<form action="index.php" method="post" name="loginform" id="loginform">
<div class="form_settings">
<p><span>Username</span><input type="text" name="username" id="username" value="" /></p>
<p><span>Password</span><input type="password" name="password" id="password" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="login" id="login" value="Login" /></p>
</div>
</form>
<?php
}
?>
</div>
</body>
</html>
+280
View File
@@ -0,0 +1,280 @@
<?php include "base.php"; ?>
<?php
//get the number of rows in the table *THIS WORKS
function GetNumberOfRows() {
$result = mysql_query( "select count(UserID) as num_rows from users" );
$row = mysql_fetch_object( $result );
$total = $row->num_rows;
return $total;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Alive')
{
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif') || file_exists("upload/".$_SESSION['Username'].'.'.'jpeg') || file_exists("upload/".$_SESSION['Username'].'.'.'jpg') || file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
?>
<meta content="120;logout.php" http-equiv="refresh">
<div id="sidebar_container">
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<h3>Log Out</h3>
<form method="post" action="logout.php" id="logout">
<p style="padding: 0 0 0px 0;"></p>
<p><input class="subscribe" name="subscribe" type="submit" value="Log Out" /></p>
</form>
</div>
<img class="paperclip" src="style/paperclip.png" alt="paperclip" />
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest Kills</h3>
<p><a class="twitter-timeline" href="https://twitter.com/search?q=%23exeassassins" data-widget-id="441062980285784064">Tweets about "#exeassassins"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
</div>
</div>
<div id="content">
<h1>Your Info</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! You are <b><?=$_SESSION['Status']?></b>...</p>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Username'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'gif'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpeg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Username'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Username'].'.'.'png'."' class=\"targetphoto\"></li>";
}
?>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
</ul>
<p>
<h1>Your Target</h1>
<ul>
<?php
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'gif')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'gif'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpeg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpeg'."' class='targetphoto'></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'jpg')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'jpg'."' class=\"targetphoto\"></li>";
}
if (file_exists("upload/".$_SESSION['Usernamet'].'.'.'png')) {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'png'."' class='targetphoto'></li>";
}
?>
<li>Full name: <b><?=$_SESSION['FullNamet']?></b></li>
<li>Year group: <b><?=$_SESSION['YearGroupt']?></b></li>
<li>Email Address: <b><?=$_SESSION['Usernamet']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subjectt']?></b></li>
<li>Societies: <b><?=$_SESSION['Societiest']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHauntst']?></b></li>
<li>They live at: <b><?=$_SESSION['Addresst']?></b></li>
<li>Ninjaness Score <b><?=$_SESSION['Ninjanesst']?>/10</b></li>
<li>They have made <b><?=$_SESSION['Killst']?> kills</b></li>
</ul>
<br>
<h1>Submit Kill</h1>
<form action="submitkill.php" method="post" name="submitkill" id="submitkill">
<div class="form_settings">
<p><span>Kill Details</span><input type="text" name="killdetails" id="killmethod" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="submitkill" id="submitkill" value="Submit Kill" /></p>
</div>
</form>
<?php
}
else {
?>
<div id="content">
<h1>Upload Photo</h1>
<p>Please <a href="uploadphoto.php">click here to add a photo</a>.</p>
<?php
}
}
elseif(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']) && $_SESSION['Status']=='Dead')
{
?>
<div id="content">
<h1>YOU ARE DEAD</h1>
<h2>Players Alive: <b><?=$_SESSION['NumberOfPlayersAlive']?>/<?=$_SESSION['NumberOfPlayers']?></h2>
<p>Thanks for logging in <b><?=$_SESSION['FullName']?></b>! </p>
<ul>
<li>Year Group: <b><?=$_SESSION['YearGroup']?></b></li>
<li>Email Address: <b><?=$_SESSION['Username']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subject']?></b></li>
<li>Societies: <b><?=$_SESSION['Societies']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHaunts']?></b></li>
<li>You live at: <b><?=$_SESSION['Address']?></b></li>
<li>Ninjaness Score: <b><?=$_SESSION['Ninjaness']?>/10</b></li>
<li>You have made <b><?=$_SESSION['Kills']?> kills</b></li>
<br>
<li>You are <b><?=$_SESSION['Status']?></b></li>
</ul>
<p><a href="logout.php">Click here to log out.</a>
<?php
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
//Get the number of players and send it to a session variable
$numberofplayers = GetNumberOfRows();
$_SESSION['NumberOfPlayers'] = $numberofplayers;
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
if(mysql_num_rows($checklogin) == 1)
{
//Set the Assassin's Information
$row = mysql_fetch_array($checklogin);
$assassinid = $row['AssassinID'];
$targetid = $row['TargetID'];
$fullname = $row['FullName'];
$yeargroup = $row['YearGroup'];
$subject = $row['Subject'];
$societies = $row['Societies'];
$regularhaunts = $row['RegularHaunts'];
$ninjaness = $row['Ninjaness'];
$address = $row['Address'];
$kills = $row['Kills'];
$status = $row['Status'];
$_SESSION['AssassinID'] = $assassinid;
$_SESSION['TargetID'] = $targetid;
$_SESSION['Username'] = $username;
$_SESSION['FullName'] = $fullname;
$_SESSION['YearGroup'] = $yeargroup;
$_SESSION['Subject'] = $subject;
$_SESSION['Societies'] = $societies;
$_SESSION['RegularHaunts'] = $regularhaunts;
$_SESSION['Ninjaness'] = $ninjaness;
$_SESSION['Address'] = $address;
$_SESSION['Kills'] = $kills;
$_SESSION['Status'] = $status;
$_SESSION['LoggedIn'] = 1;
//Now set the Target Information
//Query the database for the user with 'AssassinID'=$targetID and then
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$targetid."'");
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$addresst = $rowt['Address'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Addresst'] = $addresst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Start the HTML stuff
echo "<h1>Success</h1>";
echo "<p>We are now redirecting you to the member area.</p>";
echo '<meta content="3;index.php" http-equiv="refresh">';
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
else
{
?>
<div id="content">
<h1>Member Login</h1>
<p>Thanks for visiting! Please either login below, or <a href="register.php">click here to register</a>.</p>
<form action="index.php" method="post" name="loginform" id="loginform">
<div class="form_settings">
<p><span>Username</span><input type="text" name="username" id="username" value="" /></p>
<p><span>Password</span><input type="password" name="password" id="password" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="login" id="login" value="Login" /></p>
</div>
</form>
<?php
}
?>
</div>
</body>
</html>
+6
View File
@@ -0,0 +1,6 @@
<?php
session_start();
session_destroy();
$_SESSION = array();
?>
<meta content="0;index.php" http-equiv="refresh">
+98
View File
@@ -0,0 +1,98 @@
<?php include "base.php"; ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<?php
if(!empty($_POST['username']) && !empty($_POST['password']))
{
$assassinid = 0;
$targetid = 0;
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$fullname = mysql_real_escape_string($_POST['fullname']);
$yeargroup = mysql_real_escape_string($_POST['yeargroup']);
$subject = mysql_real_escape_string($_POST['subject']);
$societies = mysql_real_escape_string($_POST['societies']);
$regularhaunts = mysql_real_escape_string($_POST['regularhaunts']);
$ninjaness = mysql_real_escape_string($_POST['ninjaness']);
$address = mysql_real_escape_string($_POST['address']);
$kills = 0;
$status = "Alive";
$checkusername = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
if(mysql_num_rows($checkusername) == 1)
{
echo "<h1>Error</h1>";
echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
}
else
{
$registerquery = mysql_query("INSERT INTO users (AssassinID, TargetID, Username, Password, FullName, YearGroup, Subject, Societies, RegularHaunts, Ninjaness, Address, Kills, Status) VALUES('".$assassinid."','".$targetid."','".$username."', '".$password."', '".$fullname."', '".$yeargroup."', '".$subject."', '".$societies."', '".$regularhaunts."', '".$ninjaness."', '".$address."', '".$kills."', '".$status."')");
if($registerquery)
{
echo "<h1>Success</h1>";
echo "<p>Your account was successfully created. Please <a href=\"index.php\">click here to log in</a>.</p>";
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your registration failed. Please go back and try again.</p>";
}
}
}
else
{
?>
<div id="content">
<h1>Register</h1>
<p>Please enter your details below to register.</p>
<form action="register.php" method="post" name="registerform" id="registerform">
<div class="form_settings">
<p><span>Exeter Uni Username</span><input type="text" name="username" id="username" value="without the @exeter.ac.uk" /></p>
<p><span>Password</span><input type="password" name="password" id="password" value="" /></p>
<p><span>Full Name</span><input type="text" name="fullname" id="fullname" value="" /></p>
<p><span>Year Group</span><input type="text" name="yeargroup" id="yeargroup" value="" /></p>
<p><span>Subject</span><input type="text" name="subject" id="subject" value="" /></p>
<p><span>Societies</span><textarea name="societies" id="societies"></textarea></p>
<p><span>Regular Haunts</span><textarea name="regularhaunts" id="regularhaunts"></textarea></p>
<p><span>Ninjaness /10</span><input type="text" name="ninjaness" id="ninjaness" value="" /></p>
<p><span>Exeter Address (not email)</span><input type="text" name="address" id="address" value="" /></p>
<p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="register" id="register" value="Register" /></p>
</div>
</form>
<?php
}
?>
</div>
</body>
</html>
+82
View File
@@ -0,0 +1,82 @@
<?php include "base.php"; ?>
<?php
//random number generator function
function UniqueRandomNumbersWithinRange($min, $max, $quantity) {
$numbers = range($min, $max);
shuffle($numbers);
$array = array_slice($numbers, 0, $quantity);
return $array;
}
//get the number of rows in the table *THIS WORKS
function GetNumberOfRows() {
$result = mysql_query( "select count(UserID) as num_rows from users" );
$row = mysql_fetch_object( $result );
$total = $row->num_rows;
return $total;
}
//call that stuff to do what I want
$numberofrows = GetNumberOfRows(); //*THIS WORKS
$IDarray = UniqueRandomNumbersWithinRange(1,$numberofrows,$numberofrows);
echo "Here begins the tempIDs output by the for loop:" ;
echo "<br>" ;
//print_r ($IDarray);
for ($counter = 1; $counter <= $numberofrows; $counter += 1) { //*THIS WORKS
$assassinID = $IDarray[$counter - 1] ; //*THIS WORKS
if ($assassinID == $numberofrows) {
$targetID = 1 ;
}
else {
$targetID = $assassinID + 1 ;
}
echo "a: " ;
echo $assassinID ;
echo "<br>" ;
echo "t: " ;
echo $targetID ;
echo "<br>" ;
//set tempID as the assassinID of the user in the row $counter
//set tempID+1 as the target ID of the user in the row $counter
//mysql_query( "NSERT INTO users (AssassinID, TargetID) VALUES ($assassinID, $targetID)" );
echo "Start AssassinSQL " ;
//UPDATE Users SET weight = 160, desiredWeight = 145 WHERE id = 1;
mysql_query( "UPDATE users SET AssassinID = $assassinID WHERE UserID = $counter" ) ;
echo $counter ;
echo "<br>" ;
echo "Start TargetSQL " ;
//UPDATE Users SET weight = 160, desiredWeight = 145 WHERE id = 1;
mysql_query( "UPDATE users SET TargetID = $targetID WHERE UserID = $counter" ) ;
echo $counter ;
echo "<br>" ;
mysql_query( "UPDATE users SET Status = 'Alive' WHERE UserID = $counter" ) ;
mysql_query( "UPDATE users SET Kills = 0 WHERE UserID = $counter" ) ;
}
?>
<!--meta content="3;index.php" http-equiv="refresh"-->
<!--
UniqueRandomNumbersWithinRange(1,GetNumberOfRows(),GetNumberOfRows())
For each position in the array: (use i)
userID i is assigned the contents of the array as assassinID
targetID is set as as the contents of the array + 1
Then for each position in the array apply the shuffled number at that position to the user at that position in the table as a column 'AssassinID'.
Then when the game begins just allocate everyone the user with the assassin number after theirs.
When a user successfully kills a player mark that play as dead, void their target column and change the number in the killer's target column to that which was in the deceased's target column.
-->
+338
View File
@@ -0,0 +1,338 @@
html
{ height: 100%;}
*
{ margin: 0;
padding: 0;}
body
{ font: normal .80em 'trebuchet ms', arial, sans-serif;
background: #F7F7F7 url(pattern.png) fixed;
color: #555;}
p
{ padding: 0 0 20px 0;
line-height: 1.5em;
font-size: 107%;}
img
{ border: 0;}
h1, h2, h3, h4, h5, h6
{ font: normal 250% 'Yanone Kaffeesatz', arial, sans-serif;
color: #444;
margin: 0 0 15px 0;
padding: 5px 0 5px 0;}
h2
{ font: normal 170% 'Yanone Kaffeesatz', arial, sans-serif;
color: #F14E23;
margin: 0;
padding: 0 0 8px 0;}
h3
{ font-size: 200%;
margin: 0 0 9px 0;
color: #444;}
h4, h5, h6
{ margin: 0;
padding: 0 0 5px 0;
font: normal 100% arial, sans-serif;
color: #F14E23;
line-height: 1em;}
h5, h6
{ font: italic 95% arial, sans-serif;
color: #888;
padding-bottom: 15px;}
h6
{ color: #362C20;}
a, a:hover
{ outline: none;
text-decoration: none;
color: #35BDF5;}
a:hover
{ text-decoration: underline;}
.left
{ float: left;
width: auto;
margin-right: 10px;}
.right
{ float: right;
width: auto;
margin-left: 10px;}
.center
{ display: block;
text-align: center;
margin: 20px auto;}
ul
{ margin: 2px 0 22px 17px;}
ul li
{ list-style-type: circle;
margin: 0 0 0 0;
padding: 0 0 4px 5px;}
ol
{ margin: 8px 0 22px 20px;}
ol li
{ margin: 0 0 11px 0;}
#main, #header, #logo, #menubar, #site_content, #footer
{ margin-left: auto;
margin-right: auto;}
#main
{ width: 950px;
margin: 20px auto;}
#header
{ width: 952px;
height: 145px;}
#logo
{ width: 950px;
float: left;
height: 90px;
background: transparent;
padding: 0 0 0px 10px;}
#logo h1
{ font: normal 350% 'Yanone Kaffeesatz', arial, sans-serif;
padding: 5px 0 0 17px;
color: #555;
float: left;}
#logo h1 a
{ color: #35BDF5;
text-decoration: none;}
#logo h1 a:hover
{ color: #555;
text-decoration: none;}
.slogan
{ float: right;
padding-right: 25px;
padding-top: 15px;
text-align: right;
font: 300% 'tangerine', arial;
color: #111;}
#menubar
{ height: 46px;
width: 700px;
margin: 0px auto -1px auto;
float: right;
padding: 0px 0 0 0;}
ul#menu
{ float: right;}
ul#menu li
{ float: left;
padding: 0 0 0px 0px;
list-style: none;
margin: 2px 0 0 0;
background: transparent;}
ul#menu li a
{ font: normal 170% 'Yanone Kaffeesatz', sans-serif;
text-decoration: none;
color: #444;
display: block;
float: left;
height: 20px;
padding: 7px 23px 15px 23px;
text-align: center;}
ul#menu li.current a
{ height: 20px;
padding: 6px 22px 15px 22px;}
ul#menu li.current a
{ background: #fff;
border: 1px solid #ddd;
border-bottom: 0;
color: #F14E23;}
ul#menu li a:hover
{ color: #F14E23;}
#site_content
{ width: 950px;
overflow: hidden;
margin: 0 auto 0 auto;
padding: 0;
background: #fff;
border: 1px solid #E7E7E7;}
#sidebar_container
{ float: right;
width: 350px;
margin: 25px 0;}
.sidebar
{ float: right;
width: 300px;
margin: 0 24px 27px 0;
background: #FBFBFB;
border: 1px solid #eee;
padding: 0 15px 15px 15px;}
.sidebar h3, .content h1
{ padding: 10px 15px;
margin: 0 1px;}
.sidebar h1
{ padding: 5px 0 0 0;}
.paperclip
{ float: left;
position: relative;
z-index: 0;
vertical-align: middle;
margin: -27px 0 -60px -30px;}
#content
{ text-align: left;
width: 630px;
padding: 25px 0 5px 25px;
margin: 0;}
#content ul
{ margin: 2px 0 22px 0px;}
#content ul li
{ list-style-type: none;
background: url(bullet.png) no-repeat;
margin: 0 0 6px 0;
padding: 0 0 4px 25px;
line-height: 1.5em;}
#footer
{ clear: both;
width: 100%;
font: normal 150% 'yanone kaffeesatz', arial, sans-serif;
height: 85px;
padding: 20px 0 5px 0;
text-align: center;
color: #555;
background: transparent;
margin-bottom: 20px;}
#footer p
{ padding: 0 0 10px 0;}
#footer a, #footer a:hover
{ color: #555;
text-decoration: none;}
#footer a:hover
{ color: #35BDF5;
text-decoration: none;}
.gallery img
{ position:absolute;}
.form_settings
{ margin: 5px 0 0 0;}
.form_settings p
{ padding: 0 0 10px 0;}
.form_settings span
{ padding: 5px 0;
float: left;
width: 170px;
text-align: left;}
.form_settings input, .form_settings textarea
{ width: 252px;
font: 100% 'trebuchet ms', arial;
border: 0;
border: 1px solid #ddd;
padding: 5px 10px;
background: #fff;
color: black;}
.form_settings .submit
{ border: 0;
width: auto;
margin: 0 0 0 0px;
cursor: pointer;
color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 15px;
background: #fff;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
.form_settings textarea, .form_settings select
{ font: 100% 'trebuchet ms', arial;
border: 1px solid #ddd;
padding: 5px 10px;
background: #fff;
width: 252px;
overflow: auto;}
.form_settings select
{ width: 274px;}
.form_settings .checkbox
{ margin: 4px 0;
padding: 0;
width: 14px;
border: 0;
background: none;}
.search
{ color: #666;
border: 1px solid #eee;
margin: 0;
padding: 10px 5px;
width: 189px;
color: #F14E23;}
.subscribe
{ color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 10px;
background: #fff;
float: left;
cursor: pointer;
margin: 0;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
table
{ margin: 10px 0 30px 0;}
table tr th, table tr td
{ background: #F5F5F5;
color: #111;
padding: 7px 4px;
text-align: left;}
table tr td
{ background: #FBFBFB;
color: #111;
border-top: 1px solid #FFF;}
.targetphoto {
min-height: 200px;
max-height: 500px;
min-width: 200px;
max-width: 520px;
display: block;
width: auto;
height: auto;
margin: 0px;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

+326
View File
@@ -0,0 +1,326 @@
html
{ height: 100%;}
*
{ margin: 0;
padding: 0;}
body
{ font: normal .80em 'trebuchet ms', arial, sans-serif;
background: #F7F7F7 url(pattern.png) fixed;
color: #555;}
p
{ padding: 0 0 20px 0;
line-height: 1.5em;
font-size: 107%;}
img
{ border: 0;}
h1, h2, h3, h4, h5, h6
{ font: normal 250% 'Yanone Kaffeesatz', arial, sans-serif;
color: #444;
margin: 0 0 15px 0;
padding: 5px 0 5px 0;}
h2
{ font: normal 170% 'Yanone Kaffeesatz', arial, sans-serif;
color: #F14E23;
margin: 0;
padding: 0 0 8px 0;}
h3
{ font-size: 200%;
margin: 0 0 9px 0;
color: #444;}
h4, h5, h6
{ margin: 0;
padding: 0 0 5px 0;
font: normal 100% arial, sans-serif;
color: #F14E23;
line-height: 1em;}
h5, h6
{ font: italic 95% arial, sans-serif;
color: #888;
padding-bottom: 15px;}
h6
{ color: #362C20;}
a, a:hover
{ outline: none;
text-decoration: none;
color: #35BDF5;}
a:hover
{ text-decoration: underline;}
.left
{ float: left;
width: auto;
margin-right: 10px;}
.right
{ float: right;
width: auto;
margin-left: 10px;}
.center
{ display: block;
text-align: center;
margin: 20px auto;}
ul
{ margin: 2px 0 22px 17px;}
ul li
{ list-style-type: circle;
margin: 0 0 0 0;
padding: 0 0 4px 5px;}
ol
{ margin: 8px 0 22px 20px;}
ol li
{ margin: 0 0 11px 0;}
#main, #header, #logo, #menubar, #site_content, #footer
{ margin-left: auto;
margin-right: auto;}
#main
{ width: 950px;
margin: 20px auto;}
#header
{ width: 952px;
height: 145px;}
#logo
{ width: 950px;
float: left;
height: 100px;
background: transparent;
padding: 0 0 0px 10px;}
#logo h1
{ font: normal 350% 'Yanone Kaffeesatz', arial, sans-serif;
padding: 5px 0 0 17px;
color: #555;
float: left;}
#logo h1 a
{ color: #35BDF5;
text-decoration: none;}
#logo h1 a:hover
{ color: #555;
text-decoration: none;}
.slogan
{ float: right;
padding-right: 25px;
text-align: right;
font: 500% 'tangerine', arial;
color: #111;}
#menubar
{ height: 46px;
width: 700px;
margin: 0px auto -1px auto;
float: right;
padding: 0px 0 0 0;}
ul#menu
{ float: right;}
ul#menu li
{ float: left;
padding: 0 0 0px 0px;
list-style: none;
margin: 2px 0 0 0;
background: transparent;}
ul#menu li a
{ font: normal 170% 'Yanone Kaffeesatz', sans-serif;
text-decoration: none;
color: #444;
display: block;
float: left;
height: 20px;
padding: 7px 23px 15px 23px;
text-align: center;}
ul#menu li.current a
{ height: 20px;
padding: 6px 22px 15px 22px;}
ul#menu li.current a
{ background: #fff;
border: 1px solid #ddd;
border-bottom: 0;
color: #F14E23;}
ul#menu li a:hover
{ color: #F14E23;}
#site_content
{ width: 950px;
overflow: hidden;
margin: 0 auto 0 auto;
padding: 0;
background: #fff;
border: 1px solid #E7E7E7;}
#sidebar_container
{ float: right;
width: 250px;
margin: 25px 0;}
.sidebar
{ float: right;
width: 200px;
margin: 0 24px 27px 0;
background: #FBFBFB;
border: 1px solid #eee;
padding: 0 15px 15px 15px;}
.sidebar h3, .content h1
{ padding: 10px 15px;
margin: 0 1px;}
.sidebar h1
{ padding: 5px 0 0 0;}
.paperclip
{ float: left;
position: relative;
z-index: 0;
vertical-align: middle;
margin: -27px 0 -60px -30px;}
#content
{ text-align: left;
width: 630px;
padding: 25px 0 5px 25px;
margin: 0;}
#content ul
{ margin: 2px 0 22px 0px;}
#content ul li
{ list-style-type: none;
background: url(bullet.png) no-repeat;
margin: 0 0 6px 0;
padding: 0 0 4px 25px;
line-height: 1.5em;}
#footer
{ clear: both;
width: 100%;
font: normal 150% 'yanone kaffeesatz', arial, sans-serif;
height: 85px;
padding: 20px 0 5px 0;
text-align: center;
color: #555;
background: transparent;
margin-bottom: 20px;}
#footer p
{ padding: 0 0 10px 0;}
#footer a, #footer a:hover
{ color: #555;
text-decoration: none;}
#footer a:hover
{ color: #35BDF5;
text-decoration: none;}
.gallery img
{ position:absolute;}
.form_settings
{ margin: 5px 0 0 0;}
.form_settings p
{ padding: 0 0 10px 0;}
.form_settings span
{ padding: 5px 0;
float: left;
width: 170px;
text-align: left;}
.form_settings input, .form_settings textarea
{ width: 252px;
font: 100% 'trebuchet ms', arial;
border: 0;
border: 1px solid #eee;
padding: 5px 10px;
background: #fff;
color: #FFF;}
.form_settings .submit
{ border: 0;
width: auto;
margin: 0 0 0 200px;
cursor: pointer;
color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 15px;
background: #fff;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
.form_settings textarea, .form_settings select
{ font: 100% 'trebuchet ms', arial;
border: 1px solid #eee;
padding: 5px 10px;
background: #fff;
width: 252px;
overflow: auto;}
.form_settings select
{ width: 274px;}
.form_settings .checkbox
{ margin: 4px 0;
padding: 0;
width: 14px;
border: 0;
background: none;}
.search
{ color: #666;
border: 1px solid #eee;
margin: 0;
padding: 10px 5px;
width: 189px;
color: #F14E23;}
.subscribe
{ color: #35BDF5;
border: 1px solid #ddd;
padding: 5px 10px;
background: #fff;
float: right;
cursor: pointer;
margin: 0;
font: normal 140% 'Yanone Kaffeesatz', sans-serif;}
table
{ margin: 10px 0 30px 0;}
table tr th, table tr td
{ background: #F5F5F5;
color: #111;
padding: 7px 4px;
text-align: left;}
table tr td
{ background: #FBFBFB;
color: #111;
border-top: 1px solid #FFF;}
+155
View File
@@ -0,0 +1,155 @@
<?php
include "base.php";
require_once('PHPMailer_v5.1/class.phpmailer.php');
define('EUSER', 'JOSHUACR\\admin'); // EMail username
define('EPWD', '$@!$kw86'); // EMail password
?>
<script type="text/javascript" src="codebird-js-master/codebird.js"></script>
<?php
function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled ssl/tls
$mail->Host = 'ssrs.reachmail.net';
$mail->Port = 465;
$mail->Username = EUSER;
$mail->Password = EPWD;
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
}
?>
<?php
$_SESSION['KillDetails'] = mysql_real_escape_string($_POST['killdetails']);
$_killedname = $_SESSION['FullNamet'];
$_killedusername = $_SESSION['Usernamet'];
//Get the TargetID of the deceased
//$deceasedtargetid = $_SESSION['TargetIDt']; //mysql_query("SELECT TargetID FROM users WHERE AssassinID = '".$_SESSION['TargetID']."'");
//echo $_SESSION['TargetIDt'];
//Using that TargetID reset the session variables of the killer's target
mysql_query( "UPDATE users SET TargetID = '".$_SESSION['TargetIDt']."' WHERE AssassinID = '".$_SESSION['AssassinID']."'" ) ;
//Wipe the TargetID of the deceased
mysql_query( "UPDATE users SET TargetID = 0 WHERE AssassinID = '".$_SESSION['TargetID']."'" ) ;
//Mark the deceased as 'Dead'
mysql_query( "UPDATE users SET Status = 'Dead' WHERE AssassinID = '".$_SESSION['TargetID']."'" ) ;
//Increment the Killer's Kill field
$newkills = $_SESSION['Kills'] + 1;
$_SESSION['Kills'] = $newkills ;
mysql_query( "UPDATE users SET Kills = '".$_SESSION['Kills']."' WHERE AssassinID = '".$_SESSION['AssassinID']."'" ) ;
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$_SESSION['TargetIDt']."'");
$_SESSION['TargetID'] = $_SESSION['TargetIDt'];
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
?>
<!--Send kill details to FB and Twitter (Potentially set up Twitter to feed to Facebook?)-->
<script type="text/javascript">
var killdetails = "#exeassassins <?=$_killedname?> dead: <?php echo $_SESSION['KillDetails'] ?>";
var cb = new Codebird;
cb.setConsumerKey("6UxEQnzDe3rEOQprGpG9A", "87oIWvCpDb4eibJo0HNxB7efz2RI6sBPY94dgVuQX0");
cb.setToken("2344307718-t93VOJ6jvygX6FJthkj77waJb6GyLHLrL3VXkcb", "gOA6RqnopEDNewKx713kKTTi9SrVuk2H0IpdtNfh6j6Th");
cb.__call(
"statuses_update",
{"status": killdetails},
function (reply) {
// ...
}
);
</script>
<!--Send kill details via email-->
<?php
//Mail us to confirm the kill
smtpmailer('hideandseekexeter@gmail.com', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', $_killedname.' has been killed', $_SESSION['KillDetails']);
//Mail the killer
smtpmailer($_SESSION['Username'].'@exeter.ac.uk', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', 'You have killed '.$_killedname, $_SESSION['KillDetails']);
//Mail the deceased
smtpmailer($_killedusername.'@exeter.ac.uk', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', 'You, '.$_killedname.' have been killed', $_SESSION['KillDetails']);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<div id="content">
<h1>Kill registered</h1>
<p>Click below to return to the member area.</p>
<!--meta content="3;index.php" http-equiv="refresh"-->
<form method="post" action="index.php" id="home"><p style="padding: 0 0 0px 0;"></p>
<p><input class="home" name="home" type="submit" value="Return" /></p>
</form>
</div>
</body>
</html>
+155
View File
@@ -0,0 +1,155 @@
<?php
include "base.php";
require_once('PHPMailer_v5.1/class.phpmailer.php');
define('EUSER', 'JOSHUACR\\admin'); // EMail username
define('EPWD', '$@!$kw86'); // EMail password
?>
<script type="text/javascript" src="codebird-js-master/codebird.js"></script>
<?php
function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled ssl/tls
$mail->Host = 'ssrs.reachmail.net';
$mail->Port = 465;
$mail->Username = EUSER;
$mail->Password = EPWD;
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
}
?>
<?php
$_SESSION['KillDetails'] = mysql_real_escape_string($_POST['killdetails']);
$_killedname = $_SESSION['FullNamet'];
$_killedusername = $_SESSION['Usernamet'];
//Get the TargetID of the deceased
//$deceasedtargetid = $_SESSION['TargetIDt']; //mysql_query("SELECT TargetID FROM users WHERE AssassinID = '".$_SESSION['TargetID']."'");
//echo $_SESSION['TargetIDt'];
//Using that TargetID reset the session variables of the killer's target
mysql_query( "UPDATE users SET TargetID = '".$_SESSION['TargetIDt']."' WHERE AssassinID = '".$_SESSION['AssassinID']."'" ) ;
//Wipe the TargetID of the deceased
mysql_query( "UPDATE users SET TargetID = 0 WHERE AssassinID = '".$_SESSION['TargetID']."'" ) ;
//Mark the deceased as 'Dead'
mysql_query( "UPDATE users SET Status = 'Dead' WHERE AssassinID = '".$_SESSION['TargetID']."'" ) ;
//Increment the Killer's Kill field
$newkills = $_SESSION['Kills'] + 1;
$_SESSION['Kills'] = $newkills ;
mysql_query( "UPDATE users SET Kills = '".$_SESSION['Kills']."' WHERE AssassinID = '".$_SESSION['AssassinID']."'" ) ;
$targetinfo = mysql_query("SELECT * FROM users WHERE AssassinID = '".$_SESSION['TargetIDt']."'");
$_SESSION['TargetID'] = $_SESSION['TargetIDt'];
if(mysql_num_rows($targetinfo) == 1)
{
//Set the Assassin's Information
$rowt = mysql_fetch_array($targetinfo); //rowt=Row of Target
$usernamet = $rowt['Username'];
$assassinidt = $rowt['AssassinID'];
$targetidt = $rowt['TargetID'];
$fullnamet = $rowt['FullName'];
$yeargroupt = $rowt['YearGroup'];
$subjectt = $rowt['Subject'];
$societiest = $rowt['Societies'];
$regularhauntst = $rowt['RegularHaunts'];
$ninjanesst = $rowt['Ninjaness'];
$killst = $rowt['Kills'];
$statust = $rowt['Status'];
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['AssassinIDt'] = $assassinidt;
$_SESSION['TargetIDt'] = $targetidt;
$_SESSION['Usernamet'] = $usernamet;
$_SESSION['FullNamet'] = $fullnamet;
$_SESSION['YearGroupt'] = $yeargroupt;
$_SESSION['Subjectt'] = $subjectt;
$_SESSION['Societiest'] = $societiest;
$_SESSION['RegularHauntst'] = $regularhauntst;
$_SESSION['Ninjanesst'] = $ninjanesst;
$_SESSION['Killst'] = $killst;
$_SESSION['Statust'] = $statust;
}
//Get the number of players with 'Alive' as their 'Status' and send that to a session variable
$getplayersalive = mysql_query("SELECT * FROM users WHERE Status = 'Alive'");
$numberofplayersalive = mysql_num_rows($getplayersalive);
$_SESSION['NumberOfPlayersAlive'] = $numberofplayersalive;
?>
<!--Send kill details to FB and Twitter (Potentially set up Twitter to feed to Facebook?)-->
<script type="text/javascript">
var killdetails = "#exeassassins <?=$_killedname?> dead: <?php echo $_SESSION['KillDetails'] ?>";
var cb = new Codebird;
cb.setConsumerKey("6UxEQnzDe3rEOQprGpG9A", "87oIWvCpDb4eibJo0HNxB7efz2RI6sBPY94dgVuQX0");
cb.setToken("2344307718-t93VOJ6jvygX6FJthkj77waJb6GyLHLrL3VXkcb", "gOA6RqnopEDNewKx713kKTTi9SrVuk2H0IpdtNfh6j6Th");
cb.__call(
"statuses_update",
{"status": killdetails},
function (reply) {
// ...
}
);
</script>
<!--Send kill details via email-->
<?php
//Mail us to confirm the kill
smtpmailer('hideandseekexeter@gmail.com', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', $_killedname.' has been killed', $_SESSION['KillDetails']);
//Mail the killer
smtpmailer($_SESSION['Username'].'@exeter.ac.uk', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', 'You have killed '.$_killedname, $_SESSION['KillDetails']);
//Mail the deceased
smtpmailer($_killedusername.'@exeter.ac.uk', 'hideandseekexeter@gmail.com', 'Hide and Seek Exeter', 'You, '.$_killedname.' have been killed', $_SESSION['KillDetails']);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Assassins Mission Control</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<h1>assassins<a href="#">MissionControl</a></h1>
<div class="slogan">Exeter University Hide & Seek Society</div>
</div>
<div id="site_content">
<div id="content">
<h1>Kill registered</h1>
<p>Click below to return to the member area.</p>
<!--meta content="3;index.php" http-equiv="refresh"-->
<form method="post" action="index.php" id="home"><p style="padding: 0 0 0px 0;"></p>
<p><input class="home" name="home" type="submit" value="Return" /></p>
</form>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More