Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cool Flash Carousel Menu


Guest

Recommended Posts

  • Replies 641
  • Created
  • Last Reply

Top Posters In This Topic

I think that I've found the answer by importing the rest of the sql from featured products.

 

I've to strip down the sql to the absolute minimum because there are way to much settings here.

For now you can try the full sql

 

Let me know if it's working for you

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('18','Rotator', 'Rotator Products Display', '18', '1'
);

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) VALUES ('Display Rotator Products', 'ROTATOR_PRODUCTS_DISPLAY', 'true', 'Set to true or false in order to display rotator.', '18', '1', now(), now()
);

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) VALUES ('Maximum Display of rotator', 'MAX_DISPLAY_ROTATOR_PRODUCTS', '6', 'This is the maximum amount of items to display on the front page.', '18', '2', now(), now()
);

UPDATE `configuration` SET `set_function`="tep_cfg_select_option(array('true', 'false')," WHERE `configuration_key`='ROTATOR_PRODUCTS_DISPLAY';

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, set_function) VALUES ('Include Sub Categories When Displaying Rotator Products', 'ROTATOR_PRODUCTS_SUB_CATEGORIES', 'true', 'Set to true or false in order to display rotator including sub categories.', '18', '3', now(), now(), "tep_cfg_select_option(array('true', 'false'),");

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, set_function) VALUES ('Specials Only When Displaying Rotator Products', 'ROTATOR_PRODUCTS_SPECIALS_ONLY', 'false', 'Set to true or false in order to display only on special rotator products.', '18', '4', now(), now(), "tep_cfg_select_option(array('true', 'false'),");

Edited by emmetje
Link to comment
Share on other sites

The SQL import went fine but the module still will not show the movie...

The XML-file in the images directory is still empty. This happened after upgrading to 2.0a.

I think I will install 2.0 all over again just to see if I have made a mistake.

(Maybe the xml-file will come to life again...)

Link to comment
Share on other sites

Did it all over again (exept that last line in the SQL that wont work).

Still the same problem. No data in the xml-file and no movie.

Maybe I should roll back to 2.0?

Or maybe I need to install featured products somehow?

Edited by Micke
Link to comment
Share on other sites

Just thought I'd mention, I'm having a similar problem to Micke. So it looks like it's not a one off...

 

Followed the install procedure to the letter for version 2.0a (and triple checked it)

Database tables are all there, and the admin side appears to work, as I can add products to the list and can go out and back into the admin and still see the products. Checking the database the items have been added there successfully. (as expected)

 

However the XML file is empty (yes it''s set to 777)

As the XML file is empty the flash doesn't show up.

 

Any thoughts guys? I'd love to get this working, and the Admin side of this version is what's really got me interested now...

 

Cheers

Mat

Link to comment
Share on other sites

Just checked my error logs and I've got the following...

 

[Tue Oct 07 14:03:40 2008] [error] [client XXX.XXX.XXX.XXX] PHP Warning: include(includes/modules/FILENAME_ROTATOR) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/html/catalog/test.php on line 54

[Tue Oct 07 14:03:40 2008] [error] [client XXX.XXX.XXX.XXX] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'includes/modules/FILENAME_ROTATOR' for inclusion (include_path='.:/php/includes:/usr/share/php:/usr/share/pear') in /var/www/html/catalog/test.php on line 54

[Tue Oct 07 14:03:40 2008] [error] [client XXX.XXX.XXX.XXX] PHP Warning: include(includes/modules/FILENAME_ROTATOR) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /var/www/html/catalog/test.php on line 65

 

The XXX's are me hiding my IP Address... :)

 

Also

 

In catalog/includes/modules/rotator.php there is the following code

 

$xmlfile.="</products>\n";

// (turkce)  xml dosyasini images klasoru altina kaydet
// (english) save xml file under images directory
savefile($xmlfile, 'kampanya.xml');

 

Which to me is pointing the writing of the xml file into a folder called "products" I'm probably wrong as my knowledge of PHP etc is a bit rubbish, but maybe someone could comment?

 

Cheers

 

Mat

 

Oh forgot to mention, the SQL code seemed to work perfectly, so I've not had a problem with the last line like some have had....

Edited by random183
Link to comment
Share on other sites

I've made a new installation and ran into the same error.

 

After pulling some hair I found the solution. Change the code from rotator.php into the following code

 

No need to import the sql I posted before

 

<?php
/*
 $Id: kampanya.php, v 1 03/08/2008 22:59

 osCommerce, Açýk Kaynak Kodlu E-Ticaret Çözümleri
 http://www.oscommerce.com.tr

 Copyright (c) 2007 osCommerce Türkiye

 GNU Genel Kamu Lisansý (GPL) altýnda sunulmuþtur
*/
// (turkce)  Ayarlar
// (english) Configuration
   require('includes/classes/class.image-resize.php');

 $kampanya = new currencies();
 function savefile($xmldata, $filename){
	$filename_dir  = DIR_FS_CATALOG . DIR_WS_IMAGES . $filename;
	if ($fp = fopen($filename_dir, 'w+')){
			  fwrite($fp, $xmldata);
			  fclose($fp);
			  return true;
	}
	else  return false;
 }
 // (turkce) Eðer resmin boyutlandirilmasini istiyorsaniz asagidaki ayarlari degistiriniz
