| | | | |
| |||||||
| PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen |
|
| | LinkBack | Themen-Optionen | Thema bewerten |
| | |
| Gast
Beiträge: n/a
| Hi, habe mitlerweile DALBUM als Dokumentenverzeichnis auf meinem Server installiert.... (www.dalbum.org) Läuft auch, aber es gitbt möglichkeiten in die Navigation ICONS einzusetzen, da ich das gerne wollte, versuchte ich es nach anleitung, und bestem verständnis.... Wenn ich das versuche habe ich ein Problem, er kommt mit einer anderen Class die das gleiche ausführen soll in konflickt... , zu sehen unter http://www.bohemisieren.de/FAv2/mc2/ Das ist der code der den Fehler verursacht... besonderes Augenmerk auf function &customCreateAlbum()... die hapert nämlich... Code: <?php
/*** Slideshow begins ***/
// localization strings (may be added to standard distribution later)
if (!isset($lang['cSlideshowSlideshow']))
{
$lang['cSlideshowSlideshow']='-- Slide show --';
$lang['cSlideshowSeconds'] ='#sec# seconds';
}
function customGetFolderBorders(&$album,&$fg,$nThmX,$nThmY)
{
global $g_sThumbnailXSize,$g_sThumbnailYSize;
// Images in format array('URL',width,height);
$fg['blank']=array('custimg/im_corner/i_blank.gif',19,16);
$fg['nw']=array('custimg/im_corner/i_nw.gif',32,11);
$fg['n']=array('custimg/im_corner/i_n.gif',25,11);
$fg['ne']=array('custimg/im_corner/i_ne.gif',24,11);
$fg['w']=array('custimg/im_corner/i_w.gif',5,16);
$fg['e']=array('custimg/im_corner/i_e.gif',6,16);
$fg['sw']=array('custimg/im_corner/i_sw.gif',30,12);
$fg['s']=array('custimg/im_corner/i_s.gif',27,12);
$fg['se']=array('custimg/im_corner/i_se.gif',14,12);
// border around image (defined in CSS as a.fldlink .folderthumb)
$fg['borderx']=1;
$fg['bordery']=1;
// ensure that all folders have the same size
$fg['sizex']=$g_sThumbnailXSize+35;
$fg['sizey']=$g_sThumbnailYSize+35;
// return true to force DAlbum to use specified images
return true;
}
function customGetButton($id, $href, $text, $title, $nSpacer, $target)
{
$ret="";
// Display slideshow combo before 'fullscreen' button
// and only on showimg.php page
if (($id=='fullscreen'||$id=='closewindow') && defined('DALBUM_SHOWIMG_PAGE'))
{
// Add a little space before the combo
$ret = '<span id="space_slideshow" class="buttonspace"></span>';
// Localize Slideshow: string here
$ret.= '<span class="slideshow">';
$ret.= '<form onsubmit="">';
$ret.= "<select onchange='onSlideshowChange(this);'>";
// Number of seconds/slide to be displayed in the combo-box.
$seconds=array(0,5,10,30,60);
$def=0;
if (isset($_GET['slideshow']))
$def=$_GET['slideshow'];
foreach ($seconds as $s)
{
$ret.="<option value=\"$s\"";
if ($s==$def)
$ret.=" selected";
$ret.=">";
global $lang;
if ($s==0)
$ret.=$lang['cSlideshowSlideshow'];
else
$ret.=strtr($lang['cSlideshowSeconds'],array("#sec#"=>$s));
$ret.="</option>";
}
$ret.='</select></form>';
$ret.='</span>';
}
// if we are in slideshow mode already - do not display "Fullscreen"
if ($id=='fullscreen' &&
defined('DALBUM_SHOWIMG_PAGE') &&
isset($_GET['slideshow']))
return $ret;
$ret.=getButton($id,$href,$text,$title,$nSpacer,$target,false);
return $ret;
}
/*** Slideshow ends ***/
/*** customtypes sample begins ***/
require_once(DALBUM_ROOT . "/config/customtypes.php");
class CSortImage extends CCustomTypeImage
{
function &GetCustomFieldNames()
{
$f=parent::GetCustomFieldNames();
$f[]="SortOrder";
return $f;
}
}
function &customCreateImage()
{
return new CSortImage();
}
class CExAlbumCustomIcon extends CAlbum
{
function GetTreeNodeCode($myID,$nParentID,$sText,$sRef)
{
$dir="custimg/";
$ic=$this->GetCustomField("Iconfile");
$icOpen=$this->GetCustomField("IconfileOpen");
if (!empty($ic))
{
if (empty($icOpen))
$icOpen=$ic;
// You can change not only icon but also text, tooltip and target frame here
// Format:
// d.add($myID,$nParentID,"Node text","Node URL","Tooltip","Target frame",
// "Closed icon", "Open icon (for folders only)");
//
return "d.add($myID,$nParentID,'$sText','$sRef','','','$dir/$ic','$dir/$icOpen');\n";
}
return parent::GetTreeNodeCode($myID,$nParentID,$sText,$sRef);
}
// Get list of custom field names
function &GetCustomFieldNames()
{
$f=parent::GetCustomFieldNames();
$f[]="Iconfile";
$f[]="IconfileOpen";
return $f;
}
}
function &customCreateAlbum()
{
return new CExAlbumCustomIcon();
}
/*** customtypes sample ends ***/
/*** Display modified albums begins ***/
// Localize text strings below (these localizations will be added
// to DAlbum installation later)
if (!isset($lang['cModifiedNew']))
{
$lang['cModifiedNew']='new!';
$lang['cModifiedUpdated']='updated!';
}
class CExAlbumModified extends CAlbum
{
function Create($sPath, $parentUsers,$bCleanup, $bDeleteImages=false)
{
// New albums get modification time set to today's date
if (!file_exists(absfname($sPath."/.albumdef.ini")))
{
$this->m_arrCustomFields["Modified_YYMMDD"]=
$this->m_arrCustomFields["Created_YYMMDD"]=date("ymd");
}
// Call default implementation
return parent::Create($sPath,$parentUsers,$bCleanup,$bDeleteImages);
}
// Get list of custom field names
function &GetCustomFieldNames()
{
$f=parent::GetCustomFieldNames();
$f[]="Created_YYMMDD";
$f[]="Modified_YYMMDD";
$f[]="SortOrder";
return $f;
}
// Modify tree node text
function GetTreeNodeCode($myID,$nParentID,$sText,$sRef)
{
// Display (Modified) or (Updated) for those modified/updated 10 days ago or less.
// (change 10 to any number of days you wish)
$dateRecent=date("ymd",time()-86400*10);
$cur_ct=$this->GetCustomField("Created_YYMMDD");
$cur_mt=$this->GetCustomField("Modified_YYMMDD");
global $lang;
$sAdd="";
$dr=DALBUM_BROWSERROOT;
// Modify tree item text
if ($cur_ct>$dateRecent)
{
// display custimg/new.gif next to new albums
$sAdd="<sup><img src=\'{$dr}custimg/new.gif\' alt=\'\' title=\'".
$lang['cModifiedNew']."\'></sup>";
// Uncomment the next line to display text instead of images
// $sAdd="<sup>".$lang['cModifiedNew']."</sup>";
}
elseif ($cur_mt>$dateRecent)
{
// display custimg/updated.gif next to updated albums
$sAdd="<sup><img src=\'{$dr}custimg/updated.gif\' alt=\'\' title=\'".
$lang['cModifiedUpdated']."\'></sup>";
// Uncomment the next line to display text instead of images
// $sAdd="<sup>".$lang['cModifiedUpdated']."</sup>";
}
if (!empty($sAdd) && $this->m_sFolder!='/')
$sText.=$sAdd;
// Call default implementation to display updated string.
return parent::GetTreeNodeCode($myID,$nParentID,$sText,$sRef);
}
// This function is always called during reindex AFTER subfolders are loaded
function ParseDetails(&$ini_array,$bAllDetails)
{
parent::ParseDetails($ini_array,$bAllDetails);
// Get modified time for this folder
$cur_mt=$this->GetCustomField("Modified_YYMMDD");
if (strlen($cur_mt)!=6)
$cur_mt="000000";
$cur_ct=$this->GetCustomField("Created_YYMMDD");
if (strlen($cur_ct)!=6)
$cur_ct="000000";
// Go through all subfolders and set this folder modification time
// to not be before any subfolder modification time
for ($i=0;$i<count($this->m_arrContents);++$i)
{
$obj=&$this->m_arrContents[$i];
if (!$obj->IsImage())
{
$mt=$obj->GetCustomField("Modified_YYMMDD");
if (!empty($mt) && $mt>$cur_mt)
$cur_mt=$mt;
}
}
if ($this->GetCustomField("Modified_YYMMDD")!=$cur_mt)
{
$this->m_arrCustomFields["Modified_YYMMDD"]=$cur_mt;
$this->m_arrCustomFields["Created_YYMMDD"]=$cur_ct;
create_defaultIni($this,true);
}
}
// This is used to customize sorting order
function cmpAlb2($a, $b)
{
$ai=$a->IsImage();
$bi=$b->IsImage();
// If both are images or both are albums look at "SortOrder"
if ( ($ai && $bi) || (!$ai && !$bi))
{
$v1=(int)trim(strval($a->GetCustomField("SortOrder")));
$v2=(int)trim(strval($b->GetCustomField("SortOrder")));
if ($v1!=$v2)
return $v1-$v2;
}
// No sort order preference. Try names
// If both are images - compare filenames
if ($ai && $bi)
return strcasecmp($a->m_sBaseFilename, $b->m_sBaseFilename);
// Albums always go before images
if ($ai)
return 1;
if ($bi)
return -1;
// Both are albums - compare folders
return strcasecmp(basename(substr($a->m_sFolder,0,-1)), basename(substr($b->m_sFolder,0,-1)));
}
function Sort()
{
if (!empty($this->m_arrContents))
usort($this->m_arrContents,array(get_class($this),"cmpAlb2"));
}
}
function &customCreateAlbum()
{
return new CExAlbumModified();
}
/*** Display modified albums ends ***/
?>
Wie kann das Problem umgangen werden??? DANKE SCHONMAL FüR EURE MÜHE! DANKE |
|
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Moderator Registriert seit: 03.09.2004
Beiträge: 11.798
PHP-Kenntnisse: Fortgeschritten ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | http://faq-phpfriend.de/q/q-fehler-parse.html dann nimm funktion für funktion raus und teste bei welcher er kommt ?
__________________ robo47.net - Blog, Codeschnipsel und mehr | |
| | |
|
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [Erledigt] Galerie Problem... | coraplanet | PHP Tipps 2008 | 4 | 06.06.2008 13:42 |
| CSS - Problem mit class | Smily0412 | HTML, Usability und Barrierefreiheit | 3 | 16.09.2006 14:59 |
| datensätze defekt oder problem mit dem einlesen? | Ministry | Datenbanken | 4 | 06.07.2006 18:42 |
| Class Vars | fmueller | PHP Tipps 2006 | 10 | 14.02.2006 19:54 |
| problem!!! | PHP Tipps 2006 | 6 | 08.02.2006 11:06 | |
| [OS|FreeGW] Class Problem ( cl_extended_database ) | PHP Tipps 2006 | 20 | 08.02.2006 01:09 | |
| [Erledigt] wieder ein Problem bei phpmailer und smtp | PHP Tipps 2006 | 24 | 07.02.2006 01:07 | |
| Mehrere Div-Layer per Class schliessen | Diego1978 | HTML, Usability und Barrierefreiheit | 4 | 02.12.2005 12:10 |
| Progress Class - Problem mit Flush | Chr!s | PHP Tipps 2005-2 | 3 | 28.09.2005 20:45 |
| [Erledigt] Problem mit Backslash | Patrick Schwarz | PHP Tipps 2005-2 | 5 | 26.07.2005 09:54 |
| Smarty und PHP-Skript Problem | PHP Tipps 2004-2 | 2 | 03.12.2004 22:27 | |
| Problem mit alter JavaScript-Funktion | woods | PHP Tipps 2004 | 1 | 13.08.2004 13:34 |
| [Erledigt] Problem mit Timestamp! | PHP Tipps 2004 | 24 | 08.06.2004 19:51 | |
| Login Problem | PHP Tipps 2004 | 4 | 04.06.2004 18:46 | |
| foreach problem | mAy^daY | PHP Tipps 2004 | 3 | 02.06.2004 20:29 |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| customizing dalbum, show slideshow form is not defined, slideshow combo, date((\y-m-d\), time()-(86400) smarty tpl, sortorder dalbum, dalbum_root |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.