Imported AoWoW.

This version of AoWoW is based on https://github.com/udw/udwbase and is
not yet usable.

An initial amount of testing has been finished, and you can import the
aowow.sql database into your world database, and create a local copy of
config.php.in as config.php to test this version.

FirePHP (http://firephp.org/) has been added for testing purposes.

Signed-off-by: TheLuda <theluda@getmangos.com>
This commit is contained in:
TheLuda
2011-09-25 20:57:24 +02:00
parent 0fab20e9d4
commit 947f95fb20
12244 changed files with 102011 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
/*
* UDWBase: WOWDB Web Interface
*
* © UDW 2009-2011
*
* Released under the terms and conditions of the
* GNU General Public License (http://gnu.org).
*
*/
require_once('includes/game.php');
/**
*
* @param type $type
* @param type $typeid
* @return int
*/
function getcomments($type, $typeid) {
global $DB;
global $rDB;
$rows = $DB->select('
SELECT id, userid, post_date, commentbody, replyto
FROM ?_aowow_comments
WHERE type=? AND typeid=?
ORDER BY replyto, post_date
', $type, $typeid
);
$comments = array();
foreach ($rows as $i => $row) {
$comments[$i] = array();
$comments[$i] = $rDB->selectRow('SELECT username as user, gmlevel as roles FROM ?_account WHERE id=? LIMIT 1', $row['userid']);
if (!(IsSet($comments[$i]['user'])))
$comments[$i]['user'] = "Anonymous";
$comments[$i]['number'] = $i;
$comments[$i]['id'] = $row['id'];
$comments[$i]['body'] = $row['commentbody'];
$comments[$i]['date'] = $row['post_date'];
$comments[$i]['replyto'] = $row['replyto'];
if ($comments[$i]['replyto'] != $comments[$i]['id'])
$comments[$i]['indent'] = 1;
$comments[$i]['raters'] = array();
$comments[$i]['raters'] = $DB->select('SELECT userid, rate FROM ?_aowow_comments_rates WHERE commentid=?d', $comments[$i]['id']);
$comments[$i]['rating'] = sum_subarrays_by_key($comments[$i]['raters'], 'rate');
$comments[$i]['purged'] = ($comments[$i]['rating'] <= -50) ? 1 : 0;
$comments[$i]['deleted'] = 0;
}
return $comments;
}