コード例 #1
0
ファイル: buildpodcast.php プロジェクト: kldeepak/swara
         $tempurl = $settings['url'] . "/pod/" . $fields['audio_file'];
     } else {
         $tempurl = $settings['url'] . "/pod/" . $tempurl;
     }
 }
 if (!isset($_GET['post']) or $_GET['post'] == "1") {
     //start building the item
     echo "\n\n<item>\n";
     //some important general stuff
     echo "    <pubDate>" . date("r", strtotime($fields['posted'])) . "</pubDate>\n";
     echo "    <title>" . html_to_xml($fields['title']) . "</title>\n";
     echo "    <link>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</link>\n";
     echo "    <guid>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</guid>\n";
     //author
     $postauthor = html_to_xml(getfullname($fields['author_id']));
     if (veryempty($postauthor)) {
         $postauthor = html_to_xml(getnickname($fields['author_id']));
     }
     echo "    <dc:creator>" . $postauthor . "</dc:creator>\n";
     echo "    <itunes:author>" . $postauthor . "</itunes:author>\n";
     //explicit or not?
     if ($settings['itunes_explicit'] == "1") {
         $setexpl = "yes";
     } else {
         $setexpl = "no";
     }
     echo "    <itunes:explicit>" . $setexpl . "</itunes:explicit>\n";
     //comments
     if ($fields['comment_on'] == "1") {
         echo "    <comments>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "#comments</comments>\n";
     }
コード例 #2
0
ファイル: player.php プロジェクト: kldeepak/swara
function player()
{
    //puts the 1 Pixel Out flash player OR quicktime player on screen (works within postings-loop)
    global $postings;
    global $currentid;
    global $settings;
    $audioexamine = "";
    $return = "";
    //decide: flash or quicktime
    $thetype = $postings[$currentid]['audio_type'];
    //redirect or direct link? Only Flash can be redirected for counting
    if ($thetype == "1" and $settings['countfla'] == "1") {
        $before = "get.php?fla=";
    } else {
        if ($postings[$currentid]['filelocal'] == "1") {
            $before = "audio/";
            $audioexamine = $GLOBALS['audiopath'] . $postings[$currentid]['audio_file'];
        } else {
            $before = "";
        }
    }
    if (!veryempty($postings[$currentid]['audio_file'])) {
        //possible attributes and default-values
        if (isset($att['width'])) {
            $width = $att['width'];
        } else {
            $width = 200;
        }
        if (isset($att['height'])) {
            $height = $att['height'];
        } else {
            $height = 62;
        }
        if ($postings[$currentid]['filelocal'] == 1) {
            $audio = $before . $postings[$currentid]['audio_file'];
        } else {
            $audio = $postings[$currentid]['audio_file'];
            if ($settings['countfla'] == "1") {
                $audio = $before . $audio;
            }
        }
        //if mp3
        if ($thetype == "1") {
            $pre = "0x";
            //....................this is the bit where you can change the colours.............
            //..............alter the hexadecimal colour values only (eg FFFFFF)...............
            //..............note that the hexadecimal values do not have a # at the front .....
            //...take care not to alter anything else (eg the inverted commas or the semicolons)
            $bg = $pre . "FFFFFF";
            //background
            $leftbg = $pre . "e4e5d4";
            //left background
            $lefticon = $pre . "809ab1";
            //left icon
            $rightbg = $pre . "49647d";
            //right background
            $rightbghover = $pre . "191970";
            //right background (hover)
            $righticon = $pre . "e4e5d4";
            //right icon
            $righticonhover = $pre . "809ab1";
            //right icon (hover)
            $text = $pre . "666666";
            //text
            $slider = $pre . "191970";
            //slider
            $track = $pre . "6495ED";
            //progress track
            $border = $pre . "666666";
            //progress track border
            $loader = $pre . "e4e5d4";
            //loader bar
            $bgcolor = "#" . "FFFFFF";
            //page background
            //....................don't change anything below this line............
            //where can we find the audio file and the player
            $soundFile = $settings['url'] . "/" . $audio;
            $playerlocation = $settings['url'] . "/loudblog/custom/templates/" . $settings['template'] . "/player.swf";
            //build the string containing the parameters to be passed to the audio player
            $paramstring = "playerID=1&bg=" . $bg . "&leftbg=" . $leftbg . "&lefticon=" . $lefticon . "&rightbg=" . $rightbg . "&rightbghover=" . $rightbghover . "&righticon=" . $righticon . "&righticonhover=" . $righticonhover . "&text=" . $text . "&slider=" . $slider . "&track=" . $track . "&border=" . $border . "&loader=" . $loader . "&soundFile=" . $soundFile;
            //and convert special characters to html entities
            $flashvalue = htmlspecialchars($paramstring);
            //build up the code for displaying the player line by line
            $firstline = "<object type=\"application/x-shockwave-flash\" data=\"" . $playerlocation . "\" width=\"290\" height=\"24\" id=\"audioplayer1\">";
            $secondline = "<param name=\"movie\" value=\"" . $playerlocation . "\" />";
            $thirdline = "<param name=\"FlashVars\" value=\"" . $flashvalue . "\" />";
            $fourthline = "<param name=\"quality\" value=\"high\" />";
            $fifthline = "<param name=\"menu\" value=\"false\" />";
            $sixthline = "<param name=\"wmode\" value=\"transparent\" /></object>";
            //and stick them together
            $return = $firstline . $secondline . $thirdline . $fourthline . $fifthline . $sixthline;
        }
        //if quicktime audio
        if ($thetype == "2" or $thetype == "5" or $thetype == "6" or $thetype == "9" or $thetype == "12" or $thetype == "14") {
            //making an absolute link
            if ($postings[$currentid]['filelocal'] == "1") {
                $audio = $settings['url'] . "/" . $audio;
            }
            //Make width and height for showing Enhanced Podcast!
            if ($thetype == "14") {
                $fileinfo = getid3data($audioexamine, "front");
                if ($fileinfo['width'] != "") {
                    $width = $fileinfo['width'];
                    $height = $fileinfo['height'] + 16;
                    $href = "loudblog/backend/clicktoplayvideo.mov";
                } else {
                    $height = "16";
                    $href = "loudblog/backend/clicktoplayaudio.mov";
                }
            } else {
                $height = "16";
                $href = "loudblog/backend/clicktoplayaudio.mov";
            }
            //build html-code for quicktime plugin (audio)
            $return .= showquicktime($href, $audio, $width, $height, "myself", "false");
        }
        //if quicktime video
        if ($thetype == "7" or $thetype == "10" or $thetype == "13") {
            //making an absolute link
            if ($postings[$currentid]['filelocal'] == "1") {
                $audio = $settings['url'] . "/" . $audio;
                $target = "myself";
            } else {
                $target = "quicktimeplayer";
            }
            //getting width and height from getid3()
            $fileinfo = getid3data($audioexamine, "front");
            //build html-code for quicktime plugin (video)
            $return .= showquicktime("loudblog/backend/clicktoplayvideo.mov", $audio, $fileinfo['width'], $fileinfo['height'] + 16, $target, "false");
        }
        return $return;
    } else {
        return "";
    }
}
コード例 #3
0
function amendtags($criteria, $action, $oldtag, $newtag)
{
    if ($action == "add") {
        $message = bla("msg_addtag_1") . $newtag . bla("msg_addtag_2");
    }
    if ($action == "delete") {
        $message = bla("msg_deletetag") . $oldtag . "'";
    }
    if ($action == "replace") {
        $message = bla("msg_replacetag_1") . $oldtag . bla("msg_replacetag_2") . $newtag . "'";
    }
    if ($action == "replace" and veryempty($newtag)) {
        $message = bla("msg_no_tag");
    }
    if ($action == "add" and veryempty($newtag)) {
        $message = bla("msg_no_tag");
    }
    //we want to add, delete or replace $oldtag - so lets get tag info for all posts
    $dosql = "SELECT id, tags FROM " . $GLOBALS['prefix'] . "lb_postings" . $criteria;
    $tagarray = $GLOBALS['lbdata']->GetArray($dosql);
    $i = 0;
    //go through the posts one by one
    foreach ((array) $tagarray as $tagline) {
        $newtagline = "";
        $tags = explode(" ", $tagarray[$i]['tags']);
        //if 'add' and $newtag is not already present, add it
        if ($action == "add" and !in_array($newtag, $tags)) {
            $newtagline = $tagline['tags'] . " " . $newtag;
        } else {
            foreach ($tags as $t) {
                //if 'delete' and we find $oldtag, then delete it
                if ($action == "delete" and $t == $oldtag) {
                    continue;
                }
                //if 'replace' and we find $oldtag, replace it with $newtag (unless $newtag is an empty string)
                if ($action == "replace" and $t == $oldtag and !veryempty($newtag)) {
                    $t = $newtag;
                }
                $newtagline .= " " . $t;
            }
        }
        //replace the old tag line in the array with the new tag line
        $tagarray[$i]['tags'] = trim($newtagline);
        //go back for the next line
        $i += 1;
    }
    //and post the new taglines in the database
    foreach ((array) $tagarray as $tagline) {
        $tagline['tags'] = htmlentities($tagline['tags'], ENT_QUOTES, "UTF-8");
        $dosql = "UPDATE " . $GLOBALS['prefix'] . "lb_postings SET tags = '" . $tagline['tags'] . "' WHERE id = '" . $tagline['id'] . "'";
        if (!$GLOBALS['lbdata']->Execute($dosql)) {
            $message = bla("msg_database_error");
        }
    }
    message($message);
}
コード例 #4
0
ファイル: loudblogtags.php プロジェクト: kldeepak/swara
function if_audio($content)
{
    //parse content only if audio file is attached
    global $postings;
    global $currentid;
    if (!veryempty($postings[$currentid]['audio_file'])) {
        return trim(fullparse(stripcontainer($content)));
    } else {
        return "";
    }
}
コード例 #5
0
ファイル: functions.php プロジェクト: kldeepak/swara
/**
 * gets the Loudblog-Code from a filename
 *
 * @param unknown_type $request
 * @return unknown
 */
function type_suffix($request)
{
    //we have an absolute path? okay, the file is the request
    if (substr_count($request, "/") > 0) {
        $file = $request;
        //relative path? use the audio path!
    } else {
        $file = $GLOBALS['audiopath'] . $request;
    }
    $type = strtoupper(strrchr($request, "."));
    switch ($type) {
        case ".MP3":
            return "1";
            break;
        case ".AAC":
            return "2";
            break;
        case ".MP4":
            return "10";
            break;
        case ".M4V":
            return "10";
            break;
        case ".3GP":
            return "10";
            break;
        case ".OGG":
            return "3";
            break;
        case ".WMA":
            return "4";
            break;
        case ".WMV":
            return "11";
            break;
        case ".WMF":
            return "11";
            break;
        case ".WAV":
            return "5";
            break;
        case ".AIF":
            return "6";
            break;
        case ".AIFF":
            return "6";
            break;
        case ".MOV":
            return "7";
            break;
        case ".AVI":
            return "8";
            break;
        case ".MID":
            return "12";
            break;
        case ".MPG":
            return "13";
            break;
            //do we have a width/length in the files? These are Enhanced Podcasts!
        //do we have a width/length in the files? These are Enhanced Podcasts!
        case ".M4A":
            if (substr_count($request, "://") > 0) {
                return "14";
            } else {
                $id3 = getid3data($file, "back");
                if (!veryempty($id3['height'])) {
                    return "14";
                } else {
                    return "2";
                }
            }
            break;
        case ".M4B":
            if (substr_count($request, "://") > 0) {
                return "9";
            } else {
                $id3 = getid3data($file, "back");
                if (!veryempty($id3['height'])) {
                    return "14";
                } else {
                    return "9";
                }
            }
            break;
        default:
            return "0";
            break;
    }
}