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: Only works with "cpm_viewLastAddedMedia" function  (Read 9064 times)

0 Members and 1 Guest are viewing this topic.

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Only works with "cpm_viewLastAddedMedia" function
« on: September 25, 2008, 08:52:06 pm »

Hello.
I've just installed CpmFetch.
My Coppermine version is 1.4.18
My url: http://www.laciudaddelasfotos.com

My problem is than only get working with the function "cpm_viewLastAddedMedia".
But with the functions "cpm_viewRandomMediaFrom", "cpm_viewRandomMediaFromAlbum", "cpm_viewRandomMediaFromCategory " is not working.
I've readed the advances manuall (http://cpmfetch.fistfullofcode.com/docs/stable_advanced/index.html) but I don't get it to work.
The test page is: http://www.laciudaddelasfotos.com/cpmfetch/test.php

This code works:
Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(34$options);
  
$objCpm->cpm_close(); 
?>


But these don't work:
Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFromCategory(2265$options
  
$objCpm->cpm_close(); 
?>
Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFromCategory(2265, ) 
  
$objCpm->cpm_close(); 
?>
Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFromCategory(2265
  
$objCpm->cpm_close(); 
?>

Can anyone help me, please?
Thanks a lot!
Logged

anna.

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 16
    • Canon Love
Logged

poubao

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: la
  • Offline Offline
  • Gender: Male
  • Posts: 277
    • Collections du Laos
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #2 on: September 26, 2008, 05:29:41 pm »

test this

Code: [Select]
$objCpm = new cpm(”./cpmfetch/cpmfetch_config.php”);
$objCpm->cpm_viewRandomMediaFrom(”cat=3″,1, 3);
$objCpm->cpm_close();
poubao :D
Logged
L'incohérence de ceux qui nous dirigent, l'incompétence de ceux qui nous commandent,sont un vibrant hommage pour ceux qui exécutent.
                                          **Général Patton**

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #3 on: September 26, 2008, 07:34:20 pm »

With this code it doesn't work.
The path is not "/cpmfetch/cpmfetch_config.php" because is in the cpmfetch directoy.
I this this will show album 1 and 3 in the category 3, won't it?

Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
   
$objCpm->cpm_viewRandomMediaFrom("cat=3",13);
  
$objCpm->cpm_close(); 
?>
Logged

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #4 on: September 26, 2008, 07:36:02 pm »

Keep reading ;) The codes are not entirely right.

http://cpmfetch.fistfullofcode.com/docs/stable_advanced/cpmfetch/cpm.html#cpm_viewRandomMediaFromCategory

What is wrong? I'm reading it and I don't find the error.

Thanks a lot!
Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #5 on: September 26, 2008, 08:57:18 pm »

you have to define what categories and albums you want to display whenever youuse a FROM function so like it would be something like this... if you wanted to only pull images from say Categories 10-12 and albums 5-7 showing 2 rows w/ 3 photos per row....

Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFromCategory("cat=10,11,12:album=5,6,7",23,$options
  
$objCpm->cpm_close(); 
?>

Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #6 on: September 26, 2008, 08:58:53 pm »

sorry correction to the above post...


you have to define what categories and albums you want to display whenever youuse a FROM function so like it would be something like this... if you wanted to only pull images from say Categories 10-12 and albums 5-7 showing 2 rows w/ 3 photos per row....


Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFrom("cat=10,11,12:album=5,6,7",23,$options
  
$objCpm->cpm_close(); 
?>



I didn't realize you had used viewRandomMediaFromCategory... it is just viewRandomMediaFrom
Logged

poubao

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: la
  • Offline Offline
  • Gender: Male
  • Posts: 277
    • Collections du Laos
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #7 on: September 27, 2008, 06:58:05 am »

Code: [Select]
$objCpm->cpm_viewRandomMediaFrom("cat=10,11,12:album=5,6,7",2, 3,$options)is not the same that
Code: [Select]
$objCpm->cpm_viewRandomMediaFrom("cat=10,11,12:album=5,6,7",2, 3,$options);poubao :D
Logged
L'incohérence de ceux qui nous dirigent, l'incompétence de ceux qui nous commandent,sont un vibrant hommage pour ceux qui exécutent.
                                          **Général Patton**

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #8 on: September 27, 2008, 12:20:19 pm »

With this code it doesn't work yet:
Code: [Select]
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewRandomMediaFrom("cat=4:album=52,53",23,$options);
  
$objCpm->cpm_close(); 
?>
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #9 on: September 27, 2008, 01:23:51 pm »

If you want to display random pictures from category, the code must be similar to this

Code: [Select]
 
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm-> cpm_viewRandomMediaFromCategory 153);
$objCpm-> cpm_close(); 
?>


Where "1" = no. of row for pictures
Where "5" = no. of column for pictures
where "3" = is the category id no.

If the code above won't work, then you probably have a wrong path for cpmfetch.php and cpmfetch_config.php.

Another thing, a link to the page you use the code will be useful.

Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #10 on: September 27, 2008, 03:03:52 pm »

If you want to display random pictures from category, the code must be similar to this

Code: [Select]
 
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm-> cpm_viewRandomMediaFromCategory 153);
$objCpm-> cpm_close(); 
?>


Where "1" = no. of row for pictures
Where "5" = no. of column for pictures
where "3" = is the category id no.

If the code above won't work, then you probably have a wrong path for cpmfetch.php and cpmfetch_config.php.

Another thing, a link to the page you use the code will be useful.




This doesn't work for me.
I've tried with the path: ./cpmfetch/cpmfetch.php and ./cpmfetch.php
The test page and the url is in the first post.
But with the function for showing last pics added it works with the path "./cpmfetch.php" because the "test.php" is in the cpmfetch directory.

Thanks a lot man!
Logged

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #11 on: September 27, 2008, 03:06:46 pm »

Here it's the debug information:

Code: [Select]
CpmFetch Install Script version 2.0.0
do=
path=
force=
Running default command: install
* * BEGIN SERVER SETTINGS * *
SERVER HTTP_HOST: www.laciudaddelasfotos.com
SERVER HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.0
.1) Gecko/2008070208 Firefox/3.0.1
SERVER HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=
0.8
SERVER HTTP_ACCEPT_LANGUAGE: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
SERVER HTTP_ACCEPT_ENCODING: gzip,deflate
SERVER HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
SERVER HTTP_KEEP_ALIVE: 300
SERVER HTTP_CONNECTION: keep-alive
SERVER HTTP_COOKIE: 2ceac5e69815af41ee95b2e8a8e47448=3974a34ae89bb0de4b69d880efc
fa908; coppermine_data=YToyOntzOjI6IklEIjtzOjMyOiI0YjMwMjk3OWEyZjIwM2FiNTc4YWIzM
WUxMjFhZjUzYSI7czoyOiJhbSI7aToxO30%3D
SERVER PATH: /sbin:/usr/sbin:/bin:/usr/bin
SERVER SERVER_SIGNATURE:
Apache/2.2.3 (CentOS) Server at www.laciudadde lasfotos.com Port 80


