0 Members and 1 Guest are viewing this topic.

How to add Genders and include them in drop down menu
« on: June 29, 2014, 12:48:54 PM »
I have added “Couples FF” and “Couples MM” to the “I am” drop down menu on the registration page. Can anyone tell me where the code that allocates the default icons is hiding?
« Last Edit: January 23, 2018, 09:40:33 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #1 on: June 29, 2014, 05:23:00 PM »
Answered my own question (eventually).
If anyone else is trying to do this you need to modify the getsnap.php and init.tpl files as well as the lang_main.php, oh yes, and make two new profile  image jpg’s
« Last Edit: January 23, 2018, 10:35:53 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #2 on: June 29, 2014, 07:13:28 PM »
I have added “Couples FF” and “Couples MM” to the “I am” drop down menu on the registration page. Can anyone tell me where the code that allocates the default icons is hiding?

Hi mate, can you post how you did this? Wanting to do myself, thanks
« Last Edit: January 23, 2018, 10:36:10 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #3 on: June 30, 2014, 09:13:47 AM »
Hi mnarkyp77 ,
I haven’t finished testing yet so I don’t know if it will conflict with other bits of code but it does appear to work ok. Also because I have modified other bits of code on these pages I can’t give you the default line numbers but it’s very straightforward so that shouldn’t matter.

First edit the lang_main.php file.
Find the string -
$lang['signup_gender_values']
Remove the array values and replace them with-

        'M' => 'Male',
   'F' => 'Female',
   'K' => 'Couple MF',
   'L' => 'Couple FF',
   'H' => 'Couple MM'

Do the same with
$lang['signup_gender_look']
And
$lang['search_genders']

Save file, ftp and update language in admin panel.

