forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: content syndication (cpmFetch) => Topic started by: Brian on October 17, 2003, 03:37:11 am

Title: Random image include? (SSI.php)
Post by: Brian on October 17, 2003, 03:37:11 am
Is there a file I can include within my main (non-coppermine) page to display a random image from the coppermine db?

As in a random image "block"

Thanks!
Title: Random image include?
Post by: Zarsky on October 17, 2003, 04:19:57 am
check out the ssi.php (show CPG-thumb) mod in the download/mod section of this site.

http://coppermine.sourceforge.net/download.php#mods

I also have an old hacked up little script...I will dig it up and post it soon.
Title: Random image include?
Post by: Brian on October 17, 2003, 05:49:23 am
Will this work with the latest 1.2 rc?
Title: Random image include?
Post by: jasendorf on October 17, 2003, 06:26:02 am
Don't see why not.  give it a try and get back to us!  ;)
Title: Random image include?
Post by: Tarique Sani on October 17, 2003, 06:33:47 am
To repeat Gaugau - that ssi does not respect permissions so be careful
Title: Random Images
Post by: gtroll on October 17, 2003, 08:06:23 am
Here is something I took out of the nuke port and modified to work for the standalone, now I didn't test this but it should work let me know we can post it under hacks...
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.2.0                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Gregory DEMAR <gdemar@wanadoo.fr>                 //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- // 
// hack from the nuke port for the standalone  version                  //
// by gtroll                                                                                //
// modify aid!=4 AND aid!=6 AND aid!=7                                         //
// to fit the album(s) you want not to show                                        //
// ------------------------------------------------------------------------- // 

define('IN_COPPERMINE'true);
require(
'include/init.inc.php');
$numberpic=5// you can change the number of pictures here 
global $prefix$dbi
function 
truncate_string444($str

   
$maxlength 20// maximum lenght of name in block 
    
   
if (strlen($str) > $maxlength
      return 
substr($str0$maxlength)." ..."
   else 
      return 
$str


$content="<center>"
$result db_query("SELECT count(*) from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7"$dbi); 
   
$nbEnr mysql_fetch_array($result); 
   
$count $nbEnr[0]; 
while (
$stop<$numberpic

    
   
srand(time()+$stop); 
   
$random_number rand(0$count-1); 
   
$result2 db_query("SELECT pid, aid, filepath, filename  from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7  AND approved='YES' LIMIT $random_number,1"$dbi); // aid numbers can be changed as need to respect permissions
  
$picture mysql_fetch_array($result2); 
  
   
$img "<img src=\"{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">"
   
$content .= "<a href=\"displayimage.php&album=random&cat=&pos=-{$picture['pid']}\">$img<br>" truncate_string444($picture['filename']) . "</a><br><br>"
$stop++; 

$content .= "<br><a href=\"index.php">Go to gallery</a></center>"; 
print 
$content;
?>
include this where you want the images to show or save as a file and include in your main page like
Code: [Select]
<? include('pathname/filename');?>
Title: Random image include?
Post by: duntuk on November 03, 2003, 07:55:02 am
gtroll...

well... that didn't work for me... seems like somewhere the file paths are being lost when calling the 'include'... because it keeps giving errors about all lines that are not given the absolute path in init.inc.php...

hence... when it gets to this part... it states that "include/config.inc.php" can't be found...

Code: [Select]
// Include config and functions files
require 'include/config.inc.php';
require 'include/functions.inc.php';


but if you actually change the above to give an absolute path, then it works, but continues to give errors for everything else down the line using a 'require'....

 :?
Title: Random image include?
Post by: Joachim Müller on November 03, 2003, 08:03:29 am
well if you don't care about security that much or you simply don't have private albums, but only public ones you could give ssi.php a try. Like Tarique said: we do not recommend it any more, but it'll give you a little more control and is reported to work on many sites.
Download here: http://prdownloads.sourceforge.net/coppermine/cpg1.1mod_ssi.zip?download (instructions included).

GauGau
Title: Random image include?
Post by: duntuk on November 03, 2003, 06:35:56 pm
thanks gaugau... will give it a go... (since i won't be using CPG for private galleries...... 4images will be used for that, since that supports multiple forum group permissions...)
 :wink:
Title: Random Pics on non Coppermine page (CPG 1.2.0)
Post by: NHBA on November 11, 2003, 10:32:58 am
Not haveing much luck with this I did have it working with SSI on the last version 1.1.1 but since upgrading ( or something else happened at the same time) it no longer works I just get errors "failed to create stream : No Such File or dir " as the path in line 6 of example.php doesn't seem to point to my SSI.PHP file which makes more errors " undefined function calls" I also tried GTROLL'S hacked scripted but also had no luck as it give me a "T String error" on line 53 (displaying the gallery index.php file) no pics at all.
 I though the random picture was in the new version but now find it was just in the wish list of the SSI doc file any chance of adding it to a future version as its a nice touch for a logon/main page.

Keep up the great work regards Damon
Title: Random image include?
Post by: 2pac on December 07, 2003, 01:02:20 am
Hi,

You're getting that TSTRING error cause on this line

Code: [Select]
$content .= "<br><a href=\"index.php">Go to gallery</a></center>";


is not closed on the "

so should be

Code: [Select]

$content .= "<br><a href=\"index.php\">Go to gallery</a></center>";




Hope this helps,

2pac
Title: actually... this is how it works...
Post by: duntuk on December 21, 2003, 04:35:11 am
The initial instructions by gtroll would ONLY work if you had the page, you wanted to display the random photo on, in the SAME directory as coopermine....

if you put it anywhere else... the paths would break....

however... there's a simple solution...

1. create a file called, for example, ssi_include.php in your root coopermine directory, and copy/paste gtroll's code, and save the file...

2. let's say you wanted to include this on your home page, then edit index.htm in your root public-html directory...

and insert the following code where ever you'd like:

Code: [Select]


<?php include_once &#40;'http&#58;//www.sitename.com/cooperminedir/ssi_include.php'&#41;; ?>



and pa-dow... and that should do it....

although, i should note, it's comming up with broken images, as of this writing... but atleast the code fully executes now... heh...
Title: Random image include?
Post by: duntuk on December 21, 2003, 04:45:09 am
ok... that was easy....

just had to add the path to coopermine:

here's the corrected code (we'll assume our coopermine directory is called 'gallery')

Code: [Select]


<?php 
// ------------------------------------------------------------------------- // 
// Coppermine Photo Gallery 1.2.0                                            // 
// ------------------------------------------------------------------------- // 
// Copyright &#40;C&#41; 2002,2003 Gregory DEMAR <gdemar@wanadoo.fr>                 // 
// http&#58;//www.chezgreg.net/coppermine/                                       // 
// ------------------------------------------------------------------------- // 
// Updated by the Coppermine Dev Team                                        // 
// &#40;http&#58;//coppermine.sf.net/team/&#41;                                          // 
// see /docs/credits.html for details                                        // 
// ------------------------------------------------------------------------- // 
// This program is free software; you can redistribute it and/or modify      // 
// it under the terms of the GNU General Public License as published by      // 
// the Free Software Foundation; either version 2 of the License, or         // 
// &#40;at your option&#41; any later version.                                       // 
// ------------------------------------------------------------------------- // 
// hack from the nuke port for the standalone  version                  // 
// by gtroll                                                                                // 
// modify aid!=4 AND aid!=6 AND aid!=7                                         // 
// to fit the album&#40;s&#41; you want not to show                                        // 
// ------------------------------------------------------------------------- // 

define&#40;'IN_COPPERMINE', true&#41;; 
require&#40;'include/init.inc.php'&#41;; 
$numberpic=5// you can change the number of pictures here 
global $prefix$dbi
function 
truncate_string444&#40;$str&#41; 
&#123; 
   
$maxlength 20// maximum lenght of name in block 
    
   
if &#40;strlen&#40;$str&#41; > $maxlength&#41; 
      
return substr&#40;$str, 0, $maxlength&#41;." ..."; 
   
else 
      return 
$str
&
#125; 

$content="<center>"
$result db_query&#40;"SELECT count&#40;*&#41; from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7", $dbi&#41;; 
   
$nbEnr mysql_fetch_array&#40;$result&#41;; 
   
$count $nbEnr[0&#93;; 
while &#40;$stop<$numberpic&#41; 
&#123; 
    
   
srand&#40;time&#40;&#41;+$stop&#41;; 
   
$random_number rand&#40;0, $count-1&#41;; 
   
$result2 db_query&#40;"SELECT pid, aid, filepath, filename  from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7  AND approved='YES' LIMIT $random_number,1", $dbi&#41;; // aid numbers can be changed as need to respect permissions 
  
$picture mysql_fetch_array&#40;$result2&#41;; 
  
   
$img "<img src=\"gallery/&#123;$picture['filepath'&#93;&#125;thumb_&#123;$picture['filename'&#93;&#125;\"  border=\"0\">"
   
$content .= "<a href=\"gallery/displayimage.php&album=random&cat=&pos=-&#123;$picture['pid'&#93;&#125;\">$img<br>" truncate_string444&#40;$picture['filename'&#93;&#41; . "</a><br><br>"; 
$stop++; 
&
#125; 
$content .= "<br><a href=\"gallery/index.php\">Go to gallery</a></center>"
print 
$content
?>


Title: all pictures without one album
Post by: alirezaok on December 21, 2003, 09:28:24 am
if i want display all random pictueres of all albums without one specail album in front page site with use ssi hack what do i do?
Title: Random image include?
Post by: Joachim Müller on December 21, 2003, 01:40:11 pm
using ssi.php, this will show a random pic of your gallery (any album):
Code: [Select]
<?php
print cpg_thumb(0,0,1,"",1);
?>
GauGau
Title: Random image include?
Post by: duntuk on December 22, 2003, 12:00:19 am
yeah.. i'd definitely recommend gaugau's ssi.php over gtroll's way...

i'm 90% sure that gtroll's hack doesn't work like it's suppose to...  hence it only shows the same photo, with no 'random' aspect...

i only tested this with 1 album (since that's all i have setup), but with 1 album it definitely isn't random at all... but static, showing the same 1 photo...

and there also seems to be unnessary code, e.g.:

Code: [Select]
srand(time()+$stop);

which i can't see has any purpose...

unless, i'm wrong... this hack should NOT be recommended at all...

even the the author claims that he didn't check to see if his *own* code worked......  that's pretty bad... posting a mod that you didn't even check to see if it works or not.... tisk tisk...

btw... gaugau, you should edit one of your posts recommending this as one of the hacks... cause it's that post that brought me back here for a second try, which showed, that the code actually was garbage...

 :D
Title: Quick Question?
Post by: ojohn on December 22, 2003, 09:04:56 pm
In the ssi.php there is this line:

<? print cpg_thumb(0,0,4,0,0); ?>

what do each one do?
Title: Random image include?
Post by: Joachim Müller on December 22, 2003, 11:31:18 pm
did you have a look at the readme and the example that comes with ssi.zip? It's all in there!
The syntax is
Code: [Select]
<?
$cpg_include_link=1; // thumbnails are links? 0=no, 1=yes
$cpg_link_singlepic=0; // link points to album or single pic? 0=album, 1=single pic
$cpg_how_many=8; // how many thumbs do you need?
$cgp_limit_album=""; // specify certain album, ""=all
$cpg_random=0; //get random pic 0=no, 1=yes
print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random);
?>
or shortened
Code: [Select]
<? print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random,"_blank"); ?>
In your case, this means: show a thumbnail with
0 = no link pointing to the large pic
0 = no link to a single pic
4 = display a row of four thumbnails
0 = do not restrict to a special album (in other words: from any album)
0 = don't show a random pic (switching random off means showing the last uploaded)

I'd really appreciate if you did some reading before asking questions.

GauGau
Title: Random image include?
Post by: chillypk on December 26, 2003, 10:03:24 am
Great script!
I got it working right away.
One quick question?

It seems to be defaulting to a thumbnail dimension thats no longer the way its configured to the main gallery. I think the default was height dependent 100 pixels.

I changed it to width dependent 100 px on config - so it fits in a column im using for "last picture uploaded".

Shows up in the main gallery OK - albeit ugly.  But when using the example script it shows up as the old default 100pixels height dependent. I cleared cookies and it still seems to be showing the same thing.

Am I missing something?
It would be great if that was configurable :)

I think height dependent looks a lot better in album view but for my random picture in a column it would have to be width dependent obviously for layout purposes.

THanks!
Title: Random image include?
Post by: chillypk on December 26, 2003, 10:45:29 am
Hmm - well I found a way to fix it - although its not pretty - I deleted all the albums and reuploaded them using the new parameters - so now the thumbanails are at the new default size.

So problem fixed goin forward.

I also noticed in the ssi.php code some code about showing the title and other fields text?

Is that being used - documented somewhere?
It would be great to show the title and other info underneath the photo :)
Title: Random image include?
Post by: Joachim Müller on December 26, 2003, 10:49:09 am
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
Title: Random image include?
Post by: chillypk on December 26, 2003, 11:18:59 am
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.
Title: SSi does not work on my Smarty-templated homepage
Post by: Quadsk8 on December 30, 2003, 12:08:52 am
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:
Quote
Coppermine 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!!!
Title: Random image include?
Post by: Joachim Müller on December 30, 2003, 08:23:34 am
you simply can't use ssi.php within coppermine, only on non-coppermine pages.

GauGau
Title: Random image include?
Post by: Quadsk8 on December 30, 2003, 12:20:45 pm
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 (http://www.quadsk8.nl/foto&video/fotostand.php)
but when I try to include it in my Homepage I get the mentioned error.
Title: random image
Post by: binocle on January 08, 2004, 11:01:35 pm
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:
Title: Random image include?
Post by: Joachim Müller on January 09, 2004, 09:59:49 am
The error
Quote
Warning: 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
Title: Random image include?
Post by: Quadsk8 on January 09, 2004, 12:14:44 pm
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!!
Title: Random image include?
Post by: Joachim Müller on January 09, 2004, 01:10:17 pm
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:
Title: Random image include?
Post by: Quadsk8 on January 09, 2004, 02:01:27 pm
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:
Code: [Select]
$return_value.= "\" align=\"left\" class=\"padright\" />";
Title: ssi.php - how to access database with username and password
Post by: khm1972 on January 10, 2004, 07:44:28 pm
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
Title: Random image include?
Post by: Joachim Müller on January 11, 2004, 12:31:33 am
[list=1]
Title: That helped
Post by: khm1972 on January 11, 2004, 11:01:07 am
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
Title: Random image include?
Post by: binocle on January 11, 2004, 12:33:34 pm
Quote
people 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 ????
Title: Random image include?
Post by: Joachim Müller on January 11, 2004, 02:18:32 pm
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
Title: ssi.php - problem with open link in frames
Post by: khm1972 on January 13, 2004, 10:21:51 pm
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
Title: Random image include?
Post by: Celaine on January 16, 2004, 03:44:33 am
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.
Title: Random image include?
Post by: gmarik on January 17, 2004, 02:41:37 pm
so

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

will work even in vb3?
Title: Random image include?
Post by: dale on January 17, 2004, 08:06:53 pm
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.
Title: Random image include?
Post by: Joachim Müller on January 17, 2004, 09:53:35 pm
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
Title: Random image include?
Post by: Glenn on January 25, 2004, 06:55:15 am
OK - Stupid question...

(I know it not supported etc...)   :D

Will this work in a html file or does it have to be in a php file?

I have it working in a php file on my server but not in a html.

Regards,

Glenn.
Title: Random image include?
Post by: Joachim Müller on January 25, 2004, 08:52:53 am
the extension doesn't matter, as long as the file is being parsed by the php-interpreter. Usually, this is the case with the extension .php and not with files ending with .html

GauGau
Title: Random image include?
Post by: Viktor on February 16, 2004, 12:37:47 pm
OK i got it working myself the ssi i mean it really works great but my template runs on tables and i inserted the code into my table fine but some images are unusual sizes and stretch the table making my site out of proportion.
Is there anyway I can border the random images so they are all the same size within my page?
Title: Random image include?
Post by: Viktor on February 17, 2004, 12:11:48 am
bump
Title: Random image include?
Post by: Joachim Müller on February 17, 2004, 07:08:17 am
http://coppermine.sourceforge.net/faq.php?q=lamesupport#lamesupport
Title: SSI.php
Post by: Quelyn on February 26, 2004, 07:10:40 am
Not to be a bugger, I tried to read this thread thoroughly, and the "If you don't care about security" preface to the ssi.php kinda disenchanted me.  Are there any scripts that are in the works perhaps, that would produce an effect similar to http://www.runaked.com/forums/ without taking risks on an old unsupported one?
Title: Random image include?
Post by: Joachim Müller on February 26, 2004, 07:17:39 am
take a look at the rss feed mod: http://forum.coppermine-gallery.net/index.php?topic=2960

GauGau
Title: Random image include?
Post by: Quelyn on February 26, 2004, 07:29:00 am
Thanks so much for the quick reply, I'll look into the other thread now :D
Title: SSI mod with Flash ?
Post by: le_guy41 on March 09, 2004, 04:00:49 pm
Hello, i'm a newbie in PHP, MySQL and i wanted to have a random thumb pic of coppermine gallery on my home web page.

I tried the ssi mod which works perfect on an html page.

But the problem is that i wanted to integrate this pic in a flash swf.
I've read quite a lot on how to do that. And the only way is to have a file of the jpeg pic and all the comments apart.
In fact flash could load the url of the coppermine pic as it can only load text variables. And the thumb pic would be saved as file on the root of my domain.

Can anyone help me with this ? Can the ssi mod still be used for this ?

Thank u for sparing a little time to help me.
Title: Random image include?
Post by: Joachim Müller on March 09, 2004, 11:31:28 pm
ssi.mod goes unsupported and is not recommended. Anything is possible, you'll just have to code it. In fact, just look at the queries from ssi.php and use it for the swf thingy in question...

GauGau

P.S. merged your separate thread with the ssi.mod discussion
Title: ssi.php help please
Post by: Disc13 on March 15, 2004, 10:28:23 pm
Hi, I've just installed ssi.php and it works great, I now have a latest picture entry onto the front of my website. My question goes like this- I'm trying to have the latest four images uploaded, not just one. The problem is when I up the number of thumbnails to show, the thumbnails show in a row- I want them to show in a column. I'd imagine I'd have to modify something in ssi.php, maybe add a <br /> to some line of code somewhere, but I have never done php and have no idea where to begin. Can anyone help me with this? Any assitance would be greatly appreciated, thanks in advance!
Title: Random image include?
Post by: Joachim Müller on March 16, 2004, 08:01:04 am
this has been asked before in this very thread I moved your posting to - please search it.

GauGau
Title: Random image include?
Post by: tbone2004 on March 16, 2004, 10:24:46 am
Thanks so much for the script and your hard work. I read the documentaion that came with the zip file and had no problen at all installing it to work with CPG 1.2

gauqau, correct me if I'm wrong

Disc13, with php you can put php script within html, just make sure you save the file with the .php extenstion, you could do it this way

Code: [Select]
<center><table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#FF0000">
  <tr>
        <td width="25%" align="center"><?php 
print cpg_thumb&#40;0,0,1,"",1&#41;; 
?>
</td>
 <td width="25%" align="center"><?php 
print cpg_thumb&#40;0,0,1,"",1&#41;; 
?>
</td>
    <td width="25%" align="center"><?php 
print cpg_thumb&#40;0,0,1,"",1&#41;; 
?>
></td>
           <td width="25%" align="center"><?php 
print cpg_thumb&#40;0,0,1,"",1&#41;; 
?>
</td>
  </tr>
</table></center>



With using
Code: [Select]
print cpg_thumb(0,0,1,"",1); several times that will give you the same affect as using
Code: [Select]
print cpg_thumb(0,0,4,"",1);  am i right?


Cheers,
Mark
Title: Random image include?
Post by: Disc13 on March 16, 2004, 10:59:25 am
thanks for trying to help, but having that same line of code over and over simply prints out the latest picture multiple times.
Title: Doesn't work, please help
Post by: sdh on March 16, 2004, 05:02:02 pm
I have the SSI.php script and edited it according to the readme. But I can't get it working. :cry:

the ssi.php is in my fotoalbum map (and this map is in the webservers root. The ssi.php files says;
$url_of_cpg_dir='http://www.magnek.nl/fotoalbum';
$absolute_path_to_coppermine='/home/virtual/site16/fst/var/www/html/fotoalbum/';

The last path is the document_root according to phpinfo.php (also tried /var/www/html/fotoalbum/ssi/php/ and http://www.magnek.nl/fotoalbum/ssi.php)

Now I want to have a random thumbnail in a index.htm, so in the body I put:

<? include_once("/fotoalbum/ssi.php"); ?>
<? print cpg_random(); ?>

I have tried some more combinations (like http://www etc) but no luck so far. It probably is some dumb miscombination.
Who can help me please
Title: Random image include?
Post by: Disc13 on March 16, 2004, 08:36:52 pm
where is the index page you're trying to link from? older versions of php don't seem to handle relative paths really well (even though they are supposed to), and they won't accept http://www. addresses. My work around for a lot of my php was to put in the whole absolute address, '/home/virtual/site16/fst/var/www/html/fotoalbum/ssi.php' should work.
Title: Random image include?
Post by: Disc13 on March 16, 2004, 10:12:06 pm
Quote from: "gaugau"
this has been asked before in this very thread I moved your posting to - please search it.

GauGau


i still don't see where an answer to my column question here anywhere...

i tried modifying the ssi.php thing itself, trying to add random <br /> tags to places, but my lack of php knowledge ends up in giving me errors.

i'd imagine it would go somewhere in here, rite after the image tag before it calls the next image,

Code: [Select]
$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" border=\"0\" alt=\"\" title=\"";
if ($row['title']!="") {$return_value.= $row['title']." ";}
if ($row['caption']!="") {$return_value.= $row['caption']." ";}
if ($row['keywords']!="") {$return_value.= $cpg_lang_keywords . ": " . $row['keywords']." ";}
if ($row['hits']!="") {$return_value.= $row['hits']." ".$cpg_lang_views." ";}
if($cpg_random=="1")  {$return_value.= $cpg_lang_random;}
$return_value.= "\" align=\"left\" class=\"padright\" />";
if ($cpg_include_link==1){$return_value.="</a>";}
$return_value.=$td_end."\n";
$counter++;
if ($counter==$cpg_thumbcols){$counter=0;$return_value.=$tr_end;}


am I right in my thinking? again, any help would be appreciated.... thanks in advance!
Title: Random image include?
Post by: sdh on March 16, 2004, 10:24:27 pm
Quote from: "Disc13"
where is the index page you're trying to link from? older versions of php don't seem to handle relative paths really well (even though they are supposed to), and they won't accept http://www. addresses. My work around for a lot of my php was to put in the whole absolute address, '/home/virtual/site16/fst/var/www/html/fotoalbum/ssi.php' should work.


Index-page is in root, in this root the fotoalbum-map (with coppermine ofcourse) also is placed. I tried your suggestion, but nope. PHPversion according to phpinfo.php is PHP/4.3.4.
So any other tips/suggestions that I can give a try?
Title: Random image include?
Post by: Joachim Müller on March 17, 2004, 08:34:31 am
@Disc13: take a look at the html output ssi.php return: it's a table! Find the </td> tags and replace them with </td></tr>. Find the <td> tags and replace them with <tr><td>. Take a look at my posting at the start as well: this mod goes unsupported, it does what it does - no support or feature requests taken. Take it as is or leave it.

GauGau
Title: Random image include?
Post by: simoxy on March 19, 2004, 09:29:21 am
my coppermine gallery is on a different server to my main part of my website, how do I cahnge
Quote
<? include_once("/home/yourdomain/public_html/coppermine/ssi.php"); ?>

so that it calls the ssi.php from my other server?

i tries just adding the address in front but that didn't seem to work!
Title: Random image include?
Post by: Joachim Müller on March 19, 2004, 09:38:44 am
depends on the settings your webhost has for the inclusion of urls instead of path/file. Generally speaking: try
Code: [Select]
<? include_once("http://yourdomain.com/coppermine/ssi.php"); ?>If this doesn't work, you simply can't use the mod on remote domains.

GauGau
Title: picture thumbs,,help????
Post by: cifri on March 19, 2004, 08:24:58 pm
hello guys, i am trying to insert this code into my index.html and this is what i get,

Quote
// // http://www.chezgreg.net/coppermine/ // // ------------------------------------------------------------------------- // // Updated by the Coppermine Dev Team // // (http://coppermine.sf.net/team/) // // see /docs/credits.html for details // // ------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // ------------------------------------------------------------------------- // // hack from the nuke port for the standalone version // // by gtroll // // modify aid!=4 AND aid!=6 AND aid!=7 // // to fit the album(s) you want not to show // // ------------------------------------------------------------------------- // define('IN_COPPERMINE', true); require('include/init.inc.php'); $numberpic=5; // you can change the number of pictures here global $prefix, $dbi; function truncate_string444($str) { $maxlength = 20; // maximum lenght of name in block if (strlen($str) > $maxlength) return substr($str, 0, $maxlength)." ..."; else return $str; } $content="
"; $result = db_query("SELECT count(*) from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7", $dbi); $nbEnr = mysql_fetch_array($result); $count = $nbEnr[0]; while ($stop<$numberpic) { srand(time()+$stop); $random_number = rand(0, $count-1); $result2 = db_query("SELECT pid, aid, filepath, filename from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7 AND approved='YES' LIMIT $random_number,1", $dbi); // aid numbers can be changed as need to respect permissions $picture = mysql_fetch_array($result2); $img = ""; $content .= "$img
" . truncate_string444($picture['filename']) . "

"; $stop++; } $content .= "
Go to gallery
"; print $content; ?>

[edit GauGau]
removed double posting, changed existing one to show the output as quote
[/edit]
Title: Random image include?
Post by: Casper on March 19, 2004, 08:49:20 pm
Please don't double post  :evil: .  If you don't get an answer after more than a day, then use 'bump'.
Title: dude i need help
Post by: cifri on March 19, 2004, 08:51:52 pm
sorry for the postings, it was an error, help a brother out, i am not sure if i have to put the code into my index.html or somewhere else thanks
Title: Random image include?
Post by: Casper on March 19, 2004, 09:02:06 pm
Sorry, I don't know or use this mod, so can't help, but someone should give you an answer, although it's Friday, and the weekend bekons.
Title: Random image include?
Post by: hyperion on March 20, 2004, 12:07:05 am
@cifri:

Something is wrong with your PHP tags (<?php and ?>). Make sure they are there and that they are the correct type for your setup.
Title: Random image include?
Post by: Joachim Müller on March 20, 2004, 10:37:40 am
@cifri:
you said you pasted it into index.html: you can't have php code in plain html files. Unless you instructed your server to php-parse files with the extension ".html", this method simply won't work.

GauGau
Title: @gaugau
Post by: cifri on March 29, 2004, 07:40:49 pm
Hello, i inserted the code for the rss.php in to my html file and it worked on my computer but when i use another computer all i see is some text but no picture? is there a way i can have the latest pictures or thumbnails in my html website?? thanks
Title: Random image include?
Post by: Joachim Müller on March 30, 2004, 07:03:57 am
if your html web pages don't have ssi, you could try to play with some JavaScript Gimmicks, but basically html is static, so you can only have static content there (anyway there are no mods for SSI nor JavaScript inclusion around, you would have to code this by yourself).

GauGau
Title: Random image include?
Post by: deocare on April 03, 2004, 06:13:57 am
How can i make my thumbnail a little bigger using SSI?
Title: Random image include?
Post by: Joachim Müller on April 03, 2004, 08:58:17 am
not at all - the thumbs have the same size you specified them to have in coppermine config.

GauGau
Title: Random image include?
Post by: TheNakedMan on April 06, 2004, 02:45:43 am
I got mine to work famously on www.runaked.com/forums


Just working on how to make all images the same size.
Title: SSI
Post by: Wilson on April 06, 2004, 10:31:53 am
Where can i get the ssi.php to include toprate, lastup, ect images in other pages.
I've tried rss, works fine with magpie until you include it on another page.

Chars, Andy
Title: Random image include?
Post by: Wilson on April 06, 2004, 11:01:14 am
OK, so I've found the ssi.php... done what it says to do but i get mysql errors

Code: [Select]
Coppermine critical error:
Unable to connect to database !

MySQL said: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Title: Random image include?
Post by: Casper on April 06, 2004, 11:26:45 am
Merged your posts with the thread dealing with ssi.  Please read the entire thread.
Title: Random image include?
Post by: Wilson on April 06, 2004, 07:45:28 pm
ok works fine, chars!
How would you get the top rated pics to display through the ssi?
N can't u have the image title and rating included?
Title: Random image include?
Post by: Wilson on April 08, 2004, 11:21:49 am
BUMP
Title: Random image include?
Post by: puntopower on April 14, 2004, 03:59:56 pm
ive installed ssi.php and its only partly working. if u go to example.php (http://www.racershaven.com/example.php) you can see that not all the images are coming up. does any one know why this is so?

many thanks
Title: Random image include?
Post by: puntopower on April 14, 2004, 06:37:22 pm
wat i have noticed is that it is working for some albums and not others, any ideas, i have 14 albums and only about 4 of them are showing.

i am using both

<? print cpg_random(); ?>

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

also if i set it to use say album 14
<?php
print cpg_thumb(1,0,1,"14",1);
?>

that still doesnt show the image.

any ideas plz
Title: Picture Displaying
Post by: gj15987 on April 15, 2004, 06:17:59 pm
www.nintendo-vortex.com/bleh.php

How do i get these images to be displayed underneath each other?! They are here on the main page www.nintendo-vortex.com/vportal and i want them going down.

I downloaded the SSI addon to do this.

Any ideas?!

Thanks
Title: Random image include?
Post by: Joachim Müller on April 16, 2004, 07:52:44 am
merged your question with the thread dealing with ssi.php. Please understand that
a) ssi.php comes without support, as it's not recommended to use any more
b) this has been asked quite often, read this thread.

GauGau
Title: Random image include?
Post by: Vantage2 on April 17, 2004, 02:20:21 am
First of all I have read and re-read the entire thread, serached on google/yahoo and trawled through the serach results on this board for my answer.

This is the error I get;

Code: [Select]
Fatal error: Call to undefined function: cpg_thumb() in /home/fhlinux195/t/thecourt.org/user/htdocs/main.php on line 93

My <php statements in the page I require the images to be displayed in; main.php is as follows.
             
Code: [Select]
<? include_once("http://www.thecourt.org/media/gallery/ssi.php"); ?>
<?php print cpg_thumb&#40;0,0,1,"",1&#41;; ?>


My ssi.php file, held in /media/gallery has been changed as per the instructions to the following;

Code: [Select]
$url_of_cpg_dir='http://www.thecourt.org/media/gallery/';
$absolute_path_to_coppermine='/home/fhlinux195/t/thecourt.org/user/htdocs/media/gallery/';


Which I know works as previously, I would get an include error.

What might be causing my pronlem here. I know SSI isn't supported, but nowhere in the entire thread is this mentioned. I have tried putting the print statement in main.php within the php include statement to no avail.

Site is supposed to go live on Sunday 18th BTW.. so i'm running short of time.
Title: Random image include?
Post by: Nibbler on April 17, 2004, 02:35:23 am
Try setting the include as a local path eg /home/user/something/ssi.php it might not like the url.
Title: Random image include?
Post by: Vantage2 on April 17, 2004, 02:52:20 am
Thank you.. that worked for me.

I am VERY greatful
Title: Random image include?
Post by: Wilson on April 17, 2004, 09:06:23 am
Quote
How would you get the top rated pics to display through the ssi?
N can't u have the image title and rating included?

... erhem  :roll:
Title: Random image include?
Post by: Casper on April 18, 2004, 09:51:57 pm
'Bump' is much more likely to get a response.
Title: Random image include?
Post by: Wilson on April 19, 2004, 08:47:10 am
I've bumped this one already... BUMP 2  :?
Title: Random image include?
Post by: Joachim Müller on April 19, 2004, 09:09:59 am
I noticed you posting, and the bumps as well; ssi.php goes unsupported from my point of view (stated this often before on this thread). I won't make up my mind about new features. What's the use of a reply that doesn't have an answer. The mod has extremely crappy code (sorry for that :oops: , you're welcome to use it if it works for you...), and I won't make it more crappy by adding features to it. In fact, it's just some simple queries. Maybe someone else will do this for you.

GauGau
Title: SSI hack - random image on main (non CPG) page.
Post by: .andy on May 03, 2004, 12:59:05 pm
Hi,

I just put on the ssi hack. Is it possible to set a max width for a thumbnail? I noticed that the SSI code has an include for the CPG config file, so I tried setting the max width in the config, but this had no effect on the SSI thumbnail. Is there anything in ssi.php that I can set / change to make this happen? It keeps pushing a table too wide with some thumbs. TIA.

Cheers,
.andy
Title: Re: Random image include?
Post by: Joachim Müller on May 03, 2004, 06:49:40 pm
merged your posting with the thread dealing with ssi.php
Read it carefully, most questions have been answered before. The hack itself goes unsupported.

GauGau
Title: Re: Random image include?
Post by: kfc on May 30, 2004, 11:54:56 am
this script kicks ass! ssi.php

But look here http://www.lanmaniac.com/ i have a random pic on the top right of my page, but for some reason it leaves a large gap below the pic. does anyone know why? maybe the source its linked to have a large empty area below it?

Please help.

Thanks!
Title: Re: Random image include?
Post by: Glenn on June 05, 2004, 08:50:50 pm
Hi,

I have the ssi script installed and working OK. (Note - I know it is unsupported etc...)

I call the script in an iframe which is in a table
Code: [Select]
<td width="100%" bgcolor="#EED7B7" style="border-left-color: #111111; border-left-width: 1; border-right-color: #111111; border-right-width: 1">
<iframe SRC="rndimage.php" WIDTH="144" name="I1" scrolling="no" align="middle" border="0" frameborder="0" marginwidth="1" marginheight="1" class="bordercolor">
</iframe></td>

rndimage.php contains
Code: [Select]
<html>
<head>
<? include_once("/home/httpd/vhosts/domainname.com/httpdocs/cm/ssi.php"); ?>
<!-- edit above line to match the absolute path to ssi.php on your server -->
<meta http-equiv="refresh" content="30">
<style>
body {
background-color:#EED7B7;
margin-top:0px;
margin-bottom:0px;
margin-left:0px;
margin-right:0px;
padding:10px;
overflow : auto;
}
</style>
</head>
<body>
<CENTER>
<? print cpg_thumb(1,1,1,"",1,"_blank"); ?>
   </CENTER>
</body>
</html>

My question is:
How can I get it to display the thumbnail centered in the frame/cell? The align="middle" in the iframe and the <CENTER> in the php code does not seem to do it...

All suggestions appreciated!

Glenn.
Title: Re: Random image include?
Post by: Ithildin on July 01, 2004, 12:00:54 pm
Can somebody tell me what I'm doing wrong??
I tried to include the random picture at my first categorie,
because otherwise there are no thumbs which I can show!

http://www.the-spirit-of-middle-earth.de/gallery/index.php
Title: Re: Random image include?
Post by: Joachim Müller on July 01, 2004, 12:52:10 pm
you mustn't use ssi.php on coppermine pages, only on non-coppermine pages!

GauGau
Title: Re: Random image include?
Post by: nacho on July 07, 2004, 02:09:47 am
before putting this I read all and each one of the messages already exposed, probe each code exposed by the participants and the error follows:
Quote
Coppermine critical error:
Unable to connect to database !

MySQL said: Can't connect to MySQL server on 'localhost' (10061)   

my gallery already I work perfectly only needs this one detail

why is the error?..  i think maybe is in this part.. from line 55 of :    ssi.php

Code: [Select]
// get config data
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='fullpath'");
$row = mysql_fetch_row($result);
$cpg_album_path=$row[1];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumb_pfx'");
$row = mysql_fetch_row($result);
$cpg_thumb_pfx=$row['1'];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumbcols'");
$row = mysql_fetch_row($result);
$cpg_thumbcols=$row['1'];
 
please    help me!
Title: Re: Random image include?
Post by: Joachim Müller on July 07, 2004, 05:47:04 am
If the mySQL connection can't be established chances are high you're trying to use ssi.php from another server/domain. To tell you more, you'll have to supply full information:GauGau
Title: Re: Random image include?
Post by: Joachim Müller on July 07, 2004, 07:10:12 am
is your index page (http://www.sudcalifornianos.com/index.htm) php-enabled? Please edit the example.php that comes with ssi.php and post a link to it as well.

GauGau
Title: Re: Random image include?
Post by: Joachim Müller on July 07, 2004, 08:53:38 am
you didn't answer my question: are the html pages you're referring to php-enabled (usually they are not, unless you fiddled with your .htaccess settings like I did on my personal page)?

GauGau
Title: Re: Random image include?
Post by: Joachim Müller on July 08, 2004, 08:21:22 am
You still didn't answer my question. Unless you do, I'll ignore all other postings from you. Nobody asked anything about .htaccess, I just asked if the pages you're refering to are php-enabled, in other words: does php get parsed on pages that have the extension ".htm" or ".html". You can find out for yourself: create a file with this content
Code: [Select]
<?php print 'This page is php-enabled'?>and save it as test.htm. Then browse it: if you get a blank page, then the result is: pages with htm extension are not php-enabled, so you can't use php includes on them.

GauGau
Title: Re: Random image include?
Post by: Joachim Müller on July 09, 2004, 07:56:26 am
This might be a language issue, but anyway: html pages are not php-enabled on your server, which means (in short terms): this mod is not meant for you, you can't use it (well, those who have more understanding of the way a webserver works clearly could understand what I was trying to say in my last postings, so the answer would rather be "the mod only works when applied properly", but I think this is a hopeless case ;)). Please understand that this mod comes without support at all, I was just trying to be helpfull (and I already regret replying). Let's not spoil this thread with useless questions and answers you don't understand - let's end this discussion instead. You'll have to live without this mod or learn how to apply it without support.

GauGau

P.S. Bumping on this issue by PM didn't make me more inclined to help you >:(
Title: Re: Random image include?
Post by: foei on July 25, 2004, 06:00:23 pm
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
Title: Re: Random image include?
Post by: punjabicity on August 03, 2004, 12:12:02 am
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
Title: Re: Random image include?
Post by: Joachim Müller on August 03, 2004, 08:11:52 am
The first message tells it all: on your server, an open_basedir restriction is in place. Here's what the manual at php.net (http://www.php.net/features.safe-mode) has to say about it:
Quote
open_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
Title: Re: Random image include?
Post by: punjabicity on August 03, 2004, 03:50:55 pm
thank you so much my problem is solved!

does anyone know how to make the random thumbnail size bigger?
Title: Re: Random image include?
Post by: punjabicity on August 03, 2004, 03:54:57 pm
i would also like to put a border round the thumbnail! any ideas?
Title: Re: Random image include? Strange Problem
Post by: Xi_Master on August 03, 2004, 05:23:37 pm
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:
Code: [Select]
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:
Code: [Select]
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 (http://www.svzwollevoetbal.nl). You can find the message on the right side
and the site with the example: www.svzwollevoetbal.nl/example.php (http://www.svzwollevoetbal.nl/example.php)
Title: Re: Random image include?
Post by: Xi_Master on August 03, 2004, 06:39:21 pm
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.... :-\\
Title: Re: Random image include?
Post by: punjabicity on August 03, 2004, 08:06:07 pm
i would like to put a border round the thumbnail! any ideas?
Title: Re: Random image include?
Post by: Xi_Master on August 03, 2004, 10:57:46 pm
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....
Title: Re: Random image include?
Post by: punjabicity on August 04, 2004, 11:26:32 am
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
Title: Re: Random image include?
Post by: Joachim Müller on August 04, 2004, 01:10:29 pm
this thread deals with the random image mod, nothing else. Do not try to hijack this thread!

GauGau
Title: Re: Random image include?
Post by: herbie on August 25, 2004, 06:48:14 am
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.
Title: Re: Random image include?
Post by: Joachim Müller on August 25, 2004, 07:33:43 am
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
Title: Re: Random image include?
Post by: bpm32 on September 08, 2004, 02:03:27 am
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
Title: Re: Random image include?
Post by: Joachim Müller on September 08, 2004, 08:51:28 am
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
Title: Showing original pic and not the thumbnail (using SSI mod ofcourse)?
Post by: erezcarmel on September 11, 2004, 10:12:40 pm
How can I show the original picture and not only the thumbnail?
Title: Re: Random image include?
Post by: bbbbug on September 17, 2004, 02:45:58 pm
does SSI.php work with 1.3.2?
Title: Re: Random image include?
Post by: Joachim Müller on September 17, 2004, 11:52:49 pm
yes
Title: Re: Random image include? [Suggestion]
Post by: bbbbug on September 29, 2004, 01:25:19 pm
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~~~ ::) ::)
Title: Re: Random image include?
Post by: Joachim Müller on September 30, 2004, 07:29:13 am
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
Title: Re: Random image include?
Post by: DKP on October 01, 2004, 08:24:01 am
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

Actually, I have got it to work quite simply in shtml, with a quick little hack.
I created a php file 'random.php' which is simply
Code: [Select]
<?PHP
include_once("path/to/ssi.php");
print cpg_random();
?>
Then in my shtml page, I simply have
Code: [Select]
<!--#INCLUDE VIRTUAL="random.php" -->
Works a charm! (website is www.wnt.org.au (http://www.wnt.org.au), the random photo is in the top right hand corner using this method)
Right now I'm trying to implement another random (album specific) ssi on the same page, so if you load it and it looks wierd, that's why!

Oh, and the other way to do it (if your server supports it) is to make the page php and use the php functions virtual() (instead of <--#INCLUDE VIRTUAL--> and include(). My server had issues with virtual() (they claimed it should work, but it didn't), so I did this.
Title: Re: Random image include?
Post by: Titoul on October 01, 2004, 08:02:49 pm
Hi,
I try to use the ssi mod but the pics don't show up in the exemple.php  ???
and that tell me "You can't access this file directly..." if I click on one.

http://titoul.com/example.php

any idea plz?
Title: Re: Random image include?
Post by: arrs on October 29, 2004, 03:36:30 am
Hi,
I try to use the ssi mod but the pics don't show up in the exemple.php  ???
and that tell me "You can't access this file directly..." if I click on one.

http://titoul.com/example.php

any idea plz?

I dont know nothing about PHP but your url to your images are wrong :(

"http://www.titoul.com/modules/coppermine/modules/coppermine/albums/modules/coppermine/albums/userpics/cauet/thumb_Cauetu.jpg"

Make sure that $url_of_cpg_dir= and $absolute_path_to_coppermine= are correct.(remember the trailing /

Ok now its my turn :)

Is there anyway for random to just show pictures only or to display the thumbnails of a video files. As i get a red cross everytime a video is show as it is trying to display it as a picture. Any ideas/hacks guys? or another script maybe.

If dont work im gonna have to give up :(

www.southwest50s.co.uk/test/main.htm

cheers

James
Title: Re: Random image include?
Post by: kegobeer on October 29, 2004, 04:33:21 am
@Titoul:

We don't support the Nuke version of Coppermine.  For nuke questions, go to www.cpgnuke.com.
Title: Re: Random image include?
Post by: kegobeer on October 29, 2004, 04:39:42 am
@arrs:

Doesn't look like you've set up SSI correctly - your url's aren't correct.

http://www.southwest50s.co.uk/gallery/displayimage.php?&pos=-163

That's not correct.  displayimage.php?pos=-163 is correct.  You need to drop the & sign.

You can display the video thumbnails, yes, but you will have to modify SSI a lot to do it, since video was added after SSI was written.
Title: Re: Random image include?
Post by: arrs on October 29, 2004, 11:00:33 am
@arrs:

Doesn't look like you've set up SSI correctly - your url's aren't correct.

http://www.southwest50s.co.uk/gallery/displayimage.php?&pos=-163

That's not correct.  displayimage.php?pos=-163 is correct.  You need to drop the & sign.

You can display the video thumbnails, yes, but you will have to modify SSI a lot to do it, since video was added after SSI was written.

lol

I didnt realise the urls were wrong as it still works  ???

Ok is there any script that should do what im looking for?
Title: Re: Random image include?
Post by: kegobeer on October 30, 2004, 02:47:26 pm
Not that I'm aware of.  You'll have to compare the code that displays video thumbnails with the SSI code and make the appropriate changes yourself, or ask for help in the paid/freelancer board.
Title: Re: Random image include?
Post by: arrs on October 31, 2004, 12:56:50 am
Not that I'm aware of.  You'll have to compare the code that displays video thumbnails with the SSI code and make the appropriate changes yourself, or ask for help in the paid/freelancer board.

anyway i got a someone on another board to change it so it just display pictures and not videos

if anyone is interested here are the changes in the ssi.php file

Code: [Select]
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES'";
with

Code: [Select]
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' AND filename LIKE '%.jpg'";
Title: Re: Random image include?
Post by: Hein Traag on December 01, 2004, 08:43:51 am
Im not much of a coder but imho it would be better to exclude video type files and accept all types of images.
This piece of code only allows for .jpg files.
Title: Re: Random image include?
Post by: Atreiou on December 08, 2004, 09:52:01 pm
I'm trying to include ssi.php in my php homepage.
in my homepage I already have an inclusion code to show information of the forum (yabb SE)

in the first row of my homepage I have a code like this:

Code: [Select]
<? require("/home/vhosts/misite/var/www/html/YabbSE/SSI.php"); ?>
if I try to add the row that coppermine gallery SSI.php need:

Code: [Select]
<? include_once.....
I get a conflict, and I loose the information of the forum

any suggestion ?

thanks
Title: Re: Random image include?
Post by: Joachim Müller on December 09, 2004, 08:29:35 am
I get a conflict, and I loose the information of the forum
I use the mod on my frontpage as well together with YaBBSE's ssi.php without any issues - please post the exact error message you get, preferably together with a link to your site.

Joachim
Title: Re: Random image include?
Post by: Atreiou on December 09, 2004, 07:59:59 pm
Well I have prepared two test pages for you:

http://xr-italia.com/test1.php

this file have this two first rows
Code: [Select]
<? require("/home/vhosts/xr-italia.com/var/www/html/forumxr/SSI.php"); ?>
<? include_once("/home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php"); ?>


http://xr-italia.com/test2.php

this file have this two first rows
Code: [Select]
<? include_once("/home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php"); ?>
<? require("/home/vhosts/xr-italia.com/var/www/html/forumxr/SSI.php"); ?>

If you can see in this two case ora I loose the forum info, or the image on the upper right corner

thanks,
Andrea
Title: Re: Random image include?
Post by: Trauma on December 09, 2004, 10:50:53 pm
Ok another problem i found with teh ssi mod its the stats thing it wont work.
<? print cpg_stat_string("15"); ?><that thing wont work when you add it to the page.
The error is online 201 in ssi.php i was woundering if the modder could have a look at it thanks.
Title: Re: Random image include?
Post by: Joachim Müller on December 10, 2004, 12:39:40 am
Ok another problem i found with teh ssi mod its the stats thing it wont work.
<? print cpg_stat_string("15"); ?><that thing wont work when you add it to the page.
The error is online 201 in ssi.php i was woundering if the modder could have a look at it thanks.
I'm the modder, but the mod goes unsupported, as stated on this thread various time. The stats work fine for thousands, so I guess you have done something wrong.

@Atreiou: correct the error message
Quote
Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 48

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 50

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 51
first.

Joachim
Title: Re: Random image include?
Post by: Atreiou on December 10, 2004, 09:51:52 am
@Atreiou: correct the error message
Quote
Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 48

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 50

Warning: Cannot modify header information - headers already sent by (output started at /home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php:41) in /home/vhosts/xr-italia.com/var/www/html/forumxr/Sources/Load.php on line 51
first.

Joachim

Sorry GauGau... I'm not sure to understand...
where you see that error ?
I can't see in my pages...  ???
Title: Re: Random image include?
Post by: Joachim Müller on December 10, 2004, 10:05:21 am
see screenshot
Title: Re: Random image include?
Post by: Atreiou on December 10, 2004, 11:47:19 am
wow...

very strange, I don't see that errors with my browser..

how can be ?  ???
Title: Re: Random image include?
Post by: Casper on December 10, 2004, 11:55:13 am
I also do get them.
Title: Re: Random image include?
Post by: Hein Traag on December 10, 2004, 12:11:06 pm
http://xr-italia.com/test2.php

errors .. lots of them :D
Title: Re: Random image include?
Post by: Atreiou on December 10, 2004, 12:50:16 pm
I really don't understand.......



[attachment deleted by admin]
Title: Re: Random image include?
Post by: Joachim Müller on December 10, 2004, 01:02:54 pm
delete your cookie and then join the party ;).

Joachim
Title: Re: Random image include?
Post by: Atreiou on December 10, 2004, 01:55:49 pm
Oppsssssss

well... now I'm fucked...  :-X
Title: Re: Random image include?
Post by: Atreiou on December 10, 2004, 01:58:46 pm
If I delete the row:

Code: [Select]
<? include_once("/home/vhosts/xr-italia.com/var/www/html/galleria/ssi.php"); ?>
the errors go away....

look now...
Title: Re: Random image include?
Post by: Trauma on December 10, 2004, 08:19:24 pm
Hey Ga where it says in your script number of thumbs how can i make it show all thumbs do i put all instead of a number?
Also is it possible for me to add a target="_blank" in the script if so where thanks again.
Title: Re: Random image include?
Post by: Joachim Müller on December 11, 2004, 04:34:08 pm
Hey Ga
The name is "GauGau" or "Joachim" if you don't mind. Of course you have read this thread and you realize this mod goes unsupported and is not recommended to be used any longer, that's probably why you directly address me ::).
where it says in your script number of thumbs how can i make it show all thumbs do i put all instead of a number?
no, you simply can't. If you need an "all" attribute, you're free to come up with a hack.

Also is it possible for me to add a target="_blank" in the script if so where thanks again.
yes, shouldn't be to hard to search for <a href=and add the target attribute as you like.

Joachim
Title: Re: Random image include?
Post by: Atreiou on December 11, 2004, 04:50:27 pm
Solved with an upgrade of my board to SMF  ;)

http://xr-italia.com/test3.php
Title: Re: Random image include?
Post by: Trauma on December 11, 2004, 07:30:47 pm
Hey Ga
The name is "GauGau" or "Joachim" if you don't mind. Of course you have read this thread and you realize this mod goes unsupported and is not recommended to be used any longer, that's probably why you directly address me ::).
where it says in your script number of thumbs how can i make it show all thumbs do i put all instead of a number?
no, you simply can't. If you need an "all" attribute, you're free to come up with a hack.

Also is it possible for me to add a target="_blank" in the script if so where thanks again.
yes, shouldn't be to hard to search for <a href=and add the target attribute as you like.

Joachim
Thanks GauGau i dont mind using the mod even though its not supported when they realase a new version of coppermine are you going to make a supported version?
Title: Re: Random image include?
Post by: Ozh on December 11, 2004, 07:52:22 pm
(sorry to go off-topic but ... where the f*ck is the "New Thread" button on this board ? I can swear I see nothing ...)
Title: Re: Random image include?
Post by: Casper on December 11, 2004, 07:57:37 pm
There is no new thread on the mods board for regular users, just devs.
If you have a new mod, post it on a thread that asks or talks about it, or start a new thread on the general board, and we will move it if appropriate.
Title: Re: Random image include?
Post by: Ozh on December 11, 2004, 08:01:15 pm
ho ok
thx casper, feel free to delete my 2 posts here
Title: Re: Random image include?
Post by: Joachim Müller on December 12, 2004, 09:07:00 am
Thanks GauGau i dont mind using the mod even though its not supported when they realase a new version of coppermine are you going to make a supported version?
The mod will work with cpg1.4 as well. I have a total redo of the mod on my todo list, but it's not top priority, so I'm not sure if or when I'm going to start this.

Joachim
Title: Re: Random image include?
Post by: Kamui Shirou on December 14, 2004, 07:57:43 am
Im no PHP guru but Im want to export the latest images to my Portal System for IPB.If anyone knows how to set this up for the UnrealPortal for IPB 2.0 Let me know?
Title: Editable size of random image
Post by: medvidek on December 17, 2004, 12:30:54 am
This question was asked few times but I did not find the reply. Is there a chance to change the size of the random image? (For example I want to change the HEIGHT size to fit the image in the design).

And one more question. Is it possible to show random image from selected CATEGORY? Not only ALBUM.

Thanks for your time!
Title: Re: Editable size of random image
Post by: medvidek on December 17, 2004, 12:44:21 am
This question was asked few times but I did not find the reply. Is there a chance to change the size of the random image? (For example I want to change the HEIGHT size to fit the image in the design).

Of course the best thing would be to show random image of the medium image and to change the size of this medium image. It is not good idea to make small pictures larger but larger pictures smaller ;)

I found how the change the width of the small image used in random preview but the image is than just few large pixels ;))))
Title: Re: Editable size of random image
Post by: medvidek on December 19, 2004, 10:19:37 am

Quote
This question was asked few times but I did not find the reply. Is there a chance to change the size of the random image? (For example I want to change the HEIGHT size to fit the image in the design).

After three days I found the solution.

If you want to change the size of the random image, you can just add "height" parameter on the line 142:

FIND THIS LINE:
$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" border=\"0\" alt=\"\" title=\"";

CHANGE IT TO:
$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" border=\"0\" alt=\"\" height=\"190\" title=\"";


Problem is that your picture will be in terrible quality. But you can change the loading of thumbnail image for loading of NORMAL image.

Go to line 59 and look for:

$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name=thumb_pfx'");

CHANGE IT TO:

$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='normal_pfx'");

Since now you will load normal image on your main page where the hieght size will be defined as you wish.
Title: Re: Random image include?
Post by: blowndeadline on January 11, 2005, 09:44:17 am
Here is a quick question, why is this such a complicated thing to accomplish? You would think that 90% of everyone that uses a photo gallery would want to display a image from that gallery on their main page since Coppermine isn't a CMS?
I still haven't figured it out and it looks like I will just use Flash ans MySQL to call a random image from the database, might be easier!

Great gallery none the less!

Mike
Title: Re: Random image include?
Post by: Tranz on January 11, 2005, 09:52:02 am
Here is a quick question, why is this such a complicated thing to accomplish? You would think that 90% of everyone that uses a photo gallery would want to display a image from that gallery on their main page since Coppermine isn't a CMS?
I still haven't figured it out and it looks like I will just use Flash ans MySQL to call a random image from the database, might be easier!

Great gallery none the less!

Mike
er, It's been done (http://forum.coppermine-gallery.net/index.php?topic=13255.0). It's even a sticky in this sub-board.
Title: Re: Random image include?
Post by: onuzu on February 10, 2005, 08:34:47 pm
Hi all,

Can the ssi.php work with CPG 1.3.2? I just installed the latest version newly and would like images to show on my other pages
Title: Re: Random image include?
Post by: Joachim Müller on February 11, 2005, 05:05:04 pm
yes
Title: Re: Random image include?
Post by: carper on March 01, 2005, 05:09:14 pm
Hi,
I try to use the ssi mod but the pics don't show up in the example.php 
.


Warning: main(/srv/www/www.monegrosbtt.com/ssi.php): failed to open stream: No such file or directory in /srv/www/dominios/www.monegrosbtt.com/example.php on line 38

http://www.monegrosbtt.com/example.php

Si, ademas hay alguien que me contesta en cristiano, seria la releche.
Gracias
 
Title: Re: Random image include?
Post by: Joachim Müller on March 02, 2005, 07:41:58 am
the example doesn't work "out-of-the-box". Read the doc that comes with the ssi mod; it explains what settings you have to make.

Joachim
Title: Random image together with text
Post by: medvidek on March 06, 2005, 09:25:26 pm
GauGau: Is there a way to display the name of the image (I mean the description name added in the gallery) under the random image? It is already shown as an ALT text but I would like to show it under the image itself.
Title: Re: Random image include? (SSI.php)
Post by: kaalh on March 21, 2005, 12:42:48 am
restrict to public albums hook

line 88

replace :

Code: [Select]
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ";
if($cgp_limit_album!=""){$query.="AND aid='".$cgp_limit_album."'";}

by  :

Code: [Select]
$query = "SELECT {$CONFIG['TABLE_PICTURES']}.* from {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE approved='YES' AND {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND {$CONFIG['TABLE_ALBUMS']}.visibility = 0 ";
if($cgp_limit_album!=""){$query.="AND {$CONFIG['TABLE_PICTURES']}.aid='".$cgp_limit_album."'";}


KaalH!
Title: Re: Random image together with text
Post by: medvidek on March 23, 2005, 11:40:58 am
Is there a way to display the name of the image (I mean the description name added in the gallery) under the random image? It is already shown as an ALT text but I would like to show it under the image itself.

Anyone can help please?
Title: Re: Random image include? (SSI.php)
Post by: Horizon on March 28, 2005, 03:55:20 pm
Hi,
may somebody can say, why it takes white page:
http://foto.clubas.net/ssi.php

Fank`s, Tom :)
Title: Re: Random image include? (SSI.php)
Post by: Slump on June 28, 2005, 07:07:53 pm
Hi Gaugau,

thx for your SSi.php code, it's very nice  ;D

but i would like to modifiy it to view only one random picture by category and not by album...

and is it possible to know how many categories there are ?
so, we could view only one random picture by category for all the categories  ;)

thx for your help

Jerome

Title: Re: Random image include? (SSI.php)
Post by: vuud on June 28, 2005, 07:35:46 pm
Hi Gaugau,

thx for your SSi.php code, it's very nice  ;D

but i would like to modifiy it to view only one random picture by category and not by album...

and is it possible to know how many categories there are ?
so, we could view only one random picture by category for all the categories  ;)

thx for your help

Jerome



I feel wierd about promoting cross threads, but in the readme for this section GauGau states this about SSI.php

Quote
It uses php-includes, so the pages it can be used on must be PHP-enabled. As the mod doesn't take into account the privacy settings of coppermine, it is not recommended to use it anymore. It goes unsupported and only remains on this board for historical reasons and reference.

Have you looked at cpmfetch?  It does what you are looking for and is currently supported (at least by me and one or two users of it).  See the thread in this child board or check the website at http://cpmfetch.fistfullofcode.com

Vuud



Title: Re: Random image include? (SSI.php)
Post by: Joachim Müller on June 29, 2005, 09:49:50 am
@Slump: Vuud is right: ssi.php is not recommended for usage any more, I recommend you do as suggested and take a look at cpmFetch. Neither I (nor anyone else) currently supports ssi.php, and I will definitely not develop it any further or code custom hacks. Take ssi.php as it is if you must (you have been warned not to use it at all though!), but there's no support for it, nor will I look into any issues with it.

@Vuud: you don't have to feel sorry for promoting cpmFetch, it's the tool that the dev team recommends using as well. You're doing a great job developing it, so it comes only naturally that you tell people about it as well.

@all: ssi.php is only there for historical reasons, but shouldn't be used. Instead: use cpmFetch!

Title: Re: Random image include? (SSI.php)
Post by: chupa2k on July 22, 2005, 01:40:30 pm
I need help ,
Im using the ssi.php for random , All is great but i got alot of .swf files and other media and it displays it as broken image because it trys displaying it as <img and not object tag .
Can someone help ?
Title: Re: Random image include? (SSI.php)
Post by: vuud on July 22, 2005, 05:19:57 pm
I need help ,
Im using the ssi.php for random , All is great but i got alot of .swf files and other media and it displays it as broken image because it trys displaying it as <img and not object tag .
Can someone help ?

CpmFetch will / should use the representative images for other media, or the default image for it (ie: the flash graphic).

You can try that.  I'd like to see how well that part works for someone - I tested it on a few, but I don't have many.

Vuud


Title: Re: Random image include? (SSI.php)
Post by: chupa2k on July 22, 2005, 05:58:57 pm
I'm on it , PM you when im done .
Title: Re: Random image include? (SSI.php)
Post by: Joachim Müller on July 23, 2005, 01:05:50 pm
don't PM! Post!
Title: Re: Random image include? (SSI.php)
Post by: hobox on September 20, 2005, 06:12:03 pm
Ok, went through this looong thread and got a couple of examples of how this could be done. I maybe stupid and I can't even find the ssi.php anywhere among the mods.

Tried (after fixing some minor errors) the first script example and it works as long as  I just run it but with this error message:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/userx/public_html/gallery/randshow.php:2) in /home/userx/public_html/gallery/bridge/smf.inc.php on line 148

If I include the file in an another file I just get:

Coppermine Photo Gallery seems not to be installed correctly, or you're running coppermine for the first time. You'll be redirected to the installer. If your browser doesn't support redirect, click here.

Is my problem that Coppermine is bridged with smf?

Title: Re: Random image include? (SSI.php)
Post by: Joachim Müller on September 20, 2005, 06:43:00 pm
as you have read this thread, you surely have noticed that ssi-mod goes unsupported and is no longer recommended. We recommend cpmFetch instead.
Title: Re: Random image include? (SSI.php)
Post by: willstein on September 26, 2005, 09:20:47 am
yeah guys fetch works great and it's real easy to install.
Question: Is there any way to refresh the random pictures without refreshing the page?
Title: Re: Random image include? (SSI.php)
Post by: Joachim Müller on September 26, 2005, 10:04:44 am
questions related to cpmFetch should not be posted here on this thread, don't cross-post.
Title: Re: Random image include?
Post by: raummusik on October 26, 2005, 11:03:00 pm
did you have a look at the readme and the example that comes with ssi.zip? It's all in there!
The syntax is
Code: [Select]
<?
$cpg_include_link=1; // thumbnails are links? 0=no, 1=yes
$cpg_link_singlepic=0; // link points to album or single pic? 0=album, 1=single pic
$cpg_how_many=8; // how many thumbs do you need?
$cgp_limit_album=""; // specify certain album, ""=all
$cpg_random=0; //get random pic 0=no, 1=yes
print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random);
?>
or shortened
Code: [Select]
<? print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random,"_blank"); ?>In your case, this means: show a thumbnail with
0 = no link pointing to the large pic
0 = no link to a single pic
4 = display a row of four thumbnails
0 = do not restrict to a special album (in other words: from any album)
0 = don't show a random pic (switching random off means showing the last uploaded)

I'd really appreciate if you did some reading before asking questions.

GauGau

i used this gau thingy too and it rocks.. one question : when it loads in internet explorer.. first i see a white background, then it switches to black . i cannot find where i can define the white background (on load) to black background. would look nicer for me cause the whole page has black background and this comes only in internet explorer.. in firefox not . the problem is that i got the gallery on another domain so i had to include a iframe in my main.htm file, so the code works fine. its only an optical issue.. lets paste my code :

Code: [Select]

<body bgcolor="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin="0">
<div align="center">
  <?
$cpg_include_link=1; // thumbnails are links? 0=no, 1=yes
$cpg_link_singlepic=1; // link points to album or single pic? 0=album, 1=single pic
$cpg_how_many=5; // how many thumbs do you need?
$cgp_limit_album=""; // specify certain album, ""=all
$cpg_random=1; //get random pic 0=no, 1=yes
print cpg_thumb($cpg_include_link,$cpg_link_singlepic,$cpg_how_many,$cgp_limit_album,$cpg_random,"Hauptframe");
?>
</div>
</body>

</html>


here i tried to change body bgcolor... but it changes another background, and not the one i need to be changed.. the funny is that its only on load (while the pics getting out of the db , just for a short moment, but just annoying..

any ideas where to change this onload white background ?

cuuu
Title: Re: Random image include? (SSI.php)
Post by: Joachim Müller on October 27, 2005, 09:28:31 am
"Unsupported" actually means "no support at all" - is this so hard to understand? You seem to be well aware that this mod is deprecated and unsupported (you told me so in the PM you sent me, which is in fact bumping this thread). Ignoring my wish not to be PMed for support doesn't improve my readiness to help you on this issue either. The dev team recommends the use of cpmFetch instead of ssi.php (as I have repeated many times over on this board). Style sheet issues you might have (white backgorund turning black after load) don't relate at all to this mod nor cpmFetch. If you insist on using ssi.php, you're on your own - that's it!

Coming to think about it: I guess it's time I locked this thread - people just don't seem to take "no" (as in "no support") for an answer ::).

Joachim