SERVER SERVER_SOFTWARE: Apache/2.2.3 (CentOS)
SERVER SERVER_NAME: www.laciudaddelasfotos.com
SERVER SERVER_ADDR: 87.106.240.208
SERVER SERVER_PORT: 80
SERVER REMOTE_ADDR: 213.37.139.141
SERVER DOCUMENT_ROOT: /var/www/vhosts/laciudaddelasfotos.com/httpdocs
SERVER SERVER_ADMIN: root@localhost
SERVER SCRIPT_FILENAME: /var/www/vhosts/laciudaddelasfotos.com/httpdocs/cpmfetch
/install.php
SERVER REMOTE_PORT: 49626
SERVER GATEWAY_INTERFACE: CGI/1.1
SERVER SERVER_PROTOCOL: HTTP/1.1
SERVER REQUEST_METHOD: GET
SERVER QUERY_STRING:
SERVER REQUEST_URI: /cpmfetch/install.php
SERVER SCRIPT_NAME: /cpmfetch/install.php
SERVER PHP_SELF: /cpmfetch/install.php
SERVER REQUEST_TIME: 1222520840
* * END SERVER SETTINGS * *
Found config file at ../include/config.inc.php
Found init file at ../include/init.inc.php
Checking for existing cpmfetch config file
Found cpmfetch_config.php file - now reading
Config file is version 2.0.0 read in
Last flagged version is 1.9.9
Config written version same or newer than last flagged version - reinstall optio
nal
Producing output screen and exiting
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #12 on: September 28, 2008, 03:11:48 am »

This code works fine for me

Code: [Select]
<?php
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm-> cpm_viewRandomMediaFromCategory 153);
$objCpm-> cpm_close(); 
?>


Produces this page
http://www.allkoreans.net/gallery/cpmfetch/test.php

Make sure that you have the right chmod permission for cpmfetch_config.php
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

fotopolis

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Only works with "cpm_viewLastAddedMedia" function
« Reply #13 on: September 28, 2008, 12:41:50 pm »

These are permisions:

./cpmfetch/cpmfetch_config.php CHMOD 666
./cpmfetch/tmp CHMOD 666

I've tested with CHMOD 777 and continue without working.

Thanks fo the help!
Logged
Pages: [1]   Go Up
 

Page created in 0.037 seconds with 19 queries.