Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem with PHP
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

I’m trying to integrate a module called Frontpage Slideshow with Magento. It requires putting the files for the FPSS in /website/fpss/. Then it requires a code to make the slideshow show up.

<?php
// START of "Frontpage Slideshow" settings
    
$nameOfSlideshowToDisplay "myslideshow";                     // Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/.
    
$URLofyoursite "http://www.mysite.com";                     // Enter your site's URL.
    
$AbsoluteServerPathofyoursite "/home/user/public_html";    // Enter the root path of your site on the server.
    
    // do not edit below this line
    
include_once($AbsoluteServerPathofyoursite."/fpss/mod_fpslideshow.php");
// END of "Frontpage Slideshow" settings
?>

I have implemented this code in a magenta block, followed by the word test. The word test shows up, but teh slideshow does not start.

Anyone have any suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Fibo
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-06-25
Marseille, France
 

I would first test if the include works fine. Place a message in the included file.
Check the access rights for /home/user/public_html/fpss/ (should be something like 700 or 705 BUT NOT 777) and for the file there (744 or 644, 604)....

Also check that the files the slideshow needs to access have the correct access rights

Is you site rooty directory in /home/user/public_html/ ? if no (eg /home/user/public_html/magento/) you might have an acess restriction, test moving /spss/ to /magento/spss/ and change your code accordingly

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

The include is not working because I placed the word test before the first php tag in the mod_fpslideshow.php file. chmod is set for 755(owner read/write/exe, group and public read/exe) These are the same rights for all files and folders within the FPSS folder.

My site root may be the problem, but I have tried several combinations for the absolute server path. On filezilla, when I connect to my site, there is a www folder and a public_html folder but both mirror eachother. So for teh absolute path I have put /www/index.php. I have also tried /www without the index.php.

Here is the code which I have entered. I am now entering this code via cms>manage pages under the homepage. You can see the source code at http://www.fastboxgaming.com.

<?php
// START of "Frontpage Slideshow" settings
$nameOfSlideshowToDisplay = "demoslideshow"; // Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/.
$URLofyoursite = "http://www.fastboxgaming.com"; // Enter your site's URL.
$AbsoluteServerPathofyoursite = "/www/index.php";
// do not edit below this line
include_once($AbsoluteServerPathofyoursite."/fpss/mod_fpslideshow.php");
// END of "Frontpage Slideshow" settings
?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
center
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-06-20
 

Hi i also want to use fpss in magento.
I will use this as a starting point.
http://forum.joomlaworks.gr/index.php?topic=1777.0

will post my findings here…

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

That is the forum posting I origionally used to try to get fpss to work with no luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PandaWebStudio
Member
 
Avatar
Total Posts:  40
Joined:  2008-04-19
Amsterdam, Netherlands
 

@fastboxgaming

Probably is due to mod rewrite. In the magento .htaccess file you have this rule

rewrite everything else to index.php
    RewriteRule 
.* index.php [L]

Try to add this rule after RewriteBase rule

RewriteRule ^fpss/.* $0 [L]

and try to use something like this for AbsoluteServerPathofyoursite
$AbsoluteServerPathofyoursite = dirname(__FILE__);//I assumed that fpss folder is in the same folder as index.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
center
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-06-20
 

this should work…
http://www.magentocommerce.com/boards/viewthread/10709/

http://storecraft.nl/

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

Is it bad that the line you refer to above has to hash marks in front of it?

## rewrite everything else to index.php
RewriteRule .* index.php [L]

 
Magento Community Magento Community
Magento Community
Magento Community
 
ODB
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-02-06
London
 

The ## marks means the following text is a comment.

I am just about to start work on this integration....

 
Magento Community Magento Community
Magento Community
Magento Community
 
ODB
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-02-06
London
 

Use:

<?php echo getcwd(); ?>

To find out the absolute path. Your path is just that, a path, NOT the index.php file as well.

For instance, if I put a file called ‘path.php’ and insert the code above it returns the result of ‘/var/www/html’ which is the path. Note there is no ending slash at the end.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ODB
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-02-06
London
 

Also, I don’t thik you can enter php directly into any admin editable pages - if you ‘view source’ the php command is output in the source file and not parsed properly by Magento. I seem to remember this being intentional for security. IIRC you got to make a new template and put the php in there. If I find out any more I’ll post here.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

Where would I use

<?php echo getcwd(); ?>

Thanks,
Joel

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

My absolute path is /home/name/public_html
How would I integrate FPSS using this? Should I use your code instead of the code I inserted above? I was trying to insert the code through CMS or static block but it sounds like I will have to make a template. Do you know which file in the template I would insert the code into and where to insert it to make the slideshow appear directly in the middle top where the products normally would show up?
Joel

 
Magento Community Magento Community
Magento Community
Magento Community
 
ODB
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-02-06
London
 

OK So now you know the correct absolute path.

I would change the absolute path in demoslideshow.php then check that demoslideshow.php correctly runs fpss.

This is the stage I am at at the moment, until I make any further progress I can’t offer any more advice!

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastboxgaming
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-10-11
 

Got it working perfectly by making a new template and including the fpss code in it. The fpss code cannot be added as a static block or in the homepage cms editing area of the backend. It must be added directly into the code of the template phtml file.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top