Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Forum Plugin: Avatar in {SYS_MENU}  (Read 4545 times)

0 Members and 1 Guest are viewing this topic.

KyleClarkeNZ

  • Coppermine newbie
  • Country: nz
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • NZ Game Collectors
Forum Plugin: Avatar in {SYS_MENU}
« on: May 23, 2012, 08:37:30 am »

Hi,

I'm wondering if someone could please help me with a little mod to the CPG Forum Plugin. I'd like to use the users avatar as the icon next to "My Profile" instead of the yellow no-face-man icon. I'm sure it's really simple but I'm still trying to figure out some of this php/sql stuff.

Thanks in advance,

Kyle
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Forum Plugin: Avatar in {SYS_MENU}
« Reply #1 on: May 23, 2012, 02:34:18 pm »

Copy the function theme_main_menu from themes/sample/theme.php to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
$param = array(and above, add
Code: [Select]
    $my_prof_ico = cpg_fetch_icon('my_profile', 1);
    if ($my_prof_ico && function_exists('forum_start')) {
        $avatar_image = mysql_result(cpg_db_query("SELECT fr_avatar FROM {$CONFIG['TABLE_USERS']} WHERE user_id = ".USER_ID), 0);
        if ($avatar_image && file_exists($avatar_image)) {
            $my_prof_ico = '<img src="'.$avatar_image.'" border="0" alt="" width="16" height="16" class="icon" />';
        }
    }

find
Code: [Select]
'{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1),and replace with
Code: [Select]
'{MY_PROF_ICO}' => $my_prof_ico,

Copy the function theme_admin_mode_menu from themes/sample/theme.php to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
if ($admin_menu == '') {(and below, add
Code: [Select]
            $my_prof_ico = cpg_fetch_icon('my_profile', 1);
            if ($my_prof_ico && function_exists('forum_start')) {
                $avatar_image = mysql_result(cpg_db_query("SELECT fr_avatar FROM {$CONFIG['TABLE_USERS']} WHERE user_id = ".USER_ID), 0);
                if ($avatar_image && file_exists($avatar_image)) {
                    $my_prof_ico = '<img src="'.$avatar_image.'" border="0" alt="" width="16" height="16" class="icon" />';
                }
            }

find
Code: [Select]
'{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1),and replace with
Code: [Select]
'{MY_PROF_ICO}' => $my_prof_ico,(twice).
Logged

KyleClarkeNZ

  • Coppermine newbie
  • Country: nz
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • NZ Game Collectors
Re: Forum Plugin: Avatar in {SYS_MENU}
« Reply #2 on: May 24, 2012, 07:15:52 am »

Wow, that's awesome. Thank you so much for your help. It's very clear and easy for me to try and figure out how you've done it. Really appreciate it.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Forum Plugin: Avatar in {SYS_MENU}
« Reply #3 on: August 28, 2012, 02:53:42 pm »

I edited the theme.php like you said but I don't see nothing.How can I ad an avatar to my profile?
Thanks
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Forum Plugin: Avatar in {SYS_MENU}
« Reply #4 on: August 29, 2012, 11:03:48 am »

How can I ad an avatar to my profile?
Exactly as explained above. If it doesn't work for you, double check the instructions and your theme.php file and if it still doesn't work, start a new thread and post more information (e.g. a link to your gallery, your theme.php file, which plugins you use, etc.).
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 21 queries.