Add a link to coppermine user gallery in viewtopic

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Add a link to coppermine user gallery in viewtopic
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
Hey im trying to add this to my forum so it will link the user's gallery in viewtopic.php here is the code


##############################################################
## MOD Title:      Coppermine User Gallery Link in View_Topic
## MOD Author:      Dicky <dicky@askmaggymae.com> http://dicky.askmaggymae.com/
## MOD Author:      Beaniebaby148 <beaniebaby148@msn.com> http://www.marc-online.org/
## MOD Author Primary:   Marc Townson <marconli@marc-online.org> http://www.marc-online.org/
## MOD Description:   This mod will add a link to your users gallery if used with the Linking PHPBB2 and Coppermine
##         tutorial. The link will be placed in the Profile area of each user e.g.
##         Gallery: Username's Gallery  -or-  Users Gallery: Click Here
## MOD Version:      1.0.1
##
## Installation Level:   Easy
## Installation Time:   5 minutes
## Files To Edit:   2
##         viewtopic.php
##         templates/subSilver/viewtopic_body.tpl       
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Copyright and special thanks!
## -----------
## This program is free software, you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation.
##
## This mod was made by Beaniebaby148 for his phpBB2 pre-loaded version.
##
## If you want to add this Mod to any database, please don't add
## my e-mail address to a topic, just point to my website (see above).
## (for spamming prevention)
##
## 2. Compatibility
## -----------
## This MOD is compatible with phpBB 2.0.18
##
## 3. Official last version link
## -----------
## Check this official link for latest updates...
## http://www.phpbb.com/phpBB/viewtopic.php
##
## 4. Manual edits are required for this MOD
## Please be sure to read the NOTES in the MOD.
## Edits ARE REQUIRED for Coppermine table prefix and album path
##
##############################################################
## MOD History:
##
## 2005/04/16 - Version 0.0.3
##  - Added query to display link only if user has an album
##  - Added check if user has uploaded to their own album and not a public album
##
## 2005/03/26 - Version 0.0.1
##   - Beta Edition Released
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

##############################################################
## Add link to View Topic
##############################################################
#
#-----[ OPEN ]-----------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
#
#-----[ AFTER ADD ]------------------------------------
## ** NOTE ** Change table prefix (cpg132_) to that of your Coppermine table - Line 93
## ** NOTE ** Change path to gallery to match your path - Line 98
// -- BEGIN Generate Coppermine Gallery User ID

   $gallery_poster = $postrow[$i]['username'];
   if ( $postrow[$i]['user_id'] > 1 )
   {
      $l_gallery_poster_id = ($postrow[$i]['user_id'] + 10000);
   }
   else
   {
      $l_gallery_poster_id = ($postrow[$i]['user_id'] + 1);
   }
// Check if the user has any albums in the Gallery
$sql = "SELECT * FROM `cpg132_albums` WHERE'" . $l_gallery_poster_id . "'= category";
$result = $db->sql_query($sql);
$uploaded = $db->sql_fetchrow($result);
if ( !empty($uploaded) )
{
$gallerylink = '<a href="./gallery/index.php?cat=' . $l_gallery_poster_id . '">' . $gallery_poster . '\'s Photo gallery</a>';
}
else
{
$gallerylink = '';
}
// -- END Generate Coppermine Gallery User ID
#
#-----[ FIND ]------------------------------------------
#
'U_MINI_POST' => $mini_post_url,
#
#-----[ AFTER ADD ]------------------------------------
#
      'L_GALLERY_LINK' => $gallerylink,
#
#-----[ OPEN ]-----------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{postrow.POSTER_FROM}
#
#-----[ AFTER ADD ]------------------------------------
#
<br />{postrow.L_GALLERY_LINK}
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM

i tried a few different things but no luck


Back to top Reply with quote
#2   re: Add a link to coppermine user gallery in viewtopic
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
nevermind got it to work thanks



Back to top Reply with quote
#3   re: Add a link to coppermine user gallery in viewtopic
real1
CZ Newbie
real1 has been a member for over 20 year's 20 Year Member
portugal.gif
Age: 48
Gender: Male
Website:
Status: Offline
Joined: Oct 15, 2004
0.00 posts per day
Posts: 9
Points: 1,472
   
Anyway here is the right topic in codewiz forum [ Register or login to view links on this board.]

i got it to work fine

try it icon_mrgreen.gif icon_wink.gif



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum