Only works with "cpm_viewLastAddedMedia" function Only works with "cpm_viewLastAddedMedia" function
 

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]

Main Menu

Only works with "cpm_viewLastAddedMedia" function

Started by fotopolis, September 25, 2008, 08:52:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fotopolis

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:
<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(34$options);
  
$objCpm->cpm_close(); 
?>



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

<?php
  
include "./cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch_config.php");
    
$objCpm->cpm_viewRandomMediaFromCategory(2265, ) 
  
$objCpm->cpm_close(); 
?>

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


poubao

test this

$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMediaFrom("cat=3″,1, 3);
$objCpm->cpm_close();

poubao :D
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

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?

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


capecodgal

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


<?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(); 
?>


capecodgal

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



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

poubao

$objCpm->cpm_viewRandomMediaFrom("cat=10,11,12:album=5,6,7",2, 3,$options)
is not the same that
$objCpm->cpm_viewRandomMediaFrom("cat=10,11,12:album=5,6,7",2, 3,$options);
poubao :D
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

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

fangweile

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

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

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

fotopolis

Quote from: fangweile on September 27, 2008, 01:23:51 PM
If you want to display random pictures from category, the code must be similar to this

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

fotopolis

Here it's the debug information:

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

fangweile

This code works fine for me


<?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
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

fotopolis

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!