Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by apfeifer apfeifer is offline
Developer Last Online: Jan 2007 Show Printable Version Email this Page

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.

Comments
  #17  
Old 11-15-2001, 09:28 AM
BluSmurf BluSmurf is offline
 
Join Date: Nov 2001
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lesane, care to share how you do it for 2.0.3?
Reply With Quote
  #18  
Old 11-15-2001, 01:48 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure, no problem.

Its all the same except the part in register.php. The find and replace part contains "$avatarid", version 2.0.3 dont have that in the register.php.

So when it asks 2 replace the part in register.php do this:

$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield." parentemail,coppauser,homepage,icq,aim,yahoo,signa ture,adminemail,showemail,invisible,usertitle,join date,cookieuser,daysprune,lastvisit,lastactivity,u sergroupid,timezoneoffset,emailnotification,receiv epm,emailonpm,options,birthday,maxposts,startofwee k,ipaddress,pmpopup,referrerid,nosessionhash,gende r) VALUES (NULL,'".addslashes(htmlspecialchars($username))." ','".addslashes(md5($password))."','".addslashes(h tmlspecialchars($email))."',".$newstyleval."'".add slashes(htmlspecialchars($parentemail))."','$coppa user','".addslashes(htmlspecialchars($homepage))." ','".addslashes(htmlspecialchars($icq))."','".adds lashes(htmlspecialchars($aim))."','".addslashes(ht mlspecialchars($yahoo))."','".addslashes($signatur e)."','$adminemail','$showemail','$invisible','".a ddslashes($usertitle)."','".time()."','$cookieuser ','".addslashes($prunedays)."','".time()."','".tim e()."','$newusergroupid','".addslashes($timezoneof fset)."','$emailnotification','$receivepm','$email onpm','$options','".addslashes($birthday)."','".ad dslashes($umaxposts)."','".addslashes($startofweek )."','".addslashes($ipaddress)."','$pmpopup','".ad dslashes($testreferrerid['userid'])."','$nosessionhash','$gender')");

Good luck
Reply With Quote
  #19  
Old 11-21-2001, 01:46 AM
nafae's Avatar
nafae nafae is offline
 
Join Date: Nov 2001
Posts: 240
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hrm i cant find the postbit stuff, i went under "postbit templates-postbit and didnt find
$userinfo[username]</a></normalfont>" am i looking in the wrong place? i am using 2.2.1
Reply With Quote
  #20  
Old 11-21-2001, 08:45 PM
maverick1236 maverick1236 is offline
 
Join Date: Oct 2001
Location: NY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok i dont know how many times i need to say this for someone to actually notice...

the image WILL NOT SHOW IN POSTBIT-but it shows everywhere else

can ANYONE fix this??
Reply With Quote
  #21  
Old 12-03-2001, 05:18 AM
212rikanmofo 212rikanmofo is offline
 
Join Date: Nov 2001
Location: paris
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is anyone else getting the same problem? it shows up as a ? for all my users no matter where i am, weird, help me, wut am i doing wrong.
Reply With Quote
  #22  
Old 12-29-2001, 06:32 AM
DelusionalMind's Avatar
DelusionalMind DelusionalMind is offline
 
Join Date: Dec 2001
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gonna be installing this in a few

does anyone want a link to my test forums so they can check it out?
Reply With Quote
  #23  
Old 12-29-2001, 06:55 AM
DelusionalMind's Avatar
DelusionalMind DelusionalMind is offline
 
Join Date: Dec 2001
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i just installed this on my test board...

it no workie :'(

hmmm....it seems to conflict with the collapse posts thing...
Reply With Quote
  #24  
Old 12-29-2001, 09:13 AM
Bedhead Bedhead is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work on 2.2.1?
Reply With Quote
  #25  
Old 12-29-2001, 02:54 PM
Ifrani's Avatar
Ifrani Ifrani is offline
 
Join Date: Oct 2001
Location: Berlin
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But how can I edit the gender in the AdminCP ????
Reply With Quote
  #26  
Old 12-29-2001, 04:22 PM
Ifrani's Avatar
Ifrani Ifrani is offline
 
Join Date: Oct 2001
Location: Berlin
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ???
Reply With Quote
  #27  
