Recent posts - Page 7 Recent posts - Page 7
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Recent posts

#61
cpg1.6 permissions / Re: Cannot access as admin
Last post by lurkalot - August 25, 2024, 01:19:23 PM
I noticed your theme has "<!--Coppermine Photo Gallery 1.6.21 (stable)-->" at the bottom of the source code.  Did you update all your theme files correctly?
#62
cpg1.6 permissions / Re: Cannot access as admin
Last post by tomwert - August 25, 2024, 12:21:04 PM
I am adding one domain location if that helps

https://www.weinclub77.ch/Coppermine/index.php
#63
cpg1.6 permissions / Re: Cannot access as admin
Last post by tomwert - August 25, 2024, 12:19:15 PM
Hi there
My location is Switzerland. This explains time lag. I opperate Coppermins for more than 10 years! I opperate Coppermine on 3 different domains. One domain s using 1.6.10 since 2022 without any problems at all.

Recently the server made changes and I could not access the 2 domains using 1.5.48 at all. I checked with your web site and have seen it ist  nescessary to update. So I have updated to 1.6.26. Now I cannot access on these two sites my admin account. Cannot upload no more.

O have done follwowing: after update to 1.6.26 and no access to admin, I have deleted all files (exept album data) and wanted to install 1.6.10 to see if it runs.No success. I have then re-installed 1.6.26 more then two times but no success. No access to admin.

I have tried to make update but I am asked to enter admin, wich does not work. Using waterdrop give sthe same result with no access to admin.

I ask again, in which file admin entries as stored?

Hope for a serious help.
BR tomwert
#64
cpg1.6 permissions / Re: Cannot access as admin
Last post by ron4mac - August 24, 2024, 04:23:38 PM
Can you post a link to your gallery? It may be that you are using a theme that is not compatible with CPG 1.6.x

also ...

Did you run the update?
<gallery-url>/update.php

Try with a different theme to see if it is a theme issue.
<gallery-url>/index.php?theme=water_drop
#65
cpg1.6 permissions / Cannot access as admin
Last post by tomwert - August 24, 2024, 03:04:29 PM
After undating form 1.5.48 to 1.6.26 I can see my previous album datas. But I cannot access the admin section. I have entered during installation my user and pw but nothing works. In which file of the installation on my server can I find my admin pw? Thanks for your help.
#66
cpg1.6 plugin contributions / Re: Email Comments for...
Last post by rsgj0098 - August 10, 2024, 03:34:35 PM
Just installed this plugin on 1.6.26 (bridged with SMF 2.0.14) and it seems to work, but I'm getting complaints from users that they get emails every time someone posts a comment on a picture they're subscribed to. On another site I use (with older versions of Coppermine and SMF) it's configured that emails are only sent for the first comment made since the user last visited that picture, they get no more until they visit again (hope that makes sense..!)

Is it possible to do that with this plugin..? I really want to have the email notification feature, but not for every single comment, as if a thread gets busy, it clogs up peoples' email inboxes.

Thanks,

Ria  :-*
#67
cpg1.5 miscellaneous / Re: CPMfetch for 1.5.6
Last post by 406man - August 10, 2024, 10:36:02 AM
Quote from: AnnieHoney on May 16, 2024, 09:15:48 PMSorry for ressucitating such an old thread.

On version 2.0.1 and php 8 I get a
I tried installing that dev version, but it seems to support mysql only and I'm on mysqli, so all I get is a blank page.
Is there a fix for this?
I've updated the cpmfetch code to V2.2 and tested it with PHP 8.2.19 so what you want to do ought to work with the new version. See here (Link updated for the new domain and forum):
https://coppermine-gallery.com/forum/index.php/topic,80812.0.html

Quote from: AnnieHoney on May 16, 2024, 09:15:48 PMAlso, what's the code for Latest Added Albums, not media?
There are a number of options although I'm not sure if they will fit your needs. Could you clarify what you want to do and I'll recommend one of the options. Alternatively you could just try out the examples using the new testfetch test program

Another point - this forum thread is for Coppermine 1.5.x but the cpmfetch new version 2.2 will only run with Coppermine 1.6.x. I've tested it with 1.6.25 and higher and would not recommend using anything older than 1.6.25.
#68
cpg1.6 plugin contributions / Re: MiniCMS for CPG 1.6....
Last post by mustachio - August 09, 2024, 08:07:26 AM
Hi, I'm running cpg1.6.26 and I'm getting this error when I go to install the plugin:

`Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /home/vol2_8/epizy.com/epiz_34139048/htdocs/plugins/minicms/configuration.php:38 Stack trace: #0 /home/vol2_8/epizy.com/epiz_34139048/htdocs/plugins/minicms/configuration.php(38): in_array('english', NULL) #1 /home/vol2_8/epizy.com/epiz_34139048/htdocs/pluginmgr.php(329): include('/home/vol2_8/ep...') #2 /home/vol2_8/epizy.com/epiz_34139048/htdocs/pluginmgr.php(725): display_plugin_list() #3 {main} thrown in /home/vol2_8/epizy.com/epiz_34139048/htdocs/plugins/minicms/configuration.php on line 38`

Is there a simple change I can make on my side to fix this? I was able to find the line it's talking about, but I don't know enough about PHP to actually fix it. Thank you!
#69
Mods: content syndication (cpmFetch) / Linking Wordpress to a Copperm...
Last post by 406man - August 08, 2024, 04:16:14 PM
Introduction
I've described this topic in some depth as it was my main reason for getting involved with cpmfetch and I hope readers find it useful. I updated the cpmfetch code to Version 2.2 as described elsewhere in this forum so it could be used here. Wordpress is said to be the most popular site building tool on the Internet so there ought to be interest in linking it to a Coppermine gallery and I'm sharing the revised code with other users in this forum. You don't have to follow what I've done. This is the way I went about it and you might prefer some other method. If you have a different method, do share with us here what you did. The principles should be capable of being adapted to suit other types of web site but these are not described here as I don't have experience of them.

Principles
My main principles were:
- keep the code as simple as possible
- minimise the number of times when the Wordpress configuration has to be changed
- put the cpmfetch commands in a file which can be used in both live and test environments

Wordpress has a widely-used feature known as a shortcode which allow lines of PHP code to be added to a page. A shortcode looks like this:
[wpcode id="3548"].
To add the shortcode to a page either:
i) Use the Wordpress page editor
ii) or, if you use a plugin site builder like Elementor use its editor

The PHP code is written in a "snippet" which is given the shortcode. To maintain the snippet needs a plugin. I used the WPCode Lite plugin in its free basic mode and found it both reliable and easy to use. Initially I used Code Snippets and didn't get on with it at all. It was awkward to use and crashed. WPCode allows the PHP code to be added in the snippet and associated with the shortcode. The PHP snippet code for cpmfetch to fetch a grid of pictures using my recommended method has just two lines:

require '../your-gallery/cpmfetch/cpmrun.php';
cpmrun("cpmfetchsetup3.inc.php");


The PHP snippet code for a slide show is:

require '../your-gallery/cpmfetch/cpmrun.php';
cpmrun("cpmslideshowsetup5.inc.php");


In both cases above, adjust the directory reference and setup file name to suit your web site.

cpmrun.php is an included file containing a function called cpmrun which sets up the cpmfetch environment and calls the setup file. The setup file is passed into cpmrun as an argument. It knows whether an image grid or slideshow is wanted based on the name of the setup file passed in. If you change the setup file name - apart from the suffix as previously described – it probably won't work. A screenshot of the wpcode plugin is attached.

The setup file can be used with the test programs testfetch.php or testslideshow.php to check that the cpmfetch commands are working as expected. A huge advantage of this method is that the setup file can be tested with the test program and then used in the Wordpress snippet without any changes. Use of test programs and Include files is described in a separate article.

Using WPCode
When using WPCode to create a snippet it will automatically create the shortcode. This means the code snippet should created before the web page is edited to add the shortcode. Use the drop down button on the right side of the page to tell WPCode that you are entering a PHP Snippet. Paste in the PHP code, then press the Update button. Be sure to activate the shortcode using the Active slider button beside the Update button. The plugin will check the PHP syntax and warn of any problems including whether it can find the Include file in the Require statement. When the snippet has been accepted the shortcode can be copied from the lower part of the WPCode page. The web site page can then be edited to add a shortcode and the actual shortcode pasted in.

If you have difficulty at this stage one thing that can be done is to replace the code snippet with the very simple PHP code:

echo "Hello there"; 

When the web page is displayed the message "Hello there" should appear and will confirm whether the snippet and shortcode have been created correctly.

