Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Admin-controlled (only) random quote hack for header/homepage Details »»
Admin-controlled (only) random quote hack for header/homepage
Version: 1.00, by KuraFire KuraFire is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-06-2002 Last Update: Never Installs: 16
 
No support by the author.

What does this hack do?
It adds a quote and the quoter to your board, either in your header/footer (hack global.php) or on your forumhome page (hack root/index.php).

What's the additional server load of this hack?
It adds 1 query to each page you have a quote show up on. If you add it to global.php it'll add 1 query to ALL pages, if you add it to root/index.php it'll only add 1 query to your forumhome, but you won't be able to show the quotes anywhere else.

Why should we use your hack and not one of the two other quote hacks?
Mine is extremely easy (_I_ made it, and I'm a n00b!) but, more importantly, it doesn't allow your users to enter quotes nor does it put it on two silly lines (no offense Lesane, but that aspect, I found absolutely horrid). This is useful if you have a lot of users and don't feel like spending 4 hours a day moderating all new quote-submissions your members made. Or, if you just want full control.

Instructions:
Step 1: run this query on your vBulletin database (I suggest in phpMyAdmin):

PHP Code:
CREATE TABLE quotes (
  
quote text NOT NULL,
  
name text,
  
letter tinytext,
  
id int(11NOT NULL auto_increment,
  
PRIMARY KEY (id)

Step 2 a: if you want it to appear in your header/footer on ALL pages, open global.php and find this line:

PHP Code:
// ###################### Start templates ####################### 
Add ABOVE that, this code:

PHP Code:
// quotes hack by KuraFire
 
$quot=$DB_site->query_first("SELECT quote,name FROM quotes ORDER BY rand() LIMIT 1");
 
$thequote $quot['quote'];
 
$thequoter $quot['name']; 
Step 3 a: save global.php and edit your header/footer template. Put in $thequote for the quote, and $thequoter for the quote's quoter, ie. the person who said the quote.


Step 2 b: if you want this to appear only on your forumhome, open root/index.php and find this line:

PHP Code:
// get total posts 
Add ABOVE that, the following:

PHP Code:
// quotes hack by KuraFire
 
$quot=$DB_site->query_first("SELECT quote,name FROM quotes ORDER BY rand() LIMIT 1");
 
$thequote $quot['quote'];
 
$thequoter $quot['name']; 
Step 3 b: save your root/index.php and edit your forumhome template (won't work on forumhome_whatever or so, only on your main forumhome template). Add $thequote for the quote, and $thequoter for the quote's quoter, ie. person who said the quote.

That's it. I left it up to you entirely where and how you add the quote and quoter, seeing as how people will place it in different places entirely.

Attached is a small selection of my own quotes database. Not all of it, for a: it'd be quite a lot, and b: it took me a lot of work to get those quotes together and into a database, neatly, and I'm not done processing my entire collection yet so I'm not making my entire quotes database publicly available.
To add these 100 quotes to your database, run the contents of 100quotes.sql as a query in phpMyAdmin on your database.

In the second post, I will add a screenshot.

This hack is really basic, Kura, I'm sure you can do more with this! What's your plan, my man?
Self-imployed vote of confidence, woohoo!
*cough* anyway, yeah this is actually just the first part of a rather big hack I have in mind, though not yet in true development. What I'm Planning to create, is a quote index very similar to the memberlist, but then about quotes. You'll have noticed that the structure of the `quotes` table that this hack adds, includes a "letter" column. This is solely for the purpose of making the quotes table searchable by letter, later on. Like, when you click on members, you'll have the option to select all members by a single letter. Same with the quotes list I am working on (in my mind mostly, thus far).

(edit: this quotes listing is now done. Contact me if you want an early release)

UPDATE IN POST #20: Admin Panel Addition for easy Quotes adding!


[high]* KuraFire awaits response again...
[/high]

Edit: credit goes out to Lesane for being the first one to have made a quote hack, of course, but this one is different, and I think it's good for people to be able to have a choice.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 05-10-2002, 10:34 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo: the edit quote feature will be made, but just not _yet_. I can't make that in 10 minutes, my knowledge on vB's structure is far too limited for that, so it'll take time. And since my UQH is pretty much entirely finished, I'm gonna let it coincide with that. Just be patient and use phpMyAdmin for the time being

Lesane, that's what I said in the first post already, but then came the people 'attacking' me cos you already made a quote hack. I'm in the defense here, y'know. I can drop the subject easily if other people will stop coming in here going "bah, Lesane already made this, blah blah blah, I'm using Lesane's, blah blah blah". That annoys me, I don't care who uses whose hack, I made this available for people to have a choice and because I was feeling very generous (sharing things of my new board before my board itself is done yet, successfully diminishing the `impressiveness` by a bit...). I just don't like to be talked down for that, I get in my rather hot-tempered debating stance then.
(no hard feelings, right? )
Reply With Quote
  #33  
Old 05-10-2002, 10:51 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by KuraFire
Lesane, that's what I said in the first post already, but then came the people 'attacking' me cos you already made a quote hack. I'm in the defense here, y'know. I can drop the subject easily if other people will stop coming in here going "bah, Lesane already made this, blah blah blah, I'm using Lesane's, blah blah blah". That annoys me, I don't care who uses whose hack, I made this available for people to have a choice and because I was feeling very generous (sharing things of my new board before my board itself is done yet, successfully diminishing the `impressiveness` by a bit...). I just don't like to be talked down for that, I get in my rather hot-tempered debating stance then.
(no hard feelings, right? )
I fully understand but i'm not the one that's attacking you and/or your hack so it's not really fair if you attack my hack. Attack those people that attacks you instead of attacking an innocent hacker
Reply With Quote
  #34  
Old 05-10-2002, 10:57 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah but those bastards () didn't make any hacks (and if so, I ain't using 'm nor even know about 'm).

Reply With Quote
  #35  
Old 05-10-2002, 11:02 PM
zootsuit's Avatar
zootsuit zootsuit is offline
 
Join Date: May 2002
Location: CA
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Call me ethical or something but it seems that Lesane already made the hack and most of us like it...people usually check to see if a hack has already been done so we don't have 8,000 versions of the same hack floating around.

It looked to me like you were trying to 'one up' him while you where replying to your thread...if not, cool...
Reply With Quote
  #36  
Old 05-10-2002, 11:12 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Call me ethical or something but it seems that Lesane already made the hack and most of us like it...people usually check to see if a hack has already been done so we don't have 8,000 versions of the same hack floating around.
Thank you CAPTAIN OBVIOUS. That was said only 5 times already, we really needed to be told about it again.

Seriously, you deserved this slander, my first post already says that I know Lesane made a quote hack, and it also says that this one is different and therefore will appear to a different audience. Also, this hack will soon be joined up with a much bigger, comprehensive hack that has features Lesane's doesn't have (because he doesn't want them, and I needed it for my own board so... ) so people will have even more options to choose from, pretty soon. It's totally not "the same hack" - there's several very distinct, different features. And our hacks combined provide the vB-community with a whole set of options, successfully making sure that if they want SOME sort of quote hack, they will be able to get it, easily.
Reply With Quote
  #37  
Old 05-10-2002, 11:14 PM
zootsuit's Avatar
zootsuit zootsuit is offline
 
Join Date: May 2002
Location: CA
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Calm down, Mr. Ad Hominem...I was just clarifying myself.
Reply With Quote
  #38  
Old 05-10-2002, 11:23 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by KuraFire


Thank you CAPTAIN OBVIOUS. That was said only 5 times already, we really needed to be told about it again.

Seriously, you deserved this slander, my first post already says that I know Lesane made a quote hack, and it also says that this one is different and therefore will appear to a different audience. Also, this hack will soon be joined up with a much bigger, comprehensive hack that has features Lesane's doesn't have (because he doesn't want them, and I needed it for my own board so... ) so people will have even more options to choose from, pretty soon. It's totally not "the same hack" - there's several very distinct, different features. And our hacks combined provide the vB-community with a whole set of options, successfully making sure that if they want SOME sort of quote hack, they will be able to get it, easily.
This post is good, now u attack that person instead of mine hack. Thumbs up. j/p
Reply With Quote
  #39  
Old 05-10-2002, 11:23 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kurafire,

You are right, it looks as though I will have to do some editing somehow. :-) What do I do for the quotes who don't have a quoter (because I'm not sure who originally said them)? How would I index those?

Let em see if I get this right...I only need to use letters if I am going to index them, right? If I enter them without letters, they will display randomly and just fine? Am I close?
Reply With Quote
  #40  
Old 05-10-2002, 11:30 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo: if you don't know who said a certain quote, use

Unknown

as the name, and

U

as the letter.
(and later on, if you find out who said the quote, you edit it again )

And no, if you don't enter a Letter, those quotes won't be listed at all in the letter-specific index, in the Quotes List hack. They will only display in your header (or wherever you've placed them) and in the Quotes List when searching, or looking at it in default view. But not when browsing the list through letters, so you really ought to set a Letter entry for EVERY quote in your database.

Consistency is the key to success
Reply With Quote
  #41  
Old 05-11-2002, 12:14 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I understand now. But I CAN use the same letter over and over for different quotes right? It will just index those quotes under that letter, right? (E-gad, I think I might be catching on. DOH!!!)

I have been putting a letter in for each quote. I've just been doing it with the first letter the quote started with is all. And thanks for a great hack! Exactly what I was looking for.
Reply With Quote
Reply

Thread Tools

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 04:42 AM.


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.09568 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (3)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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