L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 12:52:08 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Updated Quotes Module
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: Updated Quotes Module  (Read 1645 times)
0 Members and 1 Guest are viewing this topic.
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Updated Quotes Module
« on: July 24, 2006, 02:44:04 PM »

I took Sabkor's Quotes module, and implemeted most (if not all, I don't remember) of the fixes mentioned, plus added some extra functionality.

Download: Quotes_1.5.1.zip

Also I made some other changes and added some functionality. Smiley

  • Added Automatic Quote "spam" feature. Will output a random quote to gc|pgroup|both on a set interval if enabled.
  • Changed VARCHAR to TEXT to facilitate searching of quotes
  • Added process_command() to remove redundant code.
  • Added load_settings, change_setting, show_settings to deal with settings related to quote spam.
  • Added cron(), and connect() functions to enable quote spam feature.
  • Modified add_quote() function to use addslashes() instead of str_replace() when inserting into database.
  • Added a FULLTEXT MySQL index to assist with searching the Quotes table.
  • Added upgrade_table() to automatically add the FULLTEXT index to users of previous module versions.
  • Added search_quotes() function that searches the quotes table.

To configure the quote spammer, /tell yourbot !quotes set. Everything can be configured through the settings window.

To search the quotes, just do !quotes <search string>. If there is only one result, the quote will just be displayed. If there are multiple results, you will get a text window with the results and a 72 character preview of the quote.
« Last Edit: October 30, 2006, 07:26:51 PM by Glarawyn » Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Updated Quotes Module
« Reply #1 on: July 24, 2006, 04:01:05 PM »

http://zibby.isa-geek.net/bebot/Quotes/Quotes_1.0.1.zip

-jj-
« Last Edit: July 24, 2006, 04:03:16 PM by jjones666 » Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Updated Quotes Module
« Reply #2 on: July 24, 2006, 09:30:55 PM »

Whoops, thanks Cheesy
Logged
Pharexys
Apprentice
***
Offline Offline

Posts: 94


Re: Updated Quotes Module
« Reply #3 on: August 03, 2006, 10:01:30 AM »

good job Cheesy
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Updated Quotes Module
« Reply #4 on: October 30, 2006, 01:48:48 PM »

Updated to add searching of the quotes table.
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Updated Quotes Module
« Reply #5 on: October 30, 2006, 05:04:23 PM »

Have following error:-

ERROR 1214 (HY000): The used table type doesn't support FULLTEXT indexes

id(int,11,not null)
quote(text,null)
contributor(varchar(15),null)

Cheers,

-jj-
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Updated Quotes Module
« Reply #6 on: October 30, 2006, 05:32:32 PM »

Quote from: jjones666 on October 30, 2006, 05:04:23 PM
Have following error:-

ERROR 1214 (HY000): The used table type doesn't support FULLTEXT indexes


Do you have MySQL configured to use a storage engine besides MyISAM by default? That's the only cause I can come up with unless you're running a version of earlier than 3.23.23. Smiley

You could try:
mysqldump -u user -p dbname --tables quotes > quotes-backup.sql
(Always backup your data when you're about to do something that could destroy your data.)
ALTER TABLE quotes ENGINE = MYISAM;
ALTER TABLE quotes ADD FULLTEXT(quote,contributor);

Otherwise around L253 you can find where I'm switching between doing a LIKE query (for a search term of 1 to 3 characters.) and a FULLTEXT search. If you remove the FULLTEXT search SQL you can stick to just a LIKE query, but you'll loose the flexibility and reverence sorting that comes with a FULLTEXT index search.
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Updated Quotes Module
« Reply #7 on: October 30, 2006, 06:18:34 PM »

Fixed, thanks for support (DB engine type was wrong)!

Cheers,

-jj-
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Updated Quotes Module
« Reply #8 on: October 30, 2006, 07:27:54 PM »

Updated again. Found and fixed a typo, also changed full text searching to bolean mode. You can now (optionally) use the boolean operators from http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html in your searches.
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Updated Quotes Module
« Reply #9 on: November 01, 2006, 04:46:01 PM »

Forgot to mention that you can also show only the quotes submitted by a character by doing !quotes by <character> (!quotes by Glarawyn.)
Logged
ghostimage
Freshman
*
Offline Offline

Posts: 13


Re: Updated Quotes Module
« Reply #10 on: January 16, 2007, 04:58:54 AM »

Even with the table set correctly to MyISAM I still got the same error as JJ. To fix this issue in a default installation of MySQL 5 on the MS Windows OS you need to go to:

c:\program files\mysql\mysql server 5.0\    and edit the my.ini file and change the line:

"default-storage-engine=innodb"
to
"default-storage-engine=myisam"

Then restart the mysql service.

Cheers  Cheesy
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Updated Quotes Module
« Reply #11 on: January 16, 2007, 04:53:32 PM »

Nice tip, thank you :-)

-jj-
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Updated Quotes Module
« Reply #12 on: January 16, 2007, 07:49:06 PM »

Converted module to use Glara's new module settings plugin for all settings options.

No other changes.

http://www.jjones.co.uk/files/quotes.php

-jj-
Logged
Ozball
Freshman
*
Offline Offline

Gender: Male
Posts: 15


Re: Updated Quotes Module
« Reply #13 on: February 27, 2007, 10:00:24 AM »

Getting

Fatal error: Cannot use string offset as an array in F:\Tvbot\Bebot_v0.2.11\modules\quotes.php on line 210

Any ideas?
Logged

Slynthia - General and Botmaster of Terminal Velocity - RK1
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Updated Quotes Module
« Reply #14 on: February 27, 2007, 02:55:30 PM »

You might get that in php5 if you don't have any quotes in your db. If you don't, add one then try.
Logged

Eternalist
General of The Syndicate
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Updated Quotes Module
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 14
Total: 15
xlDanek

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.184 seconds with 29 queries. (Pretty URLs adds 0.033s, 4q)
Loading...