vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Show Thread Enhancements - Image Gender In Postbit (https://vborg.vbsupport.ru/showthread.php?t=63000)

tnguy3n 03-25-2004 10:00 PM

Image Gender In Postbit
 
/*-----------------------------------------------------------------------*\
# Image Gender in postbit for vb3 gold
#
# This hack adds one's gender and it shows in postbit
/*-----------------------------------------------------------------------*\

Query to run: 1
File modification: 3
Template modication: 2
New Templates: 1
(estimate hack time: 4-5 mins)

Note: 2 gender images ain't created by me, found it at phpbb way back then.
/*-----------------------------------------------------------------------*\

To show gender in postbit, go to User CP => Edit Profile , scroll down to Gender option and select a gender or leave it blank if don't wanna show it.

Live Demo: http://all4actions.net , click on a thread to see it in action.

(adding gender in User Profile later, gotta run for class) :ermm:

lasto 03-26-2004 09:39 PM

how do i add more options to this

u have two male and female but working upon same concept i could use this for me clan site so they can choose what team they prefer to play on so i need 3 options really as we have 3 teams

ryancooper 03-26-2004 09:52 PM

can you make this a required field?

Zachery 03-26-2004 11:15 PM

wow, somthing that can be done by profile fields and template conditional

this is an insanely wonderfull hack


The No hack version of this "hack"
http://www.vbulletintemplates.com/mo...ead.php?t=5957

tnguy3n 03-27-2004 03:58 AM

Quote:

Originally Posted by lasto
how do i add more options to this

u have two male and female but working upon same concept i could use this for me clan site so they can choose what team they prefer to play on so i need 3 options really as we have 3 teams


This just give me an idea for vb3 clan (users clans, clan leader, teams, etc). I wonder if anyone works on this project yet or I gonna start it. :rolleyes:

lasto, if you want to have 3 options rather than two, open
Code:

        // gender hack
....
        // end gender hack

and modify it to:
[code]
if ($post[some-constant] == "0")
{
$var= "";
}
else
{
if ($post[some-constant] == "1")
{ $var = "Team1"; }
elseif ($post[some-constant] == "2")
{ $var = "Team2"; }
elseif ($post[gender] == "3")
{ $var = "Team3"; }
}
eval ( '$gender = "' . fetch_template ( 'postbit_genderbit' ) . '" ;' ) ;



Modify the genderbit in profile:
Code:


                        <fieldset class="fieldset">
                                <legend>Clan</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
                                <tr>
                                        <td colspan="2">Select your clan (or whatever description).</td>
                                </tr>
                                <tr>
                                        <td><select name="some-constant">
                                        <option value="0" <if condition="$bbuserinfo[some-constant] == Unknown">selected</if>>----</option>
                                        <option value="1" <if condition="$bbuserinfo[some-constant] == Team1">selected</if>>Team1</option>
                                        <option value="2" <if condition="$bbuserinfo[some-constant] == Team2">selected</if>>Team2</option>
                                        <option value="3" <if condition="$bbuserinfo[some-constant] == Team3">selected</if>>Team3</option>
</select></td>
                                </tr>
                                </table>
                        </fieldset>



If you want to use image for clan name, change postbit_genderbit template to:
Code:

<if condition="$post[some-constant] == 1">
<br>
<div class="smallfont">Clan: <img src="./images/folder/$var.gif" alt=""></div>
</if>
<if condition="$post[some-constant] == 2">
<br>
<div class="smallfont">Clan: <img src="./images/folder/$var.gif" alt=""></div>
</if>
<if condition="$post[some-constant] == 3">
<br>
<div class="smallfont">Clan: <img src="./images/folder/$var.gif" alt=""></div>
</if>




Sorry it looks a bit messy, but that's the idea.

tnguy3n 03-27-2004 04:05 AM

Quote:

Originally Posted by ryancooper
can you make this a required field?

lol... i want my members to choose whether to show their gender or not, but I'll get back to you when i got it tested. (so tired now :tired: )

Zachery 03-27-2004 08:02 AM

Like i said, and showed at vBulletinTemplates. this can be done over and over again for any appication via template conditionals and a user profile filed.

Gio Takahashi 03-27-2004 08:53 AM

This hack can be easily done by using the "Custom profile manager".

Really, a waste of effort and unncessary edit.

:rolleyes:

Floris 03-27-2004 09:19 AM

Quote:

Originally Posted by Gio Takahashi
This hack can be easily done by using the "Custom profile manager".

Really, a waste of effort and unncessary edit.

:rolleyes:

At least users have the choice to do a source code modification or a template tweak. I prefer the template one since it doesn't hack in on upgrades :)

gmarik 03-27-2004 10:16 AM

Woman are always less than men active over the www...


All times are GMT. The time now is 04:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01108 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete