Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added shoutbox and some minor changes

  • Loading branch information...
commit b2e0a696054719981d61be3d832e49b7a2f9cea3 1 parent 1d7e3b2
Mathijs Schmittmann authored
View
0  css/img_inquisitor/as_pointer.gif → css/img_autosuggest/as_pointer.gif
File renamed without changes
View
0  css/img_inquisitor/hl_corner_bl.gif → css/img_autosuggest/hl_corner_bl.gif
File renamed without changes
View
0  css/img_inquisitor/hl_corner_br.gif → css/img_autosuggest/hl_corner_br.gif
File renamed without changes
View
0  css/img_inquisitor/hl_corner_tl.gif → css/img_autosuggest/hl_corner_tl.gif
File renamed without changes
View
0  css/img_inquisitor/hl_corner_tr.gif → css/img_autosuggest/hl_corner_tr.gif
File renamed without changes
View
0  css/img_inquisitor/ul_corner_bl.gif → css/img_autosuggest/ul_corner_bl.gif
File renamed without changes
View
0  css/img_inquisitor/ul_corner_br.gif → css/img_autosuggest/ul_corner_br.gif
File renamed without changes
View
0  css/img_inquisitor/ul_corner_tl.gif → css/img_autosuggest/ul_corner_tl.gif
File renamed without changes
View
0  css/img_inquisitor/ul_corner_tr.gif → css/img_autosuggest/ul_corner_tr.gif
File renamed without changes
View
BIN  css/img_shoutbox/bubble.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  css/img_shoutbox/bullet.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
34 css/riftupgrade.css
@@ -50,14 +50,14 @@
margin-left: 645px;
text-align: center;
}
- .settingscontainer {
+ .settingscontainer,.shoutbox {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 600px;
}
- .settings {
+ .settings,.shoutbox {
position: absolute;
top: 10%;
left: 50%;
@@ -70,13 +70,13 @@
border: 10px solid black;
padding: 10px;
}
- .settings p {
+ .settings,.shoutbox p {
font-size: 9px;
}
- .settings label {
+ .settings,.shoutbox label {
font-size: 9px;
}
- .settings input {
+ .settings,.shoutbox input {
margin-top: 5px;
}
.output {
@@ -115,7 +115,7 @@ body
div.autosuggest
{
position: absolute;
- background-image: url(img_inquisitor/as_pointer.gif);
+ background-image: url(img_autosuggest/as_pointer.gif);
background-position: top;
background-repeat: no-repeat;
padding: 10px 0 0 0;
@@ -127,14 +127,14 @@ div.autosuggest div.as_footer
position: relative;
height: 6px;
padding: 0 6px;
- background-image: url(img_inquisitor/ul_corner_tr.gif);
+ background-image: url(img_autosuggest/ul_corner_tr.gif);
background-position: top right;
background-repeat: no-repeat;
overflow: hidden;
}
div.autosuggest div.as_footer
{
- background-image: url(img_inquisitor/ul_corner_br.gif);
+ background-image: url(img_autosuggest/ul_corner_br.gif);
}
div.autosuggest div.as_header div.as_corner,
@@ -145,13 +145,13 @@ div.autosuggest div.as_footer div.as_corner
left: 0;
height: 6px;
width: 6px;
- background-image: url(img_inquisitor/ul_corner_tl.gif);
+ background-image: url(img_autosuggest/ul_corner_tl.gif);
background-position: top left;
background-repeat: no-repeat;
}
div.autosuggest div.as_footer div.as_corner
{
- background-image: url(img_inquisitor/ul_corner_bl.gif);
+ background-image: url(img_autosuggest/ul_corner_bl.gif);
}
div.autosuggest div.as_header div.as_bar,
div.autosuggest div.as_footer div.as_bar
@@ -221,14 +221,14 @@ div.autosuggest ul li.as_highlight a
{
color: #fff;
background-color: #1B5CCD;
- background-image: url(img_inquisitor/hl_corner_br.gif);
+ background-image: url(img_autosuggest/hl_corner_br.gif);
background-position: bottom right;
background-repeat: no-repeat;
}
div.autosuggest ul li.as_highlight a span
{
- background-image: url(img_inquisitor/hl_corner_bl.gif);
+ background-image: url(img_autosuggest/hl_corner_bl.gif);
background-position: bottom left;
background-repeat: no-repeat;
}
@@ -253,14 +253,14 @@ div.autosuggest ul li a .tr
div.autosuggest ul li.as_highlight a .tl
{
left: 0;
- background-image: url(img_inquisitor/hl_corner_tl.gif);
+ background-image: url(img_autosuggest/hl_corner_tl.gif);
background-position: bottom left;
}
div.autosuggest ul li.as_highlight a .tr
{
right: 0;
- background-image: url(img_inquisitor/hl_corner_tr.gif);
+ background-image: url(img_autosuggest/hl_corner_tr.gif);
background-position: bottom right;
}
@@ -300,7 +300,7 @@ table.outputtable thead tr th, table.tablesorter tfoot tr th {
padding: 4px;
}
table.outputtable thead tr .header {
- background-image: url(bg.gif);
+ background-image: url(tablesort_bg.gif);
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
@@ -315,10 +315,10 @@ table.outputtable tbody tr.odd td {
background-color:#F0F0F6;
}
table.outputtable thead tr .headerSortUp {
- background-image: url(asc.gif);
+ background-image: url(tablesort_asc.gif);
}
table.outputtable thead tr .headerSortDown {
- background-image: url(desc.gif);
+ background-image: url(tablesort_desc.gif);
}
table.outputtable thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #8dbdd8;
View
0  css/asc.gif → css/tablesort_asc.gif
File renamed without changes
View
0  css/bg.gif → css/tablesort_bg.gif
File renamed without changes
View
0  css/desc.gif → css/tablesort_desc.gif
File renamed without changes
View
48 index.php
@@ -8,7 +8,6 @@
if($version==""||$version=="dev") include("welcome.php");
else { include("settings_".$version.".php");
$load = $_GET['load'];
-
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
@@ -214,6 +213,7 @@
<!-- End of 'Show Settings' -->
<p style="text-align: center; margin-top: 50px;">
+ <input type="button" value="Shoutbox" onclick="showShoutbox()" />
<input style="margin-right: 100px;" type="button" value="Show Settings" onclick="showSettings()" />
<input type="button" value="Save New" onclick="save('new')" />
<input type="button" value="Save Current" onclick="save('current')" />
@@ -228,6 +228,42 @@
<p id="saveconfirmtext"></p>
</div>
</form>
+
+
+ <!-- Shoutbox displayed when clicking Shoutbox button -->
+ <div class="shoutboxcontainer" style="display: none;">
+ <div class="shoutbox" style="display: none;">
+ <script type="text/javascript" src="js/shoutbox.js"></script>
+ <form method="post" id="form">
+ <table>
+ <tr>
+ <td><label>Name</label></td>
+ <td><input class="text user" id="nick" type="text" MAXLENGTH="25" /></td>
+ </tr>
+ <tr>
+ <td><label>Message</label></td>
+ <td><textarea id="message" rows="4" cols="30"></textarea></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input id="send" type="submit" value="Shout it!" /> &nbsp; <input type="button" value="Hide Shoutbox" onclick="hideShoutbox()" /></td>
+ </tr>
+ </table>
+ </form>
+ <hr />
+ <div id="container">
+ <span class="clear"></span>
+ <div class="content">
+ <h2>Riftupgrades Shoutbox</h2>
+ <div id="loading"></div>
+ <ul>
+ <ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- End of 'Shoutbox' -->
+
</div> <!-- left -->
<div class="output">
<h1><? echo $title; ?> Upgrade Planner</h1>
@@ -349,6 +385,16 @@ function hideSettings() {
$('.settings').hide();
}
+ function showShoutbox() {
+ $('.shoutboxcontainer').show();
+ $('.shoutbox').show();
+ }
+
+ function hideShoutbox() {
+ $('.shoutboxcontainer').hide();
+ $('.shoutbox').hide();
+ }
+
// fill the New URL textbox with the url returned by save.php
function savehandler() {
if(http.readyState == 4 && http.status == 200) {
View
64 js-full/shoutbox.js
@@ -0,0 +1,64 @@
+/***************************/
+//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
+//@website: www.yensdesign.com
+//@email: yensamg@gmail.com
+//@license: Feel free to use it, but keep this credits please!
+/***************************/
+
+$(document).ready(function(){
+ //global vars
+ var inputUser = $("#nick");
+ var inputMessage = $("#message");
+ var loading = $("#loading");
+ var messageList = $(".content > ul");
+
+ //functions
+ function updateShoutbox(){
+ //just for the fade effect
+ messageList.hide();
+ loading.fadeIn();
+ //send the post to shoutbox.php
+ $.ajax({
+ type: "POST", url: "shoutbox.php", data: "action=update",
+ complete: function(data){
+ loading.fadeOut();
+ messageList.html(data.responseText);
+ messageList.fadeIn(2000);
+ }
+ });
+ }
+ //check if all fields are filled
+ function checkForm(){
+ if(inputUser.attr("value") && inputMessage.attr("value"))
+ return true;
+ else
+ return false;
+ }
+
+ //Load for the first time the shoutbox data
+ updateShoutbox();
+
+ //on submit event
+ $("#form").submit(function(){
+ if(checkForm()){
+ var nick = inputUser.attr("value");
+ var message = inputMessage.attr("value");
+ //we deactivate submit button while sending
+ $("#send").attr({ disabled:true, value:"Sending..." });
+ $("#send").blur();
+ //send the post to shoutbox.php
+ $.ajax({
+ type: "POST", url: "shoutbox.php", data: "action=insert&nick=" + nick + "&message=" + message,
+ complete: function(data){
+ messageList.html(data.responseText);
+ updateShoutbox();
+ //reactivate the send button
+ $("#send").attr({ disabled:false, value:"Shout it!" });
+ }
+ });
+ }
+ else alert("Please fill all fields!");
+ //we prevent the refresh of the page after submitting the form
+ return false;
+ });
+});
View
1  js/shoutbox.js
@@ -0,0 +1 @@
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(I).z(0(){1 d=$("#j");1 e=$("#r");1 f=$("#F");1 g=$(".A > B");0 4(){g.H();f.s();$.t({w:"x",9:"h.i",8:"k=G",l:0(a){f.y();g.n(a.o);g.s(C)}})}0 p(){q(d.2("3")&&e.2("3"))6 u;v 6 7}4();$("#D").E(0(){q(p()){1 b=d.2("3");1 c=e.2("3");$("#5").2({m:u,3:"J..."});$("#5").K();$.t({w:"x",9:"h.i",8:"k=L&j="+b+"&r="+c,l:0(a){g.n(a.o);4();$("#5").2({m:7,3:"M N!"})}})}v O("P Q R S!");6 7})});',55,55,'function|var|attr|value|updateShoutbox|send|return|false|data|url||||||||shoutbox|php|nick|action|complete|disabled|html|responseText|checkForm|if|message|fadeIn|ajax|true|else|type|POST|fadeOut|ready|content|ul|2000|form|submit|loading|update|hide|document|Sending|blur|insert|Shout|it|alert|Please|fill|all|fields'.split('|'),0,{}))
View
75 shoutbox.php
@@ -0,0 +1,75 @@
+<?php
+/***************************/
+//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
+//@website: www.yensdesign.com
+//@email: yensamg@gmail.com
+//@license: Feel free to use it, but keep this credits please!
+/***************************/
+
+/************************
+ CONSTANTS
+/************************/
+define("HOST", "localhost");
+define("USER", "riftupgrade");
+define("PASSWORD", "Vj9Vt7NU8KnxJSvV");
+define("DB", "riftupgrade");
+
+/************************
+ FUNCTIONS
+/************************/
+function connect($db, $user, $password){
+ $link = @mysql_connect($db, $user, $password);
+ if (!$link)
+ die("Could not connect: ".mysql_error());
+ else{
+ $db = mysql_select_db(DB);
+ if(!$db)
+ die("Could not select database: ".mysql_error());
+ else return $link;
+ }
+}
+function getContent($link, $num){
+ $res = @mysql_query("SELECT date, user, message FROM shoutbox ORDER BY date DESC LIMIT ".$num, $link);
+ if(!$res)
+ die("Error: ".mysql_error());
+ else
+ return $res;
+}
+function insertMessage($user, $message){
+ $query = sprintf("INSERT INTO shoutbox(user, message) VALUES('%s', '%s');", mysql_real_escape_string(strip_tags($user)), mysql_real_escape_string(strip_tags($message)));
+ $res = @mysql_query($query);
+ if(!$res)
+ die("Error: ".mysql_error());
+ else
+ return $res;
+}
+
+/******************************
+ MANAGE REQUESTS
+/******************************/
+if(!$_POST['action']){
+ //We are redirecting people to our shoutbox page if they try to enter in our shoutbox.php
+ header ("Location: index.html");
+}
+else{
+ $link = connect(HOST, USER, PASSWORD);
+ switch($_POST['action']){
+ case "update":
+ $res = getContent($link, 20);
+ while($row = mysql_fetch_array($res)){
+ if($row['user']=="Roobarb_admin")
+ $result .= "<li><strong><span style='color:red'>Roobarb</span></strong><img src=\"css/img_shoutbox/bullet.gif\" alt=\"-\" />".$row['message']." <span class=\"date\">(".$row['date'].")</span></li>";
+ else
+ $result .= "<li><strong>".$row['user']."</strong><img src=\"css/img_shoutbox/bullet.gif\" alt=\"-\" />".$row['message']." <span class=\"date\">(".$row['date'].")</span></li>";
+ }
+ echo $result;
+ break;
+ case "insert":
+ echo insertMessage($_POST['nick'], $_POST['message']);
+ break;
+ }
+ mysql_close($link);
+}
+
+
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.