true, 'local'=>true) ); $template->set_prefilter('profile_content', 'adddinfousersPT'); $template->set_filename('profile_add', realpath(ADDINFOUSERS_PATH.'profile_add.tpl')); if (isset($userdata['id'])) { $query = ' select id,info1,info2,info3,info4,info5,info6,info7 FROM ' . ADDINFOUSERS_TABLE . ' WHERE id = '.$userdata['id'].' ;'; $result = pwg_query($query); $row = mysql_fetch_array($result); $idaddinfo=$row['id']; $info1=$row['info1']; $info2=$row['info2']; $info3=$row['info3']; $info4=$row['info4']; $info5=$row['info5']; $info6=$row['info6']; $info7=$row['info7']; $template->assign( array( 'AICONTENTID' => $userdata['id'], 'AICONTENT' => htmlspecialchars($info1), 'AICONTENT2' => htmlspecialchars($info2), 'AICONTENT3' => htmlspecialchars($info3), 'AICONTENT4' => htmlspecialchars($info4), 'AICONTENT5' => htmlspecialchars($info5), 'AICONTENT6' => htmlspecialchars($info6), 'AICONTENT7' => htmlspecialchars($info7), )); } $template->assign_var_from_handle('PROFILE_ADD', 'profile_add'); } function adddinfousersPT($content, &$smarty) { $search = '
'; return str_replace($search, '{$PROFILE_ADD}'."\n".$search, $content); } add_event_handler('save_profile_from_post', 'addInfousersPT2'); function addInfousersPT2() { global $prefixeTable,$conf; $query = ' DELETE FROM ' . ADDINFOUSERS_TABLE . ' WHERE id = '.$_POST['inserID'].' ;'; $result = pwg_query($query); $q = ' INSERT INTO ' . $prefixeTable . 'AddInfo_users(id,info1,info2,info3,info4,info5,info6,info7)VALUES ("'.$_POST['inserID'].'","'.$_POST['inser'].'","'.$_POST['inser2'].'","'.$_POST['inser3'].'","'.$_POST['inser4'].'","'.$_POST['inser5'].'","'.$_POST['inser6'].'","'.$_POST['inser7'].'");'; pwg_query($q); } ?>