function Check_ShowForumRows($info) { global $str_len; if ($str_len($info['t_name']) > $this->threadtitlelength) { $info['t_name'] = awcsforum_funcs::awc_shorten($info['t_name'], $this->threadtitlelength) . "..."; } if ($info['user']) { $info['user'] = "******" . awcsforum_funcs::awcforum_url('mem_profile/' . $info['user'] . '/' . $info['userid']) . "'>" . $info['user'] . "</a>"; } if (isset($info['search_words'])) { $info['thread_url'] = awcsforum_funcs::awcforum_url('st/id' . $info['t_id'] . $info['search_words']); } else { $info['thread_url'] = awcsforum_funcs::awcforum_url('st/id' . $info['t_id'] . '/' . str_replace(array('>', '<'), ' ', $info['t_name'])) . $this->html_ext; } $classID = "row_info"; $info['indicator_lock_sticky_ann'] = null; if (isset($info['locked']) and $info['locked'] == "1") { $info['indicator_lock_sticky_ann'] = $this->words['locked'] . ' '; //$info['row_class'] = 'locked_thread' ; } if (isset($info['sticky']) and $info['sticky'] == "1") { $info['indicator_lock_sticky_ann'] = $this->words['sticky'] . ' '; $info['row_class'] = 'sticky'; } if (isset($info['sticky']) and isset($info['locked'])) { if ($info['sticky'] == "1" and $info['locked'] == "1") { $info['indicator_lock_sticky_ann'] = $this->words['locked_sticky'] . ' '; $info['row_class'] = 'sticky'; } } if (isset($info['poll']) and $info['poll'] == "1") { $info['indicator_lock_sticky_ann'] = $this->words['poll'] . ' '; $info['row_class'] = 'poll_thread_listing'; } return $info; }
function process_all_cats($cats, $children, $cat_link = null) { global $tplt; $outHTML = null; $word_guest = get_awcsforum_word('word_guest'); $word_header = array('topics' => get_awcsforum_word('word_topics'), 'replies' => get_awcsforum_word('word_replies'), 'forum_last_post' => get_awcsforum_word('forum_last_post')); foreach ($cats as $cat_id => $cat_data) { $html = $tplt->phase('', '', 'cat_open_table'); $info['AdminEdit'] = UserPerm == 10 ? '<a href="' . awc_url . 'admin/cat/get_cat_id_edit/' . $cat_data['id'] . '">*</a> | ' : null; $info['title'] = '<a href="' . awc_url . 'sc/id' . $cat_data['id'] . '/' . rawurlencode(str_replace('/', ' ', $cat_data['name'])) . $this->html_ext . '">' . $cat_data['name'] . '</a>'; if ($cat_link != null) { $info['title'] = $cat_data['name']; } $html .= $tplt->phase($word_header, $info, 'cat_header'); foreach ($children as $forum_id => $c) { if ($c['f_parentid'] == $cat_id) { if ($this->show_guest_ip == '0' and $c['f_lastuserid'] == '0' and UserPerm < 2) { $c['f_lastuser'] = $word_guest; } $c['last_title'] = awcsforum_funcs::awc_html_entity_decode($c['f_lasttitle']); $last_title = $c['last_title']; if (isset($c['last_title'][$this->MaxTitleCol])) { $c['last_title'] = awcsforum_funcs::awc_shorten($c['last_title'], $this->MaxTitleCol) . "..."; } $c['last_date'] = $c['f_lastdate'] != '0000-00-00 00:00:00' ? awcsforum_funcs::convert_date($c['f_lastdate'], "s") : ' '; $c['mem_link'] = awcsforum_funcs::awcforum_url('mem_profile/' . $c['f_lastuser'] . '/' . $c['f_lastuserid']); $c['AdminEditLink'] = UserPerm == 10 ? '<a href="' . awc_url . 'admin/forum/get_forum_id_edit/' . $c['f_id'] . '">*</a> | ' : null; $c['forum_link'] = awc_url . 'sf/id' . $c['f_id'] . '/' . rawurlencode(str_replace('/', ' ', $c['f_name'])) . $this->html_ext; # die($last_title); $c['last_thread_link'] = awc_url . 'last_post/id' . $c['f_threadid'] . '/' . rawurlencode(str_replace('/', ' ', $last_title)) . $this->html_ext; $html .= $tplt->phase('', $c, 'cat_list_forums_rows'); } } $html .= $tplt->phase('', '', 'cat_close_table'); $outHTML .= $html; } $tplt->kill('cat_open_table'); $tplt->kill('cat_close_table'); $tplt->kill('cat_list_forums_rows'); unset($word_header, $c, $info); return $outHTML; }
function getPMoptions() { global $wgOut, $awc, $awcs_forum_config; Set_AWC_Forum_SubTitle(get_awcsforum_word('mem_memCP'), $this->membername); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('mem_pm_option'), true); $m_pmautoquote = isset($this->mem_info['m_pmoptions']['m_pmautoquote']) ? $this->mem_info['m_pmoptions']['m_pmautoquote'] == '1' ? 'checked' : '' : ''; $m_pmautosave = isset($this->mem_info['m_pmoptions']['m_pmautosave']) ? $this->mem_info['m_pmoptions']['m_pmautosave'] == '1' ? 'checked' : '' : ''; $m_pmnewemail = isset($this->mem_info['m_pmoptions']['m_pmnewemail']) ? $this->mem_info['m_pmoptions']['m_pmnewemail'] == '1' ? 'checked' : '' : ''; $m_pmpop = isset($this->mem_info['m_pmoptions']['m_pmpop']) ? $this->mem_info['m_pmoptions']['m_pmpop'] == '1' ? 'checked' : '' : ''; $m_pm_text_in_email = isset($this->mem_info['m_pmoptions']['m_pm_text_in_email']) ? $this->mem_info['m_pmoptions']['m_pm_text_in_email'] == '1' ? 'checked' : '' : ''; $html = '<form action="' . awcsforum_funcs::awcforum_url('member_options/savePMoptions') . '" method="post">'; $html .= '<INPUT TYPE=CHECKBOX NAME="m_pmautoquote" ' . $m_pmautoquote . '> ' . get_awcsforum_word('mem_pm_autoquote') . "<br />"; $html .= '<INPUT TYPE=CHECKBOX NAME="m_pmautosave" ' . $m_pmautosave . '> ' . get_awcsforum_word('mem_pm_autosave') . "<br />"; $html .= '<INPUT TYPE=CHECKBOX NAME="m_pmnewemail" ' . $m_pmnewemail . '> ' . get_awcsforum_word('mem_pm_newemail') . "<br />"; if (isset($awcs_forum_config->cf_send_pm_body_in_email) && $awcs_forum_config->cf_send_pm_body_in_email == '1') { $html .= '<INPUT TYPE=CHECKBOX NAME="m_pm_text_in_email" ' . $m_pm_text_in_email . '> ' . get_awcsforum_word('mem_send_pm_body_in_email') . "<br />"; } $html .= '<INPUT TYPE=CHECKBOX NAME="m_pmpop" ' . $m_pmpop . '> ' . get_awcsforum_word('mem_pm_newpop') . "<br />"; $html .= '<br /><hr><input type="submit" value="' . get_awcsforum_word('submit') . '"></form><br /><hr>'; self::display_memcp($html); }
function sendpm($to_name, $title, $msg, $save_sent = false, $sendto_names = null) { global $wgUser, $wgOut, $wgPasswordSender, $IP, $awc_tables, $awcs_forum_config; // awcsforum_funcs::get_page_lang(array('lang_txt_mem')); /* if ( !file_exists($IP . '/includes/AutoLoader.php')){ require($IP . "/includes/UserMailer.php"); } */ $sender_name = $wgUser->mName; $sender_id = $wgUser->mId; $send_msg_text = false; if (isset($awcs_forum_config->cf_send_pm_body_in_email) and $awcs_forum_config->cf_send_pm_body_in_email == '1') { $send_msg_text = true; } $user_get = array(); $user_get[] = 'm_id'; $dbw = wfGetDB(DB_MASTER); $date_seperated = $dbw->timestamp(); $pm_count = null; $to_address = array(); /* set up email stuff here so its not included in the loop */ $send_title = get_awcsforum_word('mem_pm_email_newpmawaiting') . ' ' . $title; $send_body = get_awcsforum_word('mem_pm_email_newpmawaitingbody'); $send_body .= " \n" . $sender_name; $send_body .= " \n\n <a href='" . awcsforum_funcs::awcforum_url('member_options/pminbox') . "'>" . awcsforum_funcs::awcforum_url('member_options/pminbox') . "</a> \n\r\n\r"; require_once awc_dir . 'send_mail.php'; $html = true; if ($awcs_forum_config->cf_send_email_html == '0') { $html = false; } foreach ($to_name as $id => $send_to_info) { $pm_count++; if ($pm_count == 1) { #$bs = $dbw->nextSequenceValue( 'awc_f_pms_pm_id_seq' ); $dbw->insert('awc_f_pms', array('pm_title' => $title, 'pm_text' => $msg)); $pm_id = awcsforum_funcs::lastID($dbw, 'awc_f_pms', 'pm_id'); } $dbw->insert('awc_f_pms_info', array('pmi_pmid' => $pm_id, 'pmi_sender' => $sender_name, 'pmi_sender_id' => $sender_id, 'pmi_receipt_id' => $send_to_info['id'], 'pmi_receipt' => $sendto_names, 'pmi_send_date' => $date_seperated)); # $mem = GetMemInfo($id, $user_get); # if(isset($mem['name'])){ # awc_pdie($wgUser->mId); if ($send_to_info['forum_username'] != 'no_name' or $send_to_info['id'] == $wgUser->mId) { $dbw->query("UPDATE {$awc_tables['awc_f_mems']} \n SET m_pmtotal = m_pmtotal + 1,\n m_pmunread = m_pmunread + 1, \n m_pminbox = m_pminbox + 1,\n m_pmpop = '1'\n WHERE m_id =" . $send_to_info['id']); } else { $dbw->insert('awc_f_mems', array('m_id' => $send_to_info['id'], 'm_idname' => $send_to_info['name'], 'm_pmtotal' => '1', 'm_pmunread' => '1', 'm_pminbox' => '1', 'm_pmpop' => '1')); } /* @changeVer 2.5.8 */ if (isset($send_to_info['email']) && !empty($send_to_info['email']) && $send_to_info['email'] != 'no_email') { $to_address[] = new MailAddress($send_to_info['email']); if ($send_to_info['pass_pm_text'] == '1' and $send_msg_text) { $send_body .= "\n\r\n\r" . awcsforum_mailer::check_msg_len($msg, 0); } awcsforum_mailer::send_mail($to_address, $send_title, $send_body, $html); } } if ($save_sent) { $dbw->insert('awc_f_pms_info', array('pmi_pmid' => $pm_id, 'pmi_sender' => $sender_name, 'pmi_sender_id' => $sender_id, 'pmi_receipt_id' => $sender_id, 'pmi_receipt' => $sendto_names, 'pmi_send_date' => $date_seperated, 'pmi_folder_id' => '1', 'pmi_read_date' => $date_seperated, 'pmi_read' => '1')); $mem = GetMemInfo($id, $user_get); if (isset($mem['name'])) { $dbw->query("UPDATE {$awc_tables['awc_f_mems']} \n SET m_pmtotal = m_pmtotal + 1,\n m_pmsent = m_pmsent + 1\n WHERE m_id =" . $sender_id); } else { $dbw->insert('awc_f_mems', array('m_id' => $sender_id, 'm_idname' => $wgUser->mName, 'm_pmtotal' => '1', 'm_pmsent' => '1')); } } $wgOut->redirect(awc_url . 'member_options/pminbox'); }