Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 29, 2022, 05:03:18 AM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193622
  • Total Topics: 21106
  • Online today: 71
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 2
Guests: 61
Total: 63

Author Topic: Last and Random Media from coppermine gallery  (Read 4397 times)

0 Members and 1 Guest are viewing this topic.

Nefeli

  • Guest
Last and Random Media from coppermine gallery
« on: May 11, 2007, 01:25:38 PM »
Hi everybody

I have  installed SMF 1.1.1, TinyPortal v0.9.7, Coppermine Photo Gallery v1.4.10 and copperminefetch-2.0.0

After a lot of trials and many many
"Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /xxxxxx/xxxxxxx/xxxxxxxxxx/Sources/Load.php(1733) : eval()'d code(35) : eval()'d code on line 3" .
I accomplished to pass rightly the code in two diferrents (!!!) php blocks in front page of TP.

Finaly the combination that functioned ΟΚ was:

First php block:

Code: [Select]
echo "<CENTER>";
  include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,8);

Second php block:

Code: [Select]
echo "<CENTER>";
include_once "./Gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./Gallery/cpmfetch/cpmfetch_config.php"); 
$objCpm->cpm_viewRandomMediaFrom("cat=10,13",1, 8, $options);

Note that the codes resembles with those of previous tryals!!!!!

The codes dont work for hours and then, suddenly it works!!!!!!!!!!!!

This auto-correction happened on the same way, yesterday when i tryed again and again the first one!!!!!!!!!!!!

Sorry for my English  :'( I hope that you understand me and i am usefull for you all ::)






bloodynightmare

  • Guest
Re: Last and Random Media from coppermine gallery
« Reply #1 on: May 19, 2007, 11:24:01 AM »
i tried both codes but it always tells me that ther'sn't the 'cpm' class on load.php in line 3

Nefeli

  • Guest
Re: Last and Random Media from coppermine gallery
« Reply #2 on: May 19, 2007, 12:50:32 PM »
i tried both codes but it always tells me that ther'sn't the 'cpm' class on load.php in line 3
ÃŽâ„¢t is very important adapting the path on this in your server.
Mine is "./Gallery/cpmfetch/cpmfetch.php", gallery with G, your?
Still, the settings "cat=10,13",1, 8, $options etc. is the same or adapted to yours needs?

bloodynightmare

  • Guest
Re: Last and Random Media from coppermine gallery
« Reply #3 on: May 19, 2007, 01:02:41 PM »
:p, you're right, i corrected the path, but still i don't understand what i have to put in cat= and $options... where have i to look up for these numbers?

Nefeli

  • Guest
Re: Last and Random Media from coppermine gallery
« Reply #4 on: May 19, 2007, 02:30:27 PM »
Read for cmpfetch walkthrough here. There are more informations about.

ÃŽÅ“ore specifically for you >>>

Quote
$objCpm->cpm_viewRandomMediaFrom("cat=1",1, 4, $options); // Line 5

The function call is named cpm_viewRandomMediaFrom - and with it, you tell CpmFetch to get random pictures from a specific source. All functions that end in "From" take the $source entry as the first parameter.

The source tag is one of the most powerful aspects of CpmFetch calls. It allows you to define (in simple terms) where to get images from.

In the documentation it will look like:

void cpm_viewRandomMediaFrom (mixed $source , int $rows, int $columns, [array $options = ""]);

Most of that will look familiar. The new one is $source. This is a string that you can pass in. Currently CpmFetch supports the following types to be passed in as a source: cat, album, owner, keyword, or text.

For now, we will focus on cat and album - these allow you to select specific categories and / or specific albums.

Most of the time you will be using something like:

"cat=5,6" - Use photos from categories 5 or 6

or

"cat=5,6:album=10" - Use photos from categories 5 or 6 or album 10.

Now, you can combine these however you want. The order does not matter, but you can only have one of each in your source string. You can list multiple entries by separating them with commas. Different types need to be separated by colons.

 :)