Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

movie details warnings


ledave

Recommended Posts

I would like to use your contribution Movie Details.

 

After installing, I get these warnings:

 

Warning: in_array(): Wrong datatype for second argument in

admin/categories.php on line 616

 

Warning: in_array(): Wrong datatype for second argument in

/admin/categories.php on line 616

 

Warning: in_array(): Wrong datatype for second argument in

/admin/categories.php on line 623

 

Warning: in_array(): Wrong datatype for second argument in

/admin/categories.php on line 860

 

Warning: in_array(): Wrong datatype for second argument in

/admin/categories.php on line 926

 

Warning: in_array(): Wrong datatype for second argument in

/admin/categories.php on line 948

 

Al these warning are from: catalog\admin\categories.php. I didn't change

the file from the package.

Link to comment
Share on other sites

well the seconds parameters should be arrays filled by the info of the database. Have you ran the movie_details.sql included in the zip in your database?

If you do maybe it's because the language you use in your admin isn't included in the package. It comes with the info for 3 languages (english, french and spanish) with languages_id 1, 2 and 3. By your mail I can see your Dutch, if your admin is in dutch well we have the problem isolated. I suggest you create a sql file translating the info at dutch and changing the parameter for the language to the languages_id of ducth in your shop.

 

Hope it helps.

regards,

David

Link to comment
Share on other sites

I indeed use Dutch as my primary language. I have added Dutch. But I still get the same warnings. ALso when I use English or German.

 

The admin/categories.php page start withe these warnings:

 

Warning: in_array(): Wrong datatype for second argument in /admin/categories.php on line 616

 

Warning: in_array(): Wrong datatype for second argument in /admin/categories.php on line 616

 

Warning: in_array(): Wrong datatype for second argument in /admin/categories.php on line 623

Link to comment
Share on other sites

well these lines are about the director/actors. The warnings are there because there is nobody in the table movie_people. I didn't think of it, so that's the first thing to arrange. Try this: change lines 614 to 628 from:

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
for ($i=0, $j=count($director_array); $i<$j; $i++){
	if (in_array($director_array[$i]['id'], $people_ids)){
		$director_id = $director_array[$i]['id'];
	}
}
}
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
for ($i=0, $j=count($actor_array); $i<$j; $i++){
	if (in_array($actor_array[$i]['id'], $people_ids)){
		$actor_id[] = $actor_array[$i]['id'];
	}
}
}
//end of movie details

to

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
if (count($director_array) > 0){
	for ($i=0, $j=count($director_array); $i<$j; $i++){
		if (in_array($director_array[$i]['id'], $people_ids)){
			$director_id = $director_array[$i]['id'];
		}
	}
}
}
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
if (count($actor_array) > 0){
	for ($i=0, $j=count($actor_array); $i<$j; $i++){
		if (in_array($actor_array[$i]['id'], $people_ids)){
			$actor_id[] = $actor_array[$i]['id'];
		}
	}
}
}
//end of movie details

it should do it. Tell me how it works.

 

ps: if you translated the 'movies_info_values', would you mind post here the translation, so I can include it in the contrib. thanx

Link to comment
Share on other sites

  • 3 weeks later...

Hi There

 

I had the same problem with my site, but ticking one of the options for the movie details gets rid of all the warning messages.

 

The issue I am having though, Is that the movie director is never appearing on the product info page. The movie_details.php module obviously returns valid data from the array, but the people_id value does not match the director people_id value. This may be caused by a fault in the /admin/catalog.php code somewhere> I am not sure, I have had a look but since my contrib is osc max, the code is quite different from a stock os commerce install.

Are you able to point me in the right direction to try and fix this?

 

Thanks

Link to comment
Share on other sites

hello Fran?ois,

I discovered some bugs and I'll upload a new version. Meanwhile I put you here the modules\movie_details.php with some bugs fixes. It should do the trick.

<script>

<!--

wmtt = null;

 

document.onmousemove = updateWMTT;

 

function updateWMTT(e) {

x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;

y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY;

if (wmtt != null) {

wmtt.style.left = (x + 20) + "px";

wmtt.style.top = (y + 20) + "px";

}

}

 

function showWMTT(id) {

wmtt = document.getElementById(id);

wmtt.style.display = "block"

}

 

function hideWMTT() {

wmtt.style.display = "none";

}

//-->

</script>

