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: Login Form  (Read 6854 times)

0 Members and 1 Guest are viewing this topic.

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Login Form
« on: June 29, 2006, 06:03:21 pm »

Hi all

Since installing Stramm's Mod Pack I've added the {LOGIN_FORM} to my custom theme but now I want to add the pic count to the {LOGIN_FORM} for every indiviual member.

I have transfered the loginForm function from theme.inc.php to my theme.php but just want to add this inditional info.

Any help will be great

Thanks, will
« Last Edit: June 30, 2006, 08:07:14 pm by Stramm »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Login Form
« Reply #1 on: June 29, 2006, 07:05:12 pm »

before
Code: [Select]
  return $loginFormHtml;add
Code: [Select]
$result = cpg_db_query("SELECT count(pid) FROM {$CONFIG['TABLE_PICTURES']} WHERE  owner_id = '" . USER_ID . "'");
$count = mysql_result($result,0);
mysql_free_result($result);
$loginFormHtml .= $count;

of course you'll need to do some formatting

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Login Form
« Reply #2 on: June 29, 2006, 07:06:45 pm »

oh, I forgot to say that this of course will suck some resources and isn't recommended for busy sites

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Login Form
« Reply #3 on: June 29, 2006, 08:25:36 pm »

Thanks Stramm, got it to work.

The following info I formatted is: Covers Uploaded: 8271
The above is what I see when I login but if I logout I see: Covers Uploaded: 0

I turned off in config: Display login form

So when I logout without the info I have added I see nothing but since I have added this above info I see: Covers Uploaded: 0

So every member will see this even tho they have logged out ???
Is there anyway of removing this with the pm & buddys when the members logout ???

Any help will be great

Thanks, will ;D
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Login Form
« Reply #4 on: June 29, 2006, 08:52:51 pm »

move that block up one bracket
means add it before
Code: [Select]
}
  return $loginFormHtml;

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Login Form
« Reply #5 on: June 29, 2006, 09:06:06 pm »

Hi Stramm

What I have is:

}
                        return $loginFormHtml;
      }

?>

This is after the added info.

With that added I get: Parse error: parse error, unexpected '}' in /home/content/w/i/l/willtaka05/html/gallery/themes/cdcover/theme.php on line 125 ???
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Login Form
« Reply #6 on: June 30, 2006, 08:56:31 am »

lol, OK, after
Code: [Select]
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."</div>";
}
}
add
Code: [Select]
$result = cpg_db_query("SELECT count(pid) FROM {$CONFIG['TABLE_PICTURES']} WHERE  owner_id = '" . USER_ID . "'");
$count = mysql_result($result,0);
mysql_free_result($result);
($count==0) ? $count = '' : $count = "<div align=\"right\" class=\"smallfont\">You have uploaded $count pics</div";
$loginFormHtml .= $count;

it's now already formatted... you can see where I hope. If a user hasn't uploads $count is set to display nothing. Only if a user is logged in and has already uploaded pics it gets displayed

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Login Form
« Reply #7 on: June 30, 2006, 07:01:34 pm »

Thanks Stramm ;D ;D ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.