'id' => $memberID, 'name' => $_POST['user'], 'href' => $scripturl . '?action=profile;u=' . $memberID, 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $memberID . '">' . $_POST['user'] . '</a>', );
foreach ($regOptions['register_vars'] as $var => $val) { $type = 'string'; $type = 'int'; $type = 'float'; elseif ($var == 'birthdate') $type = 'date'; $column_names[$var] = $type; $values[$var] = $val; } // Register them into the database. $smcFunc['db_insert']('', '{db_prefix}members', $column_names, $values, ); $memberID = $smcFunc['db_insert_id']('{db_prefix}members', 'id_member');
'id_thumb' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'id_folder' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'fileext' => 'string', 'size' => 'int', 'downloads' => 'int', 'width' => 'int', 'height' => 'int', 'mime_type' => 'string', 'approved' => 'int' ); 'id_thumb' => ?, 'id_msg' => ?, 'id_member' => $memberID, 'id_folder' => ?, 'attachment_type' => ?; 'filename' => NAZWA_PLIKU, 'file_hash' => HASH_PLIKU, // trzeba sprawdzić jak generują 'fileext' => ROZSZERZENIE_PLIKU, 'size' => WIELKOSC_PLIKU_W_BAJTACH, // najprawdopodobniej 'downloads' => 0, 'width' => WIDTH, 'height' => HEIGHT, 'mime_type' => TYP_MIME, 'approved' => 1 ); $smcFunc['db_insert']('', '{db_prefix}attchments', $column_names, $values, );
// Register them into the database. $smcFunc['db_insert']('', '{db_prefix}members', $column_names, $values, ); $memberID = $smcFunc['db_insert_id']('{db_prefix}members', 'id_member'); ///////////////////// 'id_thumb' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'id_folder' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'fileext' => 'string', 'size' => 'int', 'downloads' => 'int', 'width' => 'int', 'height' => 'int', 'mime_type' => 'string', 'approved' => 'int' ); 'id_thumb' => '0', 'id_msg' => '0', 'id_member' => $memberID, 'id_folder' => '1', 'attachment_type' => '0'; 'filename' => 'avatar_1_1308503667.png', 'file_hash' => 'd2e3fbe9241ddfca15238b1a32df2594264059b7', // trzeba sprawdzić jak generują 'fileext' => png, 'size' => '7006', 'downloads' => 0, 'width' => 64, 'height' => 64, 'mime_type' => 'image/png', 'approved' => 1 ); $smcFunc['db_insert']('', '{db_prefix}attchments', $column_names, $values, ); /////////////////////
teraz jest ok?
'id_thumb' => 0, 'id_msg' => 0, 'id_member' => $memberID, 'id_folder' => 1, 'attachment_type' => 0; 'filename' => 'avatar_1_1308503667.png', 'file_hash' => 'd2e3fbe9241ddfca15238b1a32df2594264059b7', // trzeba sprawdzić jak generują 'fileext' => png, 'size' => 7006, 'downloads' => 0, 'width' => 64, 'height' => 64, 'mime_type' => 'image/png', 'approved' => 1 );
///////////////////// //... ); //.. ); $smcFunc['db_insert']('', '{db_prefix}attachments', $column_names1, $values1, ); /////////////////////
<?php // This file is here solely to protect your attachments directory. // Look for Settings.php.... { // Found it! } // Can't find it... just forget it. else exit; ?>
i niestety nie działa kopiowanie w folderze. Głowe daje, że źle wpisałem tą linijke z "copy".
///////////////////// 'id_thumb' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'id_folder' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'fileext' => 'string', 'size' => 'int', 'downloads' => 'int', 'width' => 'int', 'height' => 'int', 'mime_type' => 'string', 'approved' => 'int' ); 'id_thumb' => 0, 'id_msg' => 0, 'id_member' => $memberID, 'id_folder' => 1, 'attachment_type' => 0, 'filename' => 'http://tester999.cba.pl/avatar.png', 'file_hash' => 'default', // trzeba sprawdzić jak generują 'fileext' => 'png', 'size' => 7006, 'downloads' => 0, 'width' => 65, 'height' => 64, 'mime_type' => 'image/png', 'approved' => 1 ); $smcFunc['db_insert']('', '{db_prefix}attachments', $column_names1, $values1, ); /////////////////////
///////////////////// 'id_thumb' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'id_folder' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'fileext' => 'string', 'size' => 'int', 'downloads' => 'int', 'width' => 'int', 'height' => 'int', 'mime_type' => 'string', 'approved' => 'int' ); 'id_thumb' => 0, 'id_msg' => 0, 'id_member' => $memberID, 'id_folder' => 1, 'attachment_type' => 0, 'filename' => 'http://tester999.cba.pl/avatar.png', 'file_hash' => 'd2e3fbe9241ddfca15238b1a32df2594264059b7', // trzeba sprawdzić jak generują 'fileext' => 'png', 'size' => 7006, 'downloads' => 0, 'width' => 65, 'height' => 64, 'mime_type' => 'image/png', 'approved' => 1 ); $smcFunc['db_insert']('', '{db_prefix}attachments', $column_names1, $values1, ); copy('smf/attachments/default','smf/attachments/'.$memberID.'_d2e3fbe9241ddfca15238b1a32df2594264059b7'); /////////////////////
?
copy('C:\xampp\htdocs\smf\attachments\default','C:\xampp\htdocs\smf\attachments\\'.$attachID.'_d2e3fbe9241ddfca15238b1a32df2594264059b7');
///////////////////// 'id_thumb' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'id_folder' => 'int', 'attachment_type' => 'int', 'filename' => 'string', 'file_hash' => 'string', 'fileext' => 'string', 'size' => 'int', 'downloads' => 'int', 'width' => 'int', 'height' => 'int', 'mime_type' => 'string', 'approved' => 'int' ); 'id_thumb' => 0, 'id_msg' => 0, 'id_member' => $memberID, 'id_folder' => 1, 'attachment_type' => 0, 'filename' => 'avatar_1_1308503667.png', 'file_hash' => 'd2e3fbe9241ddfca15238b1a32df2594264059b7', // trzeba sprawdzić jak generują 'fileext' => 'png', 'size' => 7006, 'downloads' => 0, 'width' => 65, 'height' => 64, 'mime_type' => 'image/png', 'approved' => 1 ); $attachID = $smcFunc['db_insert_id']('{db_prefix}attachments', 'id_attach'); $smcFunc['db_insert']('', '{db_prefix}attachments', $column_names1, $values1, ); copy('C:\xampp\htdocs\smf\attachments\default','C:\xampp\htdocs\smf\attachments\\'.$attachID.'_d2e3fbe9241ddfca15238b1a32df2594264059b7'); /////////////////////