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]   Go Down

Author Topic: Iframe include  (Read 6341 times)

0 Members and 1 Guest are viewing this topic.

ArturO

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Iframe include
« on: August 07, 2004, 01:48:54 pm »

Im sorry for my bad english ;D
I have a "small" problem with cpg130 .
I figuered out that it isn't possible to php-include the album-page into my page maintable.
Im serving an fishing-site and i want to publish my pictures on a page (.html) starting with a description followed by a iframe, including the fish-pictures.
But i dont want the whole album to be displayed. I just wannt the the pictures to be shown ,without all the buttons, footers and headers ect...

Example:
http://arturo.funpic.de/cgi-bin/fotos/thumbnails.php?album=25
There are 4 Pictures and the Headline "ZANDER".
I dont want the rest to be shown in the iframe.

Is there any way to realize my idea.
Thanks ... ArturO
Logged

skybax

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 180
    • SKYBAX Communications
Re: Iframe include
« Reply #1 on: August 07, 2004, 03:24:33 pm »

To include the images you'll need some sort of backend script. If I understand you're page type correctly, just a static .HTML page won't work. I think you know how your server reads files, so whatever you have set to include...

Use an RSS feed http://forum.coppermine-gallery.net/index.php?topic=8462.0. I recommend the MagpieRSS - http://magpierss.sourceforge.net/, it's simple to use and include into CM. It can all show the info you want, and I don't think it would be hard to customize it into an iFrame. I've modified my version a little to make file size smaller and the xml rss.php more streamlined. I can post directions if you are interested. -T 8)
Logged
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

ArturO

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Iframe include
« Reply #2 on: August 07, 2004, 08:15:49 pm »

I hoped the cpg is put together from different .php files. So i could display the right part in an iframe or even include it via php.
First of all i dont know what RSS is or stands for.
Logged

skybax

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 180
    • SKYBAX Communications
Re: Iframe include
« Reply #3 on: August 07, 2004, 11:52:58 pm »

RSS is a format for syndicating content from a content related site.

There are other ways to show the pictures and related info on other pages, but you'll need to setup a script that pretty much does the same thing as RSS. Where it accesses the database to gather information on the particular image and then passes that data to your formated HTML.

I pulled my rss parser and put together a quick archive with the required files to add and a short install doc. Download it from here:http://www.skybax.com/products/simpleRSS.zip

Hope this helps. It's ready to upload and put to work... no addition to other files in CM.

-T 8)
Logged
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

ArturO

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Iframe include
« Reply #4 on: August 08, 2004, 12:00:47 pm »

Thank you for your help.
I downloaded the files and tryed to install them.
First of all i failed to setup the script and im not sure if this is what im searching for.
There are lots of errors when im trying to display rss.php or rss_simple.php
Can u please discribe what the script will be like when setup correctly.
i found the the following line

$album = 'Zander'; // pick a group or single album by #
$thumb_count = 1; // how many thumbnails to display
$album_name = "Zander";

What if i want to show another album with another fish on another site....

Im also not sure if i have filled in all required fields or if they are correct.

rss.php
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// ------------------------------------------------------------------------- //
// 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.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//Change these variables to reflect your choices 
$album 'Zander'// pick a group or single album by #
$thumb_count 1// how many thumbnails to display
$album_name "Zander";
$lower_limit 0;
$thumb_per_page 1;
$rss_author "skybax";
//Changes these to point to your site
$site_url "http://arturo.funpic.de";
$link_url $site_url "cgi-bin/fotos/displayimage.php?pos=-";
$image_url $site_url "cgi-bin/fotos/albums/";

get_private_album_set();

$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);

header ("content-type: text/xml");

$rssHeader = <<<EOT
<?xml version="1.0"?>

<rdf:RDF
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://purl.org/rss/1.0/"
>

<channel>
<title>$CONFIG[gallery_name]</title>
<link>$site_url</link>
<description>$CONFIG[gallery_description] - $album_name</description>
<dc:creator>$rss_author</dc:creator>
<dc:language>en-us</dc:language>
</channel>
EOT;

echo $rssHeader;

foreach($data AS $picture) {
    $thumb_url = "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    $description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '" border="1" vspace="2" hspace="2" align="left" ></a>'.$picture[caption].$picture[caption_text];
    $description = htmlentities($description);
     
    $item = '<item rdf:about="' . $link_url . $picture['pid'] . '">
              <dc:date>' . date('Y-m-d H:i:s', time()) . '</dc:date>
              <title>'.$picture[title].'</title>
              <link>' . $link_url . $picture[pid] . '</link>
              <description>'.$description.'</description>           
             </item>';

    echo $item;
}

$rssFooter = <<<EOT
</rdf:RDF>
EOT;

echo $rssFooter;

?>

rss_simple.php
Code: [Select]
<?php
//reworked complete code overhaul to allow for simplier opperation 8/6/2004
define('MAGPIE_DIR''');
require_once(
MAGPIE_DIR.'rss_fetch.inc');

$url "http://arturo.funpic.de/cgi-bin/fotos/rss.php";

if ( 
$url ) {
        
$rss fetch_rss$url );
        
        echo 
"Channel: " $rss->channel['title'] . "<p>";
        
        foreach (
$rss->items as $item) {
                
$href $item['link'];
                
$title $item['title'];
                
$description $item['description'];        
                echo 
"<a href=$href>$title</a><br />$description";
        }
        
}
?>


