Buggyboy Posted October 17, 2005 Report Share Posted October 17, 2005 Moin! Bei OSC gibt es eine Constribution, welche das Headerbild bei jedem Aufruf auswechselt. Ich hatte das schon soweit hinbekommen, nur leider wurde es beim Template "Cubus" immer oberhalb der Tabelle eingef?gt, anstatt in der Tabelle. Vielleicht hat ja jemand Zeit und Lust sich das mal anzusehen und gegebenenfalls f?r XTC abzu ?ndern. Hier der Code der random_image.php: <?php // Change this to the total number of images in the folder $total = "7"; // Change to the type of files to use eg. .jpg or .gif $file_type = ".jpg"; // Location of the folder containing the images should have been completed in step 3 of readme.txt $image_folder = "./images/random/"; // You do not need to edit below this line $start = "1"; $random = mt_rand($start, $total); $image_name = $random . $file_type; echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />"; ?> Und hier die Installanweisung: --------------------------------------------------------------- Random Header Image V1.0 Author: Tammy OHagan [email][email protected][/email] Date: 03-11-2004 License: GPL I am available for limited free help, if needed. You can reach me at [email][email protected][/email]. Please be specific in your questions. Donations can be made to [email][email protected][/email] via Paypal, if you find this contribution useful. I am currently working from home, so I am available for hire to install this contribution for you, CHEAP! The OFFICIAL Support Forum for this contribution will be here: http://forums.oscommerce.com/index.php?showtopic=83132 ---------------------------------------------------------------- IMPORTANT: This contribution was developed for, and tested on OSC v2.2MS2. I haven't tested it on previous OSC releases, so please take care when you install it in pre-MS2 OSC versions. In any case, please BACKUP your programs!!! INSTALLATION ------------ Step 1) BACK UP - BACK UP - BACK UP! I'm not kidding! Step 2) Name your images 1.jpg, 2.jpg etc. (Of course if your images are .gif files you would name them 1.gif, 2.gif, etc) Step 3) With your favorite FTP program, make a new folder in catalog->images called "random". Step 4) FTP your images into catalog->images->random Step 5) Open the random_image.php file in this package and make the noted changes (instruction are in the file!) Step 6) FTP the files listed in the "file additions" section to their respective directories. Step 7) Make changes in the files listed in the "file modifications" section. Step 8) Ftp the random_image.php file and the newly modified header.php file up to your site. ---------------------------------------------------------------- FILE ADDITIONS - Needs Edited ---------------------------------------------------------------- - catalog/random_image.php ---------------------------------------------------------------- FILE MODIFICATIONS ---------------------------------------------------------------- ------------------------------- - catalog/includes/header.php ------------------------------- Find this line---> (around line 57) <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td> Replace with this line ---> <td valign="middle"><?php include "random_image.php"; ?></td> W?re nett, wenn sich das mal jemand ansehen k?nnte... Peter Link to comment Share on other sites More sharing options...
Seven-Art Posted October 17, 2005 Report Share Posted October 17, 2005 Warum so kompliziert ? Nimm nen JAVA Bannerwechsel Modul und da packste die Bilder rein gibst den JAVA da aus wo er angezigt werden soll fertig. In die Header.php rein. Pfade so anpassen das die Bilder angezeigt werden. <script language=JavaScript> var z= 4; // die anzahl der Banner ME_Banner = new Array(z); ME_Banner[0] = '<img src="bild1.jpg">'; ME_Banner[1] = '<img src="bild2.jpg">'; ME_Banner[2] = '<img src="bild3.jpg">'; ME_Banner[3] = '<img src="bild4.jpg">'; var jetzt=new Date(); var y=(jetzt.getSeconds())%z; //--> </SCRIPT> Dahin wo es angezeigt werden soll. <script language=JavaScript><!-- document.write(ME_Banner[y]); //--> </SCRIPT> Link to comment Share on other sites More sharing options...
Buggyboy Posted October 17, 2005 Author Report Share Posted October 17, 2005 Cool! Danke... hat super geklappt... :) Peter Link to comment Share on other sites More sharing options...
Seven-Art Posted October 17, 2005 Report Share Posted October 17, 2005 Yo Bidde Bidde !! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.