vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   [SMF feature imitation] Personal text hack (https://vborg.vbsupport.ru/showthread.php?t=95247)

Lea Verou 08-27-2005 10:00 PM

[SMF feature imitation] Personal text hack
 
Hello, this is an easy and quick modification I made when I switched to vBbulletin from SMF cause I missed the personal text thing that SMF has.


What does it do?

It allows the user to type a small personal text in his options page and the text to be displayed under the avatar if he has one (if he doesn't have one then nothing is displayed) in both the postbit and the profile page.
Note that this is made only for the "classic" thread view and won't work with others as only the postbit_legacy template is modified.

How many file/template changes should I do? Is it difficult?


You won't have to edit any php file. Only 2 template modifications should be done and you will have to add a custom profile field via the vBulletin admin cp. normally i don't think it will take more than 5 minutes :)
The templates that will be edited are "postbit_legacy" and "MEMBERINFO".

Ok, tell me how to do it!


Lets start then!

Postbit_legacy:
Add
HTML Code:

<if condition="$post['field6']">
                                <div><font size="1">$post[field6] </font></div>
                                </if>

under
HTML Code:

                        <if condition="$show['avatar']">
                                <div class="smallfont">
                                &nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                                </div>

MEMBERINFO:
Add
HTML Code:

<if condition="$post['field6']">
                          <font size="1"><br />$post[field6] </font>
                                  </if>

under
HTML Code:

<tr valign="top">
                        <if condition="$show['avatar']">
                        <td><img src="$userinfo[avatarurl]" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" />

Before or after these changes create a single line textbox in the custom profile fields with name "field6" or if it gets another name change filed6 in the code to the field's name and in Which page displays this option? choose "Options: other" so that it's displayed in the options page and also not in the profile page like eg "Biography" :) Also set the maximum characters to a relatively small amount (I have it equal to 100 in my forum) so that the postbit doesn't get too large as there will always be somebody to post his whole life story in it! :P

I hope you like it cause it's my first mod. Any suggestions, bug report and questions are welcome!

Below I attach 2 screenshots so that you can see how it looks!

Sorry if such a mod has been posted before, I haven't come across any! However if you see a similar one I would appreciate it if you informed me! :)

Blind Guardian 08-29-2005 05:40 AM

So, basically, all this does is make a second "custom title" field so it still displays their position (member/moderator/administrator)?

Not bad, but it could be done a lot easier, without having to bother making new profile fields and such.

I'm thinking you could improve it by doing the following;

Open postbit/postbit_legacy and find:
Code:

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
Copy this somewhere, then replace it with the following:
Code:

        <font size=1 color=#XXXXXX><b>
                      <if condition="$post[usergroupid] == X">Administrator</if>
                      <if condition="$post[usergroupid] == X">Super Moderator</if>
                      <if condition="$post[usergroupid] == X">Moderator</if>
                      <if condition="$post[usergroupid] == X">Registered User</if>
        </b></font>

Replace the X's with the relevant color/usergroup information.

Find the following:
Code:

                        <if condition="$show['avatar']">
                                <div class="smallfont">
                                        &nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                                </div>
                        </if>

Paste the following code, which you copied earlier, after it:
Code:

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
Of course, if your goal is to let the user have multiple custom-titles, then ignore what I just said.

Lea Verou 08-29-2005 06:05 AM

My goal is to imitate the SMF feature that some people like me that have switched to vBulletin may be missing :)
You'll undersand the goal of it better if you see a SMF forum :)

For instance in our forum we don't allow custom titles. Also this is useful so that the user can have a comment for his avatar or a sentence to comlete it's meaning. It's totally different from the usertitle. This has to do mostly with the avatar, not the user overall. This is also why the text is not displayed if the user doesn't have an avatar: there is no need to.

Also your code would get quite messy if a forum has many usergroups I think.

Thanks however for the alternative, maybe some people would need it :)

Lea Verou 10-02-2005 06:19 PM

Just tested it and it works fine with 3.5 as well :)

Reeve of shinra 10-03-2005 12:54 AM

Thank you for sharing.


All times are GMT. The time now is 12:17 AM.

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.01007 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete