MyXoops Forum

Aw: MyAlbum-P für Xoops 2.5.11 [Die Installation und Administration von XOOPS 2.5.X] - myXOOPS German Support

Goffy

Co-Administrator
Gepostet am:14.03.2021 10:54
Goffy
Goffy Offline (Show more)
Co-Administrator
Posts: 774
Since: 14.10.2004
#44

Aw: MyAlbum-P für Xoops 2.5.11

schick mir deine, damit ich sehe was du schon alles drin hast
EDV = Epoche der Verzweiflung

WDC

"myXOOPs"-Profi
Gepostet am:13.03.2021 19:16
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#43

Aw: MyAlbum-P für Xoops 2.5.11

Du hast ja das Modul, ist das myalbum, wie es auch bei github steht, halt nur zu Merchandise umbenannt. Ansonsten das selbe. Klar kann ich dir schicken, wie Du willst

Advertisement

Gepostet am:0
Advertisement (Show more)
Posts: 0
Since: 0


Hier könnten Sie Ihre Anzeige aufgeben!
Bitte kontaktieren Sie uns, um mehr darüber zu erfahren.

Goffy

Co-Administrator
Gepostet am:13.03.2021 18:13
Goffy
Goffy Offline (Show more)
Co-Administrator
Posts: 774
Since: 14.10.2004
#42

Aw: MyAlbum-P für Xoops 2.5.11

hi

schickst du mir das Modul mal per Mail?
EDV = Epoche der Verzweiflung

WDC

"myXOOPs"-Profi
Gepostet am:13.03.2021 09:41
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#41

Aw: MyAlbum-P für Xoops 2.5.11

Das war nicht angepasst, hab es jetzt so gemacht, wie es in der header.php vom Modul aufgerufen wird.

/** @var XoopsModulesWggalleryHelper $helper */
    
$helper Helper::getInstance();
    
$albumsHandler $helper->getHandler('Category');
    
$crAlbums      = new CriteriaCompo();
    
$crAlbums->add(new Criteria('cid'$cid));


Ich verstehe dass Variablen sind, die gefüllt werden, und die dann weiter verwendet werrden.

Was machen die?

$crAlbums      = new CriteriaCompo();
    
$crAlbums->add(new Criteria('cid'$cid));


Eingebunden ist der ganze Code in der viewcat.php, für die anderen Bereiche muss das ja cuh in die entsprechenden php Dateien, oder? Oder kann ich eine neue Breadcrumb.php anlegen?

So sieht das ganze jetzt aus, für die Parent Kategorien

function getParentsOfCategory($cid)
{
    
$parentsAll = [];
    
/** @var XoopsModulesWggalleryHelper $helper */
    
$helper Helper::getInstance();
    
$albumsHandler $helper->getHandler('Category');
    
$crAlbums      = new CriteriaCompo();
    
$crAlbums->add(new Criteria('cid'$cid));
    
$albumsCount $albumsHandler->getCount($crAlbums);
    
$albumsAll   $albumsHandler->getAll($crAlbums);
    
// Table view albums
    
if ($albumsCount 0) {
        foreach (
array_keys($albumsAll) as $i) {
            
$parentsAll[] = ['cid' => $albumsAll[$i]->getVar('cid'), 'title' => $albumsAll[$i]->getVar('title'), 'pid' => $albumsAll[$i]->getVar('pid')];
            
$parent     getParentsOfCategory($albumsAll[$i]->getVar('pid'));
            if (
$parent) {
                
$parentsAll[] = $parent;
            }
        }
    }

    return 
$parentsAll;
}


// Parent Kategorien
$xoBreadcrumbs[] = ['title' => $parentsAll];

Goffy

Co-Administrator
Gepostet am:13.03.2021 08:00
Goffy
Goffy Offline (Show more)
Co-Administrator
Posts: 774
Since: 14.10.2004
#40

Aw: MyAlbum-P für Xoops 2.5.11

hast du den helper an dein Modul angepasst?
$helper        XoopsModulesWggalleryHelper::getInstance();


du hast ja auch das wggallery installiert aber dort keine cid und pid
EDV = Epoche der Verzweiflung

WDC

"myXOOPs"-Profi
Gepostet am:12.03.2021 19:18
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#39

Aw: MyAlbum-P für Xoops 2.5.11

Neeee, bekomme ich nicht gebacken es gibt das was ähnliches, in der php Datei, das liest wohl das aus, was ich suche, bekomme das aber nicht in Deinen code portiert
foreach ($GLOBALS['cattree']->getAllChild($cid) as $child) {
        
$cids[$child->getVar('cid')] = $child->getVar('cid');
    }
    
$cids[]   = $cid;
    
$criteria = new CriteriaCompo(new Criteria('status''0''>'));
    
