Member
Member
ctdlg   2024-10-22, 14:15
#1
Hello,

I would like to add some more options to my plugin.
I need to get values of next and previous images links available in the keyboardnav-extended.php plugin.

I can declare
global $precedant; // for nexturl
global $suivant; // For prevurl

but I cannot declare those variables as global in keyboardnav-extended.php

Links I want to get in my plugin are in keyboardnav-extended.php plugin :
document.location.href = '<?php echo htmlspecialchars_decode($nexturl); ?>';
document.location.href = '<?php echo htmlspecialchars_decode($prevurl); ?>';

I will then be able to use the joystick of a vr headset to navigate easily !
(I use a-frame, It does use my right controller with plain text links
https://aframe.io/docs/1.6.0/introduction/ )


Member
Member
ctdlg   2024-10-23, 07:28
#2
Problem solved :

I get variables from "image.php" instead of "keyboardnav-extended.php"

I can now use the VR controller joystick to reach next or previous image if available.

Those images are equirectangular pictures : they are displayed in 360° view in headsets.
Administrator
Administrator
acrylian   2024-10-23, 08:44
#3
I am not sure you really neeed new globals. You can just use the $_zp_current_image global object as you can get the next/prev image via the object model, too.

$nextimg = $_zp_current_image->getNextImage();
$previmg = $_zp_current_image->getPrevImage();
$nextimg_url = $nextimg->getLink();
$previmg_url = $previmg->getLink();

You need to declare globals within every function you wish to use them.
Member
Member
ctdlg   2024-10-25, 12:47
#4
Thanks acrylian,
Using your zenphoto variables gives me a shorter code in my macro.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.