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: Can I get a parameter from album list of control panel?  (Read 5538 times)

0 Members and 1 Guest are viewing this topic.

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Can I get a parameter from album list of control panel?
« on: August 16, 2013, 11:25:17 am »

Dear developers,

I made a plugin, and I think, I will use this plugin more than once on index.php. Can I use or call this plugin with parameters from album list? Like you: "catlist,4" -> "myplugin,(parameter)"? Ex.: myplugin,rand\myplugin,lastn\myplugin,lastup\alblist ?

Thanks,
Mykee
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Can I get a parameter from album list of control panel?
« Reply #1 on: August 20, 2013, 03:41:39 pm »

I don't get what you're asking for. If you want to add different content to the main page, I suggest to use different keywords instead of the same keyword concatenated with another keyword. I'm not sure if this will work at all.
Logged

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Re: Can I get a parameter from album list of control panel?
« Reply #2 on: August 21, 2013, 07:59:23 am »

I need use same plugin on index.php, but with different parameters, like coppermine albums (random, latest, etc.). Can I add parameter on configure site or not? (like row numbers: "lastn,4")
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Can I get a parameter from album list of control panel?
« Reply #3 on: August 21, 2013, 10:36:48 am »

Sure, but it's only possible to add numbers, no strings. Have a look at the plugin hook:
Code: [Select]
$matches = CPGPluginAPI::filter('plugin_block', $matches);
I assume we're talking about your "isotope" plugin. If so, you implemented the filter incompletely:
Code: [Select]
function isotope_mainpage()needs to be
Code: [Select]
function isotope_mainpage($matches)
If you now add something like
Code: [Select]
isotope,42to the content of the main page, you're able to use that additional number in your isotope_mainpage function.

Code: [Select]
print_r($matches);will return
Code: [Select]
Array
(
    [0] => isotope,42
    [1] => isotope
    [2] => 42
)
which means, that you can access your additional number via $matches[2].
Logged

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Re: Can I get a parameter from album list of control panel?
« Reply #4 on: August 21, 2013, 10:50:01 am »

Thanks for great help! Yes, this is isotope plugin, where I think put latest and random gallery with isotope - more gallery on index page. I will try your help at aftertnoon, and develop this plugin with more function.
I'd like this: if add a parameter, then select more gallery on one page at twice or more, if not add parameter, then select under config what see on frontpage.
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Re: Can I get a parameter from album list of control panel?
« Reply #5 on: August 22, 2013, 06:16:05 pm »

Parameter works now. :) Thanks for help!
(I'm sad: I cannot add one plugin more than once to parameter list. :( )
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Can I get a parameter from album list of control panel?
« Reply #6 on: August 22, 2013, 08:46:44 pm »

I cannot add one plugin more than once to parameter list
Do you mean you cannot enter something like
Quote
isotope,1/isotope,4/isotope,12
? As far as I know that should be possible, at least I'm quite sure I tested that with the default options (lastup, etc.).
Logged

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Re: Can I get a parameter from album list of control panel?
« Reply #7 on: August 22, 2013, 09:31:21 pm »

Hmmm... Working now, if use more than one in parameter list, but isotope script no runned when second gallery showed. TipTip or Adipoli worked, just isotope not. :(
I will search why not. Thanks!
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php

mykee

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: hu
  • Offline Offline
  • Gender: Male
  • Posts: 140
    • One moment from Hungary
Re: Can I get a parameter from album list of control panel?
« Reply #8 on: August 22, 2013, 11:25:45 pm »

I rewrited my plugin id's, script, because if use plugin more at once, then category filter and isotope script not worked correctly. Check my website for this solution, this worked. Many thanks for great and usefull help!
If anyone need this plugin, I can publish it, but JQuery licenses is different on each script (Isotope, TipTip, Adipoli and LightBox) what includes in this plugin! Often free for personal use, but for commercial use not. I made this for better gallery start page :)
Logged
My gallery and demo for AnythingSlider, Photocols and CollagePlus plugin: http://foto.acegem.hu/index.php
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.