Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I also have the problem with the function eregi (deprecated in php 5.3). I have to replace it with preg_match. The problem is the regular expressions, I can not understand how to write, I have to translate:

    eregi(‘^[a-z0-9]+\:/{1,2}’, $filename)

    ereg(‘^’.preg_quote($this->config_document_root), $filename)

    !ereg(‘^’.preg_quote(str_replace(DIRECTORY_SEPARATOR, ‘/’, realpath($this->config_document_root))), $AbsoluteFilename)

    eregi(‘^http\://.+\.(jpe?g|gif|png)$’, $phpThumb->src)

    eregi(‘^http\://.+\.(jpe?g|gif|png)$’, $phpThumb->src)

    $this->f = ereg_replace(‘[^a-z]’, ”, strtolower($this->f));

    eregi(‘bundled \((.+)\)$’, $gd_info[‘GD Version’], $matches)

    Thanks to those who will give me a hand, I’m running out!

    Yes this code should be used with this widget plugin! ??
    Yes, can it also play from a directory on the server, also random: rand(1,5)->play the file 1.mp3 2.mp3 3.mp3 4.mp3 5.mp3 …you have to rename the file so!
    you can change the number up to what you want. es: rand(1,100) for 100 song: 1.mp3 2.mp3 ………………. 99.mp3 100.mp3

    tsenglabs

    (@tsenglabs)

    Great!!
    I unfortunately do not know why, it does not work ….. I have changed ….
    here is an alternate version, modified by me

    <?php
    // file name 1.mp3 2.mp3 3.mp3 4.mp3 5.mp3 etc…
    // modify range (1,5) ES. (1,10) if you have also 6.mp3 7.mp3 8.mp3 9.mp3 10.mp3

    srand((double)microtime()*1000000);
    $fabio =rand(1,5);

    // QUERY
    $audios =& get_children( ‘post_parent=’.$post->ID.’&post_type=attachment&post_mime_type=audio’ );

    // IF HAVE ATTACHED AUDIOS AND AVAILABLE FUNCTION
    if (function_exists(“insert_audio_player”)) {

    // BASIC VARS
    $echou_ini = “[audio:”;
    $echou_aud = “”;
    $echou_tit = “.mp3”;
    $echou_end = “|autostart=yes]”;
    $counter = 0;
    $a = array();

    // GRAB VALUES AND MAKE TEMP ARRAY
    foreach ( $audios as $attachment_id => $attachment ) {
    $a[$counter][‘url’] = wp_get_attachment_url( $attachment_id );
    $post_id_7 = get_post($attachment_id);
    $a[$counter][‘tit’] = $post_id_7->post_title;
    $counter++;
    }

    // SHUFFLE TEMP ARRAY AND PREPARE AUX STRINGS
    shuffle($a);
    foreach ( $a as $audio ) {
    $echou_aud .= $audio[‘url’]. “,”;
    $echou_tit .= $audio[‘tit’].”,”;
    }

    // REMOVE EXTRA COMMA
    $echou_aud_new = substr($echou_aud, 0, -1);
    $echou_tit_new = substr($echou_tit, 0, -1);

    // MAIN STRING
    $echou_final = $echou_ini . $fabio . $echou_tit . $echou_end;

    // PRINT TEST STRING (REMOVE AFTER TEST)
    //echo $echou_final;

    // INSERT PLAYER
    insert_audio_player( $echou_final );
    }
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)