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

Add $xoops_page for theme #197

Merged
merged 3 commits into from
Aug 17, 2016
Merged

Add $xoops_page for theme #197

merged 3 commits into from
Aug 17, 2016

Conversation

GregMage
Copy link
Contributor

Exemples of values of $xoops_page:

If you are here: http://localhost/htdocs/ ---> $xoops_page = index
If you are here: http://localhost/htdocs/modules/profile/edituser.php ---> $xoops_page = profile/edituser

$xoops_page to more easily customize themes

@geekwright
Copy link
Contributor

Looks good!

I would still like to see the startpage configuration value exposed as $xoops_startpage. There could be some uses for that piece of information.

@GregMage
Copy link
Contributor Author

I do not understand what I should do.
I put what information in the variable $xoops_startpage? Boolean if you are in the home page or other?

@geekwright
Copy link
Contributor

Sorry, I didn't specify that correctly.

This should be the module directory name from $GLOBALS['xoopsConfig']['startpage']

If the startpage option is turned off, $GLOBALS['xoopsConfig']['startpage'] is either not set, empty or the string '--'. (disclaimer - I inherited that 😉 ) In any of those cases a value of 'system' would be appropriate.

Now $xoops_startpage is available in the theme
@GregMage
Copy link
Contributor Author

GregMage commented Aug 17, 2016

Thank you for your explanations. I should have realized with other messages... Sorry

modification is sent

@geekwright
Copy link
Contributor

Fantastic 👍

@geekwright geekwright merged commit 03f901d into XOOPS:master Aug 17, 2016
@geekwright
Copy link
Contributor

Had to make a little change after some more testing, see #198. I didn't think of it before, but it is instructional.

On a linux/unix system it is possible to create a "symlink," a symbolic link to place a "virtual" copy of a file or directory in another place in the file system. There is only one copy of the files, but there can be 2 or more names for them.

For Debian derivatives, the default web root is /var/www. Rather than working directly in that directory, for me it is easier to clone a repository to my own home directory, and symlink the htdocs directory into the web root, for example as a directory "xoops."

This means that the same file can be accessed as /var/www/xoops/index.php or /home/richard/XoopsCore25/htdocs/index.php. The first is a symlink, while the second is the real path. Normally, this doesn't cause a problem, but $_SERVER['SCRIPT_FILENAME'] ends up as the symbolic link, while XOOPS_ROOT_PATH is resolved to the real path during the install. The $xoops_page code ended up with a real name and a virtual name for the same file.

This is easily resolved by adding a realpath() around the paths in \xos_opal_Theme::xoInit() when $xoops_path is calculated.

Sorry I didn't catch that before. Works great! Thanks again!

@GregMage
Copy link
Contributor Author

Thank you for the information and corrections. I never found!

@GregMage GregMage deleted the xoops_page branch August 26, 2016 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants