Link to personal wrapped gallery in posts Link to personal wrapped gallery in posts
 

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

Link to personal wrapped gallery in posts

Started by Pyrobon, October 01, 2006, 07:16:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pyrobon

Hello!
I successfully created a link to my Coppermine Gallery in the SMF forum menu where the gallery shows wrapped into SMF.
However, i have linsk under every member avatar in posts that leads to their personal gallery and i can't manage to show them wrapped.
This is how the mod for the wrapped coppermine gallery works:

You add this in the index.php file from the forum:
'Coppermine' => array('Coppermine.php', 'Coppermine'),

Create a Coppermine.php file in the Sources folder of the forum with this:
<?php


if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine()
{
global $context$mbname$txt;


//Load the main msn template
loadtemplate('Coppermine');

//Load the main msn template
$context['sub_template']  = 'main';


//Set the page title
$context['page_title'] = $mbname $txt['coppermine'];
}
?>


Create a Coppermine.template.php file in your theme folder with this:
<?php
/*
SMF MSN Page
Version 1.0
Created By Alan S
*/
 
function template_main()
{
global $db_prefix$scripturl$txt$user_info,$settings$modSettings;

 echo 
' <center><iframe width="900" height="1500" src="http://www.cobayas.net/cpg149"></iframe></center>';
   
}
?>


And then add the link to the action=coppermine in your forum menu.
Since i know very little about php, the only idea that came to my mind for doing the same with the links under the avatar was to mimic this mod
I added this in the index.php:

'Coppermine2' => array('Coppermine2.php', 'Coppermine2'),

I created a Coppermine2.php file with this:
<?php


if (!defined('SMF'))
die('Hacking attempt...');

function 
Coppermine2()
{
global $context$mbname$txt;


//Load the main msn template
loadtemplate('Coppermine2');

//Load the main msn template
$context['sub_template']  = 'main';


//Set the page title
$context['page_title'] = $mbname $txt['coppermine'];
}
?>


I created a Coppermine2.template.php with this:
<?php
/*
SMF MSN Page
Version 1.0
Created By Alan S
*/
 
function template_main()
{
global $db_prefix$scripturl$txt$user_info,$settings$modSettings;

 echo 
' <center><iframe width="900" height="1500" src="http://www.cobayas.net/cpg149/index.php?cat='$message['member']['id']+10000'"></iframe></center>';
   
}
?>


And added the link below the avatar in the Display.template.php file of the forum:
echo '

<a href="', $scripturl, '?action=Coppermine2"> <img src="http://www.cobayas.net/forum/Themes/babylon/images/gallery.gif" alt="Galeria Personal" border="0" /></a><br /><br />';


The link definitely leads to a wrapped coppermine, but not to the personal gallery of the member it's supposed to go. It goes to an anonymous member, and it seems like its not adding the "$message['member']['id']" part to the link, so it always goes to the 10000 member, not the 10001 or 10002 :P I don't know why this happens so i was wondering if some of you could give me a hand on this.

My english is not very good so sorry about that too. Thanks!

Coppermine Install: www.cobayas.net/cpg149
Forum Install: www.cobayas.net/forum
Coppermine version: 1.4.9
Forum version: SMF 1.1 RC3
Test user account: prueba / 1234

Bridge manager settings:
Forum url: www.cobayas.net/forum
Relative path to your BBS's config file:  ../forum/
Use post-based groups?:  0

Nibbler

$message is not in scope where you try to use it. You need to add it to the global.

Pyrobon

All right! Thanks! I'll find out what to add  ;)