Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:36:41+00:00 2026-06-04T08:36:41+00:00

i have multisite setup where imagecache module resides under sites/all. My goal is for

  • 0

i have multisite setup where imagecache module resides under sites/all. My goal is for every site to have its own imagecache folder filled with requests, belonging to that site; e.g. referencing them by domain1/imagecache/files/thumb_image/photos/bigavatar.jpg.

The photos folder have been uploaded via FTP so drupal basically doesnt know about it (database-wise), but imagecache functions perfectly if the folder is under sites/default/files/photos and referenced by default/imagecache/files/thumb_image/photos/bigavatar.jpg.

Have looked for setting up options – and found that if the upload path is changed for a site, then imagecache would work with it but; For my (JS) store of images, sent to my gallery the store data comes from my own module, ximagegallery. This is how the paths are produced:

<?php
/**
 * @param title : visible gallery title
 * @param basename filename base of image
 * @param site current site (commonly guessed from REQUEST_URI but goal is to let this be configurable)
 * @param location path of $basename imagefile underneath sites/$site/
*/
    function ximagegallery_get_object($title, $basename, $site, $location) {
        return array(
             "title" => $title,
             "link" => "{$site}{$location}/{$basename}",
             "screenpath" => "{$site}/imagecache/screen{$location}{$basename}",
             "thumbpath" => "{$site}/imagecache/small_thumb{$location}{$basename}"
        );
    }
    ?>

Imagecache only works with the upload-path for the filesystem config, i wish to surpass this and make imagecache respond to any location, say if two sites needs to share a common gallery / imagefolder.

Edit; i figured a solution would be to create another hook_menu, calling the imagecache functions from my derived module – as its allready a dependency, this would be modular enough for the purpose i guess

<?php
function ximagegallery_menu() {
        // standard route hook
    $items['ximagegallery/store/%'] = array(
         'title' => 'ximagegallery_GENERATE',
         'page callback' => 'ximagegallery_generate_store',
         'page arguments' => array(1),
         'access callback' => 'ximagegallery_access'
    );
        // one hook for each configured path
        $hooks = get_variable('ximagegallery_folderhooks', array());
        foreach($hooks as $folder) {
           $items['$folder.'/imagecache'] = array(
         'page callback' => 'imagecache_cache',
         'access callback' => '_imagecache_menu_access_public_files',
         'type' => MENU_CALLBACK
           );
       }
} ?>

If my folderhooks contains ‘domain2/foo/bar’, then
this allows using of http://domain.tld/drupal/?q=domain2/foo/bar/imagecache/myimagefolder/galleryid/photo.jpg

Splendid =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:36:42+00:00Added an answer on June 4, 2026 at 8:36 am
    <?php
    function ximagegallery_menu() {
            // standard route hook
        $items['ximagegallery/store/%'] = array(
             'title' => 'ximagegallery_GENERATE',
             'page callback' => 'ximagegallery_generate_store',
             'page arguments' => array(1),
             'access callback' => 'ximagegallery_access'
        );
            // one hook for each configured path
            $hooks = get_variable('ximagegallery_folderhooks', array());
            foreach($hooks as $folder) {
               $items['$folder.'/imagecache'] = array(
             'page callback' => 'imagecache_cache',
             'access callback' => '_imagecache_menu_access_public_files',
             'type' => MENU_CALLBACK
               );
           }
    } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have a single installation multi-site setup, hosted in Europe, and are looking
Events till now We have a CC 7.1.2.2, multisite setup where we do deliveries
Let's suppose that we have multi-site CMS and every website in this CMS having
I have setup a wordpress multisite blog that is load balanced over 5 servers
I have a multisite drupal instalation. I have one module used in a specific
I have this site which uses multisite manager for minisites. The issue i am
I have a multisite with drupal, I created a site which at first should
How to set individual site under MultiSite WordPress installation to use different language? I
I currently have a multisite setup of Sitecore 6.4. I had installed the LuceneSearch
I have a multisite drupal installation with domain access module. Off late, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.