Announcement

  •  » Extensions
  •  » Menu Random Photo: Random Photo not everywhere

#1 2017-02-02 17:24:52

WuppiGER
Member
Germany
2016-05-31
38

Menu Random Photo: Random Photo not everywhere

Hello,

i use at the moment "Advanced Menu Manager" ... but i need only ONE function of this plugin: Random Photo. I found Menu Random Photo ... a good idea to change a big Plugin to an smaller one ...

But: MRP has a bug ... i've checked the code but i don't find them ...
Problem: I see on every Page the "Random-Photo"-Block. Fine. But only on Pages with Pictures, i see an random pic.

* Index -> only Categories => No random
* Index / Category => Only Categories => No random
* Index / Category / Category / Pictures => Pictures .... in see an random photo.
(Example: https://galerie.fotobastler.de/index/category/17 - no random; https://galerie.fotobastler.de/index/category/19 - random)

When i activated AMM (with Random Photo), i see on EVERY Page Random Photos ... One from AMM and one from MRP ... Both together. I think there is an error in the .tpl's ... i've checked every variable... content on every page ... But this content must be lost @ tpl....??!! Why?

Any Ideas?

MRP seems to be dead - last update 2y ago :(

Thx
Wuppi

PS:
Piwigo version: 2.8.6
PHP version: 7.0

Offline

 

#2 2017-02-10 17:35:16

romanf
Member
2017-01-22
40

Re: Menu Random Photo: Random Photo not everywhere

Hi Wuppi,

I have the same problem. Picture does not show. When I look at the code, it seems that it's missing the jQuery stuff, as my browser says:

ReferenceError: $ is not defined

which refers to a piece of Javascript on the page that reads like:

----
[...]
$(function() {
  $('#imrp_ill0').width(150);
  $('#imrp_ill0').height(150);

  var randomPict = MRP_Opt['pictures'];
  if (randomPict.length > 1) {
[...]
-----

Did you try contacting the developer of MRP?

Rgds
Roman

Offline

 

#3 2017-02-13 13:01:21

WuppiGER
Member
Germany
2016-05-31
38

Re: Menu Random Photo: Random Photo not everywhere

romanf wrote:

Hi Wuppi,

I have the same problem. Picture does not show. When I look at the code, it seems that it's missing the jQuery stuff, as my browser says:

ReferenceError: $ is not defined

which refers to a piece of Javascript on the page that reads like:

Did you try contacting the developer of MRP?

Rgds
Roman

no contact. MRP is dead - 2y ago last update ... i want find the missing code here and change it by myself.

MRP works, if AMM parallel runs (with Random Pic) ... so AMM should have this javascript set correctly ... MRP not ... copy missing code from AMM to MRP should work... mhhh but i don't find them.

Offline

 

#4 2017-02-13 13:39:20

WuppiGER
Member
Germany
2016-05-31
38

Re: Menu Random Photo: Random Photo not everywhere

ok i find a Quick-and-Dirty-Workaround! Thx for your idea!

You need the Plugin GPC (Grum Plugin Classes!)

Install: AMM (!)
copy: /plugins/AMenuManager/js/amm_randomPictPublic.js
to: /plugins/MenuRandomPhoto/workaround.js

Open: /plugins/MenuRandomPhoto/main.inc.php
find:   $conf['MRP'] = unserialize($conf['MRP']);
insert AFTER:

Code:

#check without, don't work -> inserert: GPCCore::addHeaderJS('jquery', 'themes/default/js/jquery.min.js');
GPCCore::addHeaderJS('amm.randomPictPublic', 'plugins/MenuRandomPhoto/workaround.js', array('jquery'));

Delete: AMM (!)
Clear Compiled Templates

=> It works now ... BUT it don't works on an picture-Page (mhhhh)

You Need an Plugin (GPC) for an Workaround - not a good idea ... i know. Better way: integrate the content of workarcound .js into the tpl. I do not know how to do it!

Quick and Dirty!
Does someone clean it solved?! I can't JavaScript :(

Offline

 

#5 2017-02-13 13:58:31

romanf
Member
2017-01-22
40

Re: Menu Random Photo: Random Photo not everywhere

Hi Wuppi,

I'll try this evening. I think the JS from menu_random_photo.js.tpl needs to be split in two parts:
- Lines 1-15 remain in the template because they are filled with the cached data during build of the page
- Lines 17-end go into a separate JS file that is loaded in the way that GPCCore is adding extra JS *at the end of the page* (then jQuery should be loaded already).

-Roman

Offline

 

#6 2017-02-13 18:29:11

romanf
Member
2017-01-22
40

Re: Menu Random Photo: Random Photo not everywhere

Hi Wuppi,

I think I found the fix. Do you know how to submit the fixes?

-Roman

PS: You from Germany? I'm from Switzerland... maybe german would be easier. hehe

Offline

 

#7 2017-02-14 10:57:48

WuppiGER
Member
Germany
2016-05-31
38

Re: Menu Random Photo: Random Photo not everywhere

romanf wrote:

Hi Wuppi,

I think I found the fix. Do you know how to submit the fixes?

-Roman

PS: You from Germany? I'm from Switzerland... maybe german would be easier. hehe

Top! ;)

Yes ... i am from Germany ;)

Maybe ;) But this is the English-speaking forum :=)

--------------

Ja wäre einfacher ;) Bin auf den Fix gespannt wenn online ist.

Aber ein Feature-Request bekommste auf deutsch: Adminbereich - im TPL dafür: Bild-Rotation - das Limit mit 10.000ms ist im "<form>" hinterlegt - und nur dort ist es limitiert - alle 10sek ist etwas .... viel.... Traffic (nicht nur des Seitenbetreibers [egal - meist eh Flat] ... aber zumindest in DE ist Mobilfunk-Traffic ein wertvolles Gut *G* ich hab das auf 100.000 hoch gesetzt und arbeite momentan mit 45.000ms - also 45sek - erstmal)

Offline

 

#8 2017-02-14 15:04:04

romanf
Member
2017-01-22
40

Re: Menu Random Photo: Random Photo not everywhere

WuppiGER wrote:

Aber ein Feature-Request bekommste auf deutsch: Adminbereich - im TPL dafür: Bild-Rotation - das Limit mit 10.000ms ist im "<form>" hinterlegt - und nur dort ist es limitiert - alle 10sek ist etwas .... viel.... Traffic (nicht nur des Seitenbetreibers [egal - meist eh Flat] ... aber zumindest in DE ist Mobilfunk-Traffic ein wertvolles Gut *G* ich hab das auf 100.000 hoch gesetzt und arbeite momentan mit 45.000ms - also 45sek - erstmal)

English: remove upper limit of delay

I will change it so that the GUI shows seconds (instead of ms, but still storing it as ms to keep backward compatibility) and remove the upper limit completely.

Currently I'm waiting for the Admins to make me co-maintainer of the extension... as soon as that is done, I will be able to upload my changes and create a newer version. :)

-Roman

Offline

 

#9 2017-02-20 17:58:33

romanf
Member
2017-01-22
40

Re: Menu Random Photo: Random Photo not everywhere

I've posted a diff under this thread: http://piwigo.org/forum/viewtopic.php?p … 39#p166839

If you need the files... let me know how I can send them to you. :)

-Roman

Offline

 
  •  » Extensions
  •  » Menu Random Photo: Random Photo not everywhere

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact