Ejemplo n.º 1
0
    public static function ClassicNavTable($the_gallery_list, $width, $number_of_columns, &$videolist_row, &$theme_row, $AllowPagination, $videoid, $custom_itemid = 0)
    {
        require_once JPATH_SITE . DS . 'components' . DS . 'com_youtubegallery' . DS . 'includes' . DS . 'misc.php';
        $misc = new YouTubeGalleryMisc();
        $misc->videolist_row = $videolist_row;
        $misc->theme_row = $theme_row;
        if ($theme_row->prepareheadtags > 0) {
            $curPageUrl = YoutubeGalleryLayoutRenderer::curPageURL();
            $document = JFactory::getDocument();
        }
        $catalogresult = '';
        $paginationcode = '';
        $w_str = 'width:' . $width . (strpos($width, '%') === false ? 'px' : '') . ';';
        $catalogresult .= '<table cellspacing="0" ' . ($theme_row->navbarstyle != '' ? 'style="' . $w_str . 'padding:0;border:none;' . $theme_row->navbarstyle . '" ' : 'style="' . $w_str . 'padding:0;border:none;margin:0 auto;"') . '>
		<tbody>';
        $column_width = floor(100 / $number_of_columns) . '%';
        $gallery_list = $the_gallery_list;
        $getinfomethod = YouTubeGalleryMisc::getSettingValue('getinfomethod');
        $misc->RefreshVideoData($gallery_list, $getinfomethod);
        $tr = 0;
        $count = 0;
        $bgcolor = $theme_row->bgcolor;
        $item_index = 1;
        foreach ($gallery_list as $listitem) {
            if (strpos($listitem['title'], '***Video not found***') === false) {
                if ($getinfomethod == 'js') {
                    $thumbnail_item = 'updater';
                    if ($tr == 0) {
                        $catalogresult .= '<tr style="border:none;" >';
                    }
                    $catalogresult .= '<td style="width:' . $column_width . ';vertical-align:top;text-align:center;border:none;' . ($bgcolor != '' ? ' background-color: #' . $bgcolor . ';' : '') . '">' . $thumbnail_item . '</td>';
                    $tr++;
                    if ($tr == $number_of_columns) {
                        $catalogresult .= '
							</tr>
				';
                        if ($count + 1 < count($gallery_list)) {
                            $catalogresult .= '
						<tr style="border:none;"><td colspan="' . $number_of_columns . '" style="border:none;" ><hr' . ($theme_row->linestyle != '' ? ' style="' . $theme_row->linestyle . '" ' : '') . ' /></td></tr>';
                        }
                        $tr = 0;
                    }
                    $count++;
                } else {
                    $aLinkURL = '';
                    if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) {
                        //$title=str_replace('"','ygdoublequote',$listitem['title']);
                        //$description=str_replace('"','ygdoublequote',$listitem['description']);
                        //$title=str_replace('\'','ygsinglequote',$title);
                        //$description=str_replace('\'','ygsinglequote',$description);
                        //$aLink='javascript:YoutubeGalleryHotVideoSwitch'.$videolist_row->id.'(\''.$listitem['videoid'].'\',\''.$listitem['videosource'].'\',\''.$title.'\',\''.$description.'\')';
                        $aLink = 'javascript:YoutubeGalleryHotVideoSwitch' . $videolist_row->id . '(\'' . $listitem['videoid'] . '\',\'' . $listitem['videosource'] . '\',' . $listitem['id'] . ')';
                    } else {
                        $aLink = YoutubeGalleryLayoutRenderer::makeLink($listitem, $theme_row->rel, $aLinkURL, $videolist_row->id, $theme_row->id, $custom_itemid);
                    }
                    $isForShadowBox = false;
                    if (isset($theme_row)) {
                        if ($theme_row->rel != '') {
                            $isForShadowBox = true;
                        }
                    }
                    if ($isForShadowBox and $theme_row->rel != '' and $theme_row->openinnewwindow != 4 and $theme_row->openinnewwindow != 5) {
                        $aLink .= '&tmpl=component';
                    }
                    if ($theme_row->hrefaddon != '' and $theme_row->openinnewwindow != 4 and $theme_row->openinnewwindow != 5) {
                        $hrefaddon = str_replace('?', '', $theme_row->hrefaddon);
                        if ($hrefaddon[0] == '&') {
                            $hrefaddon = substr($hrefaddon, 1);
                        }
                        if (strpos($aLink, $hrefaddon) === false) {
                            if (strpos($aLink, '?') === false) {
                                $aLink .= '?';
                            } else {
                                $aLink .= '&';
                            }
                            $aLink .= $hrefaddon;
                        }
                    }
                    if ($theme_row->openinnewwindow != 4 and $theme_row->openinnewwindow != 5) {
                        if (strpos($aLink, '&amp;') === false) {
                            $aLink = str_replace('&', '&amp;', $aLink);
                        }
                        $aLink = $aLink . (($theme_row->openinnewwindow == 2 or $theme_row->openinnewwindow == 3) ? '#youtubegallery' : '');
                    }
                    //to apply shadowbox
                    //do not route the link
                    $aHrefLink = '<a href="' . $aLink . '"' . ($theme_row->rel != '' ? ' rel="' . $theme_row->rel . '"' : '') . (($theme_row->openinnewwindow == 1 or $theme_row->openinnewwindow == 3) ? ' target="_blank"' : '') . '>';
                    $thumbnail_item = YoutubeGalleryLayoutRenderer::renderThumbnailForNavBar($aHrefLink, $aLink, $videolist_row, $theme_row, $listitem, $videoid, $item_index, $gallery_list);
                    if ($thumbnail_item != '') {
                        if ($tr == 0) {
                            $catalogresult .= '<tr style="border:none;" >';
                        }
                        $catalogresult .= '<td style="width:' . $column_width . ';vertical-align:top;text-align:center;border:none;' . ($bgcolor != '' ? ' background-color: #' . $bgcolor . ';' : '') . '">' . $thumbnail_item . '</td>';
                        $tr++;
                        if ($tr == $number_of_columns) {
                            $catalogresult .= '
							</tr>
						';
                            if ($count + 1 < count($gallery_list)) {
                                $catalogresult .= '
							<tr style="border:none;"><td colspan="' . $number_of_columns . '" style="border:none;" ><hr' . ($theme_row->linestyle != '' ? ' style="' . $theme_row->linestyle . '" ' : '') . ' /></td></tr>';
                            }
                            $tr = 0;
                        }
                        $count++;
                    }
                }
                $item_index++;
            }
        }
        if ($tr > 0) {
            $catalogresult .= '<td style="border:none;" colspan="' . ($number_of_columns - $tr) . '">&nbsp;</td></tr>';
        }
        $catalogresult .= '</tbody>
	   
    </table>
	
	';
        return $catalogresult;
    }