Relative Directory Reference
When implementing a code snippet for the first time, an area that could potentially cause you a problem is the directory reference in the require statement. If you get this wrong the plugin will complain when you update the snippet as it's not valid PHP code and cpmfetch can't run. On the up side, once you have it working it won't need changing unless you move your Wordpress code – which most people won't do. The structure is what is known as a relative directory reference so it has to consider the starting point and end point. In both my live and development environments the directory structure looks like this:

Wordpress is in directory /www/wp/  and the URL to access it is: https://www.mydomain.com/wp/index.php
The gallery is in directory /www/gallery/ and the URL to access it is:
https://www.mydomain.com/gallery/index.php
The cpmfetch code is in its own subdirectory so the URL for the test fetch program will be:
https://www.mydomain.com/gallery/cpmfetch/testfetch.php

www is a directory that can be seen when accessing the hosting space using a file transfer utility such as filezilla or WinSCP but doesn't appear in URLs

To figure out what the relative directory reference looks like involves comparing the two URLs. If you think of the two directory structures as a pyramid-like hierarchy and you were standing in the wp directory, to get to the cpmfetch directory you have to go up one level to the domain, then down to the gallery directory, then down again to the cpmfetch directory. So the Relative Directory Reference is:
UP ONE LEVEL   >>   DOWN ONE LEVEL TO gallery  >>   DOWN ONE LEVEL TO cpmfetch
which can be translated to :  ../  gallery /  cpmfetch  /   
Remove the spaces above to create the Require statement:   
require "../gallery/cpmfetch/cpmrun.php";
Note how the Relative Directory Reference and file name are surrounded with double quotes and a semi-colon added at the end.

If your directory structure means you need to go up two levels from Wordpress to www the Require statement will look like:
require '../../gallery/cpmfetch/cpmrun.php';

If the relative directory reference is wrong you will see an error message like the following when you try to view the page in Wordpress:

Warning: require(../gallery /cpmfetch/cpmrun.php): Failed to open stream: No such file or directory in C:\wamp64\www\wp\wp-content\plugins\insert-headers-and-footers\includes\class-wpcode-snippet-execute.php(292) : eval()'d code on line 1

Background: in wpcode the block of code in the snippet is stored in a single PHP variable. The variable is then executed as code using PHP's built-in eval function. This explains the "eval'd code" part of the error message.

Appearance
If you've followed the method I described and developed your cpmfetch code using included setup files and the testfetch or testslideshow test programs  you'll have an initial view of how the images or slideshow will look. Prepare for a possible shock when you view the same in Wordpress. It may well be the case that the CSS styling in your theme or plugin alters the image and text appearance to fit in with its own style. You may need to change the size or alignment of the images to get it all to fit.  This is where the power of the include files comes in because you only have to change the setup file and not the code in the snippet in Wordpress. Just change the include file, depending on where your environment is located, copy the include file to the hosting space if you have external hosting space, check how it looks by running the test program in the web browser, then if you are happy refresh Wordpress.

You might wish to have multiple sets of pictures from your gallery appearing in your Wordpress site. Each set needs its own shortcode and setup file

Summary
If you've followed the description above, I hope you've found that linking Wordpress with a Coppermine Gallery is straightforward. Similar principles can be used with other types of web site.
#70
Mods: content syndication (cpmFetch) / Cpmfetch V2.2 Test Programs an...
Last post by 406man - August 08, 2024, 04:11:59 PM
Cpmfetch can be awkward to get working until you are familiar with it and, even then, it's easy to make silly mistakes during the development process. I've introduced a new way of working for V2.2 to make it easier to get cpmfetch commands working before integrating them into Wordpress and other types of web site. I recommend those who are new to cpmfetch use this method but it's entirely optional and someone experienced with cpmfetch might prefer to continue the old way of working.

The principle it that the cpmfetch commands are written in a small, simple file which is read into other programs when needed. In the IT world this is often known as an Include file. Web site developers only have to change this Include file. The test program reads in the Include file and displays the results. When this process is complete and delivers the results that are wanted the same Include file is run from Wordpress or other web site without having to change it. This should hopefully mean fewer mistakes and technical errors. When integrating the results into Wordpress there can be unexpected changes in appearance due to the CSS styling applied by the Wordpress theme or plugin. Having a simple test program means the basic appearance can be developed first, then integrated into Wordpress / other web site and revised to suit in an iterative process.

There are two test programs:
testfetch.php   This tests cpmfetch when it returns a simple grid of pictures or text
testslideshow.php This tests the slideshow feature
The Include files are all in the /inc sub-directory below the main cpmfetch directory
Both of them can work with many different Include files. I'll explain how you select the Include file to use. The principles are the same for both test programs but the file names are different

