Skip to content

Commit

Permalink
[49] Implemented account profile and character bookmarks functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Jan 17, 2010
1 parent 44bd188 commit 9de16cf
Show file tree
Hide file tree
Showing 20 changed files with 525 additions and 109 deletions.
50 changes: 25 additions & 25 deletions _css/character/sheet.css
Expand Up @@ -22,44 +22,44 @@ object:focus, a:focus{-moz-outline-style:none}


/* gear */
.profile-master2{ margin:0px;background:url('../../images/toggle_btns.jpg)profile-bg.jpg') no-repeat 50% 0; height: 460px; width: 100%;}
.profile-master2{ margin:0px;background:url('../../images/profile-bg.jpg') no-repeat 50% 0; height: 460px; width: 100%;}

#gear-profile { width:519px; background:url(../../images/profile_bg_sheet_left.jpg) no-repeat; float:left; position:relative; left:-1px; z-index:2; }

.gear_bg { background:url(../../images/sheet_itemsbg.jpg) no-repeat; height:585px; position:relative; z-index:2;}
.gearItem { height: 55px; width: 60px; margin: 0px 0 1px 0; position: relative; background-position: 100% 4px; background-repeat:no-repeat;}
.gearItem a { width: 75px; height: 60px; display: block; padding: 4px 0 0 0; position: relative; margin: 0 0 0 5px; }
.gearItem .noUpgrade:hover { background:url('../../images/toggle_btns.jpg)icon-glass0.gif') no-repeat 11px 0 !important; }
.gearItem .noUpgrade:hover { background:url('../../images/icon-glass0.gif') no-repeat 11px 0 !important; }

.upgradeBox { height: 50px; width: 10px; position:relative; float: left; top: 0px;}


.leftItems { position: absolute; left:24px; top:58px; }
.leftItems .gearItem a.gearFrame { background:url('../../images/toggle_btns.jpg)icon-glass-left.gif') no-repeat -75px -1px; top: -1px; left: -13px; }
.leftItems .gearItem a.gearFrame { background:url('../../images/icon-glass-left.gif') no-repeat -75px -1px; top: -1px; left: -13px; }
.leftItems .gearItem a.gearFrame:hover { background-position: -3px 0px; }
.leftItems .upgradeBox { left: 5px; display:block; }
.leftItems .fly-horz{top:-1px;left:-100px}

.rightItems { position:absolute; left:433px; top:58px;}
.rightItems .gearItem a.gearFrame { background:url('../../images/toggle_btns.jpg)icon-glass-right.gif') no-repeat -2px -1px; top: -1px; left: 0; width: 74px; }
.rightItems .gearItem a.gearFrame { background:url('../../images/icon-glass-right.gif') no-repeat -2px -1px; top: -1px; left: 0; width: 74px; }
.rightItems .gearItem a.gearFrame:hover { background-position: -75px 0; }
.rightItems .gearItem .noUpgrade:hover { background:url('../../images/toggle_btns.jpg)icon-glass0.gif') no-repeat -2px 0 !important; }
.rightItems .gearItem .noUpgrade:hover { background:url('../../images/icon-glass0.gif') no-repeat -2px 0 !important; }
.rightItems .upgradeBox {left: 57px; }
.rightItems .fly-horz{top:-1px; left:60px}

.bottomItems { position:absolute; left:172px; top:516px; }
.bottomItems .gearItem { float: left; display: block; width: 55px; height: 60px; }
.bottomItems .gearItem a.gearFrame { height: 75px; width: 60px; background:url('../../images/toggle_btns.jpg)icon-glass-bot.gif') no-repeat 7px 0px; top: -1px; left: -13px; padding: 0 6px 0 0;}
.bottomItems .gearItem a.gearFrame { height: 75px; width: 60px; background:url('../../images/icon-glass-bot.gif') no-repeat 7px 0px; top: -1px; left: -13px; padding: 0 6px 0 0;}
.bottomItems .gearItem a.gearFrame:hover { background-position: 5px -75px; }
.bottomItems .gearItem .noUpgrade:hover { background:url('../../images/toggle_btns.jpg)icon-glass0.gif') no-repeat 5px 1px !important; }
.bottomItems .gearItem .noUpgrade:hover { background:url('../../images/icon-glass0.gif') no-repeat 5px 1px !important; }
.bottomItems .upgradeBox { width: 50px; height: 10px; top: 57px; left: 10px; }
.bottomItems .fly-horz{top:55px;left:-10px}
.bottomItems .s_relic { background:url(../../images/relic.jpg) no-repeat 3px 4px; }

