Linking to phpBB Referral mod Linking to phpBB Referral mod
 

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]

Main Menu

Linking to phpBB Referral mod

Started by Jimbo_Test, October 20, 2005, 10:15:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jimbo_Test

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?

Nibbler


Jimbo_Test

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.

Nibbler

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.

Jimbo_Test

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. :(

Nibbler

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

<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

<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:

// 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:

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

Jimbo_Test

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