Ejemplo n.º 1
0
function getRoleMessageMostBehind($MYSQL, $PARAMS, $MEMBER_ID, $MEETING_MEMBERSHIP_ID)
{
    if (!($MEMBER_ID > 0) || !($MEETING_MEMBERSHIP_ID > 0)) {
        return "";
    }
    // 부족한 롤을 맡도록 권하는 메시지를 보여줍니다.
    $MEETING_MEMBERSHIP_ID = intval($WHAT_I_AM_JESSIE->__membership_id);
    $MOST_BEHIND_ROLE_LIST = array();
    $MOST_ADVANCED_ROLE_ID = -1;
    $MSG_ABOUT_MOST_BEHIND_ROLE = "";
    $MSG_RECOMMEND_ROLE = array("<span style=\"color:#FFF;\">Why don't you take {$PARAMS->REPLACE_ME} on next meeting?</span>", "<span style=\"color:#FFF;\">It would be perfect time to be {$PARAMS->REPLACE_ME} oncoming meeting!</span>", "<span style=\"color:#FFF;\">It is the right time for being " . $PARAMS->REPLACE_ME . "!</span>");
    $MSG_RECOMMEND = getRandomElement($MSG_RECOMMEND_ROLE);
    // 1. 스피치 기록
    $role_id_speaker = 111;
    $role_history = $MYSQL->get_speech_history($MEETING_MEMBERSHIP_ID, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>speaker</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_speaker"] = $MSG;
    // 2. 이벨류에이터 기록
    $role_id_evaluator = 222;
    $role_history = $MYSQL->get_evaluation_history($MEETING_MEMBERSHIP_ID, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "an <strong>evaluator</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_evaluator"] = $MSG;
    // 3. 롤별 기록
    // 3-1. TOAST MASTER
    $role_id_toastmaster = 2;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_toastmaster, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>toastmaster</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_toastmaster"] = $MSG;
    // 3-2. WORD & QUOTE MASTER
    $role_id_word_n_quote_master = 4;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_word_n_quote_master, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>word & quote master</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_word_quote_master"] = $MSG;
    // 3-3. TABLE TOPIC MASTER
    $role_id_table_topic_master = 5;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_table_topic_master, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>table topic master</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_table_topic_master"] = $MSG;
    // 3-4. MINI DEBATE MASTER
    $role_id_mini_debate_master = 6;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_mini_debate_master, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>mini debate master</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_mini_debate_master"] = $MSG;
    // 3-5. GENERAL EVALUATOR
    $role_id_general_evaluator = 7;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_general_evaluator, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>general evaluator</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_general_evaluator"] = $MSG;
    // 3-6. GRAMMARIAN
    $role_id_grammarian = 11;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_grammarian, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>grammarian</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_grammarian"] = $MSG;
    // 3-7. AH COUNTER
    $role_id_ah_counter = 10;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_ah_counter, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>ah counter</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_ah_counter"] = $MSG;
    // 3-8. TIMER
    $role_id_timer = 9;
    $role_history = $MYSQL->get_role_history($MEETING_MEMBERSHIP_ID, $role_id_timer, $MEMBER_ID);
    $cur_role_cnt = COUNT($role_history);
    $MSG = str_replace($PARAMS->REPLACE_ME, "a <strong>timer</strong>", $MSG_RECOMMEND);
    $MSG_ARR[$cur_role_cnt . "_timer"] = $MSG;
    // SORT BY CNT DESC
    ksort($MSG_ARR);
    // flat the key value array
    $MSG_ARR_FLAT = array_values($MSG_ARR);
    // 랜덤으로 엘리먼트 하나 가져오기.
    $MSG_SELECTED = getRandomElement($MSG_ARR_FLAT, 3);
    return $MSG_SELECTED;
}
Ejemplo n.º 2
0
function generateServerName($nouns, $adjectives)
{
    return getRandomElement($adjectives) . " " . getRandomElement($nouns);
}
function generateServerName($adjectives, $nouns)
{
    $serverName = "Your new server's name is: " . getRandomElement($adjectives) . "-" . getRandomElement($nouns) . " !";
    return $serverName;
}