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: show posters profile details in anycontent.  (Read 4548 times)

0 Members and 1 Guest are viewing this topic.

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
show posters profile details in anycontent.
« on: November 27, 2005, 12:57:30 am »

I am using an 'Any Content' file then using starttable("100%", "Members Details"); to create a table showing the members details who own this category...

In this table I want to show the details of the member who owns this category...Eg. Their Name, Their age etc
( I have altered 'Occupation' in lang/english.php to 'Your Age'. (I know  have to call 'Occupation' to show their age!))

I have kind-off got this to work by using as shown below, but This shows MY details...I need it to show the <u>MEMBERS</u> details

I need to get this to work to fit into my theme so any help would be appreciated


my db_query

Quote
$result = db_query("SELECT user_id, user_occupation FROM {$CONFIG['TABLE_USERS']} ORDER BY user_id DESC LIMIT 1");

then to get their name i've used

Quote
$user_name = get_username($user_id);

and to show this in an html section i've used

Quote
Name :  <?echo $user_name?>


As I said, This does work but it shows the current viewers details, I Need it to show the posters details


« Last Edit: November 30, 2005, 12:19:58 am by Nibbler »
Logged

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: show posters profile details in anycontent.
« Reply #1 on: November 28, 2005, 04:39:56 pm »

O.K, let me rephrase this...

If I go to

'Home->User Galleries -> admin ' it shows 'admin' in the breadcrumb

(http://www.british-babes.co.uk/1.jpg)

Now, this must be taken from the database.

I simply want to know how to get the current categorys details from the database. eg their name, location etc

Please Help
Logged

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: show posters profile details in anycontent.
« Reply #2 on: November 29, 2005, 11:14:53 pm »

Anyone?
Logged

Nibbler

  • Guest
Re: show posters profile details in anycontent.
« Reply #3 on: November 29, 2005, 11:19:21 pm »

Post a link to where you are using this, I don't understand where this code is fitting in.
Logged

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: show posters profile details in anycontent.
« Reply #4 on: November 29, 2005, 11:47:35 pm »

Hi Nibbler , thanks for your reply,

Take a look HERE

This is just a test site while I work out how to get these details from the database.

I created a member called Test1 and created this album when logged in as Test1.

I am trying to get 'Test1' details (name, location etc) from the database and then show them in the anycontent block at the bottom of the page.
Logged

Nibbler

  • Guest
Re: show posters profile details in anycontent.
« Reply #5 on: November 29, 2005, 11:56:07 pm »

See where this gets you

Code: [Select]
$aid = (int) $_GET['album'];
$result = db_query("SELECT u.* FROM {$CONFIG['TABLE_USERS']} AS u INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.category - " . FIRST_USER_CAT . " = u.user_id AND a.aid = '$aid'");
$user = mysql_fetch_assoc($result);
print_r($user);
Logged

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: show posters profile details in anycontent.
« Reply #6 on: November 30, 2005, 12:08:10 am »

Right Nibbler, Thats brought all of the correct details from the database, now how do I show them in the html part of the page?
Logged

Nibbler

  • Guest
Re: show posters profile details in anycontent.
« Reply #7 on: November 30, 2005, 12:13:11 am »

Same as before.

Code: [Select]
Name :  <?echo $user['user_name'] ?>
Logged

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: show posters profile details in anycontent.
« Reply #8 on: November 30, 2005, 12:18:00 am »

Nibbler, You are a God!

Excellent Software, even Better Support.


Thank you so much
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.