Determine if Joomla is in a subdirectory - php

Joomla 3.2.3
Hi all, I am trying to develop a plugin for Joomla (just for myself) and I have run into a problem.
Basically, the plugin searches for the URL linking to the local copy of bootstrap.min.css which is:
/media/jui/css/bootstrap.min.css
This is then replaced by a CDN version of the Bootstrap CSS.
Everything works fine when the website is located in the root of the domain but if the website is in a subdirectory then the link changes to:
/subdirectory/media/jui/css/bootstrap.min.css
And the plugin stops loading the CDN version.
Is there a PHP based way to determine if the website is being hosted in a subdirectory?
Thanks

the constant JPATH_BASE gives the base directory Joomla is installed in:
http://docs.joomla.org/How_to_find_your_absolute_path
This points to the directory the index.php is located in. Which parses all requests to the joomla installation.

I have sorted this by using
JURI::base(true);
As outlined at http://docs.joomla.org/JURI/base

Related

Install Moodle plugin into root directory or redirect it

I'm in the process of programming my own static pages in moodle. It works so far, but I have the whole thing running in the local environment in its own folder in the root directory "mymoodle.com/folder/".
Now I would like to install it as a plugin on the stable instance via the dashboard/frontend, but if I understand it correctly then only works with the available plugin types => path from the docu
Is that only possible via FTP access? Or is a plugin type not listed yet or have I overlooked one?
Is there a better moodle approach than plugin type "local" ?
I have already discovered the "Static Pages" plugin, but I don't really understand how they solve the redirect from /local/staticpage/ to /static/
Local Plugin folder is the best approach, if you are creating a plugin that doesn't comes under any of the other plugin types mentioned here.
However you can shift the folder (and make appropriate changes in files to require files) under the Moodle's root directory and it should work.

Google Cloud App Engine : Custom WordPress theme and plugins missing

Following this official guide and using the flex environment with php 7.2, I am trying to deploy to App Engine with custom plugins and themes.
These themes are not available on wppackagist, given that they are truly custom to my project.
My git repo is correctly saving the custom plugins and themes -- all composer.json based wppackagist plugins are being installed as intended.
However, for the life of me, I cannot get the deploy to include my custom files. I have additionally verified that the image uploaded to AE is the correct version, and it has been promoted to serve all traffic as intended.
Can anyone help me understand the logic that I am missing to ensure that when I deploy my app that the custom plugins and themes are built into the image?
So the answer is to not change the app output folder. Via the CLI install helper, I defined the output folder to wp_app -- it still anticipated app as the folder. Nothing was in the app folder when I created the service as wp_app being the WordPress folder. So, just keep the folder structure as-is and you will be fine.

Joomla upload zip and run in plesk

I try to host a site in plesk created with joomla.
I have installed joomla from Applications -> Joomla Install.
I can log in to the backend interface and see the general by default joomla template.
However in plesk in Files -> httpdocs where the site exist I have upload my joomla work from my local disk and extract it and their are all my files.
What should I do to configuration.php file in order to make the public url to see the results from the content I uploaded, or in other files?
I mean I have a zip file with the joomla content. I uploaded to http docs and extracted but in the public url I receive error. Why this is happening?
I noticed that index.php was overwriten when I openned the joomla from the application and after that I can't understand what changed.
Joomla consists of files and a database.
One of the easiest ways to transfer a website is to use the free or paid version of Akeeba Backup which backs up the files and the database into one file. You can then use the free Akeeba Kickstart utility to restore the files and the database on the target location.
I don't have rep points to comment, which is why this is posted as an answer. Sorry!
Can you give a little more information? You installed Joomla from the Plesk panel, so you should have all of the Joomla code files and directory structure. What is the "joomla work" you want to upload -- a complete site like Neil's answer I think assumed? Graphics files? Text documents? If it's artwork or the like, it would go in your "media" folder under the Joomla document root (httpdocs I would guess), and be accessible through the media manager.

Where I should store the Wordpress site in Xampp (linux)

I never use Wordpress but I usually use Xampp (Linux) to work.
So, I installed Wordpress and it works fine, if I enter with my browser to http://localhost/wordpress/ I can see the WP page.
I got from a friend his WordPress site files and stored them in /opt/lampp/htdocs like any regular web site, but when I try accessing http://localhost/folder_name/ I get the Index of folder_name and not the actual site.
I noticed that /opt/lampp/apps/ has a "WP" folder, and inside it - an htdocs folder like xampp have.
Where's the correct place to store the WP project ?
Is it /opt/lampp/apps/wp/htdocs or opt/lampp/htdocs/ ?
How can I get the WP site working and not get the index of / page?
You want to put the root of your WordPress installation in the same location you would put anything you want to be able to access at http://localhost. From what you're saying, it sounds like that is /opt/lampp/htdocs/
The Problem
WordPress runs just about everything through a database, including it's siteurl and home directory values. If you don't have a database at all, nothing is going to work. You'll find more on this problem Here.
The Hard Fix
You could try Migrating your friend's WP install to your XAMPP server, but you'll need their database for that to work. You could then use a tool like Wordpress Database Reset, which will get you back to basically a fresh install, just with any themes and plug-ins your friend's install included.
The Easy Fix
Since it sounds like you want a fresh install with a custom theme or plug-in from your friend, you can just start with a fresh install, and then add any themes and plug-in's in. Installing WordPress is fairly simple since they have a web-based installer to help you get everything set up. Check out this guide. Once you've got the basic site set up you can import any themes and plug-ins you want from your friend's WordPress installation.
I hope this helps!
I have read your problem folder path correct is opt/lampp/htdocs/
you need to make all services enable for server.

Uploading to a domain with WordPress extension

Hey guys am about to host a website and I think I may have a looming issue at hand I have been editing a website on WordPress online mywebsite.com/wp-login.php but have not publish it (still a blank domain) now few weeks after I decided to start the project all over again using MVC php now I want to know if I can still upload my site to mywebsite.com without having any issue?
You may want to move all your custom php files to a sub directory and put the wordpress site's files on the root directory. That will be safe I guess.

Categories