Example #1
0
 function qry($mb_id)
 {
     if (!IS_MEMBER) {
         alert_close("회원만 이용하실 수 있습니다.");
     }
     $member = unserialize(MEMBER);
     if (!$member['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
         alert_close("자신의 정보를 공개하지 않으면 다른분의 정보를 조회할 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.");
     }
     $mb = $this->Basic_model->get_member($mb_id, "mb_id, mb_level, mb_point, mb_homepage, mb_open, mb_nick, mb_datetime, mb_today_login, mb_profile");
     if (!isset($mb['mb_id'])) {
         alert_close("회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.");
     }
     if (!$mb['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
         alert_close("정보공개를 하지 않았습니다.");
     }
     $name = $this->config->item('cf_use_nick') && $mb['mb_nick'] ? $mb['mb_nick'] : $mb['mb_name'];
     $name = get_sideview($mb['mb_id'], $name);
     // 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻
     $query = $this->db->query("select (TO_DAYS('" . TIME_YMDHIS . "') - TO_DAYS('" . $mb['mb_datetime'] . "') + 1) as days");
     $row = $query->row_array();
     $mb_reg_after = $row['days'];
     $mb_homepage = prep_url($mb['mb_homepage']);
     $mb_profile = $mb['mb_profile'] ? conv_content($mb['mb_profile'], FALSE) : "소개 내용이 없습니다.";
     $mb_join_date = $member['mb_level'] >= $mb['mb_level'] ? substr($mb['mb_datetime'], 0, 10) . " (" . $mb_reg_after . " 일)" : "알 수 없음";
     $mb_last_login = $member['mb_level'] >= $mb['mb_level'] ? $mb['mb_today_login'] : "******";
     $head = array('title' => $mb['mb_nick'] . "님의 자기소개");
     $data = array('name' => $name, 'profile' => $mb_profile, 'homepage' => $mb_homepage, 'point' => number_format($mb['mb_point']), 'join_date' => $mb_join_date, 'last_login' => $mb_last_login);
     widget::run('head', $head);
     $this->load->view('member/profile', $data);
     widget::run('tail');
 }
Example #2
0
 function index()
 {
     if (SU_ADMIN != ADMIN) {
         alert('최고관리자만 접근할 수 있습니다.');
         return false;
     }
     function get_cf_custom($file)
     {
         $str = str_replace(array('<?', '?>', '\'', '"'), '', file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/app/config/cf_' . $file . '.php'));
         preg_match_all("/config\\[(.*)\\]\\s+=\\s+(.*);\\s+\\/\\/(.*)/", $str, $match);
         $list = array();
         foreach ($match[1] as $i => $v) {
             $list[$i] = new stdClass();
             $list[$i]->title = $v;
             $list[$i]->value = $match[2][$i];
             $list[$i]->comment = $match[3][$i];
         }
         return $list;
     }
     $head = array('title' => '환경설정');
     $data = array('basic' => get_cf_custom('basic'), 'board' => get_cf_custom('board'), 'icon' => get_cf_custom('icon'), 'register' => get_cf_custom('register'));
     widget::run('head', $head);
     $this->load->view(ADM_F . '/config', $data);
     widget::run('tail');
 }
Example #3
0
 function index()
 {
     $member =& $this->member;
     $board =& $this->board;
     $seg =& $this->seg;
     $type = $seg->get('type');
     switch ($type) {
         case 'image':
             $title = '이미지';
             break;
         case 'file':
             $title = '파일';
             break;
         case 'media':
             $title = '멀티미디어';
             break;
         default:
             alert_close('잘못된 접근입니다.');
             break;
     }
     if ($member['mb_level'] < $board['bo_upload_level']) {
         alert_close('업로드 권한이 없습니다.');
     }
     $head = array('title' => $title . ' 첨부');
     $data = array('upload_size' => $board['bo_upload_size'], 'upload_ext' => '*.' . str_replace('|', ';*.', $board['bo_upload_ext']));
     widget::run('head', $head);
     $this->load->view('board/editor_' . $type, $data);
     widget::run('tail');
 }
Example #4
0
 function index()
 {
     $member = unserialize(MEMBER);
     if (!$member['mb_email']) {
         alert('관리자 E-mail이 존재하지 않습니다.');
     }
     $mail_addr = $mail_msg = FALSE;
     if ($this->input->post('mail_addr')) {
         check_token();
         $mail_addr = $this->input->post('mail_addr');
         $subject = '[메일검사] 제목';
         $content = '[메일검사] 내용<br />이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<br />발송시간 : ' . date('Y-m-d H:i:s') . '<br />이 메일 주소로는 회신되지 않습니다.';
         $this->email->clear();
         $this->email->from($member['mb_email'], '메일검사');
         $this->email->to($mail_addr);
         $this->email->subject($subject);
         $this->email->message($content);
         if (!$this->email->send()) {
             $mail_msg = '<strong>※ 메일전송 오류</strong><br/>' . $this->email->print_debugger();
         } else {
             $mail_msg = '<strong>' . $mail_addr . '</strong> (으)로 메일을 발송 하였습니다.
                 <br/>해당 주소로 메일이 왔는지 확인하세요.
                 <br/>메일이 오지 않는다면 프로그램의 오류가 아닌
                 <br/>메일 서버(sendmail)의 오류일 가능성이 있습니다.
                 <br/>이런 경우에는 웹 서버관리자에게 문의하세요.';
         }
     }
     $head = array('title' => '메일전송 테스트');
     $data = array('token' => get_token(), 'mail_addr' => $mail_addr, 'mail_msg' => $mail_msg);
     widget::run('head', $head);
     $this->load->view(ADM_F . '/sendmail_test', $data);
     widget::run('tail');
 }
Example #5
0
 function step3()
 {
     check_wrkey();
     $this->session->set_flashdata('mb_idpwd', $this->input->post('mb_id'));
     $mb = $this->Basic_model->get_member($this->input->post('mb_id'), 'mb_id, mb_password_a');
     if (!isset($mb['mb_id'])) {
         alert('존재하지 않는 회원입니다.', '/');
     } else {
         if ($mb['mb_id'] == ADMIN) {
             alert('관리자 아이디는 접근 불가합니다.', '/');
         } else {
             if ($this->input->post('mb_password_a') !== $mb['mb_password_a']) {
                 alert('비밀번호 분실시 답변이 틀립니다.');
             }
         }
     }
     // 난수 발생
     list($usec, $sec) = explode(' ', microtime());
     $seed = (double) $sec + (double) $usec * 100000;
     srand($seed);
     $change_pwd = substr(md5($seed), 0, rand(4, 6));
     $this->Member_forget_model->new_pwd($change_pwd);
     $head = array('title' => '비밀번호 찾기 결과');
     $data = array('mb_id' => $mb['mb_id'], 'change_pwd' => $change_pwd);
     widget::run('head', $head);
     $this->load->view('member/forget_pwd2', $data);
     widget::run('tail');
 }
Example #6
0
File: shout.php Project: anqqa/Anqh
 /**
  * Show shouts or shout
  */
 public function index()
 {
     $shout = new Shout_Model();
     $form_values = $shout->as_array();
     $form_errors = array();
     // Check post
     if (csrf::valid() && ($post = $this->input->post())) {
         $shout->author_id = $this->user->id;
         $shout->shout = $post['shout'];
         try {
             $shout->save();
             if (!request::is_ajax()) {
                 url::redirect(url::current());
             }
         } catch (ORM_Validation_Exception $e) {
             $form_errors = $e->validation->errors();
             $form_values = arr::overwrite($form_values, $post);
         }
     }
     $shouts = ORM::factory('shout')->find_all(10);
     $view = View_Mod::factory('generic/shout', array('mod_title' => __('Shouts'), 'shouts' => $shouts, 'can_shout' => ORM::factory('shout')->has_access(Shout_Model::ACCESS_WRITE, $this->user), 'errors' => $form_errors, 'values' => $form_values));
     if (request::is_ajax()) {
         echo $view;
         return;
     }
     widget::add('main', $view);
 }
Example #7
0
 public function signup()
 {
     $this->exportJS("\$('#docNav').hide();");
     $data = base::subHeader("Create an Account", "Add your Company to the Support System");
     $data .= base::begin();
     $data .= base::pageHeader("Before you Begin", "You are about to create an account. If your company is already in our system, please have your company administrator add your account. You will only be able to add your company once.");
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'user_name', 'text' => 'Full Name:', 'comment' => 'Main contact for account'];
     $elements[] = ['type' => 'input', 'var' => 'user_email', 'text' => 'E-mail Address:', 'comment' => 'Also your login to this system'];
     $elements[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Password:'******'type' => 'input', 'var' => 'user_phone', 'text' => 'Phone Number (and Extension):', 'comment' => 'xxx.xxx.xxxx ext. xxx'];
     $elements[] = ['type' => 'input', 'var' => 'user_title', 'text' => 'Your Title:', 'comment' => 'Leave blank if individual'];
     $span = [];
     $span[] = ['span' => 6, 'elements' => $elements];
     $elements = [];
     $elements[] = ['type' => 'input', 'var' => 'company_name', 'text' => 'Company Name:', 'comment' => 'If individual leave this blank'];
     $elements[] = ['type' => 'input', 'var' => 'company_address', 'text' => 'Address:', 'comment' => 'Where to mail invoices if required?'];
     $elements[] = ['type' => 'input', 'var' => 'company_address2', 'text' => 'Address Line 2:', 'comment' => 'Suite, etc.'];
     $elements[] = ['type' => 'input', 'var' => 'company_city', 'text' => 'City:'];
     $elements[] = ['type' => 'input', 'var' => 'company_state', 'text' => 'State:'];
     $elements[] = ['type' => 'input', 'var' => 'company_zip', 'text' => 'Zip:'];
     $span[] = ['span' => 6, 'elements' => $elements];
     $form = form::init()->spanElements($span)->id('createAccount')->post('/login/')->render();
     $button = button::init()->formid('createAccount')->text('Create My Account')->addStyle('post')->addStyle('btn-primary')->icon('fire')->message('Creating Account..')->postVar('createAccount')->render();
     $save = "<div class='pull-right'>{$button}</div>";
     $data .= widget::init()->icon('share-alt')->span(12)->header('Account Details')->content($form)->footer($save)->render();
     $this->export($data);
 }
Example #8
0
 function lists()
 {
     $param =& $this->querystring;
     $page = $this->uri->segment(5, 1);
     $sfl = $param->get('sfl');
     $stx = $param->get('stx');
     $fr_date = $param->get('from', TIME_YMD);
     $to_date = $param->get('to', TIME_YMD);
     $config['suffix'] = $param->output();
     $config['base_url'] = RT_PATH . '/' . ADM_F . '/visit/lists/page/';
     $config['per_page'] = 15;
     $offset = ($page - 1) * $config['per_page'];
     $result = $this->Visit_model->list_result($fr_date, $to_date, $config['per_page'], $offset);
     $config['total_rows'] = $result['total_cnt'];
     $this->pagination->initialize($config);
     $list = array();
     foreach ($result['qry'] as $i => $row) {
         $parse = parse_url($row['vi_referer']);
         $host = isset($parse['host']) ? $parse['host'] : '';
         $list[$i] = new stdClass();
         $list[$i]->vi_ip = $row['vi_ip'];
         $list[$i]->vi_date = $row['vi_date'];
         $list[$i]->vi_time = $row['vi_time'];
         $list[$i]->vi_referer = $row['vi_referer'];
         $list[$i]->vi_agent = $row['vi_agent'];
         $list[$i]->path = $host . $parse['path'];
     }
     $head = array('title' => '방문자분석');
     $data = array('list' => $list, 'fr_date' => $fr_date, 'to_date' => $to_date, 'paging' => $this->pagination->create_links());
     widget::run('head', $head);
     $this->load->view(ADM_F . '/visit', $data);
     widget::run('tail');
 }
Example #9
0
File: FB.php Project: anqqa/Anqh
 /**
  * Initializes Facebook Connect
  */
 public static function init()
 {
     widget::add('foot', html::script(array('js/fbconnect.js', 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US')));
     widget::add('foot', html::script_source("FB.init('" . FB::$config['api_key'] . "');"));
     // Add logged in Facebook user id to session for easier access
     if ($logged_in = FB::instance()->get_loggedin_user()) {
         $_SESSION['fb_uid'] = $logged_in;
     }
 }
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     self::$escape_text = true;
     $detailed = 1;
     $ui_conf_id = $this->getP("ui_conf_id", null);
     $widget = widget::createDefaultWidgetForPartner($partner_id, $subp_id, $ui_conf_id);
     $level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
     $this->addMsg("widget", objectWrapperBase::getWrapperClass($widget, $level));
 }
Example #11
0
 function index()
 {
     $seg =& $this->seg;
     $w = $seg->get('w');
     // 모드
     $wr_id = $seg->get('wr_id');
     // 게시물아이디
     $comment_id = $seg->get('comment_id');
     // 코멘트아이디
     $qstr = $seg->output();
     switch ($w) {
         case 'u':
             $action = 'board/' . BO_TABLE . '/write' . $qstr;
             break;
         case 'd':
             $qstr = $seg->replace('wr_id', '', $qstr);
             $action = '_trans/board_write/delete';
             break;
         case 'x':
             $action = '_trans/board_comment/delete';
             break;
         case 's':
             if (IS_ADMIN) {
                 // 관리자 통과
                 goto_url('board/' . BO_TABLE . '/view/wr_id/' . $wr_id);
             }
             $write = $this->Basic_model->get_write(BO_TABLE, $wr_id, 'mb_id');
             // 회원의 글이라면
             if ($write['mb_id']) {
                 $member =& $this->member;
                 if (IS_MEMBER && $member['mb_id'] == $write['mb_id']) {
                     // 자신의 글
                     goto_url('board/' . BO_TABLE . '/view/wr_id/' . $wr_id);
                 } else {
                     $msg = '글을 읽을 권한이 없습니다.';
                     if (!IS_MEMBER) {
                         $msg .= '\\n\\n답글의 경우 비회원은 본인글을 읽은 후 읽어 주시기 바랍니다.';
                     }
                     alert($msg);
                 }
             } else {
                 // 비회원
                 $action = '_trans/board_password/check';
             }
             break;
         default:
             alert('잘못된 접근입니다.');
             break;
     }
     $head = array('title' => '비밀번호 확인');
     $data = array('w' => $w, 'wr_id' => $wr_id, 'comment_id' => $comment_id, 'action' => $action, 'qstr' => $seg->replace('w,comment_id', '', $qstr));
     widget::run('head', $head);
     $this->load->view('board/password', $data);
     widget::run('tail');
 }
 public static function createWidget($kshow, $entry_id = null, $parent_widget_obj_or_id = null, $ui_conf_id = 1, $custom_data = null, $partner_data = null, $security_type = null)
 {
     $widget = new widget();
     $widget->setKshowId($kshow->getId());
     $widget->setEntryId($entry_id);
     $widget->setPartnerId($kshow->getPartnerId());
     $widget->setSubpId($kshow->getSubpId());
     $source_widget = null;
     if ($parent_widget_obj_or_id != null) {
         if ($parent_widget_obj_or_id instanceof widget) {
             $source_widget = $parent_widget_obj_or_id;
             $widget->setSourceWidgetId($parent_widget_obj_or_id->getId());
         } else {
             // assume its an id
             $source_widget = widgetPeer::retrieveByPK($parent_widget_obj_or_id);
             $widget->setSourceWidgetId($parent_widget_obj_or_id);
         }
     }
     $widget->setUiConfId($ui_conf_id);
     if ($source_widget) {
         $widget->setRootWidgetId($source_widget->getRootWidgetId());
         if ($ui_conf_id == null) {
             // if none was explicitly set - use the parent_widget's ui_conf
             $widget->setUiConfId($source_widget->getUiConfId());
         }
     }
     $widget->setCustomData($custom_data);
     $widget->setPartnerData($partner_data);
     $widget->setSecurityType($security_type);
     $widget->setId(self::calculateId($widget));
     if ($widget->getUiConfId() == null) {
         // set the default to be 1
         $widget->setUiConfId(1);
     }
     if ($widget->getRootWidgetId() == null) {
         // set the root to be self -
         $widget->setRootWidgetId($widget->getId());
     }
     $widget->save();
     return $widget;
 }
Example #13
0
 function index()
 {
     // $this->output->cache(1440); // 캐시 되고 있는동안 common 작동 안함
     // 계정의 사용량을 구함
     $account_space = `du -sb`;
     $account_space = substr($account_space, 0, strlen($account_space) - 3);
     // DATA 폴더의 용량을 구함
     $data_path = DATA_PATH;
     $data_space = `du -sb {$data_path}`;
     $data_space = substr($data_space, 0, strlen($data_space) - 8);
     // GD 버젼
     $gd_support = extension_loaded('gd');
     if ($gd_support) {
         $gd_info = gd_info();
         $gd_version = $gd_info['GD Version'];
     } else {
         $gd_version = 'GD가 설치되지 않음';
     }
     // MySQL 버전
     $query = $this->db->query('select version() as ver');
     $row = $query->row_array();
     $db_version = $row['ver'];
     /*        
     // http://kr2.php.net/manual/kr/function.mysql-stat.php
     $mysql_stat = explode('  ', mysql_stat());
     $a = explode(':', $mysql_stat[0]);
     $db_date = $a[0] . ': ';
     $days = floor($a[1]/86400);
     if ($days)
         $db_date .= $days . '일 ';
     $hours = (floor($a[1]/3600)%24);
     if ($hours)
         $db_date .= $hours . '시간 ';
     $min = (floor($a[1]/60)%60);
     if ($min)
         $db_date .= $min . '분';
     
     $t = explode(':', $mysql_stat[2]);
     
     $db_status = $mysql_stat[1].'<br/>';
     $db_status .= $t[0].': '.number_format($t[1]).'<br/>';
     $db_status .= $mysql_stat[3].'<br/>';
     $db_status .= $mysql_stat[4].'<br/>';
     $db_status .= $mysql_stat[5].'<br/>';
     $db_status .= $mysql_stat[6].'<br/>';
     $db_status .= $mysql_stat[7].'<br/>';
     */
     $head = array('title' => '관리자 페이지');
     $data = array('os_version' => php_uname('r'), 'ip_addr' => gethostbyname(trim(`hostname`)), 'account_space' => byte_format($account_space), 'data_space' => byte_format($data_space), 'code_space' => byte_format($account_space - $data_space), 'php_version' => phpversion(), 'zend_version' => zend_version(), 'gd_version' => $gd_version, 'max_filesize' => get_cfg_var('upload_max_filesize'), 'db_version' => $db_version, 'db_date' => '', 'db_status' => '');
     widget::run('head', $head);
     $this->load->view(ADM_F . '/main', $data);
     widget::run('tail');
 }
Example #14
0
 function qry($aurl)
 {
     if (!IS_MEMBER) {
         alert('로그인 한 회원만 접근하실 수 있습니다.', '/');
     }
     $member = unserialize(MEMBER);
     $this->session->unset_userdata('ss_tmp_password');
     $head = array('title' => '회원 비밀번호 확인');
     $data = array('token' => get_token(), 'mb_id' => $member['mb_id'], 'action' => RT_PATH . '/' . str_replace('.', '/', $aurl));
     widget::run('head', $head);
     $this->load->view('member/confirm', $data);
     widget::run('tail');
 }
Example #15
0
 function _remap($pu_id)
 {
     $pu = $this->Popup_model->get($pu_id, 'pu_id, pu_name, pu_file');
     if (!isset($pu['pu_id'])) {
         alert_close('등록된 팝업이 아닙니다.');
     }
     if (SU_ADMIN && !file_exists(SKIN_PATH . 'popup/' . $pu['pu_file'] . '.html')) {
         alert_close('팝업 파일이 없습니다.');
     }
     $head = array('title' => $pu['pu_name']);
     $data = array('id' => 'popup' . $pu_id);
     widget::run('head', $head);
     $this->load->view('popup/' . $pu['pu_file'], $data);
     widget::run('tail');
 }
Example #16
0
 function qry($msg = FALSE)
 {
     if (IS_MEMBER) {
         goto_url(URL);
     }
     if ($this->input->post('url')) {
         $url = $this->input->post('url');
     } else {
         $url = is_numeric($msg) ? URL : urldecode(str_replace('.', '%', $msg));
     }
     $reId = get_cookie('ck_mb_id');
     $head = array('title' => '로그인');
     $data = array('url' => $url, 'msg' => $msg == 1 ? TRUE : FALSE, 'reId' => $reId, 'chk_reId' => $reId ? 1 : 0);
     widget::run('head', $head);
     $this->load->view('member/login', $data);
     widget::run('tail');
 }
Example #17
0
 function form($w = '', $gr_id = '')
 {
     $this->load->library('form_validation');
     $config = array(array('field' => 'gr_id', 'label' => '아이디', 'rules' => 'trim|required|min_length[3]|max_length[20]|alpha_dash|xss_clean'), array('field' => 'gr_subject', 'label' => '제목', 'rules' => 'trim|required|max_length[20]'), array('field' => 'gr_admin', 'label' => '그룹 관리자', 'rules' => 'trim|min_length[3]|max_length[20]|alpha_dash'));
     $this->form_validation->set_rules($config);
     if ($this->form_validation->run() == FALSE) {
         if ($w == '') {
             $title = '생성';
             $gr = FALSE;
         } else {
             if ($w == 'u') {
                 $gr = $this->Boardgroup_model->get_group($gr_id);
                 if (!isset($gr['gr_id'])) {
                     alert('존재하지 않는 그룹 ID 입니다.');
                 }
                 $title = '수정';
             } else {
                 alert('잘못된 접근입니다.');
             }
         }
         $head = array('title' => '게시판그룹' . $title);
         $data = array('w' => $w, 'token' => get_token(), 'gr_id' => $gr['gr_id'], 'gr_subject' => $gr['gr_subject'], 'gr_admin' => $gr['gr_admin']);
         widget::run('head', $head);
         $this->load->view(ADM_F . '/boardgroup_form', $data);
         widget::run('tail');
     } else {
         check_token();
         $w = $this->input->post('w');
         $gr_id = $this->input->post('gr_id');
         if (!$w) {
             $gr = $this->Boardgroup_model->get_group($gr_id);
             if (isset($gr['gr_id'])) {
                 alert("이미 존재하는 그룹 ID 입니다.");
             }
             $this->Boardgroup_model->insert();
         } else {
             if ($w == 'u') {
                 $this->Boardgroup_model->update();
             } else {
                 alert('잘못된 접근입니다.');
             }
         }
         // goto_url(ADM_F.'/boardgroup/form/u/'.$gr_id);
         goto_url(ADM_F . '/boardgroup/lists');
     }
 }
Example #18
0
 function index()
 {
     $bo_table = $this->input->post('bo_table');
     $wr_id = $this->input->post('wr_id');
     $sw = $this->input->post('sw');
     $board = $this->Basic_model->get_board($bo_table, 'bo_admin', TRUE);
     $member = unserialize(MEMBER);
     define('IS_ADMIN', is_admin($member, $board));
     // 게시판 관리자 이상 복사, 이동 가능
     if (!IS_ADMIN) {
         show_404();
     }
     if (!$wr_id) {
         alert_close('잘못된 접근입니다.');
     }
     switch ($sw) {
         case 'move':
             $act = '이동';
             break;
         case 'copy':
             $act = '복사';
             break;
         default:
             alert_close('잘못된 접근입니다.');
             break;
     }
     $result = $this->Board_mvcp_model->list_move_copy($bo_table, $member['mb_id']);
     $list = array();
     $save_gr_subject = '';
     foreach ($result as $i => $row) {
         $list[$i] = new stdClass();
         $list[$i]->bo_table = $row['bo_table'];
         $span = $save_gr_subject == $row['gr_subject'] ? "<span style='color:#cccccc;'>" : '<span>';
         $list[$i]->gr_subject = $span . $row['gr_subject'] . ' &gt; </span>';
         $list[$i]->bo_subject = $row['bo_subject'];
         $save_gr_subject = $row['gr_subject'];
     }
     $head = array('title' => '게시물 ' . $act);
     $data = array('sw' => $sw, 'bo_table' => $bo_table, 'wr_id' => serialize($wr_id), 'act' => $act, 'list' => $list);
     widget::run('head', $head);
     $this->load->view('board/movecopy', $data);
     widget::run('tail');
 }
Example #19
0
 function page($page = 1)
 {
     if (!IS_MEMBER) {
         alert('회원만 조회하실 수 있습니다.');
     }
     $member = unserialize(MEMBER);
     $config['base_url'] = RT_PATH . '/member/point/page/';
     $config['total_rows'] = $this->Member_point_model->total_cnt($member['mb_id']);
     $config['per_page'] = 15;
     $config['uri_segment'] = 4;
     $this->pagination->initialize($config);
     $offset = ($page - 1) * $config['per_page'];
     $result = $this->Member_point_model->list_result($member['mb_id'], $config['per_page'], $offset);
     $list = array();
     $sum_point1 = $sum_point2 = FALSE;
     foreach ($result as $i => $row) {
         $point1 = $point2 = 0;
         if ($row['po_point'] > 0) {
             $point1 = "+" . number_format($row['po_point']);
             $sum_point1 += $row['po_point'];
         } else {
             $point2 = number_format($row['po_point']);
             $sum_point2 += $row['po_point'];
         }
         $list[$i] = new stdClass();
         $list[$i]->po_content = $row['po_content'];
         $list[$i]->po_datetime = substr($row['po_datetime'], 2, 8);
         $list[$i]->point1 = $point1;
         $list[$i]->point2 = $point2;
     }
     if ($config['total_rows']) {
         if ($sum_point1 > 0) {
             $sum_point1 = '+' . number_format($sum_point1);
         }
         $sum_point2 = number_format($sum_point2);
     }
     $head = array('title' => $member['mb_nick'] . ' 님의 포인트 내역');
     $data = array('paging' => $this->pagination->create_links(), 'mb_point' => number_format($member['mb_point']), 'list' => $list, 'sum_point1' => $sum_point1, 'sum_point2' => $sum_point2);
     widget::run('head', $head);
     $this->load->view('member/point', $data);
     widget::run('tail');
 }
Example #20
0
 function qry($form, $fzip1, $fzip2, $faddr1, $faddr2)
 {
     // 메모리를 많이 잡아먹어서 아래의 코드로 대체
     // ini_set('memory_limit', '20M');
     // $zipfile = file("./zip.db");
     $zipfile = array();
     $fp = fopen(SKIN_PATH . "useful/zip.db", "r");
     while (!feof($fp)) {
         $zipfile[] = fgets($fp, 4096);
     }
     fclose($fp);
     $count = 0;
     $list = array();
     $addr1 = FALSE;
     if ($this->input->post('addr1')) {
         $addr1 = $this->input->post('addr1');
         foreach ($zipfile as $i => $row) {
             if (strstr(substr($row, 9, 512), $addr1)) {
                 $list[$i] = new stdClass();
                 $list[$i]->zip1 = substr($row, 0, 3);
                 $list[$i]->zip2 = substr($row, 4, 3);
                 $addr = explode(" ", substr($row, 8));
                 if ($addr[sizeof($addr) - 1]) {
                     $list[$i]->addr = str_replace($addr[sizeof($addr) - 1], "", substr($row, 8));
                     $list[$i]->bunji = trim($addr[sizeof($addr) - 1]);
                 } else {
                     $list[$i]->addr = substr($row, 8);
                 }
                 $count++;
             }
         }
         if (!$list) {
             alert('찾으시는 주소가 없습니다.');
         }
     }
     $head = array('title' => '우편번호 검색');
     $data = array('form' => $form, 'fzip1' => $fzip1, 'fzip2' => $fzip2, 'faddr1' => $faddr1, 'faddr2' => $faddr2, 'search_count' => $count, 'list' => $list, 'addr1' => $addr1);
     widget::run('head', $head);
     $this->load->view('useful/zip', $data);
     widget::run('tail');
 }
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     // get the new properties for the kuser from the request
     $widget = new widget();
     $obj_wrapper = objectWrapperBase::getWrapperClass($widget, 0);
     $fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $widget, "widget_", $obj_wrapper->getUpdateableFields());
     // check that mandatory fields were set
     // TODO
     $new_widget = null;
     if (count($fields_modified) > 0) {
         // see if to create a widget from a widget or from a kshow
         if ($widget->getSourceWidgetId()) {
             $widget_from_db = widgetPeer::retrieveByPK($widget->getSourceWidgetId());
             $new_widget = widget::createWidgetFromWidget($widget_from_db, $widget->getKshowId(), $widget->getEntryId(), $widget->getUiConfId(), $widget->getCustomData(), $widget->getPartnerData(), $widget->getSecurityType());
             if (!$new_widget) {
                 $this->addError(APIErrors::INVALID_KSHOW_AND_ENTRY_PAIR, $widget->getKshowId(), $widget->getEntryId());
                 return;
             }
         } else {
             $kshow_id = $widget->getKshowId();
             if ($kshow_id) {
                 $kshow = kshowPeer::retrieveByPK($kshow_id);
                 if (!$kshow) {
                     $this->addError(APIErrors::KSHOW_DOES_NOT_EXISTS);
                     // This field in unique. Please change ");
                     return;
                 }
             } else {
                 $kshow = new kshow();
                 $kshow->setId(0);
                 $kshow->setPartnerId($partner_id);
                 $kshow->setSubpId($subp_id);
             }
             $new_widget = widget::createWidget($kshow, $widget->getEntryId(), null, $widget->getUiConfId(), $widget->getCustomData(), $widget->getPartnerData(), $widget->getSecurityType());
         }
         $this->addMsg("widget", objectWrapperBase::getWrapperClass($new_widget, objectWrapperBase::DETAIL_LEVEL_DETAILED));
         $this->addDebug("added_fields", $fields_modified);
     } else {
         $this->addError(APIErrors::NO_FIELDS_SET_FOR_WIDGET);
     }
 }
Example #22
0
 function index()
 {
     $popup = $this->Popup_model->output();
     $pubasic = $pulayer = array();
     foreach ($popup as $i => $row) {
         $id = $row['pu_id'];
         $skin = 'popup/' . $row['pu_file'];
         if (!$this->input->cookie('popup' . $id) && file_exists(SKIN_PATH . $skin . '.html')) {
             if ($row['pu_type'] == 1) {
                 $pubasic[] = "<div id='popup" . $id . "' style='position:absolute; width:" . $row['pu_width'] . "px; height:" . $row['pu_height'] . "px; top:" . $row['pu_y'] . "px; left:" . $row['pu_x'] . "px; z-index:100; overflow:hidden;'>" . $this->load->view($skin, array('id' => 'popup' . $id), TRUE) . "</div>";
             } else {
                 $pulayer[$i]->id = $id;
                 $pulayer[$i]->html = "win_open('popup/" . $id . "', 'popup" . $id . "', 'left=" . $row['pu_x'] . "px,top=" . $row['pu_y'] . "px,width=" . $row['pu_width'] . "px,height=" . $row['pu_height'] . "px,scrollbars=0');";
             }
         }
     }
     $data = array('pubasic' => $pubasic, 'pulayer' => $pulayer, 'write' => $this->Latest_model->write('test', 10, 50), 'comment' => $this->Latest_model->comment(10, 50));
     widget::run('head');
     $this->load->view('main/main', $data);
     widget::run('tail');
 }
Example #23
0
File: roles.php Project: anqqa/Anqh
 /**
  * Single role view
  *
  * @param  string  $role_id
  * @param  string  $action
  */
 public function role($role_id, $action = null)
 {
     if ($action) {
         switch ($action) {
             // Delete role
             case 'delete':
                 $this->_role_delete($role_id);
                 return;
         }
     }
     $this->history = false;
     $role = new Role_Model((int) $role_id);
     $form_values = $role->as_array();
     $form_errors = $errors = array();
     // Check post
     if ($post = $this->input->post()) {
         $role->name = $post['name'];
         $role->description = $post['description'];
         try {
             $role->save();
             url::redirect('/roles');
         } catch (ORM_Validation_Exception $e) {
             $form_errors = $e->validation->errors();
         }
         $form_values = arr::overwrite($form_values, $post);
     }
     // show form
     if ($role->id) {
         $this->breadcrumb[] = html::anchor('role/' . url::title($role->id, $role->name), html::specialchars($role->name));
         $this->page_title = text::title($role->name);
         $this->page_actions[] = array('link' => 'role/' . url::title($role->id, $role->name) . '/delete', 'text' => __('Delete role'), 'class' => 'role-delete');
     } else {
         $this->page_title = __('Role');
     }
     if (empty($errors)) {
         widget::add('main', View_Mod::factory('roles/role_edit', array('values' => $form_values, 'errors' => $form_errors)));
     } else {
         $this->_error(Kohana::lang('generic.error'), $errors);
     }
 }
Example #24
0
 function index()
 {
     $this->Repair_model->delete_popular();
     $this->Repair_model->delete_memo();
     $rep_result = $opt_result = FALSE;
     $tables = $this->db->list_tables();
     foreach ($tables as $table) {
         // 테이블 수리
         if (!$this->dbutil->repair_table($table)) {
             $rep_result .= $table . ' 실패 <br/>';
         }
         // 테이블 최적화
         if (!$this->dbutil->optimize_table($table)) {
             $opt_result .= $table . ' 실패 <br/>';
         }
     }
     $head = array('title' => '테이블 복구 및 최적화');
     $data = array('rep_result' => $rep_result ? $rep_result : '테이블 수리 완료', 'opt_result' => $opt_result ? $opt_result : '테이블 최적화 완료');
     widget::run('head', $head);
     $this->load->view(ADM_F . '/repair', $data);
     widget::run('tail');
 }
Example #25
0
File: index.php Project: anqqa/Anqh
 /**
  * Home page
  */
 public function index()
 {
     $this->page_title = __('Welcome to :site', array(':site' => Kohana::config('site.site_name')));
     // Display news feed
     $newsfeed = new NewsFeed($this->user);
     $newsfeed->max_items = 25;
     widget::add('main', View_Mod::factory('generic/newsfeed', array('newsfeed' => $newsfeed->as_array())));
     // Shout
     $shouts = ORM::factory('shout')->find_all(10);
     widget::add('side', View_Mod::factory('generic/shout', array('mod_title' => __('Shouts'), 'shouts' => $shouts, 'can_shout' => ORM::factory('shout')->has_access(Shout_Model::ACCESS_WRITE, $this->user), 'errors' => array(), 'values' => array())));
     // Online
     $guests = Online_User_Model::get_guest_count();
     $online = Online_User_Model::find_online_users();
     $counts = array();
     if ($guests) {
         $counts[] = __2(':guests guest', ':guests guests', $guests, array(':guests' => $guests));
     }
     if (count($online)) {
         $counts[] = __2(':members member', ':members members', count($online), array(':members' => count($online)));
     }
     widget::add('side', View_Mod::factory('generic/users', array('mod_title' => __('Online') . ': ' . implode(', ', $counts), 'viewer' => $this->user, 'users' => $online)));
 }
Example #26
0
 function category()
 {
     $bo_table = $this->input->post('bo_table');
     if (!IS_MEMBER || !$bo_table) {
         show_404();
     }
     $bo = $this->Basic_model->get_board($bo_table, 'bo_table,bo_admin,bo_subject');
     if (!isset($bo['bo_table'])) {
         alert_close('존재하지 않는 게시판 입니다.');
     }
     $member = unserialize(MEMBER);
     if ($member['mb_id'] != $bo['bo_admin']) {
         show_404();
     }
     define('CSS_SKIN', 'category');
     $type = 'bo_' . $bo_table;
     $this->load->model('Categoryform_model');
     $bc = $this->Categoryform_model->list_result($type);
     $code_html = FALSE;
     if ($bc) {
         $t_code = $s_code = array();
         foreach ($bc as $row) {
             $code_exp = explode('-', $row['code']);
             if (!isset($code_exp[1])) {
                 $t_code[$code_exp[0]] = $row['ca_name'];
             } else {
                 $s_code[$code_exp[0]][$code_exp[1]] = $row['ca_name'];
             }
         }
         $this->load->helper('categoryform');
         $code_html = get_categoryform($t_code, $s_code);
     }
     $head = array('title' => $bo['bo_subject']);
     $data = array('bo_table' => $bo_table, 'type' => $type, 'code_html' => $code_html);
     widget::run('head', $head);
     $this->load->view('board/admin_category', $data);
     widget::run('tail');
 }
Example #27
0
 function lists($type = '', $tid = '')
 {
     switch ($type) {
         case 'board':
             $bo = $this->Basic_model->get_board($tid, 'bo_table,bo_subject');
             if (!isset($bo['bo_table'])) {
                 alert('존재하지 않는 게시판 입니다.');
             }
             $name = $bo['bo_subject'];
             $type = 'bo_' . $tid;
             break;
         default:
             alert('잘못된 접근입니다.');
             break;
     }
     $bc = $this->Categoryform_model->list_result($type);
     $code_html = FALSE;
     if ($bc) {
         $t_code = $s_code = array();
         foreach ($bc as $row) {
             $code_exp = explode('-', $row['code']);
             if (!isset($code_exp[1])) {
                 $t_code[$code_exp[0]] = $row['ca_name'];
             } else {
                 $s_code[$code_exp[0]][$code_exp[1]] = $row['ca_name'];
             }
         }
         $code_html = get_categoryform($t_code, $s_code);
     }
     // echo '<PRE>';
     // print_r($s_code);
     $head = array('title' => $name . ' 분류관리');
     $data = array('name' => $name, 'type' => $type, 'tid' => $tid, 'code_html' => $code_html);
     widget::run('head', $head);
     $this->load->view(ADM_F . '/category', $data);
     widget::run('tail');
 }
Example #28
0
 public function index()
 {
     $error = array();
     $side_views = array();
     // New users
     $new_users = ORM::factory('user')->order_by('id', 'DESC')->limit(50)->find_all();
     $users = array();
     foreach ($new_users as $user) {
         $users[date('Y-m-d', strtotime($user->created))][] = $user;
     }
     try {
         $birthdays = Users::get_birthdays();
     } catch (Kohana_Exception $e) {
         $error[] = $e;
     }
     if (empty($error)) {
         $this->page_subtitle = __('Latest :users members', array(':users' => '<var>' . count($new_users) . '</var>'));
         widget::add('main', View_Mod::factory('member/members', array('users' => $users, 'type' => 'new')));
         widget::add('side', View_Mod::factory('member/birthdays_list', array('mod_class' => 'birthdays', 'birthdays' => $birthdays)));
     } else {
         $this->page_title .= ' ' . __('Uh oh.');
         widget::add('main', implode('<br />', $error));
     }
 }
Example #29
0
		}
		$tip.html(cache[href]);
	}

	$('a.user, .avatar a').tooltip({
		predelay: 500,
		tip: '#peepbox',
		lazy: false,
		position: 'bottom right',
		onBeforeShow: function() {
			peepbox(this.getTrigger().attr('href'), this.getTip());
		}
	}).dynamic({
		borrom: {
			direction: 'down',
			bounce: true,
		}
	});

});
//]]>
</script>

<?php 
echo widget::get('foot');
?>

</body>

</html>
Example #30
0
File: forum.php Project: anqqa/Anqh
 /**
  * Edit topic
  *
  * @param  mixed  $topic_id
  * @param  mixed  $area_id
  */
 public function _topic_edit($topic_id, $area_id = false)
 {
     $this->history = false;
     $errors = array();
     $forum_topic = new Forum_Topic_Model((int) $topic_id);
     $forum_area = $forum_topic->loaded() ? $forum_topic->forum_area : new Forum_Area_Model((int) $area_id);
     if ($forum_topic->loaded()) {
         // Editing topic
         $editing = true;
         if (!$forum_topic->has_access(Forum_Topic_Model::ACCESS_EDIT)) {
             url::back('forum');
         }
     } else {
         if ($forum_area->loaded()) {
             // New topic
             $editing = false;
             if (!$forum_area->has_access(Forum_Area_Model::ACCESS_WRITE)) {
                 url::back('forum');
             }
         } else {
             // New topic in unknown area
             $errors[] = __('Area :area or topic :topic not found', array(':area' => (int) $area_id, ':topic' => (int) $topic_id));
         }
     }
     if (empty($errors)) {
         $forum_post = new Forum_Post_Model((int) $forum_topic->first_post_id);
         $form_errors = array();
         $form_values_topic = $forum_topic->as_array();
         $form_values_post = $forum_post->as_array();
         $form_topics = false;
         // Bound area?
         if ($forum_area->is_type(Forum_Area_Model::TYPE_BIND)) {
             // Get bind config and load topics
             $bind = Forum_Area_Model::binds($forum_area->bind);
             if ($editing) {
                 // Can't edit bound topic
                 $form_topics = array($forum_topic->bind_id => $forum_topic->name);
             } else {
                 // Try to load options from configured model
                 try {
                     $bind_topics = ORM::factory($bind['model'])->find_bind_topics($forum_area->bind);
                     $form_topics = array(0 => __('Choose..')) + $bind_topics;
                 } catch (Kohana_Exception $e) {
                     $form_topics = array();
                 }
             }
         }
         // Admin actions
         if ($editing && $forum_topic->has_access(Forum_Topic_Model::ACCESS_DELETE)) {
             $this->page_actions[] = array('link' => url::model($forum_topic) . '/delete/?token=' . csrf::token(), 'text' => __('Delete topic'), 'class' => 'topic-delete');
         }
         // Check post
         if ($post = $this->input->post()) {
             $post['forum_area_id'] = $forum_area->id;
             $topic = $post;
             if (isset($bind_topics)) {
                 $topic['name'] = arr::get($bind_topics, (int) $topic['bind_id'], '');
             }
             $post_extra = $topic_extra = array('author_id' => $this->user->id, 'author_name' => $this->user->username);
             if ($editing) {
                 $post_extra['modifies'] = (int) $forum_post->modifies + 1;
                 $post_extra['modified'] = date::unix2sql(time());
             }
             $post_extra['author_ip'] = $this->input->ip_address();
             $post_extra['author_host'] = $this->input->host_name();
             // validate post first and save topic if ok
             if (csrf::valid() && $forum_post->validate($post, false, $post_extra) && $forum_topic->validate($topic, true, $topic_extra)) {
                 // post
                 $forum_post->forum_topic_id = $forum_topic->id;
                 $forum_post->save();
                 if (!$editing) {
                     // topic
                     $forum_topic->first_post_id = $forum_post->id;
                     $forum_topic->last_post_id = $forum_post->id;
                     $forum_topic->last_poster = $this->user->username;
                     $forum_topic->last_posted = date::unix2sql(time());
                     $forum_topic->posts = 1;
                     $forum_topic->save();
                     // area
                     $forum_area->last_topic_id = $forum_topic->id;
                     $forum_area->posts += 1;
                     $forum_area->topics += 1;
                     $forum_area->save();
                     // user
                     $this->user->posts += 1;
                     $this->user->save();
                     // News feed
                     newsfeeditem_forum::topic($this->user, $forum_topic);
                 }
                 // redirect back to topic
                 URL::redirect(url::model($forum_topic));
             } else {
                 $form_errors = array_merge($post->errors(), is_object($topic) ? $topic->errors() : array());
             }
             $form_values_topic = arr::overwrite($form_values_topic, is_object($topic) ? $topic->as_array() : $topic);
             $form_values_post = arr::overwrite($form_values_post, $post->as_array());
         }
     }
     // Show form
     if (empty($errors)) {
         $this->breadcrumb[] = html::anchor(url::model($forum_area), text::title($forum_area->name));
         $this->page_title = $editing ? text::title($forum_topic->name) : __('New topic');
         $this->page_subtitle = __('Area :area', array(':area' => html::anchor(url::model($forum_area), text::title($forum_area->name), array('title' => strip_tags($forum_area->description)))));
         widget::add('head', html::script(array('js/jquery.markitup.pack', 'js/markitup.bbcode')));
         widget::add('main', View_Mod::factory('forum/topic_edit', array('topic' => $form_values_topic, 'topics' => $form_topics, 'post' => $form_values_post, 'errors' => $form_errors)));
     } else {
         $this->_error(__('Error'), $errors);
     }
     $this->_side_views();
 }