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)
-   -   Random Quote Hack (https://vborg.vbsupport.ru/showthread.php?t=38139)

Sketch 05-01-2002 10:00 PM

Random Quote Hack
 
If anyone else has hacked this, I could not find it, so here I post.

This is my first hack. Simple one. Took 5 minutes to create. Designed for vB 2.2.5 but may work on other versions too. Requires MySQL so if you're a high end vB'er that is using another db, you'll have to modify this to your highly customized situation.

The hack creates a new table (unpopulated) and randomly selects one quote from the table everytime the page loads. It displays on the home page immediately above the forums.

Demonstration can be seen at (not online anymore)

Good luck
Sketch

TWTCommish 05-02-2002 02:55 AM

It has indeed been done before. :) Sorry man. :(

Random Quote On ForumHome

DWZ 05-02-2002 02:58 AM

Quote:

Originally posted by TWTCommish
It has indeed been done before. :) Sorry man. :(

Random Quote On ForumHome

althought that one still has problems :(

Sketch 05-02-2002 02:59 AM

Ah well. His is a bit better, it would seem with integrated means to add quotes whereas you're on your own with mine. Valiant effort on my part anyways. ;)

Sketch

Velocd 05-02-2002 03:14 AM

Valiant indeed. ;)

Floris 05-02-2002 06:28 AM

Sorry dude, lesane beat you to it :)

Sketch 05-02-2002 09:42 AM

oh well. I had fun doing it anyways. ;)

Sketch

Sparkz 05-02-2002 09:52 AM

Hmm, Sketch, you're not supposed to remove the copyright-notice from the footer. It is clearly stated with comments surrounding it.

Sketch 05-02-2002 10:59 AM

Sparkz,

I did not look into the original footer in depth, I just copied my footer from my other board straight over. Ctrl-A/Ctrl-V without much attention given. Now that I look at the original, you're right and I have corrected that. Thanks.

Sketch

Sparkz 05-02-2002 11:16 AM

:)

KuraFire 05-02-2002 05:30 PM

I have the same one as this hack, made it myself also, but it doesn't use the phpinclude template. Rather, I have this:

PHP Code:

 $quot=$DB_site->query_first("SELECT quote,name FROM quotes ORDER BY rand() LIMIT 1");
 
$thequote $quot['quote'];
 
$thequoter $quot['name']; 

in my global.php, and I call $thequote and $thequoter in my Header.

(I just gave some secret away here, damn...)

Anyhoo, I didn't like Lesane's hack, first off because it (currently) draws credit away from those who actually Said the quotes, and second of all, I don't want my users to submit quotes. All nice and fun, but they don't know which 614 quotes I have in my (vbulletin.quotes) table, and I doubt they'll refresh to see 'm all, before submitting one. I'll deal with it myself, thankyouverymuch. Was doing that anyhow, already :)

KuraFire 05-02-2002 05:32 PM

btw, I *am* trying to figure out if I can make my quotes searchable and 'orderable', similar to the memberlist but then with my quotes :)
(ie. sort them by Letter, and search on them by either quote or name) :)

Lesane 05-02-2002 07:10 PM

Quote:

Originally posted by DWZ
althought that one still has problems :(
If their any problems with my hack then post it in the desired thread. I saw your last posts and the problem was solved right?

@Sketch: You couldn't find it? Which keyword did u tried in the search? ;):D

Sketch 05-02-2002 07:47 PM

Quote:

Originally posted by Lesane


If their any problems with my hack then post it in the desired thread. I saw your last posts and the problem was solved right?

@Sketch: You couldn't find it? Which keyword did u tried in the search? ;):D

;) I believe I searched for Quote and Random and Random quote together. However, once mentioned that you had created one, I did find it on the front page of the Forum Display hacks database page. Oh well. The more the merrier. ;)

Sketch

Zarith 05-06-2002 03:23 PM

would it be possible to have it pull pictures instead of text quotes? like if i made a folder with 1 line graphic images from a game i play could i make it pull them randomly?

like making the quotes "<img src="gfx2.jpg>" ect?

Sketch 05-06-2002 03:46 PM

Quote:

Originally posted by Zarith
would it be possible to have it pull pictures instead of text quotes? like if i made a folder with 1 line graphic images from a game i play could i make it pull them randomly?

like making the quotes "<img src="gfx2.jpg>" ect?

yeah, you'd have to modify the quote template and modify the table, although you wouldn't have to.

However, if these images were uploaded by users and you wanted to store the image in the db itself (which I don't personally recommend), then you WOULD have to modify the table to make the field containg the image BLOB or something. However, if the images are maintained by you, I recommend uploading the image to a folder on your server and storing a link to the image in your db table.

HTH.
Sketch

Zarith 05-09-2002 03:23 AM

yea i would run all the images, and maintain the quotes myself. not really sure how to use one of these random quote hacks to do it yet.. but basically i just want a random image from the DB to display at the top of the forum list and thread list. no other info just the image

Warlord 06-06-2002 05:25 AM

Ok, I just installed this hack, but I don't see how to add quotes to the db... Do I have to manually add quotes to the table via phpMyAdmin?

Sketch 06-06-2002 04:49 PM

yeah you have to actually enter it manually. I was going to release a version that integrated with your admin cp, but seems everyone thought Lesane's was so much better, I just left the hack alone. :p

Sketch

Warlord 06-07-2002 12:40 AM

I just went with Kurafire's hack.. I don't want people submitting their own quotes. (And yes I know I would have to approve them before they'd show up, but I like the idea of being in total control of all quote submissions)

Mathiau 06-23-2002 10:08 PM

Kurafire,

how exactly do i put in your quote hack? that is if you would like to let me? :)

(.P.S - see u on the couch!)


or which hack is the best of these 3..


although i do not wish to allow people to submit them...


All times are GMT. The time now is 04:14 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.01153 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)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