<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/
require_once __DIR__ . '/../../src/server/config/boot_global.php';
require_once __DIR__ . '/../../src/server/config/boot_local.php';

function liveAddTBuddyNews()
{
    // Set DB configuration for live teamdata access
    Francis_Utils_Config::set( 'db.tbteamdata.host', 'XXXXXXXX' );
    Francis_Utils_Config::set( 'db.tbteamdata.name', 'd01c3281' );
    Francis_Utils_Config::set( 'db.tbteamdata.user', 'd01c3281' );
    Francis_Utils_Config::set( 'db.tbteamdata.pass', 'XXXXXXXXX' );

    $newsHeader = 'Neue Premium Funktion';
    $newsBody = 'Exportiere nun alle Termindaten einfach mittels der neuen Export Funktion auf der Terminseite.';

    /** @var TB_Shared_Ent_TeamData_News $entNews */
    $entNews = new TB_Shared_Ent_TeamData_News();
    $entNews->team_id = NULL;
    $entNews->author_profile_id = NULL;
    $entNews->txt_key = 'txt_news_tbuddy';
    $entNews->txt_key_params_sr= array( 'news_head' => $newsHeader, 'news_body' => nl2br( $newsBody ) );
    $entNews->ref_content_type = TB_Shared_Ent_TeamData_News::REF_CONTENT_TYPE_TBUDDY_NEWS;
    $entNews->created = time();
    $entNews->save();

    echo "DONE...";
}
___liveAddTBuddyNews();
