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

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.

DKP

Quote from: GauGau 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

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

<?PHP
include_once("path/to/ssi.php");
print cpg_random();
?>

Then in my shtml page, I simply have

<!--#INCLUDE VIRTUAL="random.php" -->

Works a charm! (website is 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.

Titoul

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?

arrs

Quote from: 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?

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

kegobeer

@Titoul:

We don't support the Nuke version of Coppermine.  For nuke questions, go to www.cpgnuke.com.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

@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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

arrs

Quote from: 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.

lol

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

Ok is there any script that should do what im looking for?

kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

arrs

Quote from: 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.

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

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

with

$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' AND filename LIKE '%.jpg'";

Hein Traag

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.

Atreiou

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:

<? require("/home/vhosts/misite/var/www/html/YabbSE/SSI.php"); ?>

if I try to add the row that coppermine gallery SSI.php need:

<? include_once.....

I get a conflict, and I loose the information of the forum

any suggestion ?

thanks

Joachim Müller

Quote from: Atreiou on December 08, 2004, 09:52:01 PM
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

Atreiou

Well I have prepared two test pages for you:

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

this file have this two first rows

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

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

Trauma

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.
Whats Playing
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.hatchet-man.net%2Fwinamp%2F&hash=6e665018f7f67ae28a8ceca9cbcf90236ebc2099)

Joachim Müller

Quote from: 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.
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
QuoteWarning: 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

Atreiou

Quote from: GauGau on December 10, 2004, 12:39:40 AM
@Atreiou: correct the error message
QuoteWarning: 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...  ???

Joachim Müller

see screenshot

Atreiou

wow...

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

how can be ?  ???

Casper

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

Hein Traag


Atreiou

I really don't understand.......



[attachment deleted by admin]