Version: , by apfeifer
Developer Last Online: Jan 2007
Version: 2.2.x
Rating:
Released: 11-07-2001
Last Update: Never
Installs: 43
No support by the author.
This is basically the same as the Gender Hack for the earlier version, but made to work with 2.2.0. This is all my coding, but was not originally my idea. There are three new images that I made for this, and I may make alternate ones for those because they're kinda blah. Anyway, hope you like it.
Enjoy!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
If edit the my profile, there is always the default value selected. If I change an other option in the profile, my gender is set to unknown... Is there a problemsolving for that ???
If you want to change this part now ever, just change these 3 templates. Now to the modifications you need to do for them to work properly with the page.
IMPORTANT for the part below: Everything stays the same in the 3 files, EXCEPT $post[gender]. Justtake a good look and replace the coresponding code... it aint that hard
Wherever the instructions tol you to put in this code:
Thats it, its now template based. The fun with templates is that you change a tamplte and you change the places where you added it. Thats why i missed this function in the hack, because i felt like trying around a bit with the images and other images and it sucked to make the changes all the time to the code.
// ###################### Start makeselectcode #######################
function makeselectcode ($title,$name,$seedarray,$selvalue=-1) {
// returns a combo box containing a list thats fed from an hash called seedarray
// that hash needs a pair combination, where the name will be used as title and the value as value
// allows specification of selected value in $selvalue
Open global.php (you can put it also in the user.php in the admin directory on the top, but i used it for other hack parts too, so i needed it global) and add to the top, after the <?php this part:
Now these are for adding users over the control panel:
Find
PHP Code:
makeinputcode("Yahoo Messenger Handle","yahoo");
Paste after:
PHP Code:
makeselectcode("Gender","gender",$gender_array);
So much for the interface. Now we need to make sure your data gets saved!
Find:
PHP Code:
$userid=$DB_site->insert_id();
In the line before THIS, search for options,birthday and add ",gender" to it without the "" of course. Now go to the very end of the line. There it looks like '$birthday')"); wich you change now to '$birthday','$gender')");
Ok, new users are set, now the edits.
Search with your editor for this part:
PHP Code:
$DB_site->query("UPDATE user SET birthday='$birthday'
Found this, go to the very end of the line.
You read there something like that:
PHP Code:
$pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");
Change it to this:
PHP Code:
$pmpopup=1,pmpopup,'$pmpopup'),gender='$gender' WHERE userid=$userid");
Save it, upload the files, and you are finished. You can instantly start to edit users, or add new ones with the gender hack. I tested this on 2.2.1 as the hack before, both on an new installed test board and on an already pretty heavy hacked one.
I'm new to VB (a recent UBB convert) with my board being only 4 days old on VB, but I am having a ball installing all the hacks.
This hack here is fantastic.
I want to thank Simon for his admin add-on hack to the gender hack.
Just one note: when you modify the global.php file for Simon's admin hack, it is the admin/global.php file, not the root global.php file. It was a bit confusing as Simon specified the admin/ subdirectory for the other files, but not for the global.php file.
The gender hack works well with the admin add-on. Well done people!
DelusionalMind - worked fine with my expand/collapse hack
maverick1236 - Do you have the expand/collapse hack installed? If so, you need to put the $genderimage twice in the postbit - once in the "plusimg" part and once in the "minusimg" part. It took me forever to figure out that was what I was doing wrong!