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

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 2 Guests are viewing this topic.

Joachim Müller

ssi.php has been written for cpg1.1 and is not recommended for usage anymore (see above postings), that's why there's no support, additional documentation or whatever - in other words: use it at your own risk.
Currently, I'm working on a new version that will go into the next release, with (hopefully) all issues fixed that were reported. (And no: I don't know when it will be released!).

GauGau

chillypk

Ah I see - well no security issues here as well - as nothing private here as well.

Works well for me though :)  Just wondering if I was missed reading something somewhere as I saw the code concerning in ssi.php.

For anyone looking for the fix I was looking for (captions after photo include)

Find:
if ($cpg_include_link==1){$return_value.="</a>";}

in ssi.php


and after ADD:

if ($row['title']!="") {$return_value.= "<br>".$row['title'];}
if ($row['caption']!="") {$return_value.= "<br>".$row['caption']." ";}
$return_value.=$td_end."\n";


Thanks for the mod :)

I'm not a programmer (don't know PHP at all) - but I'm good at looking at code and figuring things out :)
Hope thats helps anyone looking for something similar.

Quadsk8

Hello Gaugau, chillypk and others,

I installed SSI.php script and example.php works as it should, also a little include script i made in the coppermine directory gives the expected result  (nice script Gaugau!)

But...

On my Homepage I use Scripty as template engine and when using an {include_php file="SSI_includefile.php"} I get the following error:
QuoteCoppermine critical error:
Unable to connect to database !

MySQL said: Access denied for user: 'wwwrun@localhost' (Using password: NO)

Does anyone know what is causing this and what would be the solution??

appreciate any answer on this!!!

Joachim Müller

you simply can't use ssi.php within coppermine, only on non-coppermine pages.

GauGau

Quadsk8

Thanks Gaugau for replying:
Quote from: "gaugau"you simply can't use ssi.php within coppermine, only on non-coppermine pages.
But I don't, that is why I do not understand this error message....

But what is special about Coppermine pages?
Do Smarty-generated pages than have the same problem?

Here you can see that my little include script works, giving all SSI-generated statistics of Coppermine
but when I try to include it in my Homepage I get the mentioned error.

binocle

I've got a problem for displaying a random image ont he main page of my site.

I've follow all of the instruction (using ssi.php)but it didn't work.

to see what happen :

http://surfbzh.free.fr/

tahnk you in advance
 :wink:

Joachim Müller

The error
QuoteWarning: php_hostconnect: connect failed in ssi.php on line 32

Warning: Failed opening 'http://surfbzh.free.fr/coppermine_dir/include/config.inc.php' for inclusion (include_path='/var/www/free.fr/14/s/u/r/f/surfbzh/include/:.') in ssi.php on line 32
Coppermine critical error:
Unable to connect to database !

MySQL said: Can't connect to MySQL server on 'sql.free.fr' (111)
is so easy to understand - it says "you're not meant to use this application untill you gain a little more knowledge about web technology".
The usage of ssi.php isn't recommended any longer, you're on your own (at least no support from me for such newbie questions).

GauGau

Quadsk8

Quote from: "gaugau"is so easy to understand - it says "you're not meant to use this application untill you gain a little more knowledge about web technology".
Don't loose your patience with us Gaugau! (das war nicht so nett!)
There must have been a time when you where not an expert on web-technology yourself.
And back then you probably also have seen some errormessage and did not have a clue.

Too bad I'm not a surfer, because binocle has put up some nice waves from Bretagne in his Coppermine.
So his config.inc.php is probably good enough to connect to his database!

Since I'am not the expert, I can only tell how I solved my (similar?) problem, see some posts back:

I was including an include file which included SSI.class.
This was probably too much so I just inserted the script into my homepage and then it worked just fine.
Don't know why it gave the MySQL Access denied message, but it works now!

Good Luck and keep on surfing binocle!!

Joachim Müller

you're right, I used to be a beginner as well (everyone is at some point), but I didn't try to apply rocket science on my site (or what appeared to be rocket science to me at that time), and I didn't ask silly questions on support boards in the first place, but used some search engines to tackle the problems on my own. Only after hours of research I would have dared to post a question on a board/mailing list, as I didn't want to waste everybody's time.
The problem with coppermine support is the same as on most support boards: people don't realize a support board is not a hotline, and that they're requested to do some research first.

There have been rants on this on many boards (including this one), and a vast majority of people behave nicely (they read the documentation, search the board, search on google, think twice about their postings, post on the proper board etc.) - that's why I keep up the support work on this project.

There are things that make supporters - well - reluctant to help:
  • people who don't stick to forum rules/common sense
  • people who post on the wrong board
  • silly subject lines
  • postings that show that users haven't even tried to solve the problem on their own[/list:u]Sometimes I lose my patience when people break those rules and I fire a not-so-nice answer (as happened with above posting), I hope you can understand why.

    I'll try to be nice in the future...

    GauGau

Quadsk8

No problem, we appreciate your work!

binocle will probably have found your answer about free.fr in http://forum.coppermine-gallery.net/index.php?topic=2921 since he does not seem to be real beginner

PS two small modifications to SSI.php made it XHTML valid on my homepage:
replaced two occurences of <br> with <br /> of the patch mentioned above and made the closing tag of  the <img> an /> as in line:
$return_value.= "\" align=\"left\" class=\"padright\" />";

khm1972

Hi

I'm trying to get the ssi.php to work "random image" but I get the message  "Cant access database (mysql) no@password" ore something like this.

How and where do edit the code and list my username and password???

And how shall it be written

Thanks
Klaus - Copenhagen

Joachim Müller

[list=1]
  • the usage of ssi.php isn't recommended nor supported any more, as it's unsecure.
  • Did you have a look at the readme that comes with it? The file ssi.php has to be in the coppermine directory. If it is (and all configuration vars in it are filled in properly), you shouldn't have a problem and a database connection error shouldn't occur.[/list:o]To tell you more, give us a link to your coppermine dir...

    GauGau

khm1972

Thanks - I know you don't do support for ssi.php any longer. But can you tell me what changes to do to make the random function to a "Picture of the Day" script??

Thanx GauGau

Klaus

binocle

Quotepeople who post on the wrong board

I don't understand something :

I use copermine 1.1 and ssi.php have been done for this version !

Why this topic is in this board ????

Joachim Müller

ssi.php should work with all versions since 1.1.0
If we'd put the topic into the cpg1.1.x support board, most users running cpg1.2 wouldn't notice it.

GauGau

khm1972

Hi

I know the ssi version in Mods is not supported any longer. But still, can any one tell me why I can't open the link in the intended frame. Statistics and the printing of the random image are working perfectly - but when I use one of GauGau examples (open in your_frame_name) and write the name of my frame "main"- print cpg_random(1,1,1,12,1,"main"); - it just opends as if I typed "_parent".

I'm using version 1.2.1 (standalone).

Please - anyone?????  :shock:
Klaus / Copenhagen

Celaine

Forgive me for being dense...I am very new to php. I tried using the ssi.php deal to show last uploaded within my invision board, with no success. I didn't get any error...nothing happened at all. I am sure this is due to some stupid error on my part.

I did upload ssi.php to my coppermine directory, and did my best at following the directions in the readme.
best...

Christine

gmarik

so

<?php
print cpg_thumb(0,0,1,"",1);
?>

will work even in vb3?

dale

Celaine,

This didn't work with my Invision board either. Although it works on its own and in other places on my site. I think it has something to do with the fact that I was adding it to the template. And the templates in invision are strange. I have had other scripts i couldn't get to work with invision. However I have gotten IFrames to work. But I'm just a PHP kid too.
Im not a complete idiot... Some parts are missing.

Joachim Müller

I have no idea of the vbulletin template engine, so I can't tell...
If vbulletin templates work similarly to other bbs template systems, this will not work.

GauGau