vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User's Favourite Quote in Postbit... (https://vborg.vbsupport.ru/showthread.php?t=39655)

Chris M 06-08-2002 10:00 PM

User's Favourite Quote in Postbit...
 
This hack will add the User's favourite Quote in the Postbit...

Download the attached file for the Instructions, or see below :

###-=START=-###

Step A)

Create a new User Profile Field (in your Admin CP). For myself, I created a new field with these properties, in order from top to bottom:

"Favourite Quote"
"Enter your Favourite Quote"
Max Input - 250
Field Length - 25
Display Order - 2
No
No
Yes

Step B)

You need to determine the field id of your new field. If you've never before added a custom profile field, this should be 5. When you hover over the "Edit" link when you go to "Modify" in your Custom profile Field section, a link should appear at the bottom left of the page. It will look something like :
Quote:

http://www.yoursite.com/forum/admin/profile.php?s=&modify&fieldid=7
The last number, in this case "7", is the field id.

Step C)

Open the file: admin/functions.php

Find this:

PHP Code:

        if ($post[aim]!="") {
            eval(
"\$post[aimicon] = \"".gettemplate("aim")."\";");
        } else {
            
$post[aim]="";
        } 

And add below :

PHP Code:

            if ($post[field5]) {
                  
$favquote="$post[field5]<br>";
            } else {
                  
$favquote="";
            } 


(Note : You will need to change the number (5) in the $post[field] brackets to the number that you found out in Step B)

Step D)

Edit the postbit template.

You can put $favquote anywhere in the postbit template that you want. Make sure, however, that there is a <br> before it, but not after it.

Step E)

Upload the functions.php file to your admin directory

###-=END=-###

There are 2 Screenshots to show this hack...

Satan

Chris M 06-09-2002 07:05 PM

This is the View from the actual posts...

Satan

Chris M 06-09-2002 07:06 PM

This is the view from your Profile...

Satan

Brad 06-09-2002 07:06 PM

im isntalling this :D

Brad 06-09-2002 07:08 PM

/me clicks install button

i think that was the fasted ive ever installed a hack :alien:

Chris M 06-09-2002 07:09 PM

Cool...

Tell me what you think:)

Satan

Brad 06-09-2002 07:10 PM

ill leave my members to that job, once i get the forum back up tomorrow :p

Chris M 06-09-2002 07:12 PM

Ok:)

If anyone wants to make any suggestions, by all means, go ahead!:)

Satan

KuraFire 06-09-2002 08:19 PM

Dude, you can do this without any file-hacks.

Just put $post[fieldX] (where X is the profile field ID) inside the postbit template and you're set to go...

No file hacks necessary at all.

KuraFire 06-09-2002 08:20 PM

Nice avatar, though ;)

filburt1 06-09-2002 08:26 PM

Before I spend the two seconds it takes to install this ;) does everything get passed through the profanity/De-HTML'ing/etc. filter?

Xenon 06-09-2002 08:30 PM

same like kurafire.
no hacking is needed for such, becaus you can include every userfield in the postbit template

KuraFire 06-09-2002 09:04 PM

filburt - AFAIK, all user fields are 'HTMLised' as the vB developers refer to it. That is, they htmlspecialchars() every field before output. The profanity filter only applies to posts themselves, AFAIK, but you should be able to check this by going to any user's profile display page (not in admin panel, but the normal one) and checking whether a by-you-censored word appears in there uncensored or not. It will display the same way in the postbit.

But again, you don't have to hack any files for this...

Chris M 06-10-2002 09:16 AM

I suppose...

But I prefer to do it via functions.php...

Satan

KuraFire 06-10-2002 12:04 PM

Why?

No offense, but that's just kinda retarded, hacking functions.php for something trivial and pointless.

(imo)

Brad 06-11-2002 12:35 AM

you can extend upon it with template contral like i did

N!ck 06-11-2002 07:25 AM

hellsatan's point in making the file edit was to eliminate any blank spaces should someone happen not to enter their favorite quote

Chris M 06-11-2002 11:37 AM

Yeh...

Not everyone will want to enter their quotes...

And besides...I find it easier my way:)

Satan

MrBojangle1 06-15-2002 04:57 PM

it would have been LOADS easyer NOT to have to edit the php file and just gone into the postbit template and pust this

Fav Quote: $post[field*] way easyer then goin into the php file

Chris M 06-15-2002 07:20 PM

Yeh...

But as nick said :

Quote:

hellsatan's point in making the file edit was to eliminate any blank spaces should someone happen not to enter their favorite quote
Satam

BigJohnson 07-07-2002 03:58 PM

I think it would be great if you can change people's favorite quotes in the Admin Control Panel for each user. How would i got ahead to do this. Can someone please help me out and maybe post the code for me. Thanks a billion. I think that would be a great addon.

cabby 07-09-2002 01:39 PM

Quote:

Originally posted by BigJohnson
I think it would be great if you can change people's favorite quotes in the Admin Control Panel for each user. How would i got ahead to do this. Can someone please help me out and maybe post the code for me. Thanks a billion. I think that would be a great addon.
I totally agree with BigJohnson! Would be very nice to get this option...

TECK 07-09-2002 01:45 PM

hehe... forum god? and satan? interesting.. :)
great hack chris.

BigJohnson 07-09-2002 04:39 PM

Bump. Please call me bigjohnson cabby hehe. BJ sounds too hhmm how should i put it.. Sexual? lol. :)

cabby 07-09-2002 04:47 PM

@BigJohnson

Your request is fulfilled... ;)

BigJohnson 07-10-2002 04:26 AM

Hehe. I would really like the requests that people have been asking for to be fulfilled for this hack as well. :)

g-force2k2 07-10-2002 05:04 AM

lmao...

bigjohnson and cabby you can edit userprofilefields in admin cp ;p

btw i agree with Xenon and KujaFire that a file edit isn't necessary...

but i also agree with hellsatan and animeloo that using a file edit can benefit for an additional addon of some sort ;)

g-force2k2

Heineken77 07-16-2002 11:38 PM

Hey thanks man, this is cool :)

Chris M 07-18-2002 12:00 PM

@BigJohnson - What g-force2k2 said...

Everyone else - Fanks:D

Satan

Massiel 07-19-2002 07:46 AM

I have included things by just making changes to the postbit before, what I liked about this hack was that the quote doesn't show in every member who hasn't written anything... Thanks!

I wanted to ask you something, in the attached pic you have Fav Quote: in bold, I figured you added that to the php file, right? So I did and it's showing now, is that what you did? How did you make it bold?

if ($post[field5]) {
$favquote="Fav Quote: $post[field5]<br>";
} else {
$favquote="";
}

Massiel 07-19-2002 08:19 AM

I just added the <b> </b> tags, hope that is okay!

Chris M 07-19-2002 08:30 AM

You can yes...

Or, you can simply do it via the Template, if you make that field Required...

Satan

SgtSling 03-12-2003 03:50 AM

i wish this worked in version 3.0

Erwin 03-12-2003 05:29 AM

You can do this without hacking. Just make a new custom profile, get the profile id from the URL by putting your mouse over the edit link, and then put $bbuserinfo[fieldxx] anywhere in your postbit template (replace xx with the profile id).

Areku 04-29-2003 09:22 PM

How can I "move" the favquote variable or even the $whatevervariableis[fieldnumba] to the getinfo template instead of the postbit so its displayed on user profile view instead of postbit?

What I mean is, ok, once i see a user profile, fav quote appears along with all the rest of user profile fields, but I want to move it out of there and write it on screen on another spot... is that possible?


All times are GMT. The time now is 08:11 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.01136 seconds
  • Memory Usage 1,784KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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