$photo_total_sum Utility::getTotalCount($cids$criteria);
    if (!empty(
$cids)) {
        foreach (
$cids as $index => $child) {
            
$childcat $catHandler->get($child);
            if (
is_object($childcat)) {
                
$catpath .= "<a href='" $helper->url() . 'viewcat.php?num=' . (int)$GLOBALS['merchandise_perpage'] . '&cid=' $childcat->getVar('cid') . "' >" $childcat->getVar('title') . '</a> ' . ($index count($cids) ? '>>' '');
            }
        }
    } else {
        
$cat     $catHandler->get($cid);
        
$catpath .= "<a href='" $helper->url() . 'viewcat.php?num=' . (int)$GLOBALS['merchandise_perpage'] . '&cid=' $cat->getVar('cid') . "' >" $cat->getVar('title') . '</a>';
    }
So habe ich es probiert, aber das Ergebnis ist leer
/**
 * Get all parents of a category
 * @param $albPid
 * @return string
 */
function getParentsOfCategory($cat)
{
    
$parentsAll = [];
    
/** @var XoopsModulesWggalleryHelper $helper */
    
$helper        XoopsModulesWggalleryHelper::getInstance();
    
$albumsHandler $helper->getHandler('Category');
    
$crAlbums      = new CriteriaCompo();
    
$crAlbums->add(new Criteria('cid'$cid));
    
$albumsCount $albumsHandler->getCount($crAlbums);
    
$albumsAll   $albumsHandler->getAll($crAlbums);
    
// Table view albums
    
if ($albumsCount 0) {
        foreach (
array_keys($albumsAll) as $i) {
            
$parentsAll[] = ['cid' => $albumsAll[$i]->getVar('cid'), 'title' => $albumsAll[$i]->getVar('title'), 'pid' => $albumsAll[$i]->getVar('pid')];
            
$parent     getParentsOfCategory($albumsAll[$i]->getVar('pid'));
            if (
$parent) {
                
$parentsAll[] = $parent;
            }
        }
    }

    return 
$parentsAll;
}

WDC

"myXOOPs"-Profi
Gepostet am:12.03.2021 12:34
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#38

Aw: MyAlbum-P für Xoops 2.5.11

Ok. Guck ich mir heute Abend an. Aber ich verstehe sogar halbwegs was da passieren soll

Goffy

Co-Administrator
Gepostet am:12.03.2021 12:21
Goffy
Goffy Offline (Show more)
Co-Administrator
Posts: 774
Since: 14.10.2004
#37

Aw: MyAlbum-P für Xoops 2.5.11

so ungefähr

/**
 * Get all parents of a category
 * @param $albPid
 * @return string
 */
function getParentsOfCategory($albId)
{
    
$parentsAll = [];
    
/** @var XoopsModulesWggalleryHelper $helper */
    
$helper        XoopsModulesWggalleryHelper::getInstance();
    
$albumsHandler $helper->getHandler('Albums');
    
$crAlbums      = new CriteriaCompo();
    
$crAlbums->add(new Criteria('cid'$albId));
    
$albumsCount $albumsHandler->getCount($crAlbums);
    
$albumsAll   $albumsHandler->getAll($crAlbums);
    
// Table view albums
    
if ($albumsCount 0) {
        foreach (
array_keys($albumsAll) as $i) {
            
$parentsAll[] = ['cid' => $albumsAll[$i]->getVar('cid'), 'title' => $albumsAll[$i]->getVar('title'), 'pid' => $albumsAll[$i]->getVar('pid')];
            
$parent     getParentsOfCategory($albumsAll[$i]->getVar('pid'));
            if (
$parent) {
                
$parentsAll[] = $parent;
            }
        }
    }

    return 
$parentsAll;
}


wirst du aber teilweise noch anpassen müssen ;)
EDV = Epoche der Verzweiflung

WDC

"myXOOPs"-Profi
Gepostet am:12.03.2021 11:45
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#36

Aw: MyAlbum-P für Xoops 2.5.11

Klingt logisch, wenn man weiß wie es geht.

Das krieg ich doch im Leben nicht hin. Evtl. Die pid der cid der aktuellen Kategiloerie, aber die oids der oids, da bin ich raus

Goffy

Co-Administrator
Gepostet am:12.03.2021 09:48
Goffy
Goffy Offline (Show more)
Co-Administrator
Posts: 774
Since: 14.10.2004
#35

Aw: MyAlbum-P für Xoops 2.5.11

hi

Eine Elternkategorie bekomme ich ja evtlnoch hinDen Rest bisher nicht

rekursive Schleife ;)
pid von aktuell (Namen und Pfad auslesen )
pid von pid (Namen und Pfad auslesen)
pid von pid (Namen und Pfad auslesen)
solange bis pid=0

Namen und Pfade in umgekehrter Reihenfolge in Breadcrumb-Array reingeben
EDV = Epoche der Verzweiflung
Diesen Thread durchsuchen:  1 Anonyme Benutzer

Aktuell aus dem Forum

Forum Thema Antworten Views Letzter Beitrag
OffOffTopic [Wichtig] Übernahme myXOOPS 0 599 11.12.2023 18:57
alfred Gehe zum letzten Beitrag
Die Installation und Administration von XOOPS 2.5.X [Offen] Upgrade 2.5.11 3 2351 07.05.2023 07:03
Goffy Gehe zum letzten Beitrag