forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: debragrant on March 21, 2007, 04:26:13 pm

Title: Joomla mod problem
Post by: debragrant on March 21, 2007, 04:26:13 pm
Code: [Select]
Warning: main(gallery/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /home/divatcom/public_html/helendallimore/main/modules/mod_coppermine.php on line 79

Fatal error: main() [function.require]: Failed opening required 'gallery/cpmfetch.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divatcom/public_html/helendallimore/main/modules/mod_coppermine.php on line 79
Title: Re: Joomla mod problem
Post by: Joachim Müller on March 21, 2007, 06:36:07 pm
RTFM
Title: Re: Joomla mod problem
Post by: thuleab on April 11, 2007, 08:55:58 pm
RTFM
From the developers homepage.
Documentation section.
--------------------------------
Joomla
How to use CpmFetch in Joomla
Vuud
Overview

This documentation has not been written or contributed yet.
-----------------------------------

So please answer the question if you can, as I have the same problem
Title: Re: Joomla mod problem
Post by: vuud on April 11, 2007, 09:01:42 pm
Code: [Select]
Warning: main(gallery/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in /home/divatcom/public_html/helendallimore/main/modules/mod_coppermine.php on line 79

Fatal error: main() [function.require]: Failed opening required 'gallery/cpmfetch.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divatcom/public_html/helendallimore/main/modules/mod_coppermine.php on line 79

What is mod_coppermine?
Its in there and apparently creating the error...

Post the code from it, or something... anything...


Title: Re: Joomla mod problem
Post by: thuleab on April 11, 2007, 09:14:06 pm
Here are the entire mod_coppermine.php
The module for joomla, that should have taken pictures from the coppermine photoalbum and shown them in a "box" in the joomla site.

<?php
/**
* @copyright (C) 2007 Der-Reisende.de
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
**/

//begin validation
defined( '_VALID_MOS' ) or die( 'Restricted access' );
//end validation

//begin module parameters
// $gallery     = $params->get('gallery'); // Galeriepfad, nicht verwendet
$cpmFetch    = $params->get('cpmFetch');// Pfad zu cpmfetch

$quelle =$params->get('quelle'); // Option album= Album, cat=Kategorie
$typ = $params->get('typ'); // Option last= zuletzt hinzugefuegt, random = Zufall, mostviewed = am meisten angesehen, toprated = am besten bewertet

$column = $params->get('column'); // Spalte
$rows = $params->get('rows');
$id = $params->get('id'); // Nummer des Albums/Kategorie
$imagesize =$params->get ('imagesize'); // thumb = Thumbnail, int = Intermediate, large = Gross
$imagelink =$params->get ('imagelink'); // standard = normaler Bildlink, none = kein Link, album = Link zum Album, large = Link zum Bild
$windowtarget =$params->get ('windowtarget'); // _parent = gleiches Fenster, _blank = Neues Fenster

$css_imagestyle = $params->get('css_cpgimage'); // IMG
$css_table = $params->get('css_cpgtable'); // TABLE
$css_tablehead = $params->get('css_cpgtablehead'); // TH
$css_row = $params->get('css_cpgrow');      // TR
$css_cell = $params->get('css_cpgcolumn'); // TD
$css_link = $params->get('css_cpglink'); // A

$imagewidth = $params->get('cpgimagewidth');
$imageheight = $params->get('cpgimageheight');
$resize =$params->get('resize');

$subtitle = $params->get('subtitle');
$alttag = $params->get('alttag');
$moduleclass_sfx = $params->get('moduleclass_sfx');

//end module parameters


$gallery = $cpmFetch .'/cpmfetch_config.php'; // Anhaengen der Config Datei fuer cpmfetch


// Zusammensetzen des Strings, entweder fuer Album oder Kategorie
$id = $quelle.'='.$id;


// Uergeben der Parameter in das Options Feld

 $options ['subtitle'] = $subtitle;
 $options ['alttag'] = $alttag;
 $options ['imagestyle'] = $css_imagestyle;
 $options ['tablestyle'] = $css_table;
 $options ['cellstyle'] = $css_cell;
 $options ['tableheadstyle'] = $css_tablehead;
 $options ['rowstyle'] = $css_row;
 $options ['linkstyle'] = $css_link;
 $options ['imagesize'] = $imagesize;
 $options ['imagelink'] = $imagelink;
 $options ['windowtarget'] = $windowtarget;
 
 // due a display bug in Iexplorer -> dont use these parameters
 if ( $resize == '1' )
 {
 $options ['imageheight'] = $imageheight;
 $options ['imagewidth'] = $imagewidth;
}

// echo "<center>";
// echo $id;
// echo $quelle;
// echo $typ;
// echo $rows;
// echo $column;
// echo $css_table;

require_once $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);


switch ($typ)
{
         case 'last': //Zuletzt hinzugefuegt
                 $objCpm->cpm_viewLastAddedMediaFrom($id,$rows, $column, $options);
                 break;
         case 'random': // Zufallsbilder
                  $objCpm->cpm_viewRandomMediaFrom($id,$rows, $column, $options);
                  break;
         case 'mostviewed': // am meisten angesehen
                  $objCpm->cpm_viewRandomMostViewedMediaFrom($id,$rows, $column, $options);
                  break;
         case 'toprated': // am besten bewertet
                  $objCpm->cpm_viewTopRatedMediaFrom($id,$rows, $column, $options);
                  break;
         case 'mostrated': // am haeufigsten bewertet
                  $objCpm->cpm_viewMostVotedMediaFrom($id,$rows, $column, $options);
                  break;

}

$objCpm->cpm_close();
echo "</enter";
?>

Hope this will help you help us  ::)
Title: Re: Joomla mod problem
Post by: vuud on April 11, 2007, 10:41:24 pm
$cpmFetch    = $params->get('cpmFetch');// Pfad zu cpmfetch

