Theme Functions run a function upon activation or preview

Try

if ( isset($_GET['activated']) && $_GET['activated'] == 'true' || isset($_GET['preview']) && $_GET['preview'] == 1 )

instead of

if ( $_GET['activated'] == 'true' || $_GET['preview'] == 1 )

Edit:

You should wrap the if-sentence in the functions.php file into a function and a relevant hook. Here is an example using the after_theme_setup hook:

add_action('after_theme_setup','my_theme_setup');
function my_theme_setup(){
    if ( isset($_GET['activated']) && $_GET['activated'] == 'true' || isset($_GET['preview']) && $_GET['preview'] == 1 ){
        ddthemes_setup();
    }
}