function newpoints_hello_world($page) { global $mybb, $lang; if ($mybb->settings['newpoints_hello_show'] != 1) { return; } // load language files newpoints_lang_load('newpoints_hello'); $page = str_replace("<!-- end: header -->", "<!-- end: header -->" . $lang->newpoints_hello_message, $page); return $page; }
function newpoints_shop_admin_stats() { global $form, $db, $lang, $mybb; newpoints_lang_load("newpoints_shop"); echo "<br />"; // table $table = new Table(); $table->construct_header($lang->newpoints_shop_item, array('width' => '30%')); $table->construct_header($lang->newpoints_shop_username, array('width' => '30%')); $table->construct_header($lang->newpoints_shop_price, array('width' => '20%', 'class' => 'align_center')); $table->construct_header($lang->newpoints_shop_date, array('width' => '20%', 'class' => 'align_center')); $query = $db->simple_select('newpoints_log', '*', 'action=\'shop_purchase\'', array('order_by' => 'date', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_shop_lastpurchases']))); while ($stats = $db->fetch_array($query)) { $data = explode('-', $stats['data']); $item = newpoints_shop_get_item($data[0]); $table->construct_cell(htmlspecialchars_uni($item['name'])); $link = build_profile_link(htmlspecialchars_uni($stats['username']), intval($stats['uid'])); $table->construct_cell($link); $table->construct_cell(newpoints_format_points($data[1]), array('class' => 'align_center')); $table->construct_cell(my_date($mybb->settings['dateformat'], intval($stats['date']), '', false) . ", " . my_date($mybb->settings['timeformat'], intval($stats['date'])), array('class' => 'align_center')); $table->construct_row(); } if ($table->num_rows() == 0) { $table->construct_cell($lang->newpoints_error_gathering, array('colspan' => 4)); $table->construct_row(); } $table->output($lang->newpoints_stats_lastpurchases); }
function load_language() { global $lang; isset($lang->newpoints_buy_sticky) or newpoints_lang_load('newpoints_buy_sticky'); }