From the code, whatever this is getting back from the parameters is wrong.   Seems like a setting you have in joomla or something.

Title: Re: Joomla mod problem
Post by: jessdk on April 11, 2007, 11:05:11 pm
Hi all

Solution:

First backup mod_coppermine.php

Install copperminefetch-2.0.0

http://cpmfetch.fistfullofcode.com/downloads/index.php (http://cpmfetch.fistfullofcode.com/downloads/index.php)

Replace the folloing code in mod_coppermine.php

Code: [Select]

require_once $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);


switch ($typ)
{
         case 'last': //Zuletzt hinzugefuegt
                 $objCpm->cpm_viewLastAddedMediaFrom($id,$rows, $column, $options);
                 break;
         case 'random': // Zufallsbilder
                  $objCpm->cpm_viewRandomMediaFrom($id,$rows, $column, $options);
                  break;
         case 'mostviewed': // am meisten angesehen
                  $objCpm->cpm_viewRandomMostViewedMediaFrom($id,$rows, $column, $options);
                  break;
         case 'toprated': // am besten bewertet
                  $objCpm->cpm_viewTopRatedMediaFrom($id,$rows, $column, $options);
                  break;
         case 'mostrated': // am haeufigsten bewertet
                  $objCpm->cpm_viewMostVotedMediaFrom($id,$rows, $column, $options);
                  break;

}

$objCpm->cpm_close();

With

Code: [Select]
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();

The solution is here:

http://forum.joomla.org/index.php/topic,159237.msg768255.html#msg768255 (http://forum.joomla.org/index.php/topic,159237.msg768255.html#msg768255)

Best regard

Jessdk
Title: Re: Joomla mod problem
Post by: jessdk on April 11, 2007, 11:12:13 pm
Code: [Select]
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();

Remember to change "/gallery/" in this line to your gallery folder name eks. /foto/
1. include "./gallery/cpmfetch/cpmfetch.php";
2. $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");

Best regard

Jessdk
Title: Re: Joomla mod problem
Post by: viajero on April 19, 2007, 06:40:39 pm
Hi guys,

I am the source of the problems :) as I developed the little mod
please ask my self at my little forum - because I am not around here too often Link to forum (http://www.der-reisende.de/cms/forum/func,showcat/catid,4/)

Mod is under development and things getting better  quickly :)

version 1.1 out soon

greetings

André aka viajero