Advanced search  

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]

Pages: 1 ... 3 4 5 6 [7] 8 9   Go Down

Author Topic: Random image include? (SSI.php)  (Read 183373 times)

0 Members and 1 Guest are viewing this topic.

DKP

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Random image include?
« Reply #120 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, 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.
Logged

Titoul

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Random image include?
« Reply #121 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?
Logged

arrs

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Random image include?
« Reply #122 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

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Random image include?
« Reply #123 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.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Random image include?
« Reply #124 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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Random image include?
« Reply #125 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?

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Random image include?
« Reply #126 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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Random image include?
« Reply #127 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'";

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Random image include?
« Reply #128 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.
Logged

Atreiou

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Random image include?
« Reply #129 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Random image include?
« Reply #130 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
Logged

Atreiou

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Random image include?
« Reply #131 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
Logged

Trauma

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
    • http://www.hatchet-man.net
Re: Random image include?
« Reply #132 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.
Logged
Whats Playing
(http://www.hatchet-man.net/winamp/)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Random image include?
« Reply #133 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
Logged

Atreiou

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Random image include?
« Reply #134 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...  ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Random image include?
« Reply #135 on: December 10, 2004, 10:05:21 am »

see screenshot
Logged

Atreiou

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Random image include?
« Reply #136 on: December 10, 2004, 11:47:19 am »

wow...

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

how can be ?  ???
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Random image include?
« Reply #137 on: December 10, 2004, 11:55:13 am »

I also do get them.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Random image include?
« Reply #138 on: December 10, 2004, 12:11:06 pm »

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

errors .. lots of them :D
Logged

Atreiou

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Random image include?
« Reply #139 on: December 10, 2004, 12:50:16 pm »

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



[attachment deleted by admin]
Logged
Pages: 1 ... 3 4 5 6 [7] 8 9   Go Up
 

Page created in 0.028 seconds with 20 queries.