In the getsnap.php
Find the string -
$gender = $osDB->getOne( 'select gender from ! where id = ?'
Remove the array values and replace them with-

   if ($gender == 'M') {
      $nopic = SKIN_IMAGES_DIR.'male.jpg';
   } elseif ($gender == 'F') {
      $nopic = SKIN_IMAGES_DIR.'female.jpg';
   } elseif ($gender == 'K') {
      $nopic = SKIN_IMAGES_DIR.'couple.jpg';
   } elseif ($gender == 'L') {
      $nopic = SKIN_IMAGES_DIR.'coupleff.jpg';
   } elseif ($gender == 'H') {
      $nopic = SKIN_IMAGES_DIR.'couplemm.jpg';
   }

In the init.php
Find the string -
$row = $osDB->getRow( 'select sum(if(gender=\'M\',1,0)) as gents, sum(if(gender=\'F\',1,0)) as females, sum(if(gender=\'C\',1,0)) as couples, sum(if(gender=\'L\',1,0)) as fcouples, sum(if(gender=\'H\',1,0)) as mcouples from ! where active = ? and status in (?, ?)

Remove the array values and replace them with-
$t->assign( 'gents', $row['gents'] );

$t->assign( 'females', $row['females'] );

$t->assign( 'couples', $row['couples'] );

$t->assign( 'fcouples', $row['fcouples'] );

$t->assign( 'hcouples', $row['hcouples'] );
unset($row);


Create two new default thumbnails and name them
coupleff.jpg and couplemm.jpg and put them in your images folder.

Save and ftp files.

If anyone wants to repost this in a more elegant way with default line numbers I wont be offended.
« Last Edit: January 23, 2018, 10:37:18 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #4 on: July 02, 2014, 06:59:58 PM »
hi mate, only just seen this will give it a go many thanks,  ;)
« Last Edit: January 23, 2018, 10:38:01 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #5 on: July 02, 2014, 07:15:40 PM »
Hi mnarkyp77 ,
I haven’t finished testing yet so I don’t know if it will conflict with other bits of code but it does appear to work ok. Also because I have modified other bits of code on these pages I can’t give you the default line numbers but it’s very straightforward so that shouldn’t matter.

First edit the lang_main.php file.
Find the string -
$lang['signup_gender_values']
Remove the array values and replace them with-

        'M' => 'Male',
   'F' => 'Female',
   'K' => 'Couple MF',
   'L' => 'Couple FF',
   'H' => 'Couple MM'

Do the same with
$lang['signup_gender_look']
And
$lang['search_genders']

Save file, ftp and update language in admin panel.

In the getsnap.php
Find the string -
$gender = $osDB->getOne( 'select gender from ! where id = ?'
Remove the array values and replace them with-

   if ($gender == 'M') {
      $nopic = SKIN_IMAGES_DIR.'male.jpg';
   } elseif ($gender == 'F') {
      $nopic = SKIN_IMAGES_DIR.'female.jpg';
   } elseif ($gender == 'K') {
      $nopic = SKIN_IMAGES_DIR.'couple.jpg';
   } elseif ($gender == 'L') {
      $nopic = SKIN_IMAGES_DIR.'coupleff.jpg';
   } elseif ($gender == 'H') {
      $nopic = SKIN_IMAGES_DIR.'couplemm.jpg';
   }

In the init.php
Find the string -
$row = $osDB->getRow( 'select sum(if(gender=\'M\',1,0)) as gents, sum(if(gender=\'F\',1,0)) as females, sum(if(gender=\'C\',1,0)) as couples, sum(if(gender=\'L\',1,0)) as fcouples, sum(if(gender=\'H\',1,0)) as mcouples from ! where active = ? and status in (?, ?)

Remove the array values and replace them with-
$t->assign( 'gents', $row['gents'] );

$t->assign( 'females', $row['females'] );

$t->assign( 'couples', $row['couples'] );

$t->assign( 'fcouples', $row['fcouples'] );

$t->assign( 'hcouples', $row['hcouples'] );
unset($row);


Create two new default thumbnails and name them
coupleff.jpg and couplemm.jpg and put them in your images folder.

Save and ftp files.

If anyone wants to repost this in a more elegant way with default line numbers I wont be offended.

works great that mate much appreciated!!
« Last Edit: January 23, 2018, 10:38:38 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #6 on: July 05, 2014, 05:33:27 PM »
hi mate, can also add to user stats in lang main  ;)
« Last Edit: January 23, 2018, 10:38:55 PM by Pharg »

Re: How to add Genders and inlcude them in drop down menu
« Reply #7 on: July 05, 2014, 06:22:23 PM »
I missed a few bits, thanks for the feedback.
« Last Edit: January 23, 2018, 09:23:41 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #8 on: October 13, 2014, 02:15:37 AM »
Well damnit, I removed "Groups" and "Couples" from all the listed files above, and yet, they still show up on the main page drop-down menu!!!
« Last Edit: January 23, 2018, 10:39:14 PM by Pharg »

*

Pharg

  • *****
  • 3,118
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: How to add Genders and inlcude them in drop down menu
« Reply #9 on: October 13, 2014, 05:14:20 AM »
Well damnit, I removed "Groups" and "Couples" from all the listed files above, and yet, they still show up on the main page drop-down menu!!!

Hi WolfMan14,

Clear the temporary files in the templates_c folder should fix it.
« Last Edit: January 23, 2018, 09:24:28 PM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.1.15 | MySQL: 5.5.35

Re: How to add Genders and include them in drop down menu
« Reply #10 on: October 13, 2014, 10:56:17 AM »
Hi WolfMan14,

Clear the temporary files in the templates_c folder should fix it.
I can't seem to locate this folder! Where should I be looking?

I even ran a search under the copy left on my computer, and it came up with thirty results, execpt that none of the matches was a folder named templates_c.
« Last Edit: January 23, 2018, 10:39:34 PM by Pharg »

Re: How to add Genders and inlcude them in drop down menu
« Reply #11 on: October 13, 2014, 10:59:09 AM »
Go to ur public folder, where templates folder, JavaScript folder etc is, look for temp folder,  look inside
« Last Edit: January 23, 2018, 09:25:04 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #12 on: October 13, 2014, 11:01:36 AM »
Found it! Should I delete all the files in it and just leave the sub-folders? One of them is empty, and the other one is full of files; should I delete these files as well?
« Last Edit: January 23, 2018, 10:39:58 PM by Pharg »

Re: How to add Genders and include them in drop down menu
« Reply #13 on: October 13, 2014, 11:21:38 AM »
Well... I deleted every file in templates_c...

And this is still what the drop-down menu looks like:

« Last Edit: January 23, 2018, 10:40:14 PM by Pharg »

*

Pharg

  • *****
  • 3,118
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: How to add Genders and include them in drop down menu
« Reply #14 on: October 13, 2014, 11:23:57 AM »
Hi Wolfman14,

Only delete whats inside the /temp/templates_c/ <--- Empty all in HERE --->

This is the folder that caches your website every time it's loaded / Refreshed.
« Last Edit: January 23, 2018, 10:40:33 PM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.1.15 | MySQL: 5.5.35