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
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
  #2  
Old 05-07-2002, 09:56 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A screenshot of how it looks on my own (new, not publicly available) board.

Note that I can't include the entire header, since I'm keeping that a secret until all is done. This screenie is just how it looks if you add it between the header and content-table, using the global.php edition of the hack.


Oh and if you find the ID's on the 100quotes attachment rather odd: that's due to the auto_increment, and the fact that I didn't want to give you guys 100 Letter A quotes.
Reply With Quote
  #3  
Old 05-08-2002, 07:27 AM
dimitr|'s Avatar
dimitr| dimitr| is offline
 
Join Date: Oct 2001
Location: St Paul
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shouldn't the $quote and $quoter that you put into the template be $thequote and $thequoter ?
Reply With Quote
  #4  
Old 05-08-2002, 07:50 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'm not sure, but this was done also by lesane.
Reply With Quote
  #5  
Old 05-08-2002, 08:37 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dimitr| ~ sheize, you're right, my mistake!

*edits the first post*

nakkid, like my first post says, yes Lesane made a random quote hack too, but I don't like it. It splits quotes into two short lines, it doesn't give out the Quoter information, rather it tells who submitted the quote, and as is clear from the last sentence, it lets members submit quotes, which this hack doesn't. This is useful for big boards where you don't want to sift through 500 submitted quotes a day.
Reply With Quote
  #6  
Old 05-08-2002, 08:45 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think that every member from a board likes to contribute on his favorite board by adding quotes. My members loved it to contribute to the forum by adding quotes. Adding quotes of their favorite artist/actor or their own quotes. Why would u take this ability away from them?

In my eyes it's like making a new store hack but then let only admins buy things
Reply With Quote
  #7  
Old 05-08-2002, 09:07 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like I said, there's the obvious reason if you run a very big board - who wants to moderate hundreds of quotes all the time? You can bet your ass on it that users will be submitting quotes that already exist in your database. I don't have the time to even moderate my board if I'd let my users submit quotes, and I have about 50 really active people and 150 ones that drop by every so often.

Second of all, your hack lists quotes in two small lines. I totally don't like that, looked ugly as hell, so that was one more reason for me to make my own hack.

Thirdly, this hack will, one day, incorporate a Quotes listing similar to memberlist.php and will be searchable and orderable by letter. Is your quotes table structured for that? (just wondering )

Lastly, your hack (last I checked) didn't display the Quoter, only the member who submitted a quote. That's just taking credit away from ALL those people who made the quotes!
Reply With Quote
  #8  
Old 05-08-2002, 09:10 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

besides, Lesane, why not let your users contribute by donating to The Cause (tm) of your board, eh?
Reply With Quote
  #9  
Old 05-08-2002, 10:20 AM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by nakkid
i'm not sure, but this was done also by lesane.
Do you ever read the content of a thread, or just reply to the title of a thread? Geez. Kura already mentioned this.

Besides that, this one differs too much from the one lesane made. As the thread title implies, admin only .. One person invented the wheel, the rest uses it and sometimes even improves it, if we didn't. Your bmw would be running with rocks instead of rubber.
Reply With Quote
  #10  
Old 05-08-2002, 02:54 PM
John's Avatar
John John is offline
 
Join Date: Mar 2002
Location: Norwich, UK
Posts: 1,543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very basic hack, but it's brilliant - gives us n00bs a chance to figure out how this stuff works
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 01:36 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.04302 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
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
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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