Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carousel not display in xbootstrap #415

Closed
liomj opened this issue Mar 9, 2017 · 9 comments
Closed

carousel not display in xbootstrap #415

liomj opened this issue Mar 9, 2017 · 9 comments
Labels

Comments

@liomj
Copy link
Contributor

liomj commented Mar 9, 2017

in themes/xbootsrap/tpl/slider.tpl carousel is not showing in xbootstrap theme

need to change
<{if $xoops_page == "index"}>
to
<{if $xoops_dirname == "system"}>

@geekwright
Copy link
Contributor

geekwright commented Mar 9, 2017

As for that change suggestion, absolutely no.

The change to the xoops_page variable was made about seven months ago and has worked perfectly as far as I know. It solved several issues. See #197

Sounds like you might have the 2.5.9 xbootstrap on an older version of xoops?

At any rate, we would need more info on how to recreate the failure as it most definitely works as delivered.

@liomj
Copy link
Contributor Author

liomj commented Mar 9, 2017

.i just downloaded the latest 259 beta2 from github today and test it in localhost and used the xbootstrap theme the carousel is not showing...if it helps...my url in localhost is localhost/259/
changing to <{if $xoops_dirname == "system"}> the carousel is working

@GregMage
Copy link
Contributor

GregMage commented Mar 9, 2017

There is reason, it doesn't work!

This is line 277 of theme.php which is problematic
xoops_page = str_replace(realpath(XOOPS_ROOT_PATH) . '/', '', realpath($_SERVER['SCRIPT_FILENAME']));

With this code it works:
xoops_page = str_replace(XOOPS_ROOT_PATH . '/', '', $_SERVER['SCRIPT_FILENAME']);

Problem with realpath()!

The addition is here: #198

@geekwright
Copy link
Contributor

@GregMage Can you show me the output of:

echo 'path ' . XOOPS_ROOT_PATH;
echo 'realpath ' . realpath(XOOPS_ROOT_PATH);
echo 'script ' . $_SERVER['SCRIPT_FILENAME'];
echo 'realscript ' . realpath($_SERVER['SCRIPT_FILENAME']);

Also, what stack are you using? (WAMP, XAMP, etc.)

I'll look again, but I never have seen this issue with my windows environment. I need to see the raw values from a system where it doesn't work.

@GregMage
Copy link
Contributor

GregMage commented Mar 9, 2017

path D:/wamp_3/www/XoopsCore25/htdocs
realpath D:\wamp_3\www\XoopsCore25\htdocs
script D:/wamp_3/www/XoopsCore25/htdocs/index.php
realscript D:\wamp_3\www\XoopsCore25\htdocs\index.php

I use WAMP 3 with Windows 10

@GregMage
Copy link
Contributor

GregMage commented Mar 9, 2017

echo '<br>xoops_page ' . $xoops_page;

xoops_page D:\wamp_3\www\XoopsCore25\htdocs\index

@GregMage
Copy link
Contributor

GregMage commented Mar 9, 2017

If I change:

$xoops_page = str_replace(realpath(XOOPS_ROOT_PATH) . '/', '', realpath($_SERVER['SCRIPT_FILENAME']));

With:

$xoops_page = str_replace(realpath(XOOPS_ROOT_PATH) . '\\', '', realpath($_SERVER['SCRIPT_FILENAME']));

It works!
echo '<br>xoops_page ' . $xoops_page;

xoops_page index

@geekwright
Copy link
Contributor

Thanks! That is what I thought might be going on.

I'll add a normalization step that will handle the symlink (realpath) expansion AND the directory separator. From what I am seeing, the realpath() behavior can vary under some circumstances.

geekwright added a commit to geekwright/XoopsCore25 that referenced this issue Mar 9, 2017
@GregMage
Copy link
Contributor

GregMage commented Mar 9, 2017

Your solution works very well! Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants