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
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
$param = array(
and above, add
$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
'{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1),
and replace with
'{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
if ($admin_menu == '') {(
and below, add
$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
'{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1),
and replace with
'{MY_PROF_ICO}' => $my_prof_ico,
(twice).
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.
I edited the theme.php like you said but I don't see nothing.How can I ad an avatar to my profile?
Thanks
Quote from: allvip on August 28, 2012, 02:53:42 PM
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.).