![]() |
Cap'n
Could point me to the area where I need to edit and I will see if I can follow the bbcode parsing tutorial? I'll post how I make out good or bad. :S Jaks |
I'm not a coder at all and I know you said you don't know but do you think something like this as a plugin would work and if so where would I stick it in?
Update: Tried this in every quoteit related hook i could find. Did absolutely nothin PHP Code:
PHP Code:
|
Installed on 3.5.3 and working perfectly.
Thank you very much for sharing this with us! |
ok I figured out a way to manipulate the templates to link to a specific post. This is not by any means a great alternative but as I said before it works for me.
First I am only allowing admin to post these because it's bound to get too many broke links. So first I added permission tags around the "Add New Quote" link in the quote_randomquote and quote_listquote templates Then I editted PHP Code:
K first the changes ( I didn't think to to copy the code prior to posting this so you might have to search by eye instead of with a text search. Not a very big templates anyway ) Find in quote_listbit template PHP Code:
PHP Code:
Next in the inquote_randomquote template ( If you only want to allow admin to submit quotes) **Recommended if you use this linking mod** Find PHP Code:
PHP Code:
PHP Code:
PHP Code:
Find PHP Code:
PHP Code:
Example: You want to link to this thread below all you need to enter is 8 in the context field. PHP Code:
Hope this helps some one. This hack be used in many applications. Random images, random links, random facts with read more etc... :D Your the best Cap'n Jaks |
This is how it would look for external links ( I use author as my title and not user so if you dont need the title in there chage it to suit your needs.)
PHP Code:
|
Quote:
|
You'd still need to convert the bbcode to HTML when people view the quote. Since there are no hooks in the hack yet, you'd have to parse it in quotes.php before it's printed out to the page.
|
Quote:
:D Jaks |
This is what they did for the downloads hack if it helps any
https://vborg.vbsupport.ru/showpost....&postcount=256 |
I tried to match stuff up and figure it out but it's a weeee bit over my head lol. Looks pretty straightforward until the db stuff. :S
|
Quote:
|
Try something like this:
HTML Code:
<if condition="in_array($_REQUEST['f'], array(forumid1, forumid2, forumid3))">$showrandomquote</if> |
Quote:
|
i installed it.... and it worked.... then for reasons i cannot explain.... it now says this
Database error in vBulletin 3.5.3: Invalid SQL: SELECT COUNT(*) AS count FROM quotes AS quotes WHERE approved = 1 AND quotes.average >= 0 AND quotes.rating >= 0; MySQL Error : Unknown column 'quotes.average' in 'where clause' Error Number : 1054 |
Run this query and tell me what it says:
Code:
SHOW CREATE TABLE $TPquotes |
i don't use a table prefix so i ran it as $quotes.... got some error...
anyways i uninstalled, and reinstalled... and it works again.... but... now i'm wondering if that reinstall.... wiped all my old quotes? And if so... I have the old database.... so it must be possible to import them somehow.... |
You should also have removed the dollar sign. Uninstalling will delete all your quotes, but if you have the backup you can restore your quotes table through phpMyAdmin or just run all the queries.
|
Quote:
Also, and atthe risk of looking extremely dim, what are the following for: Average Threshold and Total Threshhold. Also, what does 'enable context' do? Is that for BB code? Any help appreciated. |
|
Quote:
If they aren't allowed to show up in random posts until a certain rating is received, how do they appear at all to get their rating? I suppose I had just better try the threshold options and see what happens. Thanks for this feature, really adds to the site. |
They'll still show up when browsing the list of quotes, just not in the random quote on your forum home page.
|
Quote:
Code:
quotes CREATE TABLE `quotes` ( `quoteid` int(10) unsigned NOT NULL auto_increment, `quote` mediumtext NOT NULL, `author` mediumtext NOT NULL, `userid` int(10) unsigned NOT NULL default '0', `approved` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`quoteid`), KEY `approved` (`approved`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
You somehow reverted to the old quotes table. Run these queries to fix it, replacing $TP with your table prefix:
Code:
ALTER TABLE $TPquotes ADD COLUMN votes int (5) unsigned not null default 0 Code:
ALTER TABLE $TPquotes ADD COLUMN rating int (10) not null default 0 Code:
ALTER TABLE $TPquotes ADD COLUMN average float (3, 2) not null default 0.00 Code:
ALTER TABLE $TPquotes ADD COLUMN context varchar (250) |
sweet man... fixed it...appreciate your help
|
Great! However is there anyway I can make the random quote bit smaller? Thanks.
|
You'd have to edit the quote_randomquote template and rearrange it to your liking.
|
Thanks Cap'n Steve, installed and works fine :)
|
I've made a little modification that shows the name and avatar of the user that posted a quote. This is only shown in the random quote at forumhome. Maybe someone else also likes this so I thought to share it with you people :)
Here goes: Open the phrasemanager and add a new global phrase "added_by". Open the plugin "Random Quote" and find: Code:
eval('$showrandomquote = "' . fetch_template('quote_randomquote') . '";'); Above it, insert: Code:
require_once('./includes/functions_user.php'); Find Code:
<tr><td class="alt1" width="30%"></td> Code:
<tr><td class="alt1" width="20%">$vbphrase[added_by]:<br> Check http://forum.seti.nl/ for a demo. Enjoy Thanks go to amykhar, cause I used part of her code from her avatar on WOL hack :) |
Awesome! Thanks for sharing!
|
I am running vb 3.5.4 and CMPS v2
Everything works fine in the forum, and it shows up in moderation sections, it also kept the old quotes from my previous version which is awesome. Over all I cannot thank you enough for posting this Captain. The problem I am having is this: When I create the module for the CMPS home page, I follow your directions but when I hit Save or whatever, I get this message: You already have a Module with an identifier of ''. Please select a different identifier. Any ideas? I checked the modules page and no I don't already have anything for quote it in there. And I reverted my old quote it templates before installing. I appreciate any thoughts on it. |
Does it actually say the identifier is blank? Can you take and post a screenshot of the values you have filled out before you hit save?
|
Quote:
|
Just put whatever you want in the Identifier field. I suggest "Random Quote".
|
*sigh* so simple too. That worked thank you.
And noticing the 18 pages of questions and you being on the ball to answer each one, thanks for doing such an awesome job. Your hack is great and your support is great. *cheers* |
I upgraded from vB 3.0.7 -> 3.5.4.
What do I need to do to upgrade this mod? When I try to run the install xml, I get this: Invalid SQL: INSERT INTO datastore (title, data) VALUES ("quote_settings", "1:0::1:5:0:::"); MySQL Error : Duplicate entry 'quote_settings' for key 1 Error Number : 1062 I'd really like to not lose all my quotes. :( tnx |
Try using this instead of the version in the zip file:
|
Thanksk, Cap'n Steve! That worked!!
|
Awesome hack!
Is there anyway to make this so that guests/unregistered users wouldn't be able to see it on my main page? Thanks in advance. :) Oh and also, in the postbit. How do I change the link (submit to quotes) to an image? |
Quote:
Quote:
Then edit the link like this: Code:
<!-- hack: BEGIN QuoteIt! --> |
To hide the quote from guests, in your FORUMHOME template find
HTML Code:
$showrandomquote HTML Code:
<if condition="$vbulletin->userinfo[userid]"> |
All times are GMT. The time now is 03:59 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|