Die anderen Gallerien sind alle viel zu arg aufgetragen.
Ich muss nun also doch den Code anpassen.
PHP-Code:
function SingleGallery() {
$template['total'] = $this->cObj->getSubpart($this->template,$this->conf['singleLayout']==0?'###SINGLEVIEW###':'###SINGLEVIEW1###');
$template['item'] = $this->cObj->getSubpart($template['total'],'###THUMBLIST###');
$template['single'] = $this->cObj->getSubpart($template['total'],'###SINGLEONE###');
$innercontent=$singlecontent=$cap='';
$single=array();
if(!isset($this->piVars['id'])) $this->piVars['id']=$this->conf['singleView.']['singleID'];
$page=intval($this->piVars['page']);
// get Data
$where = '';
if ($this->sys_language_mode == 'strict' && $GLOBALS['TSFE']->sys_language_content) {
$tmpres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_sksimplegallery_galleries.l18n_parent', 'tx_sksimplegallery_galleries', 'tx_sksimplegallery_galleries.sys_language_uid = '.$GLOBALS['TSFE']->sys_language_content.$this->enableFields);
$strictUids = array();
while ($tmprow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($tmpres)) {
$strictUids[] = $tmprow['l18n_parent'];
}
$strStrictUids = implode(',', $strictUids);
$where .= '(tx_sksimplegallery_galleries.uid IN (' . ($strStrictUids?$strStrictUids:0) . ') OR tx_sksimplegallery_galleries.sys_language_uid=-1)';
} else
$where .= 'tx_sksimplegallery_galleries.sys_language_uid IN (0,-1)';
$where .= ' AND deleted = 0 AND hidden = 0';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_sksimplegallery_galleries', $where.' AND uid='.intval($this->piVars['id']));
if(!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
return "no data for this view";
break;
}
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
// get the translated record if the content language is not the default language
if ($GLOBALS['TSFE']->sys_language_content) {
$OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':'');
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_sksimplegallery_galleries', $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);
}
$thumb_ids=explode(',',$row['pictures']);
$count=count($thumb_ids);
//PB
$PB='';
// initialize loop params
$start=0;
$end=$count;
// calculate Pagebrowser (only with $this->conf['singleLayout']==0)
if($this->conf['singleLayout']==0 || ($this->conf['singleLayout']==1 && !$this->piVars['single']) ) {
if(intval($this->conf['singlePageRecords'])>0 && $count>intval($this->conf['singlePageRecords']) ) {
$maxpages=ceil($count/intval($this->conf['singlePageRecords']));
$start=$page*$this->conf['singlePageRecords'];
$end=$start+$this->conf['singlePageRecords']>$count?$count:$start+$this->conf['singlePageRecords'];
$PB.='<p class="pagebrowser">'.$this->pi_getLL('pi_list_browseresults_page','Page').' ';
for($i=0;$i<$maxpages;$i++) {
$PB.=($i==$page ? '<span class="active">'.($i+1) : '<span><a href="'.$this->pi_linkTP_keepPIvars_url(array('page'=>$i),1,0,$GLOBALS['TSFE']->id).'">'.($i+1).'</a>').'</span>';
}
$PB.='</p>';
}
}
$this->caption='';
for($i=$start;$i<$end;$i++) {
$where = '';
if ($this->sys_language_mode == 'strict' && $GLOBALS['TSFE']->sys_language_content) {
$tmpres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_sksimplegallery_pictures.l18n_parent', 'tx_sksimplegallery_pictures', 'tx_sksimplegallery_pictures.sys_language_uid = '.$GLOBALS['TSFE']->sys_language_content.$this->enableFields);
$strictUids = array();
while ($tmprow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($tmpres)) {
$strictUids[] = $tmprow['l18n_parent'];
}
$strStrictUids = implode(',', $strictUids);
$where .= '(tx_sksimplegallery_pictures.uid IN (' . ($strStrictUids?$strStrictUids:0) . ') OR tx_sksimplegallery_pictures.sys_language_uid=-1)';
} else
$where .= 'tx_sksimplegallery_pictures.sys_language_uid IN (0,-1)';
$where .= ' AND uid='.intval($thumb_ids[$i]).' and hidden=0 and deleted=0';
$query = $GLOBALS['TYPO3_DB']->SELECTquery(
'*', // SELECT ...
'tx_sksimplegallery_pictures', // FROM ...
$where, // WHERE...
'', // GROUP BY...
'', // ORDER BY...
'' // LIMIT ...
);
$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
// already localized picture
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$query = $GLOBALS['TYPO3_DB']->SELECTquery(
'*', // SELECT ...
'tx_sksimplegallery_pictures', // FROM ...
'uid = ' . intval($thumb_ids[$i]) . ' AND deleted = 0 AND hidden = 0',
'', // GROUP BY...
'', // ORDER BY...
'' // LIMIT ...
);
$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
$thumb = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
} else {
$thumb = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
// get the translated record if the content language is not the default language
if ($GLOBALS['TSFE']->sys_language_content) {
$OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':'');
$thumb = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_sksimplegallery_pictures', $thumb, $GLOBALS['TSFE']->sys_language_content, $OLmode);
}
}
if($thumb) {
$this->conf['thumbView.']['file']=$this->uploaddir.$thumb['picture'];
$this->conf['thumbView.']['params'] = $this->pi_classParam('image');
$this->conf['thumbView.']['altText'] = $thumb['title'];
$this->conf['thumbView.']['titleText'] = $thumb['title'];
$this->conf['thumbView.']['caption'] = $thumb['description'] ? strip_tags($thumb['description']) : $thumb[$this->config['popupAltDescriptionField']];
$this->caption.=$thumb['title']."\n";
//retrieve EXIF Data
$markerArray['###EXIF###']='';
if(!$this->conf['donotreadEXIF']) {
$exif = $this->getExifData($this->uploaddir.$thumb['picture']);
$markerArray['###EXIF###']=is_array($exif) ? $this->cObj->stdWrap($this->infoExifDiv($exif),$this->conf['exifData.']) : '';
}
$popup=$this->cObj->data['tx_kjimagelightbox2_imagelightbox2']==0?$this->conf['thumbMode']:0;
if($this->conf['singleLayout']==1) $popup=0;
$markerArray['###THUMB###']=$this->ImageMarker($this->conf['thumbView.'],$popup);
$imginfo=$GLOBALS['TSFE']->lastImageInfo;
$markerArray['###WIDTH###']='style="width:'.$imginfo[0].'px;"';
if($this->cObj->data['tx_kjimagelightbox2_imagelightbox2']==0 && $popup==0) {
$markerArray['###THUMB###']=$this->pi_linkTP_keepPIvars($markerArray['###THUMB###'],array('id'=>$this->piVars['id'],'backpid'=>$this->piVars['backpid'],'page'=>$this->piVars['page'],'single'=>$thumb['uid']),1,1,$GLOBALS["TSFE"]->id);
}
$markerArray['###THUMBTITLE###']=$thumb['title'];
if($this->conf['activateEcards']==1) {
$linkWrapArray['###ECARDLINK###']=explode('|',$this->pi_linkToPage('|',$this->conf['eCards.']['viewPID'],'',array($this->prefixId.'[newecard]'=>$thumb['uid'],$this->prefixId.'[backpid]'=>$GLOBALS["TSFE"]->id)));
} else {
$subpartArray['###ECARDLINK###']='';
}
// Adds hook for processing of extra item markers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sk_simplegallery']['extraSingleMarkerHook'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['sk_simplegallery']['extraSingleMarkerHook'] as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$markerArray = $_procObj->extraSingleMarkerProcessor($markerArray, $thumb, $this);
}
}
$innercontent.=$this->cObj->substituteMarkerArrayCached($template['item'], $markerArray,$subpartArray,$linkWrapArray);
if($thumb_ids[$i]==$this->piVars['single']) {
$single=$thumb;
//change for Layout1, thx to Uwe Schmelzer
//clear overview part of template
$subpartArray['###OVERVIEW###']='';
// Store ID of prev/next image for later use
// as prev/next Link in single view.
$single['linkToPreviousImage'] = '';
$single['linkToNextImage' ] = '';
if (($i-1) >= 0 ) {
// set Link to previous image
$link_param = array();
$link_param['id' ] = $this->piVars['id'];
$link_param['backpid'] = $this->piVars['backpid'];
$link_param['page' ] = $this->piVars['page'];
$link_param['single' ] = $thumb_ids[$i-1];
$link_text = $this->cObj->stdWrap($this->pi_getLL('pi_list_browseresults_prev'),$this->conf['linkTextPrevious.']);
// link marker content
$single['linkToPreviousPicture'] = $this->pi_linkTP_keepPIvars($link_text, $link_param, 1, 1, $GLOBALS["TSFE"]->id);
// counter info marker content
$single['pictureXofY' ] = '('. $link_param['single' ] .'/'. $end .')';
} else {
// this is the first image
$link_text = $this->cObj->stdWrap($this->pi_getLL('pi_list_browseresults_first'),$this->conf['linkTextFirst.']);
$single['linkToPreviousPicture'] = $link_text;
}
if (($i+1) < $end) {
// set Link to next image
$link_param = array();
$link_param['id' ] = $this->piVars['id'];
$link_param['backpid'] = $this->piVars['backpid'];
$link_param['page' ] = $this->piVars['page'];
$link_param['single' ] = $thumb_ids[$i+1];
$link_text = $this->cObj->stdWrap($this->pi_getLL('pi_list_browseresults_next'),$this->conf['linkTextNext.']);
$single['linkToNextPicture'] = $this->pi_linkTP_keepPIvars($link_text, $link_param, 1, 1, $GLOBALS["TSFE"]->id);
} else {
// this is the last image
$link_text = $this->cObj->stdWrap($this->pi_getLL('pi_list_browseresults_last'),$this->conf['linkTextLast.']);
$single['linkToNextPicture'] = $link_text