forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: ian ditch on November 27, 2005, 12:57:30 am

Title: show posters profile details in anycontent.
Post by: ian ditch 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


Title: Re: show posters profile details in anycontent.
Post by: ian ditch 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

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.british-babes.co.uk%2F1.jpg&hash=8e463cef18a1b29ef065ad36bc46eb1ee00093bc)

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
Title: Re: show posters profile details in anycontent.
Post by: ian ditch on November 29, 2005, 11:14:53 pm
Anyone?
Title: Re: show posters profile details in anycontent.
Post by: Nibbler 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.
Title: Re: show posters profile details in anycontent.
Post by: ian ditch on November 29, 2005, 11:47:35 pm
Hi Nibbler , thanks for your reply,

Take a look HERE (http://www.british-babes.co.uk/temp/thumbnails.php?album=5)

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.
Title: Re: show posters profile details in anycontent.
Post by: Nibbler 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);
Title: Re: show posters profile details in anycontent.
Post by: ian ditch 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?
Title: Re: show posters profile details in anycontent.
Post by: Nibbler on November 30, 2005, 12:13:11 am
Same as before.

Code: [Select]
Name :  <?echo $user['user_name'] ?>
Title: Re: show posters profile details in anycontent.
Post by: ian ditch on November 30, 2005, 12:18:00 am
Nibbler, You are a God!

Excellent Software, even Better Support.


Thank you so much