Zen Cart Logo

Record Company image

Locked

Views: 2,930

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
21 May 2007, 10:49 PM
#1
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Record Company image

Anyone know how to get record company icons to appear? While there's a field to enter an image in Admin/Extras/Record Companies, I cannot see anywhere to actually turn the image on..

Actually I'd love to have the record company logo be the link in the "product URL".

Currently that area in tpl_product_music_info_display.php reads:

<!--bof Product URL -->
<?php
  if (zen_not_null($products_record_company_url)) {
    if ($flag_show_product_music_info_record_company == 1) {
?>
    <li id="productInfoLink"><?php echo sprintf(TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false)); ?></li>
<?php
    } // $flag_show_product_info_record_company
  }
?>
<!--eof Product URL -->

I've tried a number of ideas to call up products_record_company_image, but have not succeeded.

Any idea would be awesome. Thanks!

-SWW

22 May 2007, 1:56 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

You should be able to get the name of the image with:
$record_company->fields['record_company_image']

22 May 2007, 1:38 PM
#3
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Re: Record Company image

Seems like the logical place (i.e. least desctructive to the original code) to change that might be /includes/langues/english/product_music_info.php?

And then change the definition of TEXT_RECORD_COMPANY_URL to something like:

define('TEXT_RECORD_COMPANY_URL', '<a href="%s">' . zen_image($record_company->fields['record_company_image']) . '</a>.');

Alas, not working. The image is not appearing. Don't I need a 'require' function in there or something?

(I apologize for being such a php and SQL spaz..) :wacko:

23 May 2007, 8:55 PM
#4
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Re: Record Company image

Actually, I just noticed that the 'record artist url' (web site for the recording artist, added in the Admin control panel) also has no way of being shown either.. And.. come to think of it... neither can the artist picture.....

I do believe the the Product Music addition is in need of tweeks.

24 May 2007, 4:39 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

I was rather noticing that too ...

The fields are available but not in the variable format like the others ...

Look in the /pages/product_music__infp/header_php

  $products_record_company_url = $record_company_info->fields['record_company_url'];
24 May 2007, 6:07 PM
#6
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Re: Record Company image

Probably a number of (better) ways of doing this, but I went with:

Changed the Product URL area in [my template]/templates/tpl_product_music_info.php to:

<!--bof Product URL -->

<?php
  if (zen_not_null($products_record_company_url)) {
    if ($flag_show_product_music_info_record_company == 1) {
?>
<?php echo sprintf('<a href="' . TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $record_company->fields['record_company_image']) . '</a>'); ?>

<?php
    } // $flag_show_product_info_record_company
  }
?>

<!--eof Product URL -->

And then changing the define TEXT_RECORD_COMPANY_URL line in /includes/languages/english/product_music-info.php, to:

define('TEXT_RECORD_COMPANY_URL', '%s');

And viola, now every music product indeed shows the record company logo which links to their web site.

24 May 2007, 7:06 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

Thanks for sharing the solution that works for you ... :smile:

9 Aug 2008, 8:42 PM
#8
reza avatar

reza

Zen Follower

Join Date:
Aug 2006
Posts:
166
Plugin Contributions:
0

Re: Record Company image

hi
I am still looking for finding the reason of adding images for artist and recorrding company for music products if there is no place that you can show them?

anyway that we can show their images on the pages? the explanation above was not enough to get solve yhis problem.
please if somebody wants to give solution, write it complete that be understandable for everybody.

10 Aug 2008, 2:32 PM
#9
reza avatar

reza

Zen Follower

Join Date:
Aug 2006
Posts:
166
Plugin Contributions:
0

Re: Record Company image

I could get the image of record company on the product music info.
I could make a line to show the product artist url and also its image which is hyperlinked to its url. the problem is that the image of artist does not been displayed?
I checked the table of record artists and fields therein, and there is an image in the fields of this table for a defined artists, but on page it displays "image not available.gif)

any idea about the reason:

this is what I put in tpl_product_music_info_display.php

<?php echo sprintf('<a href="' . TEXT_ARTIST_IMAGE_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_artist_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $record_artists->fields['artists_image']). '</a>'); ?>
10 Aug 2008, 4:37 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

Where are you building the data for obtaining: $record_artists->fields['artists_image']

10 Aug 2008, 6:11 PM
#11
reza avatar

reza

Zen Follower

Join Date:
Aug 2006
Posts:
166
Plugin Contributions:
0

Re: Record Company image

hi
in the tpl_product_music_info_display.php

after <!--eof Product date added/available -->
I added:

<!--bof Product URL --> <?php if (zen_not_null($products_url)) { if ($flag_show_product_info_url == 1) { ?>
<p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php } // $flag_show_product_info_url } ?> <!--eof Product URL --> <!--bof Product artists url and image --> <?php if ($flag_show_product_music_info_artist == 1 or $flag_show_product_music_info_genre == 1 or $flag_show_product_music_artist == 1) { ?> <ul id="productDetailsList" class="floatingBox back"> <?php echo (($flag_show_product_music_info_artist == 1 and !empty($products_artist_name)) ? '<li>' . TEXT_ARTIST_URL . $products_artist_name . '</li>' : '') . "\n"; ?> <?php // $flag_show_product_info_record_company ?> </ul> <br class="clearBoth" /> <?php } ?> <?php echo sprintf('<a href="' . TEXT_ARTIST_IMAGE_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_artist_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $record_artists->fields['artists_image']). '</a>'); ?> <!--eof Product artists url and image --> <!--bof record company url and image --> <?php if (zen_not_null($products_record_company_url)) { if ($flag_show_product_music_info_record_company == 1) { ?>
<p id="productInfoLink" class="productMusic centeredContent">For more information, you can visit the <a href=<?php echo sprintf(TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false)); ?> >webpage</a> of manufacturer.</p>
<?php
}// $flag_show_product_info_record_company

}
?>

