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 [2]   Go Down

Author Topic: Getting Member Avatars to be Displayed in index.php ?  (Read 17632 times)

0 Members and 1 Guest are viewing this topic.

dumbo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 112
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #20 on: March 20, 2008, 10:09:04 am »

paste following code into the theme.php you're using right before the final ?>

Code: [Select]
function loginForm($logged=1) {

global $CONFIG, $lang_loginform, $REFERER;

//if (!$CONFIG['enable_loginform']) return $loginFormHtml = "";

if (!USER_ID && $CONFIG['enable_loginform']) {
  $loginFormHtml = <<<EOT
<ins>
    <form action="login.php?referer=$REFERER" method="post" name="loginbox" style="margin:0; padding:0;">
        <table cellpadding="0" cellspacing="3" border="0">
        <tr>
            <td><input type="text" class="textinput" name="username" size="10" /></td>
            <td><input type="password" class="textinput" name="password" size="10" /></td>
            <td><input name="submitted" type="submit" value="Login" />
            <input name="remember_me" type="hidden" class="checkbox" value="1" checked="checked" /></td>
        </tr>
        <tr>
        <td class="smallfont">$lang_loginform[user]</td>
        <td class="smallfont">$lang_loginform[pass]</td>
        <td></td>
</tr>
        </table>
        </form>
</ins>
EOT;
}

if (USER_ID) {

if ($CONFIG['enable_avatar']) {
if (AVATAR_URL !="") $avatar_url = "<a href='profile.php?op=edit_profile'><img src='".AVATAR_PATH.AVATAR_URL."' class=\"image\"></a>";
else $avatar_url="&nbsp;";
    $edit_profile_form_param[] = array('textplain', $avatar_url, $lang_register_php['manage_avatar']);

if (isset($_GET['uid'])) {
$user_data = $cpg_udb->get_user_infos($_GET['uid']);
$avatar_url = $user_data['avatar_url'];
if ($avatar_url !="") $avatar_url = "<img src='".AVATAR_PATH.$avatar_url."' class=\"image\">";
}
$loginFormHtml = "<span style=\"float: right\">".$avatar_url."</span>";
} else $loginFormHtml = NULL;

$loginFormHtml .= "<div align=\"right\" class=\"smallfont\">".$lang_loginform['welcome']." <strong>".(USER_NAME)."&nbsp;</strong><br />";


if ($CONFIG['display_pms_status']){
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_PMS']} WHERE owner=".(USER_ID));
list($tot_all_messages) = @mysql_fetch_array($result);
mysql_free_result($result);
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_PMS']} WHERE owner=".(USER_ID)." AND showed='0'");
list($tot_new_messages) = @mysql_fetch_array($result);
mysql_free_result($result);

if ($CONFIG['pms_enabled']) {
$loginFormHtml .= "<a href='pms.php'>".$lang_loginform['pms']."</a> ".$tot_new_messages.$lang_loginform['unread_total'].$tot_all_messages."&nbsp;</div>";
}
}

if ($CONFIG['display_buddy_status']){
// get some buddy data
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_BUDDY']} WHERE user_id=".(USER_ID));
list($tot_all_buddies) = @mysql_fetch_array($result);
mysql_free_result($result);
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_BUDDY_REQ']} WHERE buddy_to=".(USER_ID));
list($tot_new_buddies) = @mysql_fetch_array($result);
mysql_free_result($result);

if ($CONFIG['enable_buddy']){
$loginFormHtml .= "<div align=\"right\" class=\"smallfont\"><a href='buddy_manage.php'>".$lang_loginform['friends'].":</a> ".$tot_new_buddies." ".$lang_loginform['request'].", ".$lang_loginform['active']." ".$tot_all_buddies."&nbsp;</div>";
}
}

}
  return $loginFormHtml;
}

works fine Stram but when we click on the use names from the user list or the online status it shows error ...else things working fine , please tell me how to fix this , i tried the above mentioned codes exactly
Logged

dumbo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 112
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #21 on: March 20, 2008, 10:34:04 am »

also plaicing avatar image using place holder possible  :) , i am new to php
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #22 on: March 21, 2008, 06:31:22 pm »

possible... but then you have to do a lil bit more coding

dumbo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 112
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #23 on: March 23, 2008, 07:56:28 am »

Please do it staramm actually now i got to complete my Aero theme at any cost :)
Got to get that control on avatar's positioning ..would be great if its has a place holder. once this is done lil work on my skin also will be completed

I wish i Knew php  :'(

Working on a gif based theme for sick IE :) .
Logged

dumbo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 112
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #24 on: March 23, 2008, 08:04:06 am »

Stramm Hope u have read through the erron i am getting , its on reply 20...
Logged

seros

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #25 on: August 12, 2008, 05:23:32 am »

I tried to apply this code in the theme.php (oranje theme) but actually the avatar s shown, BUT if I click on my profile i just get empty white pages.
So where can I find the login form which is already somewhere in some file? I think I need to make changes in there.
Thanks Stramm :)
Logged

seros

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #26 on: August 12, 2008, 02:09:23 pm »

solved
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #27 on: August 12, 2008, 11:23:56 pm »

Why don't you tell us how you solved your issue for the benfit of others with similar issues? That's the point of a support board.
Logged

seros

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 85
Re: Getting Member Avatars to be Displayed in index.php ?
« Reply #28 on: August 13, 2008, 07:54:51 am »

Late at night I was just too tired, sorry. Hope this is the solution, for me it worked.

remove this part from the code:
Code: [Select]
if (isset($_GET['uid'])) {
$user_data = $cpg_udb->get_user_infos($_GET['uid']);
$avatar_url = $user_data['avatar_url'];
if ($avatar_url !="") $avatar_url = "<img src='".AVATAR_PATH.$avatar_url."' class=\"image\">";
}
« Last Edit: August 13, 2008, 09:50:09 am by Joachim Müller »
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.018 seconds with 20 queries.