<style>

.tooltip {

position: absolute;

display: none;

background-color: #E4E4E4;

}

</style>

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="2"><?php echo TEXT_MOVIE_DETAILS; ?></td>

</tr>

<tr>

<td class="main" colspan="2">

<?php

$director_query = tep_db_query("select mp.people_id, mp.director, mp.picture from " . TABLE_MOVIES_PEOPLE . " mp natural join " . TABLE_MOVIES_INFO . " mi where mi.people_id = mp.people_id and mi.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mp.director != ''");

$director = tep_db_fetch_array($director_query);

$id = $director['people_id'];

echo (isset($director['director']) ? TEXT_DIRECTOR . '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'people=' . $director['people_id']) . '" onMouseOver="showWMTT('. $id .')" onMouseOut="hideWMTT()" alt="' . TEXT_SEE_ALL_MOVIES . $director['director'] . '" title="' . TEXT_SEE_ALL_MOVIES . $director['director'] . '">' . $director['director'] . '</a><br>' : '');

echo '<div class="tooltip" id="'.$id.'"><img src="' . DIR_WS_IMAGES . $director['picture'] . '" /></div>';

$actor_query = tep_db_query("select mp.people_id, mp.actor, mp.picture from " . TABLE_MOVIES_PEOPLE . " mp natural join " . TABLE_MOVIES_INFO . " mi where mi.people_id = mp.people_id and mi.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mp.actor != '' order by mi.movies_info_id");

if (tep_db_num_rows($actor_query) > 0){

echo TEXT_ACTOR;

$coma = 1;

while ($actor = tep_db_fetch_array($actor_query)){

echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'people=' . $actor['people_id']) . '" onMouseOver="showWMTT('. $actor['people_id'] .')" onMouseOut="hideWMTT()" alt="' . TEXT_SEE_ALL_MOVIES . $actor['actor'] . '" title="' . TEXT_SEE_ALL_MOVIES . $actor['actor'] . '">' . $actor['actor'] . '</a>' . (($coma < tep_db_num_rows($actor_query)) ? ', ' : '');

echo '<div class="tooltip" id="'.$actor['people_id'].'"><img src="' . DIR_WS_IMAGES . $actor['picture'] . '" /></div>';

$coma++;

}

echo '<br>';

}

$movie_parent_query = tep_db_query("select distinct miv.movies_info_parent_id from " . TABLE_MOVIES_INFO_VALUE . " miv, " . TABLE_MOVIES_INFO . " mi where miv.movies_info_value_id = mi.movies_info_value_id and mi.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and miv.language_id = '" . (int)$languages_id . "' order by miv.movies_info_parent_id");

while ($movie_parent = tep_db_fetch_array($movie_parent_query)){

$coma = 1;

$movies_info_parent_query = tep_db_query("select movies_info_value from " . TABLE_MOVIES_INFO_VALUE . " where movies_info_value_id = '" .$movie_parent['movies_info_parent_id'] . "' and language_id = '" . (int)$languages_id . "'");

$movies_info_parent = tep_db_fetch_array($movies_info_parent_query);

echo strtoupper($movies_info_parent['movies_info_value']) . ': ';

$movie_info_values_query = tep_db_query("select miv.movies_info_value from " . TABLE_MOVIES_INFO_VALUE . " miv, " . TABLE_MOVIES_INFO . " mi where miv.movies_info_parent_id = '" . $movie_parent['movies_info_parent_id'] . "' and mi.movies_info_value_id = miv.movies_info_value_id and mi.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "' order by mi.movies_info_value_id");

while ($movie_info_value = tep_db_fetch_array($movie_info_values_query)){

echo ucfirst($movie_info_value['movies_info_value']) . (($coma < tep_db_num_rows($movie_info_values_query)) ? ', ' : '');

$coma++;

}

echo '<br>';

}

$movie_details_query = tep_db_query("select movie_reg_cod, movie_length from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$movie_details = tep_db_fetch_array($movie_details_query);

$region_codes[] = array('id' => '1',

'text' => 'U.S. territories and Canada');

$region_codes[] = array('id' => '2',

'text' => 'Europe, Japan, the Middle East, Egypt, South Africa, Greenland');

$region_codes[] = array('id' => '3',

'text' => 'Taiwan, Korea, the Philippines, Indonesia, Hong Kong');

$region_codes[] = array('id' => '4',

'text' => 'Mexico, South America, Central America, Australia, New Zealand, Pacific Islands, Caribbean');

$region_codes[] = array('id' => '5',

'text' => 'Russia, Eastern Europe, India, most of Africa, North Korea, Mongolia');

$region_codes[] = array('id' => '6',

'text' => 'China');

echo (isset($movie_details['movie_reg_cod'])) ? TEXT_REG_COD . $region_codes[$movie_details['movie_reg_cod']-1]['text'] . '<br>' : '';

echo (isset($movie_details['movie_length']) && $movie_details['movie_length'] != 0) ? TEXT_LENGTH . $movie_details['movie_length'] : '';

?>

</td>

</tr>

</table>

tell me if it works ok now.

Regards

Link to comment
Share on other sites

Thanks, that did the trick, you may want to also add the following to the install instructions to add to catclog/includes/languages/english.php

 

define('TEXT_REG_COD', 'REGION CODES: ');

 

Thanks

Francois.

 

 

hello Fran?ois,

I discovered some bugs and I'll upload a new version. Meanwhile I put you here the modules\movie_details.php with some bugs fixes. It should do the trick.tell me if it works ok now.

Regards

Link to comment
Share on other sites

You may also want to modify /admin/catalog.php lines above to something like..

 

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
if (count($director_array) > 0){
for ($i=0, $j=count($director_array); $i<$j; $i++){

if (is_array($people_ids) && (in_array($director_array[$i]['id'], $people_ids))){
$director_id = $director_array[$i]['id'];
}
}
}
}
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
if (count($actor_array) > 0){
for ($i=0, $j=count($actor_array); $i<$j; $i++){
if (is_array($people_ids) && (in_array($actor_array[$i]['id'], $people_ids))){
$actor_id[] = $actor_array[$i]['id'];
}
}
}
}

 

The fix you provided in the above post does not resolve the warnings for me. I added the check (is_array($people_ids) to make sure $people_ids is an array as this "empty" array was the cause of the warning message. This way you may also not require the if (count($actor_arrary) > ) line... as these arrays will always return at least a count of 1 due to the lines of code a few lines above..

 

$director_array = array(array('id' => '0', 'text' => TEXT_CHOOSE));
$actor_array = array(array('id' => '0', 'text' => TEXT_CHOOSE));

 

Hope this helps.

Link to comment
Share on other sites

I also had to make the same sort of modifications later on in admin/categories.php to resolve more warnings..

 

Around line 860 (unmodified OSC install):

 

Replace the following line;

 if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS) && in_array($movie_languages['movies_info_value_id'], $movie_infos)){

 

with

 

 if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS) && (is_array($movie_infos)) && in_array($movie_languages['movies_info_value_id'], $movie_infos)){

 

This mod (checking to make sure $movie_infos is an array) also needs to be done to the rest of the lines which build the check boxes for Subtitles, Type, Audio Format, Picture format and others.

Link to comment
Share on other sites

I forgot to mention, thanks David for creating this great bit of code, a great addition for movie sites.
you're welcome Fran?ois, my pleasure. Thank you for using it and giving him life.

Thanks also for mentioning the errors it gave to you, it helps me to correct it. I hope this week end I'll got time to upload the new version. If you think in anything else please post it here.

see you

 

pd: when you have something live I would be glad to see it running

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hello,

I think this is a fantastic contribution and it's exactly what I'm looking for for my site. However, the installation is confusing for me and when I installed it I got an error.

 

Am I correct in that I have to import the .sql and then upload and replace the files on my oscommerce setup with the ones in the contribution? This is the error I am getting on the product info page:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/pgdvd/public_html/shop/includes/header.php:428) in /home/pgdvd/public_html/shop/includes/boxes/categories.php on line 13

 

Any help would be greatly appreciated. Thank you!

Link to comment
Share on other sites

  • 1 month later...
hello all,

 

so this is it, I created my first contrib for OSC which gives more details in the product_info.php.

You can download it here: http://www.oscommerce.com/community/contributions,4202

 

So this thread is to help youwith instalation and use of it.

 

see you.

If this is your first contribution, I want to say "Congratulations". You made a great work and it is working fine. I am building a DVD shop and my client wanted from me lots of details. You already covered most of them. I am a new buy in OS commerce. I want to add more details to the information that you covered. Is it hard to edit your work?

 

The details I want to add:

Original Language

The name in the target language(Other than the Original Name)

Producer

Scenario

Composer

Director of Photography

Disc Number

IMDB Rating (I will try to reflect the latest changes to the Catalog)

Editor's Note

 

As you see, it will be DVD Fanatics' site :) They will be able to find nearly all the details about the DVD.

 

Thanks for your contribution

Link to comment
Share on other sites

hello raskolt, thanks for congratulations :blush:

 

I'm glad you see that contrib usefull. I think it's quite easy to edit my code to make it as you want to. Just copy what I've done changing the name of the fields and variables should do the trick.

 

You'll have to create columns and/or table in the db, edit the catalog/admin/categories.php to add the fields you need and edit the catalog/includes/modules/movie_details.php (and the corespondant languages) to add the relevant information.

Aditionaly, if you want to enable the clients to look for dvd's by some of the caracteristics you'll add, yo will have to edit the catalog/advanced_search_result.php as well.

 

If you need any help to understand some of my code don't hesitate to ask me here.

Good luck

Link to comment
Share on other sites

hello raskolt, thanks for congratulations :blush:

 

I'm glad you see that contrib usefull. I think it's quite easy to edit my code to make it as you want to. Just copy what I've done changing the name of the fields and variables should do the trick.

 

You'll have to create columns and/or table in the db, edit the catalog/admin/categories.php to add the fields you need and edit the catalog/includes/modules/movie_details.php (and the corespondant languages) to add the relevant information.

Aditionaly, if you want to enable the clients to look for dvd's by some of the caracteristics you'll add, yo will have to edit the catalog/advanced_search_result.php as well.

 

If you need any help to understand some of my code don't hesitate to ask me here.

Good luck

 

As you say, it is easy to edit your code. I have added new fields and variables by changing your variables. I copied the movie_length variable to add new details and finally I could add the new details to the database. However, I can not show them on the mainpage. Simply the code adds but does not show.

 

My variables' and database fields' names are the same like in your movie_length variable. I changed the files that you said. Is there another file that I have to change?

Link to comment
Share on other sites

I don't understand that:

Simply the code adds but does not show.

Anyway, let's find what's wrong.

The datas are in the database, right? your new datas are all stored in the products table or is there a part in the movie_details_info? In the catalog/includes/modules/movie_details.php you made the select query to select the datas you want to show up and the code to echo it?

A thing that occurs to me, there is a condition in the product_info.php to call the module: it checks if there is something to show acording to the movie_info table. If you made a test without any info in this table, the module will not show up.

If I can see it online pass me the URL.

good luck

Link to comment
Share on other sites

I don't understand that:

Anyway, let's find what's wrong.

The datas are in the database, right? your new datas are all stored in the products table or is there a part in the movie_details_info? In the catalog/includes/modules/movie_details.php you made the select query to select the datas you want to show up and the code to echo it?

A thing that occurs to me, there is a condition in the product_info.php to call the module: it checks if there is something to show acording to the movie_info table. If you made a test without any info in this table, the module will not show up.

If I can see it online pass me the URL.

good luck

I mean I can add the data. However, in my main page, I can not see them. All of the data is stored in the products table and I wrote the code according to the movie_length variable. As you know, it is stored in the database with the same name.

I also call it in movie_database.php with the same name. Think it as a second movie_length variable with a different name. It will just store another information.

Link to comment
Share on other sites

ledave, thanks for the contribution

I really need it.

But i dun know how to edit catalog/advance_search.php

And this is my advance_search.php

 

<?php
/*
 $Id: advanced_search.php,v 1.50 2003/06/05 23:25:46 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);

 $breadcrumb->add(NAvb script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SEARCH_HELP) . '\')">' . TEXT_SEARCH_HELP_LINK . '</a>'; ?></td>
		<td class="smallText" align="right"><?php echo tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_CATEGORIES; ?></td>
			<td class="fieldValue"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"> </td>
			<td class="smallText"><?php echo tep_draw_checkbox_field('inc_subcat', '1', true) . ' ' . ENTRY_INCLUDE_SUBCATEGORIES; ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_MANUFACTURERS; ?></td>
			<td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_PRICE_FROM; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('pfrom'); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_PRICE_TO; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('pto'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_DATE_FROM; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('dfrom', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
		  </tr>
		  <tr>
			<td class="fieldKey"><?php echo ENTRY_DATE_TO; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('dto', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I cannot get the

  if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
   (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
   (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
   (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
   (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {

Link to comment
Share on other sites

@raskolt: sorry for the wait, I've just passed 1 week in the "Real World", far from the web...how bizarre! Regarding your problem, have you checked that the condition is met in order to display the mod? I mean, in this mod, in the product_info.php there is a sql query that check if there is something in the database about movie info to display. This piece of code:

//begin of movie details
$check_movie_details_query = tep_db_query("select movies_info_id from " . TABLE_MOVIES_INFO . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
if (tep_db_num_rows($check_movie_details_query) > 0){
	include(DIR_WS_MODULES . FILENAME_MOVIE_DETAILS);
}
//end of movie details

As you can see, it only checks that there is something in the movies_info table about the product. As you tell me that what you've add is in the products table it may be the cause. You should change this query to select the info you need. If this is not the problem, post your code and I'll have a look. Also if you have it online it could be useful for me to see it.

cheers.

 

@aHfUi: hi and thanks for your interest in my contrib. Your problem is quite easier to solve: you're looking in the wrong file! :rolleyes:. Actually the changes affect the advanced_search_result.php ;)

good luck with your shop, and I'd be glad to see my contrib working, give me the URL if you can.

bye.

Link to comment
Share on other sites

@aHfUi: hi and thanks for your interest in my contrib. Your problem is quite easier to solve: you're looking in the wrong file! :rolleyes:. Actually the changes affect the advanced_search_result.php ;)

good luck with your shop, and I'd be glad to see my contrib working, give me the URL if you can.

bye.

 

Hahahahha

I get it now, thanks you very much :P

Ledave, if i need to add the extra field for "disc number" which look like the "movie lenght"

Can you show me step by step @@?

this is because i no expert for php and what i do before is copy and paste only ..

I already edit it, but fail ....

or i show to you related edited file ?

Link to comment
Share on other sites

well I can tell you what you should do but cannot do it for you. The easier way is to follow the instructions for the instalation of the mod and where it says something about movie_length just add the same code just below, changing movie_length with disc_number.

For info that should be the steps:

 

1. create the field in the db.

2. add code in the catalog/admin/categories.php. This is the tricky part. If you want to be sure to not forget anything you should compare your actual categories.php file with an original one (use winmerge, for example: free and free :)): for every diference check if it is about the movie_length and add the same piece of code just below (as I said before).

3. modify the code of the catalog/includes/modules/movies_info.php to select the new field in the db and echoing it.

 

Try it and if you don't succeed put here the code of what's wrong and tell me the error that it gives you.

have fun coding.

cheers.

Link to comment
Share on other sites

well I can tell you what you should do but cannot do it for you. The easier way is to follow the instructions for the instalation of the mod and where it says something about movie_length just add the same code just below, changing movie_length with disc_number.

For info that should be the steps:

 

1. create the field in the db.

2. add code in the catalog/admin/categories.php. This is the tricky part. If you want to be sure to not forget anything you should compare your actual categories.php file with an original one (use winmerge, for example: free and free :)): for every diference check if it is about the movie_length and add the same piece of code just below (as I said before).

3. modify the code of the catalog/includes/modules/movies_info.php to select the new field in the db and echoing it.

 

Try it and if you don't succeed put here the code of what's wrong and tell me the error that it gives you.

have fun coding.

cheers.

 

Thanks you.

I understand and i already do it for myself

This is the zip file from what i edit before : http://shopping.forum-talk.com/movie_detail.rar

 

And i found the database filed do not record any value after update the products.

Can you help me check what mistake i made ?

 

catalog/includes/modules/movies_info.php

 

This should be catalog/includes/modules/movies_detail.php =.="

Thanks you :thumbsup:

Link to comment
Share on other sites

This should be catalog/includes/modules/movies_detail.php =.="
indeed, you're totaly right. My mistake, sorry :)

I already see one thing in your code that make it imposible to works: the field where you introduce the disc's number is called disc_number (line 1045), and on line 1327 you make a check to see if there is any post variable for disc_num, which of course will never append. Change one of those 2 lines and tell me if it works better.

 

Anyway I'd recomend you to name all the variable and the db field the same way, it makes it more easy to read/understand it and avoid you this type of error.

Good luck

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...