MyXoops Forum

Forum - All Posts - myXOOPS German Support

Forum Index


Board-Index » Neue Beiträge

BottomBottom



WDC

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

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


Goffy

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

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
#53

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: 775
Since: 14.10.2004
#54

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
#55

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
#56

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: 775
Since: 14.10.2004
#57

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
#58

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: 775
Since: 14.10.2004
#59

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


WDC

"myXOOPs"-Profi
Gepostet am:12.03.2021 08:00
WDC
WDC Offline (Show more)
"myXOOPs"-Profi
Posts: 637
Since: 27.06.2004
#60

Aw: MyAlbum-P für Xoops 2.5.11

Zitat:

Goffy schrieb:
Hi
Zitat:
Na das wird ja was

super

den Modulnamen solltest du über
$GLOBALS['xoopsModule']->getVar('name');

erhalten


Super, das hat funktioniert, Danke!

Zitat:

Goffy schrieb:wegen Namen der aktuellen Kategorie:
da musst du mal die Variablen checken, die du auf der Seite verwendest, ob da die übergeordnete Kategorie irgendwo drin ist.
ansonsten müsstest du die Parent-Id zur aktuellen Kategorie abfragen


Das gibt mir große Rätsel auf. Zum Beispiel diese Kategorie hier

https://kenner-mask.com/modules/merchandise/viewcat.php?cid=52

Müsste die Breadcrumb wie folgt aussehen

Merchandise / Bücher | Comics / Bücher / Deutschland / Bücher

Also insgesamt 3 Elternkategorien + Die aktuelle Kategoerie

Eine Elternkategorie bekomme ich ja evtl. noch hin. Den Rest bisher nicht



TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 4708 »



Aktuell aus dem Forum

Forum Thema Antworten Views Letzter Beitrag
Modulentwicklung New Xoops Xcreate Module 0 5490 26.11.2025 15:22
efkan Gehe zum letzten Beitrag
Modulentwicklung XOOPS Custom Field Module 1 1899 24.11.2025 11:21
Goffy Gehe zum letzten Beitrag