// (english)If you want to resize images change below lines
$image_need_resize = 1;		  // 1 on, 0 off - 1 acik, 0 kapali
$width = 100;								 // image width - resim genisligi
$height = 80;								 // image height - resim yuksekligi
$limit_product_number = 12; // how many products want to show - kac tane urun gostermek istiyorsunuz
// (turkce)  Ayarlar bitti
// (english) Configuration end

function thumb_kampanya($img, $width, $height, $fill = false) {
 if (!extension_loaded('gd') && !extension_loaded('gd2')) {
			trigger_error("No dispones de la libreria GD para generar la imagen.", E_USER_WARNING);
			return false;
	}

 //$ext = strtolower(array_pop(explode(".",$img)));
 $imgInfo = getimagesize($img);
 switch ($imgInfo[2]) {
case 1: $im = imagecreatefromgif($img); break;
case 2: $im = imagecreatefromjpeg($img);  break;
case 3: $im = imagecreatefrompng($img); break;
default:  trigger_error('Tipo de imagen no reconocido.', E_USER_WARNING);  break;
 }


//


		$ratio = $imgInfo[1] / $imgInfo[0];

		// Set the width and height to the proper ratio
		if (!$width && $height) {
			$ratio = $height / $imgInfo[1];
			$width = intval($imgInfo[0] * $ratio);
		} elseif ($width && !$height) {
			$ratio = $width / $imgInfo[0];
			$height = intval($imgInfo[1] * $ratio);
		} elseif (!$width && !$height) {
			$width = $imgInfo[0];
			$height = $imgInfo[1];
		}

		// Scale the image if not the original size
		if ($imgInfo[0] != $width || $imgInfo[1] != $height) {
			$rx = $imgInfo[0] / $width;
			$ry = $imgInfo[1] / $height;

			if ($rx < $ry) {
				$width = intval($height / $ratio);
			} else {
				$height = intval($width * $ratio);
			}
		}
//


 $nWidth = round($width);
 $nHeight = round($height);

 $newImg = imagecreatetruecolor($nWidth, $nHeight);
 $th_bg_color = imagecolorallocate($newImg, 255, 255, 255);
 imagefill($newImg, 0, 0, $th_bg_color);
 imagecolortransparent($newImg, $th_bg_color);

 imagecopyresampled($newImg, $im, 0, 0, 0, 0, $nWidth, $nHeight, $imgInfo[0], $imgInfo[1]);



 switch ($imgInfo[2]) {
case 1: imagegif($newImg,$img.'kampanya.gif');
return 'kampanya.gif';
break;
case 2: imagejpeg($newImg,$img.'kampanya.jpg');
return 'kampanya.jpg';
break;
case 3: imagepng($newImg,$img.'kampanya.png');
return 'kampanya.png';
break;
default:  trigger_error('I havea problem ', E_USER_WARNING);  break;
 }

 imagedestroy($newImg);
}
// (turkce)  xml dosyasini olustur
// (english) create xml file
$xmlfile='<?xml version="1.0" encoding="'.CHARSET.'"?>'."\n";
$xmlfile.="<products>\n";

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_ROTATOR . " f where p.products_status = '1' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and f.status = '1' order by rand() DESC LIMIT $limit_product_number";


$specials_query = tep_db_query($specials_query_raw);
while ($specials = tep_db_fetch_array($specials_query)) {
  if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
	$products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
	$products = tep_db_fetch_array($products_query);
  }
  if($image_need_resize == 1){
  $new_image = $specials['products_image'].thumb_kampanya('images/'.$specials['products_image'], $width, $height,false);
  }else{
  $new_image = $specials['products_image'];
  }



  $xmlfile .= "\t\t" . '<product filename="'.$new_image.'" productname="'.$specials['products_name'].'" productprice="'.$kampanya->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '" />'."\n";


}
$xmlfile.="</products>\n";

// (turkce)  xml dosyasini images klasoru altina kaydet
// (english) save xml file under images directory
savefile($xmlfile, 'kampanya.xml');
?>

<?php
// (turkce)  flash dosyasini goster
// (english) show flash file
?>
<script type="text/javascript" src="includes/swfobject.js"></script>

<div id="flashcontent">
 This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
  var so = new SWFObject("includes/kampanya.swf", "mymovie", "640", "200", "8", "#ffffff");
  so.write("flashcontent");
</script>

Edited by emmetje
Link to comment
Share on other sites

This wil fix the link

 

In rotator.php change line 131 into

 

$xmlfile .= "\t\t" . '<product filename="'.$new_image.'" productname="'.$specials['products_name'].'" productprice="'.$kampanya->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])).'" url="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']). '" />'."\n";

