forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: will on June 29, 2006, 06:03:21 pm

Title: Login Form
Post by: will 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
Title: Re: Login Form
Post by: Stramm 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
Title: Re: Login Form
Post by: Stramm 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
Title: Re: Login Form
Post by: will 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
Title: Re: Login Form
Post by: Stramm on June 29, 2006, 08:52:51 pm
move that block up one bracket
means add it before
Code: [Select]
}
  return $loginFormHtml;
Title: Re: Login Form
Post by: will 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 ???
Title: Re: Login Form
Post by: Stramm 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
Title: Re: Login Form
Post by: will on June 30, 2006, 07:01:34 pm
Thanks Stramm ;D ;D ;D