J'essaye d'envoyer en mass des messages privé, le probléme c'est qu'avec la limite des 30 sec d'execution de php.ini le script ne va pas jusqu'au bout. Comment évité cette limite des 30 sec ? (a part changer la limite dans php.ini biensur :-p)
voilà le script si sa peu aider, est-ce que quelqu'un aurait une idée ?
$DB->simple_construct( array( 'select' => 's.member_id, c.name',
'from' => 'pfields_content s LEFT JOIN '.SQL_PREFIX.'members c ON (s.member_id=c.id) ',
'where' => " $condition " ) );
$DB->simple_exec();
if ( $DB->get_num_rows() )
{
while ( $row = $DB->fetch_row() )
{
$val = "|";
$msg = $ibforums->input['Post'];
$ids[] = $row['name'];
}
foreach($ids as $name) {
if ($to_name != "") $to_name.="|";
$to_name.= $name;
}
$to_users = $std->clean_value( $std->txt_UNhtmlspecialchars($to_name) );
$to_array = explode('|', $to_users);
if ( is_array($to_array) && count($to_array) )
{
foreach ( $to_array as $k )
{
$tmp[] = $k;
}
}
else
{
$tmp[] = $to_users;
}
$pm_to = array();
$pm_to = array_unique($tmp);
require_once( ROOT_PATH.'sources/lib/msg_functions.php' );
$msglib = new msg_functions(1);
$msglib->init();
for ( $i = 0; $i < count($pm_to); $i++ )
{
$msglib->to = $pm_to[$i];
$msglib->from_member = $ibforums->member;
$msglib->msg_title = $titl;
$msglib->msg_post = $msg;
$msglib->force_pm = 1;
$msglib->send_pm();
if ( $msglib->error ) return;
}
}
//-----------------------------------------
// Swap and serve...
//-----------------------------------------
$text = preg_replace( "/<#FROM_MEMBER#>/" , $ibforums->member['name'] , $ibforums->lang['sent_text'] );
$text = preg_replace( "/<#MESSAGE_TITLE#>/" , $ibforums->input['msg_title'], $text );
$print->redirect_screen( $text , "&act=Msg&CODE=01" );
}