Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: going directly to intermediate screen  (Read 6699 times)

0 Members and 1 Guest are viewing this topic.

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
going directly to intermediate screen
« on: October 17, 2015, 11:47:38 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: going directly to intermediate screen
« Reply #1 on: October 21, 2015, 10:12:07 am »

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.
Logged

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
Re: going directly to intermediate screen
« Reply #2 on: October 24, 2015, 12:40:16 am »

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





Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: going directly to intermediate screen
« Reply #3 on: October 30, 2015, 02:21:12 pm »

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:
Code: [Select]
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
Logged

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
Re: going directly to intermediate screen
« Reply #4 on: October 31, 2015, 12:23:11 am »

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
Logged

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
Re: going directly to intermediate screen
« Reply #5 on: November 04, 2015, 12:49:30 am »

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
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: going directly to intermediate screen
« Reply #6 on: November 04, 2015, 02:59:48 am »

If your menu link can be altered by PHP code... a simple SQL statement like this will give you the pid you want:
Code: [Select]
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...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Re: going directly to intermediate screen
« Reply #7 on: November 04, 2015, 09:20:11 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.
Logged

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
Re: going directly to intermediate screen
« Reply #8 on: November 04, 2015, 11:48:08 am »

Α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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: going directly to intermediate screen
« Reply #9 on: November 04, 2015, 12:19:48 pm »

Create a new PHP file in your gallery root (e.g. start.php or redirect.php) and add the following code to it:
Code: [Select]
<?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.
Logged

bobmiers

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foxglove Software
Re: going directly to intermediate screen
« Reply #10 on: November 05, 2015, 01:08:42 pm »

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

Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.