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
-
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?
-
Use the USER_ID constant.
-
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.
-
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.
-
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. :(
-
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.
-
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