Im thankig you for your support
Logged

skybax

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 180
    • SKYBAX Communications
Re: Iframe include
« Reply #5 on: August 10, 2004, 04:17:15 am »

ok the way to fix this... I had to work today, so it's taken me a while to get back to you on this. The get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page); function is located in the functions.inc.php file inside of the include folder.... I had to look through this to figure out that: to call a particular album you have to use the album id (find the # by either display image... or login into the mysql db and look under albums)... now the catch is (this threw me off too) when you put the number in. DO NOT use quotes... i spent the last 20 mins on that one... and i should have known... anyways. If you call that particular album then the rss.php file will only be good for that album. Make sense?

so basically find this:
Code: [Select]
$album = 'Zander'; // pick a group or single album by #
$thumb_count = 1; // how many thumbnails to display
$album_name = "Zander";
$lower_limit = 0;
$thumb_per_page = 1;
$rss_author = "skybax";

and replace with this:
Code: [Select]
$album = 25; // pick a group or single album by #
$thumb_count = 1; // how many thumbnails to display
$album_name = "";
$lower_limit = 0;
$thumb_per_page = 1;
$rss_author = "arturO";

An example file is located:
http://www.sheererotic.com/imgdb/rss.php *pages @ this url may contain nudity.

Don't forget to use a require command to call the rss_simple.php to your page to parse.
« Last Edit: August 10, 2004, 12:46:14 pm by skybax »
Logged
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

skybax

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 180
    • SKYBAX Communications
Re: Iframe include
« Reply #6 on: August 10, 2004, 02:13:49 pm »

Just as a quick note to anyone reading... If you have special characters in your album title or gallerie description it will cause the following errors:

The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------

Whitespace is not allowed at this location. Error processing resource 'http://arturo.funpic.de/cgi-bin/fotos/rss.php'. Line 11, Position 27

<description>Title & words
--------------------^


Two ways to fix this:

1. Change the title on the album or gallerie.
2. Or edit rss.php and search for:
Code: [Select]
<description>$CONFIG[gallery_description] - $album_name</description>change to:
Code: [Select]
<description>$album_name</description>

or

<description>No Description</description>



EDIT: again to solve this topic - it turned out that the webhost ArturO is using is attatching some sort of "hidden" counter script to every page. I think this is partly to prevent hotlinking... but any actions like this from a webserver will crash this script (and other scripts and mods in CM as well)  -T :o
« Last Edit: August 12, 2004, 04:05:50 am by skybax »
Logged
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

ArturO

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Iframe include
« Reply #7 on: September 13, 2004, 07:30:31 pm »

I have a problem with the rss_simple script
Errors @ http://arturo.ar.funpic.de/index.php?angelberichte=1&id=10

When i change the album# into something other the old pictures remain. For some reason no other pictures are displayed.

Here are the codes
rss.php
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// ------------------------------------------------------------------------- //
// 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.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //
define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//Change these variables to reflect your choices 


if(isset($_GET['id'])) {
switch(
$_GET['id']) {
case 
"10" $album 28; break;
default : 
$album 5; break;
};} else { 
$album 5;}



//$album = 14; 
$thumb_count 99// how many thumbnails to display
$album_name "Bildergallerie";
$lower_limit 0;
$thumb_per_page 99;
$rss_author "ArturO";
//Changes these to point to your site
$site_url "http://arturo.ar.funpic.de/";
$link_url $site_url "cgi-bin/fotos/displayimage.php?pos=-";
$image_url $site_url "cgi-bin/fotos/albums/";

get_private_album_set();

$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);

header ("content-type: text/xml");

$rssHeader = <<<EOT
<?xml version="1.0"?>

<rdf:RDF
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://purl.org/rss/1.0/"
>

<channel>
<title>$CONFIG[gallery_name]</title>
<link>$site_url</link>
<description>$album_name</description>
<dc:creator>$rss_author</dc:creator>
<dc:language>en-us</dc:language>
</channel>
EOT;

echo $rssHeader;

foreach($data AS $picture) {
    $thumb_url = "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    $description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '" border="1" vspace="2" hspace="2" align="left" ></a>'.$picture[caption].$picture[caption_text];
    $description = htmlentities($description);
     
    $item = '<item rdf:about="' . $link_url . $picture['pid'] . '">
              <dc:date>' . date('Y-m-d H:i:s', time()) . '</dc:date>
              <title>'.$picture[title].'</title>
              <link>' . $link_url . $picture[pid] . '</link>
              <description>'.$description.'</description>           
             </item>';

    echo $item;
}

$rssFooter = <<<EOT
</rdf:RDF>
EOT;

echo $rssFooter;

?>

rss_simple.php
Code: [Select]
<?php
//reworked complete code overhaul to allow for simplier opperation 8/6/2004
define('MAGPIE_DIR''');
require_once(
MAGPIE_DIR.'rss_fetch.inc');

$url "http://arturo.funpic.de/cgi-bin/fotos/rss.php";

if ( 
$url ) {
        
$rss fetch_rss$url );
        
        echo 
"Channel: " $rss->channel['title'] . "<p>";
        
        foreach (
$rss->items as $item) {
                
$href $item['link'];
                
$title $item['title'];
                
$description $item['description'];        
                echo 
"<a href=$href>$title</a><br />$description";
        }
        
}
?>

Logged
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 19 queries.