TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,046
  • Total Topics: 21,335
  • Online today: 319
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 195
  • Total: 195

Linking from block

Started by trvlnman, April 18, 2008, 01:26:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

trvlnman

I am putting this here because I am not sure where else it might go.

I am using the following:

SMF 1.1.4 w/ Apollo
TP 0.9.8
CPG 1.4.16
cmpFetch 2.1.1

I have CPG installed and bridged and I have added a button on the main menu that will take me there.  It all works as it should.

However, I also have a frontpage block that I use with cpmFetch to pull the most recent additions to the gallery.  I am having a problem getting the links from those images to work correctly.

What I would like to happen is I would like it to act just like it does when I select the CPG button.  It loads the gallery on the page and keeps the main SMF / TP menu items (Home, Forum, etc etc.).  The link it goes to is:

http://mysite.com/index.php?action=coppermine

This takes me to the home page of the gallery.

I have an override to point it to the following link from my cpmFetch to link me to the lastup album, which is a meta album that keeps track of the last added images.  This link is:

http://mysite.com/coppermine/displayimage.php?album=lastup&cat=0&pos=0

Even though the image is incorrect (that's a separate post to the cpmFetch folks), it still takes me to a standalone Coppermine page that does not have the forum still wrapped around it.

What I would like to know is there some way that I can designate a link that will take me into coppermine, and have it execute the displayimage.php program that will keep the gallery page within the forum.

I have looked at using an Iframe, but it duplicates the SMF menu from within the window, so that is not working correctly either.

I'll try any suggestions, and appreciate the help.

G6Cad

The only way to open coppermine withiin SMF and TP is to use iframe with in an article

A search for "iframe coppermine" will lead to several posts on how to make it happen

trvlnman

I have the iFrame working from the CPG button.  What I want to be able to do is link from a image pulled using copFetch and go to that image in the Coppermine iFrame without it ruining the integrity of the SMF / TP page.  I have been looking through what I have found with the "iFrame Coppermine" search.

Ianedres

My solution to a direct jump to an album or category within Coppermine under SMF/TP was something like this:

a) Create a script to load Coppermine in an IFRAME; uses 'cat' or 'album' in the URL to load a specific target.
b) Load the above script in a PHP article within TP using an 'include' statement.
c) Link to the TP article and add the 'cat' or 'album' in the URL that corresponds to your intended target.

i.e. yourserver.com/index.php?page=cpg_frameload&cat=12

I named the TP article 'cpg_frameload' (or you can use the article number) and the URL loads the article; the '&cat=12' appended to the end would load category 12. Using '&album=4' would go to album 4. (If you specify both, then it go to the category...)

I placed the script below on my server (so that I could easily edit it with Dreamweaver) but you could do this all in one article.

There are some other variables that you can use in the URL to adjust the IFRAME; look for the dynamic comment about scrolling, frameboard, height, width, etc.

Hope this helps, or at least gets you started in the right direction. Could have sworn that I shared this somewhere...  8)

<?php

// Iframe Direct Jump To Category Or Album
// 'cpg_frameload.php' : October 29, 2007
// Tim Antley / www.BayouMX.com

// For Use With Coppermine Photo Gallery
// Implemented Into Simple Machines Forum / Tiny Portal
// Load iFrame For Category Or Album Directly

// Specify 'cat=xx' or 'album=xx' In Load Statement In URL link
// i.e. -> www.domain.com/index.php?page=cpg_frameload&cat=10 <-

$cpg_path = '../media_server'; // Use the relative path to your CPG installation

// Sets Default Values For Frame Parameters; Adjust Once For Your Forum's Display Needs
$scrolling = 'auto'; // Values: 'yes', 'no', or 'auto'
$frameborder = '0';
$marginwidth = '0';
$marginheight = '0';
$vspace = '0';
$hspace = '0';
$height = '2500px'; // Be sure to follow with 'px' after the numerical amount.
$width = '100%'; // Be sure to follow with '%' after the numerical amount.

// No Need To Edit Below This Line
// ______________________________________________________________________________________________

// Dynamically Adjust Frame Parameters From URL Values (Not Usually Needed But Provided For)
if(isset($_GET['scrolling'])) $scroll = $_GET['scrolling'];
if(isset(
$_GET['frameborder'])) $frameborder = $_GET['frameborder'];
if(isset(
$_GET['marginwidth'])) $marginwidth = $_GET['marginwidth'];
if(isset(
$_GET['marginheight'])) $marginheight = $_GET['marginheight'];
if(isset(
$_GET['vspace'])) $vspace = $_GET['vspace'];
if(isset(
$_GET['hspace'])) $hspace = $_GET['hspace'];
if(isset(
$_GET['height'])) $height = $_GET['height'];
if(isset(
$_GET['width'])) $width = $_GET['width'];

// Default Page To Load If 'cat' or 'album' Not Specified
$var = 'index.php';

// Check For 'cat' Or 'album' In URL; 'cat' Has Priority Over 'album'
if(isset($_GET['cat']))
{
$var = 'index.php?cat='.$_GET['cat'];
}
else
{
if(isset($_GET['album'])) $var = 'thumbnails.php?album='.$_GET['album'];
}

// Output iFrame HTML Statement With Variables
echo '<iframe scrolling="'.$scrolling.'" frameborder="'.$frameborder.'" id="myframe" src="'.$cpg_path.'/'.$var.'" marginwidth="'.$marginwidth.'" marginheight="'.$marginheight.'" vspace="'.$vspace.'" hspace="'.$hspace.'"  height="'.$height.'" style="width: '.$width.'"></iframe>';

// End Of Script
?>

This website is proudly hosted on Crocweb Cloud Website Hosting.