forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: Jimbo_Test on October 20, 2005, 10:15:05 am

Title: Linking to phpBB Referral mod
Post by: Jimbo_Test on October 20, 2005, 10:15:05 am
I'm using the phpBB Referral mod which creates urls in the following format...

/board/rp_center.php?mode=referralcp&u=xxx

where xxx is the profile number of the user.

How do I recreate the same link in my Coppermine pages - ie, so that Coppermine automatically replaces the xxx with the correct phpBB profile number?
Title: Re: Linking to phpBB Referral mod
Post by: Nibbler on October 20, 2005, 10:23:31 am
Use the USER_ID constant.
Title: Re: Linking to phpBB Referral mod
Post by: Jimbo_Test on October 20, 2005, 05:17:11 pm
I'm a bit confused here.

What how would I use this to form a URL and where do I put it? Does it go in template.html or template.php? I'm a newbie to all of this.
Title: Re: Linking to phpBB Referral mod
Post by: Nibbler on October 20, 2005, 06:10:07 pm
Show me how you are creating the link currently and I will show you how to add the USER_ID to it. I can't give you code unless you tell me where you want the link to appear.
Title: Re: Linking to phpBB Referral mod
Post by: Jimbo_Test on October 20, 2005, 06:26:30 pm
Okay, the link can currently be found at http://www.modelsanctum.com/board/ in the right column entitled 'Earn Upgrade Points - Invite A Friend'

and it links to http://www.modelsanctum.com/board/rp_center.php?mode=referralcp&u=xxx where xxx is the user_id

I would like to create this link in exactly the same place on my Coppermine installation which can be found at

http://www.modelsanctum.com/portfolios/

I've not added link yet because each time I've tried, it buggers up. :(
Title: Re: Linking to phpBB Referral mod
Post by: Nibbler on October 20, 2005, 06:44:29 pm
OK, you need to setup that link as a custom footer. To do this you need to first modify your theme's template.html, finding

Code: [Select]
<a href="/board/template.php?page=10" target="_top"><img src="../../../images/button_upgrade_now.gif" width="120" height="23" border="0"></a>
and changing it to

Code: [Select]
<a href="{REF_LINK}" target="_top"><img src="../../../images/button_upgrade_now.gif" width="120" height="23" border="0"></a>
Then you need to modify your theme's theme.php, finding this:

Code: [Select]
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    echo $template_footer;
}

and changing it to this:

Code: [Select]
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

$template_vars = array(
'{REF_LINK}' => "http://www.modelsanctum.com/board/rp_center.php?mode=referralcp&u=" . USER_ID
);

echo template_eval($template_footer, $template_vars);
}

Save and upload the changes. I'm going to move this into themes as it's not really bridge related.
Title: Re: Linking to phpBB Referral mod
Post by: Jimbo_Test on October 20, 2005, 07:25:13 pm
Nibbler, thank you so much - it works perfectly, and best of all, I can apply this to other links like this.

And your reply was so quick - just long enough for me to make toast and coffee!  ;D ;D