Random image include? (SSI.php) - Page 6 Random image include? (SSI.php) - Page 6
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Random image include? (SSI.php)

Started by Brian, October 17, 2003, 03:37:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

foei

#100
I think script is good work. I just mod show picture on my main page don't gallery page to show last pic, random pic,Statistics Of Galleries and miage of the week.It ok

Not work safe
http://heretheporn.com

punjabicity

im getting the following errors. please help me

Warning: main(): open_basedir restriction in effect. File(/home/httpd/vhosts/punjabicity.co.uk/httpdocs/mmi/ssi.php) is not within the allowed path(s): (/usr/local/psa/home/vhosts/punjabicity.co.uk/httpdocs:/tmp) in /usr/local/psa/home/vhosts/punjabicity.co.uk/httpdocs/mmi/rndimage.php on line 3

Warning: main(/home/httpd/vhosts/punjabicity.co.uk/httpdocs/mmi/ssi.php): failed to open stream: Operation not permitted in /usr/local/psa/home/vhosts/punjabicity.co.uk/httpdocs/mmi/rndimage.php on line 3

Warning: main(): Failed opening '/home/httpd/vhosts/punjabicity.co.uk/httpdocs/mmi/ssi.php' for inclusion (include_path='.:/usr/local/psa/apache/lib/php') in /usr/local/psa/home/vhosts/punjabicity.co.uk/httpdocs/mmi/rndimage.php on line 3


Fatal error: Call to undefined function: cpg_thumb() in /usr/local/psa/home/vhosts/punjabicity.co.uk/httpdocs/mmi/rndimage.php on line 20

Joachim Müller

The first message tells it all: on your server, an open_basedir restriction is in place. Here's what the manual at php.net has to say about it:
Quoteopen_basedir string
Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink.

The special value . indicates that the directory in which the script is stored will be used as base-directory.

Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, open_basedir paths from parent directories are now automatically inherited.

The restriction specified with open_basedir is actually a prefix, not a directory name. This means that "open_basedir = /dir/incl" also allows access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: "open_basedir = /dir/incl/"

Note: Support for multiple directories was added in 3.0.7.

The default is to allow all files to be opened.
This means that you will have to contact your webhost to have this fixed.

GauGau

punjabicity

thank you so much my problem is solved!

does anyone know how to make the random thumbnail size bigger?

punjabicity

i would also like to put a border round the thumbnail! any ideas?

Xi_Master

Ok,

After I've read most of the comments in this topic, I made it to install the -unsupported- random image script.
But when I've put the code on my site; ik get this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site93/fst/var/www/html/fotoalbum/ssi.php on line 115


I've opened ssi.php and this is what line 115 has to say:

while ($row = mysql_fetch_array($result)) {


I would'nt have a clue what's wrong with it ???. I've read the manual again and decided to upload the example.php into the same dir as index.php (where i get the error message) and guess what? It works!
So the example works, but not index.php.

this is the site with the error message: www.svzwollevoetbal.nl. You can find the message on the right side
and the site with the example: www.svzwollevoetbal.nl/example.php

Xi_Master

Well,

I've done the same thing with the random pic and it's working fine for me. So the problem is getting more strange to me now.... :-\\

punjabicity

i would like to put a border round the thumbnail! any ideas?

Xi_Master

Come on man, it's not that hard to put a border around ur thumbs. And asking the same question twice does not help to get it answered.
Put the php-code in a table and make it 100px wide and there u have ur border....

punjabicity

yes I have tried that but it doesn't work  ???

anyway another thing is when you click on the random pic it goes to that wallpaper. does anyone know a way that when you click on it it goes to that wallpaper album instead of the actual wallpaper.

please can someone help with this

Joachim Müller

this thread deals with the random image mod, nothing else. Do not try to hijack this thread!

GauGau

herbie

Guys, I'm greener than Granny Smith at this. I'm running 1.3 and tried the ssi mod, learned the hard way that it has to work on the same server as coppermine is running.
I tried a sample page in a test directory in coppermine:

<html>
<? include_once("http://sulu.maxit.net/coppermine/ssi.php"); ?>
This is a test page only.
<br>
<br>
<br>
<? print cpg_random(); ?>

<br>Did it work?
</html>

It returns the test page only, the rest is blank. Teach me, O great masters. I'd like to put a random thumb w link onto my main website, which resides on a far away server.

Joachim Müller

If your remote server allows includes to remote servers (allow_url_fopen, see http://www.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen ), this should work as well (not tested though).

GauGau

bpm32

I've read and reread this threat multiple times.  If this is not an allowable post, please remove it.

I have put in place the ssi mod after having read the warnings, etc.  I extend my sincerest gratitude to those who have worked so hard to create this script and put up with such dealings as I'm about to present.

The script works beautifully for me on pages ending in .htm, .html, or .php.  However, my site uses .shtml in order to employ some ssi files for quicker menu editing, as well as a few news feeds from our forums. 

As long as my site files end in .shtml, I cannot get this script to work.  As soon as I change the ending to .htm, .html, or .php, the script works perfectly, but then I lose my menus and news feeds.

Is it possible to get both working simultaneously?

I appreciate any guidance, whether it's direct or via other threads or offsite links.  I have searched, but cannot find anything so specific.

I thank you for your time,

Brian

Joachim Müller

This has been requested in the past: shtml usually means you have true "server side includes" working on that page. In fact the ssi-mod is named inacurately, as it isn't using the server side includes technology, but plain php includes. When I started ssi-mod I had in mind to make it work for true ssi as well, but I failed (one reason for this being the fact that I didn't have access to a webserver that had ssi at that time), so I gave up. Basic answer is: in theory, it is possible, but it requires someone with know-how to look into this. I won't be that one, as I have abandoned this mod a long time ago, sorry. Currently, the mod will not work on ssi-enabled pages, so the short answer to your question is: the mod will not work for shtml pages.

Joachim

erezcarmel

How can I show the original picture and not only the thumbnail?

bbbbug

does SSI.php work with 1.3.2?
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mytfls.com%2Fphoto%2Fmyphoto.php&hash=69be14cb204c2f9b30a4bb1876cf8d5154fec7f8)

Joachim Müller


bbbbug

I like to use Random image include in this way:

<SCRIPT language=JavaScript src="/randompics.js"></SCRIPT>

Can anyone develope this Add-Ons? I need it so crazily~~~ ::) ::)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mytfls.com%2Fphoto%2Fmyphoto.php&hash=69be14cb204c2f9b30a4bb1876cf8d5154fec7f8)

Joachim Müller

requests for new mods shouldn't go into existing mods threads. JavaScript is client sided, there's little chance you will get this to work.

Joachim