You are here:  » Moving Logo Folder to different directory


Moving Logo Folder to different directory

Submitted by Antony on Tue, 2020-09-22 14:09 in

Hi David,

Hope you are well,

Sorry to bother you but I would like to move the Logos folder to a different directory so that it can be shared with multiple PT installs, this would cut down on future potential duplicated efforts. I've gone through few treads on the forum, but I cant seem to find my answer and tried various cowboy coding without any success :(

From what I gather only prices.php and atoz.php would have to be amended by modifying the 2 lines bellow:

prices.php

<?php
 
print $config_baseHREF."logos/".str_replace(" ","%20",$product["merchant"]); 
?>

atoz.php

<?php
 
print $atoz_item["logo"]; 
?>

I would need both to refer to https://www.example.com/logos

Any chance for your support? and of course would there be any other job to do so that the admin side works as normal ie. uploading logos etc?

Thanks in advance David.

Ant

Submitted by support on Wed, 2020-09-23 07:47

Hi Ant,

The logo img src can simply be changed to the top level by removing $config_baseHREF and prefixing with "/" but if the test is still required, that will need to be changed to reference the top level relatively using "../" so for html/prices.php, look for the following code beginning at line 47:

            <?php if (file_exists("logos/".$product["merchant"].$config_logoExtension)): ?>
              <td class='pt_pr_mlogo'><a href='<?php print tapestry_buyURL($product); ?>'><img alt='<?php print htmlspecialchars($product["merchant"],ENT_QUOTES,$config_charset); ?> <?php print translate("Logo"); ?>' src='<?php print $config_baseHREF."logos/".str_replace(" ","%20",$product["merchant"]).$config_logoExtension?>' /></a></td>
            <?php else: ?>

...and REPLACE with:

            <?php if (file_exists("../logos/".$product["merchant"].$config_logoExtension)): ?>
              <td class='pt_pr_mlogo'><a href='<?php print tapestry_buyURL($product); ?>'><img alt='<?php print htmlspecialchars($product["merchant"],ENT_QUOTES,$config_charset); ?> <?php print translate("Logo"); ?>' src='<?php print "/logos/".str_replace(" ","%20",$product["merchant"]).$config_logoExtension?>' /></a></td>
            <?php else: ?>

And in merchants.php look for the following code beginning at line 16:

      if (file_exists("logos/".$product["merchant"].$config_logoExtension))
      {
        $item["logo"] = $config_baseHREF."logos/".str_replace(" ","%20",$product["merchant"]).$config_logoExtension;
      }

...and REPLACE with:

      if (file_exists("../logos/".$product["merchant"].$config_logoExtension))
      {
        $item["logo"] = "/logos/".str_replace(" ","%20",$product["merchant"]).$config_logoExtension;
      }

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Wed, 2020-09-23 08:54

Works great! Many thanks!