Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Forum Plugin: Avatar in {SYS_MENU}  (Read 5679 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: 15764
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: 15764
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.02 seconds with 20 queries.