Пример #1
0
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version 1.4.1
 * @author Sajaki
 *
 */
if (!defined('IN_PHPBB')) {
    exit;
}
/**  begin recruitment block ***/
$template->assign_block_vars('status', array('MESSAGE' => $user->lang['RECRUIT_MESSAGE']));
// Include the abstract base
if (!class_exists('\\bbdkp\\controller\\guilds\\Recruitment')) {
    require "{$phpbb_root_path}includes/bbdkp/controller/guilds/Recruitment.{$phpEx}";
}
$color = array(array(0, $user->lang['CLOSED'], "#AAAAAA", "rec_closed.png"), array(1, $user->lang['LOW'], "#FFBB44", "rec_low.png"), array(2, $user->lang['MEDIUM'], "#FF3300", "rec_med.png"), array(3, $user->lang['HIGH'], "#AA00AA", "rec_high.png"));
$recruit = new \bbdkp\controller\guilds\Recruitment();
$guildrecruitingresult = $recruit->get_recruiting_guilds();
$this->apply_installed = false;
$plugin_versioninfo = (array) parent::get_plugin_info(request_var('versioncheck_force', false));
if (isset($plugin_versioninfo['apply'])) {
    $this->apply_installed = true;
}
while ($row = $db->sql_fetchrow($guildrecruitingresult)) {
    $guild_id = $row['id'];
    $template->assign_block_vars('guild', array('EMBLEM' => $row['emblemurl'], 'NAME' => $row['name'], 'S_CLOSED' => $row['rec_status'] == 0 ? true : false));
    $recruit->setGuildId($guild_id);
    $Guild = new \bbdkp\controller\guilds\Guilds();
    $Guild->guildid = $guild_id;
    $Guild->Getguild();
    $blockresult = $recruit->ListRecruitments(1);
    while ($row = $db->sql_fetchrow($blockresult)) {
Пример #2
0
 /**
  * list the recruitments
  * @param $guild_id
  *
  */
 private function BuildTemplateListRecruits($guild_id)
 {
     global $user, $template, $phpbb_root_path, $phpbb_admin_path, $phpEx, $db;
     if (count($this->games) == 0) {
         trigger_error($user->lang['ERROR_NOGAMES'], E_USER_WARNING);
     }
     $recruits = new \bbdkp\controller\guilds\Recruitment();
     $recruits->setGuildId($guild_id);
     $result = $recruits->ListRecruitments(1);
     $recruit_count = 0;
     while ($row = $db->sql_fetchrow($result)) {
         $recruit_count++;
         $template->assign_block_vars('recruit_row', array('ID' => $row['id'], 'GUILD_ID' => $row['guild_id'], 'ROLE_ID' => $row['role_id'], 'CLASS_ID' => $row['class_id'], 'CLASS_NAME' => $row['class_name'], 'COLOR_CODE' => $row['colorcode'], 'CLASS_IMAGE' => $row['imagename'], 'S_CLASS_IMAGE_EXISTS' => strlen($row['imagename']) > 1 ? true : false, 'CLASS_IMAGE' => strlen($row['imagename']) > 1 ? $phpbb_root_path . "images/bbdkp/class_images/" . $row['imagename'] . ".png" : '', 'POSITIONS' => $row['positions'], 'APPLICANTS' => $row['applicants'], 'STATUS' => $row['status'] == '1' ? $user->lang['RECRUIT_OPEN'] : $user->lang['RECRUIT_CLOSED'], 'NOTE' => $row['note'], 'ROLE_COLOR' => $row['role_color'], 'ROLE_NAME' => $row['role_name'], 'APPLYTEMPLATE_ID' => $row['applytemplate_id'], 'U_DELETE_RECRUIT' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=dkp_recruit&mode=addrecruit&action=delete&id=' . $row['id']), 'U_VIEW_RECRUIT' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=dkp_recruit&mode=addrecruit&action=edit&id=' . $row['id'])));
     }
     // if apply is installed insert an extra column in recruitment listing to indicate the template to be used for that recruitment.
     $template->assign_vars(array('RECRUIT_FOOTCOUNT' => sprintf($user->lang['RECRUIT_FOOTCOUNT'], $recruit_count)));
     $this->page_title = 'ACP_LISTRECRUITS';
 }