.rightItems .fly-horz,.leftItems .fly-horz,.bottomItems .fly-horz{ display: none; position: absolute; width: 95px; height: 53px; background: url('../../images/toggle_btns.jpg)flyout.png') no-repeat 0 0; z-index: 9991; padding: 8px 0 0 12px; }
.rightItems .fly-horz,.leftItems .fly-horz,.bottomItems .fly-horz{ display: none; position: absolute; width: 95px; height: 53px; background: url('../../images/flyout.png') no-repeat 0 0; z-index: 9991; padding: 8px 0 0 12px; }
.fly-horz a,.fly-horz a:active,.fly-horz a:visited{color:#5c4500 !important;font-family:Arial,Helvetica,sans-serif !important}
.fly-horz a:hover{color:black !important;}
a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important; padding: 0 0 0 23px !important; background: url('../../images/toggle_btns.jpg)icons/upgrade.gif') no-repeat !important; position: relative !important; top: 6px !important; left: 0 !important; height: 30px !important; width: 55px !important; line-height: 14px; }
a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important; padding: 0 0 0 23px !important; background: url('../../images/icons/upgrade.gif') no-repeat !important; position: relative !important; top: 6px !important; left: 0 !important; height: 30px !important; width: 55px !important; line-height: 14px; }

/* center info of charcater sheet */
.profileCenter { position:absolute; left:102px; top:62px; width:321px; height:444px; }
Expand Down Expand Up @@ -103,7 +103,7 @@ a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important
.character-stats i{ float:right; font:14px Georgia; color:#6d420f; padding-right:13px; margin-top:-3px;}
.character-stats .mod { color:#446d0f; }
.character-stats .moddown{ color:#ff0000; }
.stack1 em,.stack2 em,.stats1 em, .stats2 em{position:absolute;height:3px;width:3px;display:block;background-image:url('../../images/toggle_btns.jpg)pc1.gif');background-repeat:no-repeat;}
.stack1 em,.stack2 em,.stats1 em, .stats2 em{position:absolute;height:3px;width:3px;display:block;background-image:url('../../images/pc1.gif');background-repeat:no-repeat;}
.mod{ color:#7EFF00; }

.char-profile_stats h4 { color:#815f3e; font-size:14px; clear:both; padding:15px 0 4px 0; margin:0; }
Expand All @@ -117,8 +117,8 @@ a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important
.char-profile_stats .achRight .achPointsLink, .profileCenter .achRight .achPointsLink:visited { text-decoration: none; display: block; color: #FFD200; font-weight: bold; margin: 8px 0 0; padding: 0 10px 0; font-size: 14px; }


.achieve-bar{line-height: 14px !important; width: 170px; margin: 12px 0 6px 4px; text-align:center;color:white;padding:0;height:16px; border:1px solid black;background:url('../../images/toggle_btns.jpg)bar-grey.gif') repeat-x;}
.achieve-bar b{height:16px;margin:0;padding:0; background:url('../../images/toggle_btns.jpg)bar-life.gif') repeat-x; white-space: nowrap; float: left; }
.achieve-bar{line-height: 14px !important; width: 170px; margin: 12px 0 6px 4px; text-align:center;color:white;padding:0;height:16px; border:1px solid black;background:url('../../images/bar-grey.gif') repeat-x;}
.achieve-bar b{height:16px;margin:0;padding:0; background:url('../../images/bar-life.gif') repeat-x; white-space: nowrap; float: left; }
.achieve-bar .progressTxt { position: absolute; left: 5px; top: 57px; display: inline; float: left;}


Expand Down Expand Up @@ -154,21 +154,21 @@ a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important
.drop-stats a{display:block;width:100%;padding:0 0 0 4px;color:white !important;text-decoration:none}
.drop-stats .tooltip{width:170px !important}
.drop-stats a img{width:21px;height:13px;margin:1px 0 0 3px;border:0}
.drop-stats a:hover{color:white;background:url('../../images/toggle_btns.jpg)UI-Listbox-Highlight.png') no-repeat}
.drop-stats a:hover{color:white;background:url('../../images/UI-Listbox-Highlight.png') no-repeat}

.dropdown1,.stats1{float:left}
.dropdown2,.stats2{float:right}
.buffs li,.debuffs li{width:21px !important;height:21px !important;padding:1px 0}
.buffs li img,.debuffs li img{height:21px;width:21px;position:relative;left:0}
.debuffs li p{background:url('../../images/toggle_btns.jpg)icons/debuff.png') no-repeat 0 0;height:24px;width:24px;position:absolute;left:-1px;top:3px;cursor:default !important}
.debuffs li p:hover{background:url('../../images/toggle_btns.jpg)icons/debuff.png') no-repeat 0 0}
.debuffs li p{background:url('../../images/icons/debuff.png') no-repeat 0 0;height:24px;width:24px;position:absolute;left:-1px;top:3px;cursor:default !important}
.debuffs li p:hover{background:url('../../images/icons/debuff.png') no-repeat 0 0}
.icon-holy,.icon-fire,.icon-nature,.icon-arcane,.icon-frost,.icon-shadow{height:14px;line-height:14px;padding-left:21px}
.icon-holy{background:url('../../images/toggle_btns.jpg)icons/icon-holy.gif') 0 center no-repeat}
.icon-fire{background:url('../../images/toggle_btns.jpg)icons/icon-fire.gif') 0 center no-repeat}
.icon-nature{background:url('../../images/toggle_btns.jpg)icons/icon-nature.gif') 0 center no-repeat}
.icon-arcane{background:url('../../images/toggle_btns.jpg)icons/icon-arcane.gif') 0 center no-repeat}
.icon-frost{background:url('../../images/toggle_btns.jpg)icons/icon-frost.gif') 0 center no-repeat}
.icon-shadow{background:url('../../images/toggle_btns.jpg)icons/icon-shadow.gif') 0 center no-repeat}
.icon-holy{background:url('../../images/icons/icon-holy.gif') 0 center no-repeat}
.icon-fire{background:url('../../images/icons/icon-fire.gif') 0 center no-repeat}
.icon-nature{background:url('../../images/icons/icon-nature.gif') 0 center no-repeat}
.icon-arcane{background:url('../../images/icons/icon-arcane.gif') 0 center no-repeat}
.icon-frost{background:url('../../images/icons/icon-frost.gif') 0 center no-repeat}
.icon-shadow{background:url('../../images/icons/icon-shadow.gif') 0 center no-repeat}

.checkmark{vertical-align:top}
.stack1,.stack2,.stack3,.stack4{width:365px;margin:0 auto;position:relative}
Expand All @@ -177,7 +177,7 @@ a.upgrd, a.upgrd:visited{ text-decoration: none !important; margin: 0 !important
.stack2{height:50px}
.stack3{height:132px}
.stack4{height:70px}
.stack1 em,.stack2 em,.stack3 em, .achRight em, .brownBox em{position:absolute;height:3px;width:3px;display:block;background-image:url('../../images/toggle_btns.jpg)pc1.gif') !important;background-repeat:no-repeat;}
.stack1 em,.stack2 em,.stack3 em, .achRight em, .brownBox em{position:absolute;height:3px;width:3px;display:block;background-image:url('../../images/pc1.gif') !important;background-repeat:no-repeat;}
.resists,.profs,.stack2,.stats1,.stats2, .achRight, .brownBox{ position:relative;cursor:default}

.last_modified { color:#a98128; font-size:14px; font-style:italic; padding:15px 30px; clear:both }
Expand Down Expand Up @@ -279,17 +279,17 @@ a.more_char_act:hover { background-position:-18px -210px; }
.under10{width:550px;margin:0 auto;}
.under10 table{width:495px !important}
.under10 .bonus-stats{margin:0px 0 10px -10px;width:459px !important}
.kids{height:352px;width:497px;background:url('../../images/toggle_btns.jpg)kids.jpg') no-repeat;z-index:90;position:relative}
.kids{height:352px;width:497px;background:url('../../images/kids.jpg') no-repeat;z-index:90;position:relative}
.kids h2{position:absolute;top:119px;left:-39px;width:564px;height:131px}
.kids h2 span{display:none}
.kids .levelBar-wrapper{position:absolute;top:-10px;right:-101px;width:71px;height:387px}
.levelBar-wrapper div{height:387px;width:23px;position:relative}
.levelBar-wrapper div a{display:block;width:21px;position:absolute;bottom:2px;left:2px;height:75%;background:url('../../images/toggle_btns.jpg)kidbar-tile.gif') repeat-y}
.levelBar-wrapper div a{display:block;width:21px;position:absolute;bottom:2px;left:2px;height:75%;background:url('../../images/kidbar-tile.gif') repeat-y}

/* arena/pvp */
.arena-ranking{padding:8px 8px 5px 8px;;}
.arena-ranking h2{clear:both;height:25px;line-height:25px !important;margin:0;padding:0 0 0 6px;background:url(../../images/achievetitle-bg.jpg) #f1db91 0 0 repeat-y;color:#f2e09a;font:18px 'Trebuchet MS',Arial,Helvetica,sans-serif;text-transform:uppercase}
.arena-ranking h2 a:link,.arena-ranking h2 a:hover,.arena-ranking h2 a:visited,.arena-ranking h2 a:active{float:right;position:relative;color:#005ba1;font:11px 'Trebuchet MS',Arial,Helvetica,sans-serif;display:block;height:25px;line-height:25px;text-transform:none;background:url('../../images/toggle_btns.jpg)more-arrow.gif') 100% 50% no-repeat;padding-right:21px}
.arena-ranking h2 a:link,.arena-ranking h2 a:hover,.arena-ranking h2 a:visited,.arena-ranking h2 a:active{float:right;position:relative;color:#005ba1;font:11px 'Trebuchet MS',Arial,Helvetica,sans-serif;display:block;height:25px;line-height:25px;text-transform:none;background:url('../../images/more-arrow.gif') 100% 50% no-repeat;padding-right:21px}
.arena-ranking h3{margin:0 0 3px 0;padding:0 0 0px 6px;text-transform:uppercase;color:#847240;font-size:12px;background:url('../../images/achievetitle-bg.jpg') #f0da8d -250px 100% repeat-y;}
.arena-ranking h3 strong{color:#533A00}

Expand Down
14 changes: 7 additions & 7 deletions _js/armory.js
Expand Up @@ -282,9 +282,9 @@ function menuCheckLength(formReference){

function goToPropass() {
if (getcookie2("armory.cookiePropassBG"))
document.location.href = "/arena-ladder.xml?b="+encodeURI(getcookie2("armory.cookiePropassBG")) + "&ts=3";
document.location.href = "arena-ladder.xml?b="+encodeURI(getcookie2("armory.cookiePropassBG")) + "&ts=3";
else
document.location.href = "/battlegroups.xml#tournament";
document.location.href = "battlegroups.xml#tournament";
}

function fixReportLink(linkId, siteUrl){
Expand Down Expand Up @@ -738,7 +738,7 @@ function getTipHTML(itemID, itemWithTip, mouseEvent)
//get the stylesheet
var xslDoc = Sarissa.getDomDocument();
xslDoc.async = false;
xslDoc.load("/_layout/items/tooltip.xsl");
xslDoc.load("_layout/items/tooltip.xsl");

xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xslDoc);
Expand All @@ -754,7 +754,7 @@ function getTipHTML(itemID, itemWithTip, mouseEvent)
setTipText(tLoading+"...");
setToolTipPosition(itemWithTip,mouseEvent);

var urlstr = "/item-tooltip.xml?i="+itemID;
var urlstr = "item-tooltip.xml?i="+itemID;

$.ajax({
type: "GET",
Expand Down Expand Up @@ -921,13 +921,13 @@ function ajaxBookmarkChar(){
if(asyncType == true){
$("#profileRight")[0].innerHTML = "<div class=\"bmcEnabled\"></div>";
}
buildBookmarkMenu("/vault/bookmarks.xml?" + charUrl + "&action=1");
buildBookmarkMenu("bookmarks.xml?" + charUrl + "&action=1");
}

//removes a bookmarked character from the drop down list
function ajaxRemoveChar(removedLink, clickedItem){
function ajaxRemoveChar(removedLink, clickedItem){
$(theGlobalToolTip).hide(); //hide tooltip
buildBookmarkMenu("/vault/bookmarks.xml?" + removedLink + "&action=2");
buildBookmarkMenu("bookmarks.xml?" + removedLink + "&action=2");
}


Expand Down
66 changes: 66 additions & 0 deletions bookmarks.php
@@ -0,0 +1,66 @@
<?php
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 49
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**/

define('__ARMORY__', true);

if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> can not load main system files!');
}

if(!isset($_SESSION['accountId'])) {
header('Location: login.xml');
exit;
}

if(isset($_GET['action'])) {
if(isset($_GET['cn'])) {
$name = $_GET['cn'];
}
elseif(isset($_GET['n'])) {
$name = $_GET['n'];
}
else {
$name = false;
}
$guid = $armory->cDB->selectCell("SELECT `guid` FROM `characters` WHERE `name`=? LIMIT 1", $name);
switch($_GET['action']) {
case 1: // Add new character bookmark
if($guid) {
$armory->aDB->query("INSERT IGNORE INTO `character_bookmarks` (`account`, `guid`) VALUES (?, ?)", $_SESSION['accountId'], $guid);
}
break;
case 2: // Delete character bookmark
if($guid) {
$armory->aDB->query("DELETE FROM `character_bookmarks` WHERE `account`=? AND `guid`=? LIMIT 1", $_SESSION['accountId'], $guid);
}
break;
}
}
if(isset($_SERVER['HTTP_REFERER'])) {
$urlReturn = $_SERVER['HTTP_REFERER'];
}
else {
$urlReturn = 'character-sheet.xml?r='.$armory->armoryconfig['defaultRealmName'].'&amp;n='.$name;
}
header('Location: '.$urlReturn);
?>
45 changes: 27 additions & 18 deletions character-select-submit.php
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 37
* @revision 49
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -28,24 +28,33 @@
die('<b>Fatal error:</b> can not load main system files!');
}

/** Profile functions are in development! **/

if(isset($_GET['n2'])) {
$guid = $armory->cDB->selectCell("SELECT `guid` FROM `characters` WHERE `name`=? AND `account`=?", $_GET['n2'], $_SESSION['accountId']);
$armory->aDB->query("DELETE FROM `login_characters` WHERE `guid`=? AND `account`=?", $guid, $_SESSION['accountId']);
if(!isset($_SESSION['accountId'])) {
header('Location: login.xml');
exit;
}
elseif(isset($_GET['n4'])) {
$num = $armory->aDB->selectCell("SELECT MAX(`num`) FROM `login_characters` WHERE `account`=?", $_SESSION['accountId']);
if($num == 3) {
exit();

if(isset($_GET['action'])) {
switch($_GET['action']) {
case 'add':
if(!$armory->aDB->selectCell("SELECT `guid` FROM `login_characters` WHERE `name`=? AND `account`=? LIMIT 1", $_GET['name'], $_SESSION['accountId'])) {
if($data = $armory->cDB->selectRow("SELECT `guid`, `account`, `name`, `level`, `race`, `class`, `gender` FROM `characters` WHERE `name`=? AND `account`=? LIMIT 1", $_GET['name'], $_SESSION['accountId'])) {
$data['selected'] = 0;
$armory->aDB->query("INSERT IGNORE INTO `login_characters` (?#) VALUES (?a)", array_keys($data), array_values($data));
}
}
break;
case 'delete':
if($data = $armory->aDB->selectCell("SELECT `guid` FROM `login_characters` WHERE `name`=? AND `account`=? LIMIT 1", $_GET['name'], $_SESSION['accountId'])) {
$armory->aDB->query("DELETE FROM `login_characters` WHERE `name`=? AND `account`=? LIMIT 1", $_GET['name'], $_SESSION['accountId']);
}
break;
case 'setmain':
if($data = $armory->aDB->selectCell("SELECT `guid` FROM `login_characters` WHERE `name`=? AND `account`=? LIMIT 1", $_GET['name'], $_SESSION['accountId'])) {
$armory->aDB->query("UPDATE `login_characters` SET `selected`=0 WHERE `account`=?", $_SESSION['accountId']);
$armory->aDB->query("UPDATE `login_characters` SET `selected`=1 WHERE `name`=? AND `account`=?", $_GET['name'], $_SESSION['accountId']);
}
break;
}
$charInfo = $armory->cDB->selectRow("
SELECT `account`, `guid`, `name`, `class`, `race`, `gender`, `level`
FROM `characters`
WHERE `account`=? AND `name`=? LIMIT 1", $_SESSION['accountId'], $_GET['n4']);
$charInfo['num'] = $num+1;
$charInfo['selected'] = 0;
$armory->aDB->query("INSERT INTO `login_characters` (?#) VALUES (?a)", array_keys($charInfo), array_values($charInfo));
}
exit();
header('Location: character-select.xml');
?>

0 comments on commit 9de16cf

Please sign in to comment.