TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,047
  • Total Topics: 21,336
  • Online today: 374
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 109
  • Total: 109

Latest Profile Photos

Started by wilsy, November 29, 2007, 08:27:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wilsy

Hi Dragooon,

Many thanks for the very quick response, it's really appreciated!

What I was looking for is a block that looks like: -

Male (checkbox)
Female (checkbox)
Profile Photos (checkbox)

Search Button

Regards,

Wilsy.

Dragooon

You can edit the echo commands and replace them with a checkbox image And about the search Button, Look at the TP Search code in Search Box.

wilsy

Thanks Dragoon,

It might be a little bit beyond me but I'll take a look ;)

Regards,

Wilsy.

wilsy

Hi Dragooon,

Well, after about a week I've finally given up on this. Would you be kind enough to help me out? ;)

I would be eternally grateful.

Regards,

Wilsy.

wilsy

Quote from: wilsy on December 02, 2007, 11:05:52 AM
Hi Dragooon,

Many thanks for the very quick response, it's really appreciated!

What I was looking for is a block that looks like: -

Male (checkbox)
Female (checkbox)
Profile Photos (checkbox)

Search Button

Regards,

Wilsy.

Quote from: Dragooon on December 02, 2007, 10:43:42 AM
It is easy,
For the Profile Photos Part Use
global $db_prefix, $ID_MEMBER, $settings;
$request = db_query("SELECT ID_PICTURE, ID_MEMBER
FROM {$db_prefix}profile_pictures
WHERE ID_MEMBER = $ID_MEMBER
ORDER BY ID_PICTURE DESC
LIMIT 1",__FILE__, __LINE__);
if(mysql_num_rows($request) > 0)
   echo 'Profile Photos : Yes';
else
   echo 'Profile Photos : No';
mysql_free_result($request);

Now for Gender you can use

$request = db_query("SELECT ID_MEMBER, gender
FROM {$db_prefix}members
WHERE ID_MEMBER = $ID_MEMBER
LIMIT 1",__FILE__,__LINE__);
$row = mysql_fetch_assoc($request);
if($row['gender'] == 1)
{
// The gender is male
echo 'Gender : <img src="',$settings['images_url'],'/Female.gif" />';
}
elseif($row['gender'] == 2)
{
// The gender is male
echo 'Gender : <img src="',$settings['images_url'],'/Male.gif" />';
}

I just wrote this while typing the reply so expect errors :P


Hi all,

I've still been trying to get the search block to work but with no joy. I guess it's just beyond what I'm capable of.

Can anybody help and provide the full code for this block? It would be just the best Christmas present ever :)

Regards,

Wilsy.

PfalzNacht

Hi!

How can i make it to show not the latest 5 pictures, but 5 random pictures?

wilsy

Hi,

Try this: -

global $db_prefix, $modSettings, $scripturl;

$sql = db_query ('SELECT p.ID_PICTURE, p.ID_MEMBER, p.title, p.time, p.filename, m.realName
FROM ' . $db_prefix . 'profile_pictures AS p, ' . $db_prefix . 'members AS m
WHERE p.ID_MEMBER = m.ID_MEMBER
ORDER BY RAND()
LIMIT 5', __FILE__, __LINE__);


$data = array();
while ($row = mysql_fetch_assoc ($sql)) {
$data[] = array (
'title' => $row['title'],
'thumb' => $modSettings['profile_pictures_url'] . '/' . $row['ID_MEMBER'] . '_' . $row['time'] . '_thumb.' . substr (strrchr ($row['filename'], '.'), 1),
'url' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . ';sa=pictures;view=' . $row['ID_PICTURE'],
'time' => timeformat ($row['time']),
'user' => $row['realName'],
'profile' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
);
}


echo '
<table cellspacing="0" cellpadding="10" border="0" ALIGN="center" width="100%">
<tr>';
foreach ($data as $picture)
{
echo '
<td><center>
<a href="', $picture['url'] ,'"><img src="' . $picture['thumb'] . '" alt="" /></a>
</center></td>';
}
echo '
</tr>
</table>';


Regards,

Wilsy

PfalzNacht


wilsy

Quote from: wilsy on December 22, 2007, 09:02:37 AM
Quote from: wilsy on December 02, 2007, 11:05:52 AM
Hi Dragooon,

Many thanks for the very quick response, it's really appreciated!

What I was looking for is a block that looks like: -

Male (checkbox)
Female (checkbox)
Profile Photos (checkbox)

Search Button

Regards,

Wilsy.

Quote from: Dragooon on December 02, 2007, 10:43:42 AM
It is easy,
For the Profile Photos Part Use
global $db_prefix, $ID_MEMBER, $settings;
$request = db_query("SELECT ID_PICTURE, ID_MEMBER
FROM {$db_prefix}profile_pictures
WHERE ID_MEMBER = $ID_MEMBER
ORDER BY ID_PICTURE DESC
LIMIT 1",__FILE__, __LINE__);
if(mysql_num_rows($request) > 0)
   echo 'Profile Photos : Yes';
else
   echo 'Profile Photos : No';
mysql_free_result($request);

Now for Gender you can use

$request = db_query("SELECT ID_MEMBER, gender
FROM {$db_prefix}members
WHERE ID_MEMBER = $ID_MEMBER
LIMIT 1",__FILE__,__LINE__);
$row = mysql_fetch_assoc($request);
if($row['gender'] == 1)
{
// The gender is male
echo 'Gender : <img src="',$settings['images_url'],'/Female.gif" />';
}
elseif($row['gender'] == 2)
{
// The gender is male
echo 'Gender : <img src="',$settings['images_url'],'/Male.gif" />';
}

I just wrote this while typing the reply so expect errors :P


Hi all,

I've still been trying to get the search block to work but with no joy. I guess it's just beyond what I'm capable of.

Can anybody help and provide the full code for this block? It would be just the best Christmas present ever :)

Regards,

Wilsy.

Hi all,

I hope you don't mind me giving this one a very gentle nudge. It may be that some people are back after the festive holidays and may be able to help.

Regards,

Wilsy.

Embrace

Can you make this so it shows just the most recently uploaded forum for the member who is viewing it...?

This website is proudly hosted on Crocweb Cloud Website Hosting.