<?php echo sprintf('<a href="' . TEXT_RECORD_COMPANY_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_record_company_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $record_company->fields['record_company_image']) . '</a>'); ?> <!--eof Product URL -->

so: I repeated the same principle of record company for the artists, but for record company it displays image of respected record company,
for artists: it displays url of artists and the link to his url, also the url of artists is on the artists image, just there is no image, like the script can not find the image of artist. the """" zen_image(DIR_WS_IMAGES . $record_artists->fields['artists_image']). '</a>'); """"
comes from the table record_artists where there is a filed of artists_image.
problem:
1- image of artists doen't displayed.
2- when I install lichtbox addon, the image of product will not more get the function of lichtbox image, even if I add this code to the appropriate file of lichtbox file.

thanks

10 Aug 2008, 8:17 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

This will give you the image:

zen_image(DIR_WS_IMAGES . $artist->fields['artists_image'])

I am not sure what you are trying to do with the rest of that line as it won't display the image even when you reference it correctly ...

10 Aug 2008, 11:15 PM
#13
reza avatar

reza

Zen Follower

Join Date:
Aug 2006
Posts:
166
Plugin Contributions:
0

Re: Record Company image

Ajeh:

This will give you the image:

zen_image(DIR_WS_IMAGES . $artist->fields['artists_image'])

> 
> I am not sure what you are trying to do with the rest of that line as it won't display the image even when you reference it correctly ...

I did your changes, still no image; I don't know why you wrote this address for image, but the table is like this:

************
Table structure for table `record_artists`
--

CREATE TABLE `record_artists` (
  `artists_id` int(11) NOT NULL auto_increment,
  `artists_name` varchar(32) NOT NULL default '',
  `artists_image` varchar(64) default NULL,
  `date_added` datetime default NULL,
  `last_modified` datetime default NULL,
  PRIMARY KEY  (`artists_id`),
  KEY `idx_rec_artists_name_zen` (`artists_name`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `record_artists`
--

INSERT INTO `record_artists` (`artists_id`, `artists_name`, `artists_image`, `date_added`, `last_modified`) VALUES
(1, 'The Russ Tippins Band', 'category_dvd_movies.gif', '2004-06-01 20:53:00', '2008-08-09 22:13:47'),
(2, 'Alphaveto', 'Importers_Distributors/Zonsondergang.jpg', '2008-08-09 01:04:03', '2008-08-10 15:48:19'),
(3, 'Trovet', 'countrychart_20402.jpg', '2008-08-09 01:04:24', '2008-08-10 14:47:36');


************
11 Aug 2008, 12:14 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

While the table may be written one way ... the available variables, contants and arrays can change from place to place ...

On the tpl_product_music_info_display.php you need to look into the files in the pages for the:
/includes/modules/pages/product_music_info

to see what is available to you ...

If you look in the main_template_vars_product_type.php you will see that that table is referenced with:

    $sql = "select * from " . TABLE_RECORD_ARTISTS . "
            where artists_id = '" . $music_extras->fields['artists_id'] . "'";

    $artist = $db->Execute($sql);

So now you want from the record_artists table the field for the artists_image which is available with:
$artist->fields['artists_image']

Paste this into your tpl_product_music_info_display.php and see what happens:

<?php echo 'I SEE: ' . zen_image(DIR_WS_IMAGES . $artist->fields['artists_image']) . ' I do NOT SEE: ' . sprintf('<a href="' . TEXT_ARTIST_IMAGE_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_artist_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $artist->fields['artists_image']). '</a>'); ?>

You will see that one reference works and the other fails ... you need to fix whatever it is you think you want to have happened to the displayed image ... :blink:

11 Aug 2008, 8:33 PM
#15
reza avatar

reza

Zen Follower

Join Date:
Aug 2006
Posts:
166
Plugin Contributions:
0

Re: Record Company image

Ajeh:

While the table may be written one way ... the available variables, contants and arrays can change from place to place ...

On the tpl_product_music_info_display.php you need to look into the files in the pages for the:
/includes/modules/pages/product_music_info

to see what is available to you ...

If you look in the main_template_vars_product_type.php you will see that that table is referenced with:

$sql = "select * from " . TABLE_RECORD_ARTISTS . "
        where artists_id = '" . $music_extras->fields['artists_id'] . "'";

$artist = $db->Execute($sql);
> 
> So now you want from the record_artists table the field for the artists_image which is available with:
> $artist->fields['artists_image']
> 
> Paste this into your tpl_product_music_info_display.php and see what happens:
> ```php
<?php echo 'I SEE: ' . zen_image(DIR_WS_IMAGES . $artist->fields['artists_image']) . ' I do NOT SEE: ' . sprintf('<a href="' . TEXT_ARTIST_IMAGE_URL, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_artist_url), 'NONSSL', true, false) . '">' . zen_image(DIR_WS_IMAGES . $artist->fields['artists_image']). '</a>'); ?>

You will see that one reference works and the other fails ... you need to fix whatever it is you think you want to have happened to the displayed image ... :blink:

Hi Ajeh
It works now, your code is the same as your last advise, but it works now !!! :clap:to be honest, I spent more than 4 hours wihout results, thank you very much. it is very strange that lichtbox module or zwap image works on all products excepyt of music products. any idea for it ?

12 Aug 2008, 4:46 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Record Company image

Sorry I do not use it ... but glad to hear that this is working for you now ... :smile: