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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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.

Glenn

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.

Joachim Müller

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

Viktor

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?

Viktor


Joachim Müller


Quelyn

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?

Joachim Müller


Quelyn

Thanks so much for the quick reply, I'll look into the other thread now :D

le_guy41

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.

Joachim Müller

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

Disc13

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!

Joachim Müller

this has been asked before in this very thread I moved your posting to - please search it.

GauGau

tbone2004

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

<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
print cpg_thumb(0,0,1,"",1); several times that will give you the same affect as using
print cpg_thumb(0,0,4,"",1);  am i right?


Cheers,
Mark

Disc13

thanks for trying to help, but having that same line of code over and over simply prints out the latest picture multiple times.

sdh

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

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.

Disc13

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,

$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!

sdh

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?

Joachim Müller

@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

simoxy

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!
go get in the surf!