示例#1
0
         $jsavatar = $db->loadResult();
     } elseif ($params->get('js_avatar') == 1) {
         $query = 'SELECT thumb FROM #__community_users WHERE userid = ' . $row->created_by;
         $db->setQuery($query);
         $jsavatar = $db->loadResult();
     }
 }
 //Get first of article's images (par Thor) ------------ $getimage
 if ($params->get('show_image') == '1' || $params->get('show_image') == '4' || $params->get('show_image') == '6' || $params->get('show_image') == '8') {
     $wheretolook = $row->introtext . $row->fulltext;
     $getimage = getFirstImg($wheretolook);
 }
 //Get Youtube ID from {youtube} TAG ------------------- $vid
 if ($params->get('youthumb')) {
     $wheretolook = $row->introtext . $row->fulltext;
     $pid = getYoutubeID($wheretolook);
     if ($pid) {
         $vid = "http://img.youtube.com/vi/" . $pid . "/default.jpg";
     }
 }
 //Get Image folder from {gallery} TAG ------------------- $gal
 if ($params->get('gallery')) {
     $basegalfolder = $params->get('basfold');
     $wheretolook = $row->introtext . $row->fulltext;
     $al = getGalFolder($wheretolook);
     if ($al) {
         $fold = $basegalfolder . '/' . $al;
         $d = dir($fold) or die("Wrong path: {$fold}");
         while (false !== ($entry = $d->read())) {
             if ($entry != '.' && $entry != '..' && !is_dir($dir . $entry)) {
                 $gimages[] = $entry;
示例#2
0
    fclose($oFile);
}
// Parcours les ligne de youtubeAdd.txt
if (is_file(PATH_OVERLAY_YOUTUBE_ADD)) {
    $oFile = fopen(PATH_OVERLAY_YOUTUBE_ADD, "r");
    $aProfile = array();
    while (!feof($oFile)) {
        $sLine = fgets($oFile, 4096);
        // explose la ligne et stop si il manque auteur &| link
        $aData = explode(' ', $sLine);
        // Récupére les donné et stop si le lien est invalide
        $sAuteur = formatName($aData[0]);
        if (!isset($aData[1])) {
            $sLink = false;
        } else {
            $sLink = trim(getYoutubeID($aData[1]));
        }
        if (!isset($aData[2])) {
            $sPlaylist = 'viewer';
        } else {
            $sPlaylist = $aData[2];
        }
        $sPlaylist = trim(strtolower($sPlaylist));
        if (isset($sAuteur) && !empty($sAuteur) && $sLink) {
            while (true) {
                // Supprime les doublons de viewer si ils ont déjà était lus, pour que le songrequest sois accepté
                $oPDO->query('DELETE FROM youtube WHERE youtubeID="' . $sLink . '" AND playlist="viewer" AND played>0');
                // Vérifie que la musique existe pas déjà
                $iCount = $oPDO->query('SELECT COUNT(*) FROM youtube WHERE youtubeID="' . $sLink . '" AND playlist="viewer"')->fetch(PDO::FETCH_COLUMN);
                if ($iCount != '0' && $sAuteur != 'Nestoyeur') {
                    $iADD = 0;