Ben sql sorgusu ile forumuma yeni konu eklemek istiyorum. Bunu nasıl yapabilirim?
komut insert into ile başlayacak sanırım ama mysql fazla bilmediğim için gerisini yapamıyorum.
Web sayfamız sadece phpBB 3.0.x sürümlerine destek vermektedir. Konu açmadan, ileti yazmadan önce lütfen site kuralları sayfamıza göz atınız.
<?php
/**
* @version $Id$
* @author Sevdin Filiz <angelside@users.sourceforge.net>
* @copyright (c) 2008, Canver Software
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$mode = request_var('mode', '');
switch ($mode)
{
case 'user':
$kac_uye = 1000;
$i = 0;
while ($i < $kac_uye)
{
$user_row = array(
'user_type' => USER_NORMAL,
'group_id' => 2,
'username' => 'test_uye' . $i,
'user_regdate' => time(),
'user_password' => '',
'user_colour' => '9E8DA7',
'user_email' => '',
'user_lang' => 'tr',
'user_style' => 1,
'user_timezone' => 0,
'user_dateformat' => '',
'user_allow_massemail' => 0,
);
user_add($user_row);
$i++;
}
echo $i . 'kullanıcı açıldı <br />';
break;
case 'post':
$kac_konu = 1000;
$i = 0;
while ($i < $kac_konu)
{
// note that multibyte support is enabled here
$my_subject = 'konu ' . $i; //utf8_normalize_nfc(request_var('my_subject', '', true));
$my_text = 'mesaj ' . $i; //utf8_normalize_nfc(request_var('my_text', '', true));
// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = '';
generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);
$data = array(
'forum_id' => 2,
'icon_id' => false,
'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => true,
'enable_sig' => true,
'message' => $my_text,
'message_md5' => md5($my_text),
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'poster_id' => 2,
'post_edit_locked' => 0,
'topic_title' => $my_subject,
'notify_set' => false,
'notify' => false,
'post_time' => 0,
'forum_name' => '',
'enable_indexing' => true,
'post_approved' => true,
);
submit_post('post', $my_subject, '', POST_NORMAL, $poll, $data);
$i++;
}
echo $i . 'konu açıldı <br />';
break;
}
/*
page_header($user->lang['INDEX']);
$template->set_filenames(array(
// 'body' => 'index_body.html')
);
page_footer();
*/
?>
CitLemBiK yazdı:Basligi acanin adi...
Basligi acanin ip adresi...
Basligin acilis tarihi...
Basligin görüntülenme sayisi...
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 1 misafir