testfetch.php
It tries to include a file called cpmfetchsetup.inc.php     If this exists, it always uses it. If it doesn't exist it looks for similarly named files: cpmfetchsetup*.inc.php     where * can be any text which I've called the suffix. This allows you to develop multiple configurations each with its own name. For example, you might have Wordpress shortcodes (more about this in the Wordpress topic) numbered 508 and 509 for two different places where you pull in pictures from your gallery. You could name your setup files cpmfetchsetup508.inc.php  and cpmfetchsetup509.inc.php so you can easily recognise how they relate to the shortcode       When it finds a file with this pattern of name testfetch lists all of them and asks which one to use. Once chosen, the test program URL is updated so you can keep using that Include file by Refreshing the web browser after making changes. This method avoids the need to keep making changes to the Wordpress / web site configuration as only the Include file has to be changed.  Only update the Include file between the ===== divisions because the === section is used to recognise the code block. To run a test use the URL below, updated to suit your gallery:

https://www.yourdomain.com/yourgallery/cpmfetch/testfetch.php

The test program displays the cpmfetch code that has been used as I found this helped the development process.

testslideshow.php
This works in the same way as testfetch.php above, the only difference being that the Include files are named cpmslideshowsetup.inc.php     and  cpmslideshowsetup*.inc.php     

The Include files in the zip file should retrieve pictures from any gallery once the cpmfetch code is installed so I recommend running the unaltered Include files first, then rename them to something else and edit those copies to suit what you want to show on your web site.

The Include file for the slideshow has a lot more CSS styling to set up the basic appearance. Change it if you wish but be ready for the appearance to look strange and the Wordpress / web site styling will inevitably change it again.

Below is an example of an Include file for cpmfetchtest.php. I've split the $options definition over multiple lines as I think it's easier to read and spot any errors.

<?php
// cpmfetchsetup3.inc.php
//------------------------------------------------------------------------------------------------------------
// THIS SECTION CONTAINS THE PHP CODE TO BE USE BY ANOTHER APPLICATION, FOR EXAMPLE WORDPRESS. ADD YOUR
// CPMFETCH COMMANDS BETWEEN THE ===== LINES AND COMMENT OUT ANY LINES OF CODE YOU DON'T NEED USING //   
// DON'T TOUCH THE START OF CODE AND END OF CODE LINES
//============================================================================================================
//= Start of code for the application ==

$options = array(
'cellstyleproperties' => 'vertical-align:top',
'imageheight' => '250',
'imagesize' => 'int' ,
'subtitle' => 'Title: {{pTitle}}, Photographer: {{uUser_name}}',
'subtitlestyleproperties' => 'color:green;', 'subtitlelink' => 'x',
'tableattributes' => array("width" => "100%"),
'tablestyleproperties' => 'text-align:center; width:70%;margin-left:auto;margin-right:auto;vertical-align:top',
'windowtarget' => '_blank-js',
);
$objCpm-> cpm_viewRandomMediaFrom("album=228",2, 2, $options);

//= End of code for the application ==
//============================================================================================================

?>


The Include files all live in the /inc directory below the main cpmfetch directory. Don't change any of the directory structure or names as the coding will break. In the cpmfetch/inc/examples directory I've included a large number of example include files that create a grid of static images or text output. There are none for slide shows. They have very long names which indicate the cpmfetch function that they run. It means you don't have to type in the names and can hopefully avoid making typing errors. With a handful of exceptions which I'll explain they all work so you can check out the functionality without creating any Include files yourself. All you need to do is copy or move them up one level into the /inc directory and then run the test program. The exceptions are a couple of functions that need an Albumid passed in. I've included a number which works in my gallery but may not work in yours. The example Include files in their current form all choose images from the entire set of publically available images. You may wish to narrow down the set to, for example, a particular category or album, pictures uploaded since a certain date or pictures containing a particular keyword. These options are all possible and will require the source parameter in the Include file to be updated. For example "cat=5", "album=23,25" or "keyword=vacation2023".

Exceptions
cpm_listMediaCountForAlbum
cpm_viewMediaFromAlbum


Finally
Remember:
i) the Include files must be in the /inc directory to be able to be seen by the test programs and work correctly.
ii) if you have either cpmfetchsetup.inc.php or cpmslideshowsetup.inc.php present in the /inc directory, these will be run automatically and any others will not be seen. Rename them or delete if you wish to use other setup files.