going directly to intermediate screen going directly to intermediate screen
 

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

going directly to intermediate screen

Started by bobmiers, October 17, 2015, 11:47:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bobmiers

Hi everyone,
A quick question.

Using CPG 15.38 and theme=curve_altmenu, only 1 Album; only Admin should be able to modify the album content. No guest info i.e. comments to be allowed.

Currently only running on localhost (XAMPP).  As soon as I can resolve this issue, will be going live.

The is my first time attempting to use CPG so your help will be greatly appreciated.

I have searched for the answer to this question in the Help File and on the forum.  I suspect that the info is there, but I couldn't find it.

1)   Is there a method to go directly to the intermediate screen? If so, point me to the instructions.
Thanks,
Bob Miers

Αndré

If you're talking about skipping the thumbnails page, please have a look at this thread: http://forum.coppermine-gallery.net/index.php/topic,70107.msg352503.html#msg352503

If not, please post more details from which point you want to be directed to the intermediate-sized picture page.

bobmiers

Hi Αndré,
Thank you for your quick response to my question.
Yes, I was attempting to skip the thumbnail page. We are interested in using Coppermine as a simple slideshow type of presentation.  Thus, there is no need for guest users to start higher up the chain than the intermediate presentation.
I believe that I followed your directions, but when I open Coppermine as guest via a link in my php page or from a desktop shortcut, I am started at the thumbnail presentation.
Since the curve_altmeu theme didn't have the functions:
theme_display_album_list
theme_display_album_list_cat
I copied n' pasted them at the end of the Curve_altmeu theme.php file. (Right before the "?>" statement.
Using the search code that you supplied I located the 2 occurances.  I then added the 'global$USER;' etc. code above the 'if (is_array($alb_list)) {' statement in each of the functions.

I then located the short '{ALB_LINK_TGT}' => line of code and replaced it with the long line of code from you post.

I then made sure that the curve_altmeu was specified in the CPG config.

I then test by using a desktop shortcut that points to:
http://localhost/WoodmereAssociatesNoFlash/cpg15x/index.php which in turn is calling the template.html file in the curve_altmenu folder.  I've edited the template file to reflect the basic layout of the rest of the pages of the site.

The index file runs, but I'm shown the thumbnail presentation rather than the intermediate presentation.

Did I miss something in my editing or did I do it incorrectly?

Your help is greatly appreciated.

Bob Miers






Αndré

index.php is not the thumbnail view, that would be thumbnails.php. That's what I expected you want to skip and that's why the mod doesn't work as expected for you.

However, in your case I'd create a simple redirect rule in your web server, that redirects from index.php to either displayimage.php?pid=1#top_display_media or displayimage.php?pid=1&slideshow=5000#top_display_media - depending if you immediately want to start the slideshow or just want to view the intermediate-sized picture.

Just create a .htaccess file in your gallery root with the following content:
Redirect /WoodmereAssociatesNoFlash/cpg15x/index.php http://localhost/WoodmereAssociatesNoFlash/cpg15x/displayimage.php?pid=1&slideshow=5000#top_display_media

See also https://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect

bobmiers

Hi Αndré

You were correct in your assumption.

I followed your suggestion (and code) and the 1st time I tested I got an error... nothing serious, just that I had deleted/removed 6 of the photos in the gallery because they had used an incorrect watermark file - my fault when I created the watermark.  So the 1st pid in the database was "7".  I changed the code to point to "7" and everything worked as expected.

Thank you very, very, very much.

Bob Miers

bobmiers

Hello everyone,

Recently I asked a question regarding bypass the thumbnail page.  Αndré was kind enough to answer and gave me a method to accomplish the task.  His response was to use a redirect command in the .htaccess file.  That method worked as expected.  For reference: http://forum.coppermine-gallery.net/index.php?topic=78433.0

What I ended up doing was to take a part of the redirect command and put it into my menu.  (I'm only using CPG on 1 page of my site). This also works. 

The portion of the redirect that I inserted into my menu is:

./cpg15x/displayimage.php?pid=1&#top_display_media

A little background:  I made a typing error in the watermark.png file that I only discovered after uploading 5 test photographs into CPG. I fixed my typing error and then deleted the photographs using the CPG delete function.(I previously had deleted another photo.) I then proceeded to upload the photos once more.

When I made a test run of the one page, it crashed indicating that there was no "pid=1" in the database.  Examination via phpMyAdmin reviled that the "pid" of my photos started with 7 not 1.

I then changed the menu item code to reflect pid=7 and it worked again.  As a follow up, I change the code back to a "1" and then used phpMyAdmin to edit the pid number of the 1st record back to a "1".  This also worked.

Looking ahead, the number of photos and the photos themselves will be constantly changing as time progresses, so is there a method to have the "pid number" portion of the command examine the database and select the 1st existing record?

(I tested to see if there was a break in the "pid" number sequence and that works correctly—showing the photos for existing pid's.)

As always any help will be greatly appreciated.

Bob Miers

gmc

If your menu link can be altered by PHP code... a simple SQL statement like this will give you the pid you want:
SELECT `pid` FROM `cpg_pictures` ORDER BY `pid` LIMIT 1
(use your defined CPG table prefix of course...)
Execute the SQL and get the result - a single pid representing the first picture in gallery.

If you can't update the menu link dynamically - it will need to route to a page that determines the right link via SQL and redirects.

Placing a pic you will never delete at PID 1 might be a simple workaround...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

Quote from: gmc on November 04, 2015, 02:59:48 AM
route to a page that determines the right link via SQL and redirects.

I recommend this solution, as it will be needed for the .htaccess redirect anyway.

bobmiers

Αndré & gmc

Thanks for the quick replies.

gmc.... I had though of doing the "Placing a pic you will never delete at PID 1 might be a simple workaround..." and may do that as a quick workaround to get the site "live".

I think that I'll spend some time working on a php page the gets a valid pid.

Thanks again,
Bob Miers

Αndré

Create a new PHP file in your gallery root (e.g. start.php or redirect.php) and add the following code to it:
<?php
define
('IN_COPPERMINE'true);
require_once (
'include/init.inc.php');

get_meta_album_set(0);
$pid mysql_result(cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} AS r $RESTRICTEDWHERE ORDER BY pid ASC LIMIT 1"), 0);
header("Location: displayimage.php?pid={$pid}#top_display_media");


Now you just need to use that file as target for your menu button and .htaccess redirection rule. I also added some check in case your "first" picture has restricted access.

bobmiers

Hi Αndré
Your last post was way above the call of duty.  Obviously, it saved me a lot of time, but probably cost me a learning experience.
Anyway, your efforts are greatly appreciated.
Bob Miers