show posters profile details in anycontent. show posters profile details in anycontent.
 

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]

Main Menu

show posters profile details in anycontent.

Started by ian ditch, November 27, 2005, 12:57:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ian ditch

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

QuoteName :  <?echo $user_name?>


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



ian ditch

O.K, let me rephrase this...

If I go to

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

(https://coppermine-gallery.com/forum/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


Nibbler

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

ian ditch

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.

Nibbler

See where this gets you


$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);

ian ditch

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?

Nibbler

Same as before.

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

ian ditch

Nibbler, You are a God!

Excellent Software, even Better Support.


Thank you so much