<commit_before><?php

include_once 'header.php';
include_once 'methods.php';
include_once 'database.php';

$useCKEditor = false;

if( $useCKEditor )
    echo '<script src="https://cdn.ckeditor.com/4.6.2/standard/ckeditor.js"></script>';
?>

<script>
function displayEvent( button )
{
    alert( button.value );
};
function displayRequest( button )
{
    alert( button.value );
};
</script>

<?php

function fixHTML( $html, $strip_tags = false )
{
    $res = $html;
    if( $strip_tags )
        $res = strip_tags(  $res, '<br><p><a><strong><tt>' );
    // Replate all new line with space.
    $res = preg_replace( "/[\r\n]+/", ' ', $res );
    $res = str_replace( '<br />', ' ', $res );
    $res = str_replace( '<br/>', ' ', $res );
    $res = str_replace( '<br>', ' ', $res );


    return $res;
}

/**
    * @brief Generate SPEAKER HTML with homepage and link.
    *
    * @param $speaker
    *
    * @return 
 */
function speakerToHTML( $speaker )
{
    if( is_string( $speaker ) )
    {
        $speaker = explode( ' ', $speaker );
        $fname = $speaker[0];
        $lname = end( $speaker );
        $speaker[ 'first_name' ] = $fname;
        $speaker[ 'last_name' ] = $lname;
        $speaker = getTableEntry( 'speakers', 'first_name,last_name', $speaker );
    }

    // Get name of the speaker.
    $name = array( );
    foreach( explode( ',', 'first_name,middle_name,last_name' ) as $k )
        if( $speaker[ $k ] )
            array_push( $name, $speaker[ $k ] );

    $name = implode( ' ', $name );

    // Start preparing speaker HTML.
    $html = $name;

    // If there is url. create a clickable link.
    if( $speaker )
    {
        if( array_key_exists('homepage', $speaker) && $speaker[ 'homepage' ] )
            $html .=  '<br><a target="_blank" href="' . $speaker['homepage'] . '">Homepage</a>';

        if( $speaker[ 'department' ] )
            $html .= "<small><br>" . $speaker[ 'department' ];

        $html .= "<br>" . $speaker[ 'institute' ] . "</small>";
    }

    return $html;<commit_msg>Fixed issue with show talk issue.<commit_after><?php

include_once 'header.php';
include_once 'methods.php';
include_once 'database.php';

$useCKEditor = false;

if( $useCKEditor )
    echo '<script src="https://cdn.ckeditor.com/4.6.2/standard/ckeditor.js"></script>';
?>

<script>
function displayEvent( button )
{
    alert( button.value );
};
function displayRequest( button )
{
    alert( button.value );
};
</script>

<?php

function fixHTML( $html, $strip_tags = false )
{
    $res = $html;
    if( $strip_tags )
        $res = strip_tags(  $res, '<br><p><a><strong><tt>' );
    // Replate all new line with space.
    $res = preg_replace( "/[\r\n]+/", ' ', $res );
    $res = str_replace( '<br />', ' ', $res );
    $res = str_replace( '<br/>', ' ', $res );
    $res = str_replace( '<br>', ' ', $res );


    return $res;
}

/**
    * @brief Generate SPEAKER HTML with homepage and link.
    *
    * @param $speaker
    *
    * @return 
 */
function speakerToHTML( $speaker )
{
    
    if( is_string( $speaker ) )
    {
        // Remove Dr. Prof. Mr. Mrs. etc from name.
        $speaker = preg_replace( '/(Dr|Prof|Mr\w?)\s*/', '', $speaker );
        $speaker = explode( ' ', $speaker );
        $fname = $speaker[0];
        $lname = end( $speaker );
        $speaker[ 'first_name' ] = $fname;
        $speaker[ 'last_name' ] = $lname;
        $speaker = getTableEntry( 'speakers', 'first_name,last_name', $speaker );
    }

    // Get name of the speaker.
    $name = array( );
    foreach( explode( ',', 'honorific,first_name,middle_name,last_name' ) as $k )
        if( $speaker[ $k ] )
            array_push( $name, $speaker[ $k ] );

    $name = implode( ' ', $name );

    // Start preparing speaker HTML.
    $html = $name;

    // If there is url. create a clickable link.
    if( $speaker )
    {
        if( array_key_exists('homepage', $speaker) && $speaker[ 'homepage' ] )
            $html .=  '<br><a target="_blank" href="' . $speaker['homepage'] . '">Homepage</a>';

        if( $speaker[ 'department' ] )
            $html .= "<small><br>" . $speaker[ 'department' ];

        $html .= "<br>" . $speaker[ 'institute' ] . "</small>";
    }

    return $html;
{'fraction_non_alphanumeric': 0.19681861348528015, 'fraction_numerical': 0.001899335232668566, 'mean_word_length': 2.507910074937552, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 43, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3539854', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1487, 'n_words': 342}