1. Forum
    1. Themen Übersicht
  2. Hilfe
  3. Forenregeln
  4. Mitglieder
    1. Team
    2. Mitgliedersuche
  5. Webseite
  6. Archiv
  • Anmelden
  • Registrieren
  • Suche

Neuigkeiten

Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche

Neuigkeiten

Letzte Beiträge
  1. JoomGallery 3.x JUX für Joomla! 3
  2. Alle Beiträge zur JoomGallery 3.x JUX
  3. Sonstiges - JG 3.x

Use joomgallery for article images script

  • Tazzios
  • 10. September 2019 11:09
  • Erledigt
1. offizieller Beitrag
  • Tazzios
    Neumitglied
    Reaktionen
    2
    • 10. September 2019 11:09
    • #1

    i use joomgallery as media manager because :

    • i have a lot of different usersgroups and have created an hidden album for each group where the upload there
    • the current media manager from joomla is not friendly
    • User will makes a mess (of everything) so it is nice of you still can move stuff without breaking it.

    For images within an article this is not a problem but is is for the article intro and full image picture. Users can of course select there image but it will brake when images are archieved(to other category). To fix this i made the SQL script below that replaces the image path to a joomgallery url.

    Code
    /* Replace ep23j with your own prefix*/ 
    
        /*replacing article intro image with joomgalley url incase of thumbnail*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=thumb') )  
        where images like  '%\\\\/joomgallery\\\\/thumbnails%' /*adjust acording to you own path */
        ;
        /*replacing article intro image with joomgalley url incase of detail*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=img') )  
        where images like '%\\\\/joomgallery\\\\/details%' /*adjust acording to you own path */
        ;
        /*replacing article intro image with joomgalley url incase of original*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=orig') )  
        where images like '%\\\\/joomgallery\\\\/originals%' /*adjust acording to you own path */
        ;
        /*replacing article intro image with joomgalley url incase of detail*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=img') )  
        where images like '%\\\\/joomgallery\\\\/details%' /*adjust acording to you own path */
        ;
        /*replacing article full image with joomgalley url incase of thumbnail*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=thumb') )  
        where images like '%\\\\/joomgallery\\\\/thumbnails%' /*adjust acording to you own path */
        ;
        /*replacing article full image with joomgalley url incase of original*/
        update `joomla`.`ep23j_content` 
        SET images=replace(images,SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1), 
        concat('index.php?option=com_joomgallery&view=image&format=raw&id=',(SELECT  `id` FROM `joomla`.`ep23j_joomgallery` where 
        catid= (SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-2),'/',1),'_',-1))
        AND imgfilename=( SUBSTRING_INDEX(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(images, '"', 4), '"',-1),"\\",""),'/',-1) )
        ),'&type=orig') )  
        where images like '%\\\\/joomgallery\\\\/originals%' /*adjust acording to you own path */
        ;
    Alles anzeigen

    If some one knows how to edit the article edit pages so that the joomgallery plugin shows up instead of the joomla media manager that would be even better but till then this is maybe helpful for others.

    Use at own risk, I`m sure there are people you can make a safer script in php as i`m now depend on the number of " in the string. ^^

    Einmal editiert, zuletzt von Tazzios (10. September 2019 11:36)

    • Zitieren
  • MrMusic
    Moderator
    Reaktionen
    107
    • 10. September 2019 12:45
    • Offizieller Beitrag
    • #2

    Hi,

    there is the plugin 'JoomMediaFormField' to use the images of the JoomGallery as article intro or full images. This plugin adds an additional button to the article editor to select the image.

    Even after moving to another category, the image will still be displayed.

    Using an SQL script should not be necessary.

    Regards

    MrMusic

    JoomGalleryfriends.net - die neue Webseite für die JoomGallery

    • Nächster offizieller Beitrag
    • Zitieren
  • Tazzios
    Neumitglied
    Reaktionen
    2
    • 10. September 2019 13:36
    • #3

    haha, yes that`s exactly what i need. :love:

    Well the script is maybe still usable to correct old content. :P

    • Zitieren
  • MrMusic
    Moderator
    Reaktionen
    107
    • 10. September 2019 15:40
    • Offizieller Beitrag
    • #4

    Fine if I could help you.

    JoomGalleryfriends.net - die neue Webseite für die JoomGallery

    • Vorheriger offizieller Beitrag
    • Zitieren
  • Thomas-DAV
    Neumitglied
    • 5. Oktober 2019 21:19
    • #5

    Thanks, too. Maybe this could be the solution, that I was looking for. ;)

    Meine aktuellen Projekte:

    https://www.weidener-huette.at

    http://https.//www.dav-weiden.de

    • Zitieren
  • Tazzios
    Neumitglied
    Reaktionen
    2
    • 8. April 2020 15:13
    • #6

    To hide the default button i added this css to my template:

    Code
        /*hide default  article image  button*/
        a[href$="/component/media/?view=images&tmpl=component&asset=com_content&author=&fieldid=jform_images_image_intro&folder="], a[href$="/component/media/?view=images&tmpl=component&asset=com_content&author=&fieldid=jform_images_image_fulltext&folder="] {
            display: none;
    }

    Maybe there is an more elegant way that can be added as a config option in the plugin. But for now this also works which why i wanted to share it for other users. :)

    • Zitieren
  • Tazzios
    Neumitglied
    Reaktionen
    2
    • 20. April 2020 11:12
    • #7

    New version:

    bugfix, old one only worked on new pages not on edits.

    Code
    /*hide default article image button*/
    a[href$="jform_images_image_intro&folder="], a[href$="jform_images_image_fulltext&folder="] {
    display: none;
    }
    • Zitieren

Letzte Beiträge

  • URLs nach Update auf JoomGallery4 und SH404SEF /4SEF

    Bjoern 1. Juli 2025 23:56
  • Looking to replicate JG3 Gallery / Category View under JG4

    GJSchaller 1. Juli 2025 20:01
  • What can you do with Tags?

    FriendlyUser 30. Juni 2025 22:40
  • JG3 Bilder als Artikelbild verlinkt - Welche Migrationseinstellung erhält die Dateipfade?

    MrMusic 30. Juni 2025 10:21
  • JoomGallery for Joomla 4

    MrMusic 26. Juni 2025 13:53
  • Bearbeiten von Bildern nicht möglich

    kaufi88 26. Juni 2025 11:11
  • URLS nach Migration auf JG4

    Elfangor93 25. Juni 2025 12:45
  • Inconsistent category folder paths defined in the database of your JG3 tables

    MrMusic 24. Juni 2025 15:49
  • JoomImages Module in Joomgallery 4

    Elfangor93 17. Juni 2025 09:07
  • 4SEF have native support for JoomGallery

    Elfangor93 17. Juni 2025 08:36
  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™