espr Опубликовано 23 Августа 2009 Жалоба Поделиться Опубликовано 23 Августа 2009 <? // select --------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'test_table', 'where' => 'id = 1', 'order' => 'name desc' ) ); $this->ipsclass->DB->simple_exec(); $row = $this->ipsclass->DB->fetch_row(); //while or forech // select_join ------------------------------------------------------------------------------------------------------ $this->ipsclass->DB->build_query( array( 'select' => 'a.*', 'from' => array( 'table_a' => 'a' ), 'where' => 'a.id= 1 order by a.id asc', 'add_join' => array( array( 'type' => 'left', 'select' => 'b.*', 'where' => 'b.id=a.id', 'from' => array( 'table_b' => 'b' ), ) ), ) ); $this->ipsclass->DB->exec_query(); $this->ipsclass->DB->fetch_row(); // insert ----------------------------------------------------------------------------------------------------------- $Param = array( 'name' => "abs", 'cat_id' => 2 ); if($this->ipsclass->DB->do_insert( 'test_table', $Param )) header('Location: /?act=test_page'); // update ----------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_construct(array( 'update' => 'test_table', 'set' => 'name = "abs"', 'where' => 'id = 1' ) ); $this->ipsclass->DB->simple_shutdown_exec(); // delete ----------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_exec_query( array( 'delete' => 'test_table', 'where' => 'id = 1' ) ); // func pages ------------------------------------------------------------------------------------------------------- function StPages() { $pages = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => 50,//всего 'PER_PAGE' => 20,// на 1 странице 'CUR_ST_VAL' => $this->ipsclass->input['st'],// текущая страница 'L_SINGLE' => '', 'BASE_URL' => '/?page='.$this->ipsclass->input['page'], ) ); return($pages); } // send mail to mail ---------------------------------------------------------------------------------------------- require_once( ROOT_PATH."sources/classes/class_email.php" ); $this->email = new emailer(); $this->email->ipsclass =& $this->ipsclass; $this->email->email_init(); $this->email->message = 'test'; $this->email->subject = 'title'; $this->email->html_email = 1; // использовать html - 1, нет - 0 $this->email->from = 'noreply@test.test'; $this->email->to = 'test@test.test'; $this->email->send_mail(); // send pm to user ------------------------------------------------------------------------------------------------ require_once( ROOT_PATH.'sources/lib/func_msg.php' ); $this->lib = new func_msg(); $this->lib->ipsclass =& $this->ipsclass; $this->lib->init(); $this->lib->to_by_id = '1'; //id member $this->lib->from_member = '0'; //id from member $this->lib->postlib->parser->parse_bbcode = 1; $this->lib->postlib->parser->parse_smilies = 0; $this->lib->postlib->parser->parse_html = 1; $this->lib->postlib->parser->parse_nl2br = 1; $this->lib->msg_post = 'message'; $this->lib->msg_title = 'title'; $this->lib->force_pm = 1; $this->lib->send_pm(); ?> мой небольшой сборник, может кому пригодиться что бы не лазить постоянно, или на оборот добавит еще что нибудь Цитата Ссылка на комментарий Поделиться на других сайтах Прочее
Вопрос
espr
<? // select --------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'test_table', 'where' => 'id = 1', 'order' => 'name desc' ) ); $this->ipsclass->DB->simple_exec(); $row = $this->ipsclass->DB->fetch_row(); //while or forech // select_join ------------------------------------------------------------------------------------------------------ $this->ipsclass->DB->build_query( array( 'select' => 'a.*', 'from' => array( 'table_a' => 'a' ), 'where' => 'a.id= 1 order by a.id asc', 'add_join' => array( array( 'type' => 'left', 'select' => 'b.*', 'where' => 'b.id=a.id', 'from' => array( 'table_b' => 'b' ), ) ), ) ); $this->ipsclass->DB->exec_query(); $this->ipsclass->DB->fetch_row(); // insert ----------------------------------------------------------------------------------------------------------- $Param = array( 'name' => "abs", 'cat_id' => 2 ); if($this->ipsclass->DB->do_insert( 'test_table', $Param )) header('Location: /?act=test_page'); // update ----------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_construct(array( 'update' => 'test_table', 'set' => 'name = "abs"', 'where' => 'id = 1' ) ); $this->ipsclass->DB->simple_shutdown_exec(); // delete ----------------------------------------------------------------------------------------------------------- $this->ipsclass->DB->simple_exec_query( array( 'delete' => 'test_table', 'where' => 'id = 1' ) ); // func pages ------------------------------------------------------------------------------------------------------- function StPages() { $pages = $this->ipsclass->build_pagelinks( array( 'TOTAL_POSS' => 50,//всего 'PER_PAGE' => 20,// на 1 странице 'CUR_ST_VAL' => $this->ipsclass->input['st'],// текущая страница 'L_SINGLE' => '', 'BASE_URL' => '/?page='.$this->ipsclass->input['page'], ) ); return($pages); } // send mail to mail ---------------------------------------------------------------------------------------------- require_once( ROOT_PATH."sources/classes/class_email.php" ); $this->email = new emailer(); $this->email->ipsclass =& $this->ipsclass; $this->email->email_init(); $this->email->message = 'test'; $this->email->subject = 'title'; $this->email->html_email = 1; // использовать html - 1, нет - 0 $this->email->from = 'noreply@test.test'; $this->email->to = 'test@test.test'; $this->email->send_mail(); // send pm to user ------------------------------------------------------------------------------------------------ require_once( ROOT_PATH.'sources/lib/func_msg.php' ); $this->lib = new func_msg(); $this->lib->ipsclass =& $this->ipsclass; $this->lib->init(); $this->lib->to_by_id = '1'; //id member $this->lib->from_member = '0'; //id from member $this->lib->postlib->parser->parse_bbcode = 1; $this->lib->postlib->parser->parse_smilies = 0; $this->lib->postlib->parser->parse_html = 1; $this->lib->postlib->parser->parse_nl2br = 1; $this->lib->msg_post = 'message'; $this->lib->msg_title = 'title'; $this->lib->force_pm = 1; $this->lib->send_pm(); ?>мой небольшой сборник, может кому пригодиться что бы не лазить постоянно, или на оборот добавит еще что нибудь
Ссылка на комментарий
Поделиться на других сайтах
0 ответов на этот вопрос
Рекомендуемые сообщения
Присоединиться к обсуждению
Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.