OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Background gif

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Background gif

Postby nef » Wed Oct 17, 2007 11:53 am

Hi
On our OJS platform we have several journals installed, so if I want to use a gif image as a background for my header in one of our journals, I guess I have to save the gif on our web server and then put the complete URL into the style sheet, or can I do it in a more simple way?

Regards
nef
 
Posts: 234
Joined: Fri Jun 01, 2007 2:56 am
Location: Aarhus, Denmark

Re: Background gif

Postby asmecher » Wed Oct 17, 2007 12:29 pm

Hi nef,

Uploading a journal stylesheet to set the background image is the best way; if you want to add the ability to upload files to the journal's public files directory via the web interface, I'd suggest creating a symbolic link from the files path into the public files directory. Then you'll be able to use the Files Browser to upload a file into the public files directory. Since the journal CSS will be in the same directory as the image, you don't have to specify any paths when referring to the image file in CSS.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: Background gif

Postby tgc99 » Thu Oct 18, 2007 4:00 am

Hello Alec,

I'm the sysadm for nef's OJS installation and I'm trying to figure out what exactly it is I should link where.

asmecher wrote:Hi nef,

Uploading a journal stylesheet to set the background image is the best way; if you want to add the ability to upload files to the journal's public files directory via the web interface, I'd suggest creating a symbolic link from the files path into the public files directory. Then you'll be able to use the Files Browser to upload a file into the public files directory. Since the journal CSS will be in the same directory as the image, you don't have to specify any paths when referring to the image file in CSS.

In the filesystem I have ~ojs/files and ~ojs/ojs-2.1.1/public where ~ojs/ojs-2.1.1 is the DocumentRoot of the OJS website.
Could you clarify what it is I should symlink where?

-tgc
tgc99
 
Posts: 56
Joined: Thu Oct 18, 2007 3:50 am
Location: Aarhus, Denmark

Re: Background gif

Postby asmecher » Thu Oct 18, 2007 9:19 am

Hi tgc,

The two paths in question are:
  • The files directory, as configured using config.inc.php's files_dir directive, and
  • The public files path, as configured in config.inc.php's public_files_dir directive.
FYI, it's unsafe to have the files directory be web-accessible; I'd suggest either moving it out of the web root, or adding an .htaccess restriction to ensure that people can't access its contents directly via the web server.

The symlink I mentioned earlier is:
Code: Select all
ln -s /path/to/ojs-2.1.1/public/journals/1 /path/to/files_dir/journals/1/public
NOTE: Typo in command fixed according to comment below - AS

...for each journal ID, which will appear as a numerically-named directory e.g. the 1 above. (If you're only hosting a single journal, the above symlink is all you need.)

Once this is done, you should be able to find the "public" symlink in the Journal Manager's Files Browser and follow it to get to the journal's public files directory, where you can upload and download image cover pages, stylesheets, images, etc.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: Background gif

Postby tgc99 » Fri Oct 19, 2007 12:04 am

asmecher wrote:The symlink I mentioned earlier is:
Code: Select all
ln -s /path/to/ojs-2.1.1/public/journals/1/public /path/to/files_dir/journals/1
...for each journal ID, which will appear as a numerically-named directory e.g. the 1 above. (If you're only hosting a single journal, the above symlink is all you need.)

Did you mean:
Code: Select all
ln -s /path/to/ojs-2.1.1/public/journals/1 /path/to/files_dir/journals/1/public

Once this is done, you should be able to find the "public" symlink in the Journal Manager's Files Browser and follow it to get to the journal's public files directory, where you can upload and download image cover pages, stylesheets, images, etc.

With the symlink I created above, that is exactly what I see.
If my thinking is right this should still be safe, as the symlink goes from files_dir to public_files_dir and not the other way around. Thus it's still not possible to gain direct access to files_dir through the webserver.

Thank you!

-tgc
tgc99
 
Posts: 56
Joined: Thu Oct 18, 2007 3:50 am
Location: Aarhus, Denmark

Re: Background gif

Postby asmecher » Fri Oct 19, 2007 8:28 am

Hi tgc,

Yes; sorry, my typo on the symlink command.

My note about the files directory being web-accessible still stands, though -- if you've got the files directory somewhere in your web root, you may be exposing submission documents etc. for download.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests