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

News:

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

Main Menu

Random image include? (SSI.php)

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

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Joachim Müller

depends on the settings your webhost has for the inclusion of urls instead of path/file. Generally speaking: try<? include_once("http://yourdomain.com/coppermine/ssi.php"); ?>If this doesn't work, you simply can't use the mod on remote domains.

GauGau

cifri

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]

Casper

Please don't double post  :evil: .  If you don't get an answer after more than a day, then use 'bump'.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

cifri

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

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

hyperion

@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.
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Joachim Müller

@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

cifri

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

Joachim Müller

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

deocare

How can i make my thumbnail a little bigger using SSI?

Joachim Müller

not at all - the thumbs have the same size you specified them to have in coppermine config.

GauGau

TheNakedMan

I got mine to work famously on www.runaked.com/forums


Just working on how to make all images the same size.
Are you naked?  More importantly, do you want to be?

Wilson

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
Sweet Pie

Wilson

OK, so I've found the ssi.php... done what it says to do but i get mysql errors

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)
Sweet Pie

Casper

Merged your posts with the thread dealing with ssi.  Please read the entire thread.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Wilson

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?
Sweet Pie

Wilson

Sweet Pie

puntopower

ive installed ssi.php and its only partly working. if u go to example.php you can see that not all the images are coming up. does any one know why this is so?

many thanks

puntopower

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

gj15987

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