Old 01-05-2002, 02:56 AM
Simon Moon Simon Moon is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi everyone. Great hack, but i think it needs some more treatment... Hardcodeing the images is not a very usable idea, therefore, use templates.

Add 3 templates
gender_male:
&nbsp;<img src="images/male.gif" border="0">

gender_female:
&nbsp;<img src="images/female.gif" border="0">

gender_undiscloed:
&nbsp;<img src="images/questionmark.gif" border="0">


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:
PHP Code:
        if ($post[gender] == "0") {
          
$genderimage "&nbsp;<img src=\"images/questionmark.gif\" border=\"0\">";
        } elseif (
$post[gender] == "1") {
          
$genderimage "&nbsp;<img src=\"images/female.gif\" border=\"0\">";
        } elseif (
$post[gender] == "2") {
          
$genderimage "&nbsp;<img src=\"images/male.gif\" border=\"0\">";
        } 
Put now in this one:
PHP Code:
      if ($post[gender] == "0") {
         eval(
"\$genderimage = \"".gettemplate("gender_undisclosed")."\";");
      } elseif (
$post[gender] == "1") {
         eval(
"\$genderimage = \"".gettemplate("gender_female")."\";");
      } elseif (
$post[gender] == "2") {
         eval(
"\$genderimage = \"".gettemplate("gender_male")."\";");
      } 
This has to be done in these files: admin/functions.php member.php memberlist.php

Now 2 more steps and we have it.
in member.php search for
PHP Code:
if ($action=="getinfo") {
  
$templatesused "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,getinfo_customfields,getinfo"
change the second part to this:
PHP Code:
$templatesused "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,getinfo_customfields,getinfo,gender_male,gender_female,gender_undisclosed"
If you have some hacks that might need here more, just take a look at the end. Its just 3 names added.

Now change in memberlist.php the 4th line, and add there also the three templates. If you have no other hacks it could look like this:
PHP Code:
$templatesused "memberlist_letterselected,memberlist_letter,postbit_search,postbit_useremail,icq,aim,yahoo,postbit_homepage,postbit_sendpm,postbit_profile,memberlistbit,memberlist,memberlistsearch,gender_male,gender_female,gender_undisclosed"
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.

Thanks for the great hack!!!
Reply With Quote
  #28  
Old 01-05-2002, 08:33 AM
Simon Moon Simon Moon is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Toying around, i found it sucks not to be able to change the the status of the user as an admin. So i whipped out this little hack.

First, you need a whole new function in admin/adminfunctions.php
Find:
PHP Code:
// ###################### Start makechoosercode ####################### 
Add BEFORE:
PHP 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


  
echo "<tr class=\"".getrowbg()."\" valign=\"top\">\n<td><p>$title</p></td>\n<td><p><select name=\"$name\">\n";
  
  while ( list(
$key$val) = each($seedarray) ) {
    if (
$selvalue==$val) {
      echo 
"<option value=\"$val\" SELECTED>$key</option>\n";
    } else {
      echo 
"<option value=\"$val\">$key</option>\n";
    }
  }
  echo 
"</select>\n</p></td>\n</tr>\n";

Close adminfunctions.php

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:
PHP Code:
$gender_array = array(  "Undisclosed"  => "0",
                        
"Female"       => "1",
                        
"Male"         => "2"); 
This will help a lot later on...
SAve it and close it.

Open admin/user.php

These are for the edit part of the users...
Find:
PHP Code:
makeinputcode("Yahoo Messenger Handle","yahoo",$user[yahoo],0); 
Paste after it:
PHP Code:
makeselectcode("Gender","gender",$gender_array,$user[gender]); 
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.

If you got questions, mail me.
Reply With Quote
  #29  
Old 01-07-2002, 06:36 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!

Reply With Quote
  #30  
Old 01-10-2002, 01:35 AM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by apfeifer
Whoops...yeah, the one in the Postbit section. I'm amazed you're the first person to notice that! Sorry about that!
yea well glad ur sorry but where do we go?
Reply With Quote
  #31  
Old 01-10-2002, 05:51 PM
Sadie Frost's Avatar
Sadie Frost Sadie Frost is offline
 
Join Date: Dec 2001
Location: Pittsburgh
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I put it in the postbit in the postbit section

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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05911 seconds
  • Memory Usage 2,402KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (16)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete