<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Juicebox Support Forum — Juicebox and PHP 7.x [SOLVED]]]></title>
		<link>https://juicebox.net/forum/viewtopic.php?id=5184</link>
		<atom:link href="https://juicebox.net/forum/extern.php?action=feed&amp;tid=5184&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Juicebox and PHP 7.x [SOLVED].]]></description>
		<lastBuildDate>Thu, 01 Oct 2020 15:56:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17729#p17729</link>
			<description><![CDATA[<p>The other code <em>should </em>work fine. (I tested it myself under PHP 7.4.10 before posting it.)&nbsp; Maybe scandir() has been disabled in your web server&#039;s PHP configuration.<br />Anyhow, I&#039;m glad that my other suggestion worked for you.<br />Thank you for posting back to let me know. It&#039;s most appreciated!</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Thu, 01 Oct 2020 15:56:25 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17729#p17729</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17728#p17728</link>
			<description><![CDATA[<p>Omg! Thx so much mate for this help! Now it works with php 7.4. I changed this code:</p><div class="codebox"><pre><code>$ret[count($ret)]=$file;</code></pre></div><p>to</p><div class="codebox"><pre><code>$ret[]=$file;</code></pre></div><p>The other code made the gallery to behave weird =).</p><p>Thx again! =) Im closing this one! Have a nice weekend!</p>]]></description>
			<author><![CDATA[null@example.com (movietajm)]]></author>
			<pubDate>Thu, 01 Oct 2020 15:23:06 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17728#p17728</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17725#p17725</link>
			<description><![CDATA[<p>Just changing the line:<br /></p><div class="codebox"><pre><code>$ret[count($ret)]=$file;</code></pre></div><p>... to:<br /></p><div class="codebox"><pre><code>$ret[]=$file;</code></pre></div><p>... should hopefully resolve your problem (and be backwards compatible with older versions of PHP).</p><p>Edit:<br />In fact, here&#039;s an alternative one-liner for the entire GetDirArray function:<br /></p><div class="codebox"><pre><code>function GetDirArray($folder)
{
    return array_diff(scandir($folder), array(&#039;.&#039;, &#039;..&#039;));
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Wed, 30 Sep 2020 15:27:54 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17725#p17725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17724#p17724</link>
			<description><![CDATA[<p>Ok, thx mate. Here is the code!</p><div class="codebox"><pre><code>&lt;?php
header(&quot;Content-type: application/xml&quot;);
function GetDirArray($folder)
{
    $handle=opendir($folder);
    while ($file=readdir($handle))
    {
        if ($file!=&quot;.&quot; &amp;&amp; $file!=&quot;..&quot;)
        {
            $ret[count($ret)]=$file;
        }
    }
    closedir($handle);
    sort($ret);
    return $ret;
}
$gallery=GetDirArray(&#039;images&#039;);
$gallery=array_reverse($gallery);
echo &#039;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#039;;
echo &#039;&lt;juiceboxgallery useFlickr=&quot;false&quot; maxThumbColumns=&quot;7&quot; captionPosition=&quot;BELOW_IMAGE&quot; buttonBarPosition=&quot;OVERLAY_IMAGE&quot; galleryTitlePosition=&quot;NONE&quot; backgroundColor=&quot;rgba(18,18,18,1)&quot; topBackColor=&quot;rgba(0,0,0,0.5)&quot; thumbFrameColor=&quot;rgba(204,204,204,1)&quot; thumbHoverFrameWidth=&quot;3&quot; thumbSelectedFrameWidth=&quot;5&quot; topAreaHeight=&quot;5&quot; stagePadding=&quot;10&quot; showOpenButton=&quot;true&quot; showExpandButton=&quot;false&quot; showThumbsButton=&quot;true&quot; showImageOverlay=&quot;ALWAYS&quot; showOverlayOnLoad=&quot;true&quot; showImageNumber=&quot;false&quot; maxCaptionHeight=&quot;45&quot; captionHAlign=&quot;CENTER&quot; showSplashPage=&quot;NEVER&quot; showInfoButton=&quot;false&quot; screenMode=&quot;LARGE&quot; showSmallPagingText=&quot;false&quot; showSmallThumbsButton=&quot;false&quot; showSmallThumbsOnLoad=&quot;false&quot; backButtonUseIcon=&quot;true&quot; showImageNav=&quot;ALWAYS&quot; captionBackColor=&quot;rgba(0,0,0,0.4)&quot; useLargeImages=&quot;false&quot; resizeOnImport=&quot;true&quot; maxImageWidth=&quot;2048&quot; maxImageHeight=&quot;1536&quot; showNavButtons=&quot;false&quot; flickrShowTitle=&quot;false&quot; showAutoPlayButton=&quot;false&quot; useFullscreenExpand=&quot;false&quot; useThumbDots=&quot;false&quot; expandInNewPage=&quot;TRUE&quot; showThumbsOnLoad=&quot;true&quot; galleryTitle=&quot;The Neighbourhood Gallery&quot; enableDirectLinks=&quot;false&quot; imageNavPosition=&quot;IMAGE&quot; thumbNavPosition=&quot;CENTER&quot; buttonBarHAlign=&quot;RIGHT&quot;&gt;&#039;;
for ($i=0; $i&lt;sizeof($gallery); $i++)
{
    echo &#039;&lt;image imageURL=&quot;images/&#039;.$gallery[$i].&#039;&quot; thumbURL=&quot;images/&#039;.$gallery[$i].&#039;&quot; linkURL=&quot;&quot; linkTarget=&quot;&quot;&gt;&#039;;
    echo &#039;&lt;title&gt;&lt;![CDATA[&#039; . pathinfo($gallery[$i], PATHINFO_FILENAME) . &#039;]]&gt;&lt;/title&gt;&#039;;
    echo &#039;&lt;caption&gt;&lt;/caption&gt;&#039;;
    echo &#039;&lt;/image&gt;&#039;;
}
echo &#039;&lt;/juiceboxgallery&gt;&#039;;
?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (movietajm)]]></author>
			<pubDate>Wed, 30 Sep 2020 15:14:25 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17724#p17724</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17715#p17715</link>
			<description><![CDATA[<p>Thank you for the links to your galleries.</p><p>I see that you are using a custom PHP file (named &#039;config.php&#039;)&nbsp; to dynamically generate your gallery&#039;s XML data.<br />The problem lies somewhere within this file (which is not part of the Juicebox package).<br />There is something within this file that is not compatible with PHP 7.2 onwards.</p><p>Unfortunately, I do not have access to your &#039;config.php&#039; file to inspect its code but opening it directly in a browser reveals the following warning:<br /></p><div class="quotebox"><blockquote><p><em>Warning:&nbsp; count(): Parameter must be an array or an object that implements Countable in config.php on line 10</em></p></blockquote></div><p>Your use of the PHP count() function (whatever it may be) on line 10 is listed in the &#039;Backward incompatible changes&#039; on the &#039;Migrating from PHP 7.1.x to PHP 7.2.x&#039; support page <a href="https://www.php.net/manual/en/migration72.incompatible.php">here</a>.</p><div class="quotebox"><blockquote><p>An E_WARNING will now be emitted when attempting to count() non-countable types (this includes the sizeof() alias function).</p></blockquote></div><p>In order for your &#039;config.php&#039; file to be compatible with PHP 7.2 onwards, you&#039;ll need to find a new PHP method to count whatever it is that you are counting.</p><p>I hope this points you in the right direction.<br />If you continue to experience difficulties, then please zip and upload your &#039;config.php&#039; file somewhere (and provide a download link) so that I can inspect the code and hopefully help further.<br />Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Tue, 29 Sep 2020 19:23:52 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17715#p17715</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17712#p17712</link>
			<description><![CDATA[<p>Ok thx. I have made testmaps here for you:</p><p><a href="https://zeerux.com/php-test-71">https://zeerux.com/php-test-71</a>&nbsp; &nbsp; &nbsp; working! (check <a href="https://zeerux.com/php-test-71/info.php)">https://zeerux.com/php-test-71/info.php)</a><br /><a href="https://zeerux.com/php-test-74">https://zeerux.com/php-test-74</a>&nbsp; &nbsp; &nbsp; not working! (check <a href="https://zeerux.com/php-test-74/info.php)">https://zeerux.com/php-test-74/info.php)</a></p><p>(its the exact same folders, I have used modified the .htaccess for specified php-versions.</p>]]></description>
			<author><![CDATA[null@example.com (movietajm)]]></author>
			<pubDate>Tue, 29 Sep 2020 14:27:35 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17712#p17712</guid>
		</item>
		<item>
			<title><![CDATA[Re: Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17707#p17707</link>
			<description><![CDATA[<p>That&#039;s very strange...</p><p>With the exception of the Download Button (<strong>showDownloadButton=&quot;TRUE&quot;</strong>) and Password Protection (<strong>usePassword=&quot;TRUE&quot;</strong>), Juicebox-Pro does not need or use PHP at all.</p><p>I have just uploaded two test galleries to my own web space (one with both the Download Button and Password Protection and one with neither) and they both run fine under PHP 7.2.33, 7.3.22 and PHP 7.4.10.</p><p>I think there must be something else going on when you switch PHP versions as PHP is not required for a gallery&#039;s configuration file to be found.</p><p>If possible, please post back with a link to the gallery in question (under PHP 7.2, PHP 7.3 or PHP 7.4) so that I can see the problem for myself and investigate further.</p><p>Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Sun, 27 Sep 2020 09:53:32 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17707#p17707</guid>
		</item>
		<item>
			<title><![CDATA[Juicebox and PHP 7.x [SOLVED]]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=17706#p17706</link>
			<description><![CDATA[<p>Hi. I have been running Juicebox Pro with PHP 5.6 for several years and now it was time to upgrade. So I discovered that if I use PHP 7.0 or PHP 7.1 everything works perfect but if I use PHP 7.2, 7.3 och 7.4 I get this message on the gallery:<br />&quot;Juicebox Error: Config XML file not found.&quot; If I change back to 7.1 the gallery works again?</p>]]></description>
			<author><![CDATA[null@example.com (movietajm)]]></author>
			<pubDate>Sat, 26 Sep 2020 19:27:23 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=17706#p17706</guid>
		</item>
	</channel>
</rss>
