Author Topic: Additional fields, additional search and more - question [please help!]  (Read 5740 times)

0 Members and 1 Guest are viewing this topic.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Hello,

i hope you can really help me on this, because it is very important to me. I try to use my 4images gallery also as an "dating" service, so i modified the profile to look like a normnal dating site - ok.

I added gender, city (country), age and some other details for each member. I have two small problems:

When a new user registers, i added the gender and the location, but when i add the birthday fields it doesnt work. There are the dropdown options, but there are no numbers or months in it just nothing. Maybe i have to register that field in the register.php? If yes, how dto do that? Actually if tried to put it in like this:

Code: [Select]
<tr>
<td class="cl_left"><b>{lang_user_birthday}</b></td>
<td class="cl_right">
<select name="birthday_day" style="width:50px;">
{dropdown_day}
</select>
<select name="birthday_month" style="width:98px;">
{dropdown_month}
</select>
<select name="birthday_year" style="width:75px;">
{dropdown_year}
</select>
</td>
</tr>

My second question is a little bit harder. I want to have two searches on my site, the regular search for images, comments etc., and new search just for users. So users can search for:

- username
- user age
- user gender
- user country/city
- show only user with picture / yes or no

Is there a way to do this? My site grows and too many users want that feature  :? :? I dont know what to do so i hope anyone can help me.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Additional fields, additional search and more - question
« Reply #1 on: February 09, 2006, 12:50:12 AM »
To make the additional fields searchable:
http://www.4homepages.de/forum/index.php?topic=1313.0

For the birthday problem:
In which format are your birthday values been saved in db?

If you want i can help you,
cause i build a little mod for myself for birthday entry with dropdownoptions,
which saves the birthday in a format like xxxx-xx-xx (year-month-day).
Saving in unix timestamp format causes some errors for birthdays before 1970.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Additional fields, additional search and more - question
« Reply #2 on: February 09, 2006, 12:54:08 AM »
I think i use the same MOD you are talking about, its called "User Age Version 1", that are the files :)
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4Images Mod - User Age                *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: user_age_install.php                                 *
 *        Copyright: (C) 2004 Michael Porr                                *
 *            Email: webmaster@exploreourplanet.net                       *
 *              Web: http://www.worlddiscovery.net                        *
 *    Scriptversion: 1.0                                                  *
 *                                                                        *
 *************************************************************************/
 
error_reporting(E_ALL);
 
//--- Constants -----------------------------------
//Mod Related Constants
define("MOD""User Age");
define("VERSION""1.0");
define("AUTHOR""Michael Porr");
define("MAIL""webmaster@exploreourplanet.net");
//Relevant Constants for the Installer
define('ROOT_PATH''./');

//--- Include files --------------------------------
include(ROOT_PATH.'config.php'); 
include(
ROOT_PATH.'includes/constants.php'); 
include(
ROOT_PATH.'includes/db_mysql.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{direction}">
<head>
<title><? echo(MOD . " Version: " . VERSION . " by " . AUTHOR . " for 4Images") ?></title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="style.css" />
</head>
<body>

<!-- The header, before and after the installation the same !-->
<div id="main">
<div id="header">
<? echo(MOD) ?> Mod Installer, Version <? echo(VERSION) ?> by <? echo(AUTHOR) ?> for 4Images
</div>

<?php
if(!isset($_POST['install']))
{
?>

<!-- First case: Before installation !-->
<div id="content">
<p>
Please check before the installation, that all parameters below are correct. If so, click the
Install-Button. Otherwise, something would be incorrect with your 4Images settings, so please check
it in advance, otherwise this installer-script won't work properly.
</p>
<p>
Have fun!
</p>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td width="50%">
<b>Host:</b>
</td>
<td width="50%">
<? echo($db_host) ?>
</td>
</tr>

<tr>
<td width="50%">
<b>Username:</b>
</td>
<td width="50%">
<? echo($db_user) ?>
</td>
</tr>

<tr>
<td width="50%">
<b>Password:</b>
</td>
<td width="50%">
<? echo($db_password) ?>
</td>
</tr>

<tr>
<td width="50%">
<b>Database Name:</b>
</td>
<td width="50%">
<? echo($db_name) ?>
</td>
</tr>
</table>

<br />

<div style="text-align: center;">
<hr />
<br />

<form name="install" action="" method="post">
<input type="submit" name="install" value="Install" />
</form>
</div>
</div>

<?php
}
else
{
?>

<!-- Second case: Afther the installation !-->
<?php
$site_db = new Db($db_host$db_user$db_password$db_name); 
$sql "ALTER TABLE ".USERS_TABLE.
ADD user_age_birthday date NOT NULL default '0000-00-00'"
;

$site_db->query($sql); 
?>


<div id="content">
Database succesfully updated. You can now delete this installer.
<br /><br />
If you have any advice for the installer or the mod itself,
dont hesitate to <a href="mailto: <? echo(MAIL); ?>">contact me</a>!
</div>


<?php
}
?>

<!-- The footer, before and after the installation the same !-->
</div>

</body>
</html>

thanks for your help :)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Additional fields, additional search and more - question [please help!]
« Reply #3 on: February 09, 2006, 03:53:55 PM »
Quote

Saving in unix timestamp format causes some errors for birthdays before 1970.


@icecream:

Would it be possible to post the fix ? I have been, myself, looking for a solution in order to resolve the 1969 bug issue.

Thanks. ;)

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Additional fields, additional search and more - question [please help!]
« Reply #4 on: February 09, 2006, 09:23:15 PM »
@trez:
no thats why i am asking you,
i have made my own mod, cause i needed a other workaround because of integration of my board.

but i have to rewrite some lines and add some extra functions then i can post it for you as a new mod.

@oracle:
save it in date format in db.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Additional fields, additional search and more - question [please help!]
« Reply #5 on: February 09, 2006, 09:35:30 PM »
ok, has anyone a clue about the second search engine? The fields are allready added to the database,
all we have to do is:

make the fields searchable
a second search template with only user-relating things (age, sex, location, pic, avatar)

please!

edit: thanks for the amazing support, a "i cant do it, i dont have time, etc" would be better than no answer  :roll:
« Last Edit: February 13, 2006, 08:28:09 AM by trez »