Edited by emmetje
Link to comment
Share on other sites

Hi Today I installed this contrib. However when I run it it produces this error:

 

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/home/XXXXXXXX public_html/catalog/images/kampanya.xml) is not within the allowed path(s): (/usr/share/php:/home/treinen-paradijs.nl/:/usr/share/pear:/usr/sbin:/usr/bin:/bin:/tmp:/etc/phpmyadmin:/usr/lib/php4:/usr/lib/php5:/opt/ioncube/lib) in /home/XXXXXXXX/public_html/catalog/includes/modules/rotator.php on line 19

 

Warning: fopen(/home/XXXXXXXX.nl/public_html/catalog/images/kampanya.xml) [function.fopen]: failed to open stream: Operation not permitted in /home/XXXXXXXX/public_html/catalog/includes/modules/rotator.php on line 19

 

the file has permissions 777 and the images directory also.

 

Anyone has any suggestions?

 

Thkx

 

Hans

Link to comment
Share on other sites

Hi Today I installed this contrib. However when I run it it produces this error:

 

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/home/XXXXXXXX public_html/catalog/images/kampanya.xml) is not within the allowed path(s): (/usr/share/php:/home/treinen-paradijs.nl/:/usr/share/pear:/usr/sbin:/usr/bin:/bin:/tmp:/etc/phpmyadmin:/usr/lib/php4:/usr/lib/php5:/opt/ioncube/lib) in /home/XXXXXXXX/public_html/catalog/includes/modules/rotator.php on line 19

 

Warning: fopen(/home/XXXXXXXX.nl/public_html/catalog/images/kampanya.xml) [function.fopen]: failed to open stream: Operation not permitted in /home/XXXXXXXX/public_html/catalog/includes/modules/rotator.php on line 19

 

the file has permissions 777 and the images directory also.

 

Anyone has any suggestions?

 

Thkx

 

Hans

 

This problem is solved, There was in error in my config.

I also added this pc of code to rotator.php Now it also shows a special price when assigned to it.

 

Please add underneath

 

        $products = tep_db_fetch_array($products_query);

 

 

 

The following code:

 

	    $special_price = tep_db_query(" SELECT specials_new_products_price FROM " . TABLE_SPECIALS . " where products_id = '" . (int)$specials['products_id'] . "'");
    $new_price = tep_db_fetch_array($special_price);
    if ($new_price) 
		{ $specials['products_price'] = $new_price['specials_new_products_price']; }
            }

 

great contrib!

Link to comment
Share on other sites

I have just added the contrib, loaded fine and I can see the link and add products in the admin page. However all I get is a white section on the front page. What am I doing wrong, this may have been address already but I am unable to find the solution.

Thanks,

Link to comment
Share on other sites

Ok guys, I know what this glitch is;

 

If you open your site like this, http://mysite.com/ (Works fine!)

 

But, if you open your site like this, http://www.mysite.com/

including th www. in front of your domain (It don't work!)

This applies to explorer & firefox

 

Hope this helps, please someone fixthis

 

Hey All,

 

First of all, excellent contribution, looks great and gives a great look to my site.

 

I have a problem though.

 

The carousel works fine, images and all...... but the links dont work. When any image is clicked on to show the product, i get this error on anew page -

 

404 Not Found

 

The requested URL /undefined was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Any ideas what might be wrong ?

 

Try It ! - - - http://nemesispcsystems.com

(I'm aware there is no www, my domain is like this)

 

Thanks in advance

Link to comment
Share on other sites

Having to give up on this no solution been given to white screen issue.

 

 

I have just added the contrib, loaded fine and I can see the link and add products in the admin page. However all I get is a white section on the front page. What am I doing wrong, this may have been address already but I am unable to find the solution.

Thanks,

Link to comment
Share on other sites

Having to give up on this no solution been given to white screen issue.

 

You're not very patient are you?

 

Can you give me a link? I expect that you've checked that all the modifications are correctly made. Did you use version 2.0b?

Edited by emmetje
Link to comment
Share on other sites

I also added this pc of code to rotator.php Now it also shows a special price when assigned to it.

 

Thanks!! I'll post version 2.0c today and add this. This version will also have the link fix

Link to comment
Share on other sites

The carousel works fine, images and all...... but the links dont work. When any image is clicked on to show the product, i get this error on anew page -

 

Try the code given just a few posts above or download version 2.0c

Link to comment
Share on other sites

Hi everybody,

 

First of all thanks to emmetje for wonderul working about second version of Flash Carousel.

Nowadays I was working on new version of Flash Carousel, and I was planning to release it as a 2 (second) version.

I will release it as 3 version.

In this version I developed plug in flash carousel style. It means that after installing the contribution you can download new carousel styles which prepared before and you will copy this style to your flash carousel directory and you will choose the carousel style by using admin page.

 

I have just finished Turkish install manual. Now working on English one. Than you can download it.

 

Thanks to everybody.

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...