Ejemplo n.º 2
0
$videoid = JRequest::getVar('videoid');
if (isset($_POST['ygvdata'])) {
    $video_data = $_POST['ygvdata'];
    require_once JPATH_SITE . DS . 'components' . DS . 'com_youtubegallery' . DS . 'includes' . DS . 'misc.php';
    $video_data = str_replace('"', '\\"', $video_data);
    YouTubeGalleryMisc::setRawData($videoid, $video_data);
    $db = JFactory::getDBO();
    $query = 'SELECT * FROM `#__youtubegallery_videos` WHERE `videoid`="' . $videoid . '"';
    $db->setQuery($query);
    if (!$db->query()) {
        die($db->stderr());
    }
    $videos_rows = $db->loadAssocList();
    $misc = new YouTubeGalleryMisc();
    $getinfomethod = YouTubeGalleryMisc::getSettingValue('getinfomethod');
    $misc->RefreshVideoData($videos_rows, $getinfomethod, true);
    $query = 'SELECT * FROM `#__youtubegallery_videos` WHERE `videoid`="' . $videoid . '"';
    $db->setQuery($query);
    if (!$db->query()) {
        die($db->stderr());
    }
    $videos_rows = $db->loadAssocList();
    if (count($videos_rows) != 0) {
        $row = $videos_rows[0];
        echo '*title_start*=' . $row['title'] . '*title_end*';
        echo '*description_start*=' . $row['description'] . '*description_end*';
        echo '*lastupdate_start*=' . $row['lastupdate'] . '*lastupdate_end*';
    } else {
        echo '*status_start*=video not found*status_end*';
    }
} else {