PDA

View Full Version : QuoteIt! 2.0 - Quote Management System


Pages : [1] 2

Cap'n Steve
04-10-2005, 10:00 PM
QuoteIt! version 2.0

QuoteIt! allows you to have a database of quotes integrated with your forum. Users submit quotes that can then be voted on by the other users, using your choice of two rating systems. The average installation will show a random quote on the forum home page, but you can include it on any vBulletin page. This was developed on vBulletin 3.0.7, but should work on 3.0.0 and above.

You can see a demo on forums.monkeycrap.com (http://forums.monkeycrap.com).
Instructions for adding a random quote to vBadvanced and vBindex are in this post.


Features (features new to 2.0 are in yellow)

Random Quote
- a random quote can be shown on any vBulletin powered page
- the administrator can set a default rating threshold that quotes must meet before showing up as the random quote
- the quote shown is much more random than in previous versions

Quote Database
- quotes can only be edited or deleted by an administrator
- quotes can be viewed individually or listed on several pages
- quotes can be sorted by total score, average score, author, submitter, or date added
- quotes now have a "context" field that can be turned on or off to include more information about the quote
- each post and private message now has a "Submit to Quotes" link that allows users to quote things said on your forum more easily

Quote Ratings System
- quotes can be rated either plus/minus or on a scale from 1 to 5
- quotes below a certain total score or average score can be filtered out

Quote Management
- quotes can either be automatically approved or moderated
- the administrator can now edit quotes
- the quote moderation que is now more like the que for posts, enabling the moderation of several quotes at once



Don't forget to click https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=79756)

This hack is based on QuoteIt! 1.2, originally by magnus. The "submit post" feature was inspired by an addon by CtrlAltDel. The location code is based on a post by Acido.

You may release translations of this hack as long as the original credits are included. Otherwise, you not redistribute this hack without permission from me.

seangworld
04-11-2005, 07:10 AM
this may be a dumb question, but what the heck is the difference between THIS quoteit and the one posted by magnus?

or is the diff going to be that you'll answer my question about my quotes that i posted in the other thread???

Carnage
04-11-2005, 11:37 AM
will it work with vb versions prior to 3.0.7 ?

if so i think you've got an instal... providing i can't find something better... i'm looking for something to use with our irc server to produce something akin to www.bash.org. As opposed to using forum posts for it... sounds like it should work for this purpose with little or no further modification.

Cyricx
04-11-2005, 11:44 AM
Seang, if you read above I believe he has highlighted in yellow all the changes he's made.

Prolly why magnus is labeld 1.2 and this one is 2.0 ;)

Looks great Cap, specially love the upgrade instructions! Will definately install.

TheComputerGuy
04-11-2005, 03:44 PM
<a href="http://www.runaked.com/forums" target="_blank">www.runaked.com/forums</a> will have it installed shortly! Thanks for this!

YLP1
04-11-2005, 05:11 PM
My community is going to LOVE this feature... Is there a CMPS Module for this? I am newer to VB and PHP and still learning the portal module creation thingie....I searched but couldn't find a module...anyone know how to do this? Thanks in advance.

Cap'n Steve
04-11-2005, 05:47 PM
The main difference is that this version allows you to rate the quotes, but there are several other improvements as well.

It's running on my forum, which is 3.0.3 with the security updates applied, so it should work on any version of vBulletin 3.

I forgot to add instructions for adding it to your portal, I'll do that today. In the meantime, you can probably figure it out yourself: the code that you add to index.php needs to be run, and then you just use the quote_randomquote template.

Lionel
04-11-2005, 05:56 PM
that seems to be using the same name and the same db name, the same everything. Which means I can't have both. I just finished 2 days ago installing a very nice rating system on 1.2 and I am using for jokes. Yours, I could use for quotes... I don't think it's fair to interfere with someone else hack and overwrite it.

Cap'n Steve
04-11-2005, 07:46 PM
This is simply an updated version of the original QuoteIt, meant to replace it. I asked magnus's permission, as he apparently doesn't have time to continue development on it.

TyleR
04-11-2005, 07:51 PM
Awesome :)

* TyleR clicks install

Acido
04-11-2005, 09:59 PM
I got this error with the upgrade installer:

mysql error: Duplicate entry 'quote_rating1--1' for key 2
mysql error number: 1062
Date: Monday 11th of April 2005 07:47:48 PM
Script: http://www.webconferencia.net/foros/admincp/install_quoteit.php?do=upgrade&step=1
Referer: http://www.webconferencia.net/foros/admincp/install_quoteit.php

May be a error in the installer sintaxis ?

Cap'n Steve
04-11-2005, 10:25 PM
I got this error with the upgrade installer:

You must have accidentally hit refresh or something because it's trying to add the template twice. Try going to yourdomain.com/admincp/install_quoteit.php?do=upgrade&step=2 to skip to the second step.

Cap'n Steve
04-11-2005, 10:31 PM
I've attached the instructions for adding a random quote to your portal. There are instructions for vBadvanced and vBindex, let me know if there are any others you would like.

ehjay
04-11-2005, 11:22 PM
I get the same error as Acido.
And you cannot skip to the second step, as you need to first to work correctly as it generates the quotes table.

Skipping to the second step, merely gives me another sql error resulting from the lack of said table.

Cap'n Steve
04-11-2005, 11:52 PM
Can you post the exact error that you're getting on the second step? The first step only inserts the templates, the second step is the one that creates tables.

Acido
04-11-2005, 11:59 PM
Can you post the exact error that you're getting on the second step? The first step only inserts the templates, the second step is the one that creates tables.

After run step=2 i needed install templates manually, taking the text from the installer.
After that all works Perfectly.
I have the CMPS module installed, working fine too :)

Thanx !

ehjay
04-12-2005, 12:10 AM
I had to do the same.
I think it may have to do with the former quote system I had installed.. you should bundle a complete uninstall for the former quote system as well.

The upgrade function didn't work initially.

Cap'n Steve
04-12-2005, 12:54 AM
I still don't know what's causing the template error, since it doesn't happen when I upgrade, but I uploaded a new zip file with an updated installer that should avoid it.

EDIT: I just realized that it was probably caused by having more than one style. I only had one style on my test forum! :o Oh well, it should work now.

Ski-Whiz
04-12-2005, 09:14 AM
I've attached the instructions for adding a random quote to your portal. There are instructions for vBadvanced and vBindex, let me know if there are any others you would like.


I run vbportal, is it hard for that CMS?

TheComputerGuy
04-12-2005, 01:01 PM
hi...

I installed it...or I should say upgraded it. The templates are really weird. I haven't touched them I just let them install.

www.runaked.com/forums

If you get a chance to take a look.

YLP1
04-12-2005, 04:07 PM
I am getting an error as well:

Database error in vBulletin 3.0.7:

Invalid SQL:
INSERT INTO vb3_template
(styleid, title, template, template_un, dateline, username, version) VALUES
(-1, "quote_rating1", "
$vbphrase[rate_this_quote]:
<form name=\\\"quote$quote[quoteid]\\\">
<input type=\\\"button\\\" name=\\\"plus\\\" id=\\\"plus\\\" value=\\\"+\\\" class=\\\"vote\\\" onclick=\\\"rateQuote(\'plus\', $quote[quoteid], \'quote$quote[quoteid]\');\\\" />
&nbsp;
<input type=\\\"button\\\" name=\\\"minus\\\" id=\\\"minus\\\" value=\\\"-\\\" class=\\\"vote\\\" onclick=\\\"rateQuote(\'minus\', $quote[quoteid], \'quote$quote[quoteid]\');\\\" />
</form>", "
$vbphrase[rate_this_quote]:
<form name=\"quote$quote[quoteid]\">
<input type=\"button\" name=\"plus\" id=\"plus\" value=\"+\" class=\"vote\" onclick=\"rateQuote(\'plus\', $quote[quoteid], \'quote$quote[quoteid]\');\" />
&nbsp;
<input type=\"button\" name=\"minus\" id=\"minus\" value=\"-\" class=\"vote\" onclick=\"rateQuote(\'minus\', $quote[quoteid], \'quote$quote[quoteid]\');\" />
</form>", "Robin", "3.0.7")

mysql error: Duplicate entry 'quote_rating1--1' for key 2

mysql error number: 1062

Cap'n Steve
04-12-2005, 04:53 PM
TheComputerGuy - It looks fine to me. What exactly is the problem? What browser are you using? Maybe you should attach a screenshot.

YLP1 - You also somehow already have the quote_rating1 template. Go to yourdomain.com/admincp/install_quoteit.php?do=x&step=2 (replace x with either install or upgrade). If that doesn't work, just delete all templates that start with quote_ and run the installer again.

I'll take a look at vbportal later today.

YLP1
04-12-2005, 05:29 PM
I didnt' get to the second step....I quit in case it caused damage. But I found another little issue....when I go to edit a quote.....the script is timing out.....all other queries for other things are working and no other timeouts are occuring....I think maybe this edit has something to do with the install db error? Just guessing here.

zetetic
04-12-2005, 06:42 PM
This is a great upgrade, Cap'n Steve. Thanks. :)

I got a parse error on the "Who's Online" page though, because when I copied and pasted the includes/functions_online.php code from your instructions it put "&-#-0-3-9-;"* in the code instead of apostrophes (marked red below). And I had to remove the apostrophes from around bburl.

'<a href="' . $vboptions['bburl'] . '/quotes.php?do=list">'

*Minus the hyphens, of course. I tried every bbcode here and couldn't write out that damn code without it getting converted.

Cap'n Steve
04-12-2005, 07:19 PM
Thanks for catching that typo, anyone who's already installed should replace ' with ' in includes/functions_online.php.

YLP1, you should download the installer again to be sure. I've updated it so it deletes every QuoteIt template before upgrading, just in case. I don't know what would cause the edit error, though.

EDIT: You're right about not being able to post ', the only way I could do it was by using empty bbcode tags in the middle of it. I think you found a bug in vBulletin.

YLP1
04-12-2005, 08:28 PM
Thanks for catching that typo, anyone who's already installed should replace ' with ' in includes/functions_online.php.

YLP1, you should download the installer again to be sure. I've updated it so it deletes every QuoteIt template before upgrading, just in case. I don't know what would cause the edit error, though.

EDIT: You're right about not being able to post ', the only way I could do it was by using empty bbcode tags in the middle of it. I think you found a bug in vBulletin.
I downloaded the file again and installed it in the correct directories.

Ran the installer as an upgrade and this is the error I recieved after the templates were modified:

Database error in vBulletin 3.0.7:

Invalid SQL:
ALTER TABLE vb3_quotes
ADD COLUMN votes SMALLINT(10) UNSIGNED NOT NULL DEFAULT 0,
ADD COLUMN rating MEDIUMINT(10) NOT NULL DEFAULT 0,
ADD COLUMN average FLOAT(3, 2) NOT NULL DEFAULT 0.00,
ADD COLUMN context VARCHAR(250),
ADD INDEX (rating),
ADD INDEX (average)

mysql error: Duplicate column name 'votes'

mysql error number: 1060

Date: Tuesday 12th of April 2005 05:28:51 PM
Script: http://www.yourlincolnpark.com/lpsforum/admin/install_quoteit.php
Referer: http://www.yourlincolnpark.com/lpsforum/admin/install_quoteit.php?do=upgrade&step=1

Should I try the new install vs upgrade??

Also, how would I delete a style template? I looked everywhere and can't find how to manually delete the quoteit templates that were installed or any other template deletion for that matter.

Cap'n Steve
04-12-2005, 08:30 PM
You already ran the second step then. Go to your admincp phrase manager and search for a phrase named quoteit. If that exists, your installation is complete, if not, skip to the third step of the installer.

ehjay
04-12-2005, 08:47 PM
The page that offers views of all the quotes is giving (null) errors whenever my users attempt to vote "+" or "-" on any particular quote.

you can see it in action here:
http://www.warboards.org/quotes.php?do=list

if you need to login, you can use the account test/asd

Cap'n Steve
04-12-2005, 09:23 PM
Did you modify the templates? Here's what the quote_rating1 template should look like:

$vbphrase[rate_this_quote]:
<form name="quote$quote[quoteid]">
<input type="button" name="plus" id="plus" value="+" class="vote" onclick="rateQuote(\'plus\', $quote[quoteid], \'quote$quote[quoteid]\');" />
&nbsp;
<input type="button" name="minus" id="minus" value="-" class="vote" onclick="rateQuote(\'minus\', $quote[quoteid], \'quote$quote[quoteid]\');" />
</form>

Notice that it actually uses a javascript function to fill in a hidden form, which is submitted all at once by the vote button at the bottom of the page.

EDIT: I just noticed rating your random quote doesn't work either. It might have something to do the javascript, although the rating does actually get recorded, for some reason it's not redirecting you back to the forum home page. The only thing I can think of is that there's something wrong with your $vboptions['forumhome'] variable, because that's what it redirects to.

Cap'n Steve
04-12-2005, 10:00 PM
I run vbportal, is it hard for that CMS?

Is there some sort of free version I could look at? I don't see anything about it at their site, and I'm not going to pay for something just to release an addon for it.

TheComputerGuy
04-12-2005, 10:27 PM
<a href="http://www.runaked.com/forums/quotes.php?do=list" target="_blank">http://www.runaked.com/forums/quotes.php?do=list</a>

When you check out that page...its like weird. Sorry I should have been more descriptive.

Cap'n Steve
04-12-2005, 10:53 PM
Ah, I see. I guess it only shows up in Internet Explorer. In that style, you have a 1 pixel white border defined for alt1 and alt2 class table cells. In the quote_listquote template, add this to the first table tag:

style="border-top:0;border-left:0;"

That should fix it.

YLP1
04-13-2005, 02:24 AM
You already ran the second step then. Go to your admincp phrase manager and search for a phrase named quoteit. If that exists, your installation is complete, if not, skip to the third step of the installer.

Ok I have the quoteit phrase but the edit quote is still timing out...

Cap'n Steve
04-13-2005, 03:32 AM
Have you tried adding and deleting quotes? There's really nothing special about editing a quote that should cause an error.

ehjay
04-13-2005, 03:55 AM
EDIT: I just noticed rating your random quote doesn't work either. It might have something to do the javascript, although the rating does actually get recorded, for some reason it's not redirecting you back to the forum home page. The only thing I can think of is that there's something wrong with your $vboptions['forumhome'] variable, because that's what it redirects to.

I don't know.. I am running two custom variations on the standard templates, but the errors are still present when both are reset to their defaults.

YLP1
04-13-2005, 11:51 AM
Have you tried adding and deleting quotes? There's really nothing special about editing a quote that should cause an error.

I can add and delete quotes and use the submit to quotes link with no issue but it is choking (timing out on the edit). I created a test/test login if you want to check it out. http://www.yourlincolnpark.com/LPSForum/lpsforum.php

This is the url in the address bar when I receive the timeout: http://www.yourlincolnpark.com/LPSForum/quotes.php?do=editquote&quoteid=21

The rate this quote + and - appears to work on the random quote on the forum page but the rate this quote + / - doesn't work when you are in the view all quotes screen......when I view all quotes there is a VOTE button at the bottom of the quotes.....I click it but don't know what it does.

The editing is an issue for me more than the rating system.

Any ideas on this?

Cap'n Steve
04-13-2005, 02:26 PM
ehjay - The problem is with the form you have set up. On the randomquote, you don't have vote defined, on the list of quotes you have it set to either + or -. It should be "vote=plus" or "vote=minus".

YLP1 - The ratings on the list of quotes work like this: you select your rating for the quotes, then click the vote button to send your votes. As for the edit thing, can you use the "Submit to quotes" feature for posts? The only thing different about the editing is that it uses the html_entity_decode() and str_replace() functions, other than that it's almost identical to the add quote code. You might have to ask your host for help.

YLP1
04-13-2005, 02:53 PM
ehjay - The problem is with the form you have set up. On the randomquote, you don't have vote defined, on the list of quotes you have it set to either + or -. It should be "vote=plus" or "vote=minus".

YLP1 - The ratings on the list of quotes work like this: you select your rating for the quotes, then click the vote button to send your votes. As for the edit thing, can you use the "Submit to quotes" feature for posts? The only thing different about the editing is that it uses the html_entity_decode() and str_replace() functions, other than that it's almost identical to the add quote code. You might have to ask your host for help.
Yes I can use the submit to quotes feature ...the only real issue is the timeout on the edit.

I spoke with my ISP mySQL/PHP manager and of course they are saying it's the script because no other timeouts are occurring.

Is there a way to go back to the previous version without me messing everything up?

Cap'n Steve
04-13-2005, 03:11 PM
Yes, you can probably just replace the php files with the old versions, but I can't help you much with that if anything goes wrong. If the editing is the only problem, I'm not sure why you'd want to do that anyway, since 1.2 doesn't have editing at all. All I can suggest is to look at the error log and have your host try and see what's running for so long when you try and edit the quote. The database query is about as simple as it can get, and there's very little code being run, so there's no reason it should be taking a long time.

j_86
04-14-2005, 02:51 PM
I like the hack, but the table arrangement is very very messy when not used in 100% width forums on a 1024x760 screen.

Not too pleasing to the eye.

j_86
04-14-2005, 03:09 PM
Tryign to redraw the randomquote table - i'd like to be able to get $randomquote[userid] (the one who submitted the quote) visable there - anyone know how?

zetetic
04-14-2005, 03:15 PM
Tryign to redraw the randomquote table - i'd like to be able to get $randomquote[userid] (the one who submitted the quote) visable there - anyone know how?
If you want the person's name it's $randomquote[username]. Where are you looking to have it show up?

j_86
04-14-2005, 03:24 PM
On the forumhome. I do not believe $randomquote[username] is queryed for in the index.php code but I will check :)

EDIT: No it is not.

zetetic
04-14-2005, 03:35 PM
On the forumhome. I do not believe $randomquote[username] is queryed for in the index.php code but I will check :)

EDIT: No it is not.
Oh, I see. It must be queried for in quotes.php, 'cause it's used in the quote_listquote template. You can probably get the query from there and put it in index.php...

Greebo
04-14-2005, 03:51 PM
I'm trying to use this with the CMPS module that I had displaying quotes before but my module simply isn't showing up at all. Has anyone gotten this update working with CMPS? I ended up having to revert my module code back to the original and the template as well. :(

zetetic
04-14-2005, 04:03 PM
I'm trying to use this with the CMPS module that I had displaying quotes before but my module simply isn't showing up at all. Has anyone gotten this update working with CMPS? I ended up having to revert my module code back to the original and the template as well. :(
I haven't tried it yet, but Cap'n Steve gave instructions in this post (https://vborg.vbsupport.ru/showpost.php?p=639397&postcount=13).

Greebo
04-14-2005, 04:28 PM
Thanks I'll check it out.

Greebo
04-14-2005, 04:31 PM
That did the trick, but one flaw in the instructions - you pick the quote.php file ONLY, don't specify the template too - its an either or setup. :) But now it works - thanks! :)

j_86
04-14-2005, 04:46 PM
Still a work in progress, but part way through redrawing the FORUHOME quote display (see bottom) http://www.ugamer.net/forums/index.php?

Still would like to know what to add to index.php so I can use $randomquote[username] :)

zetetic
04-14-2005, 05:41 PM
That did the trick, but one flaw in the instructions - you pick the quote.php file ONLY, don't specify the template too - its an either or setup. :) But now it works - thanks! :)
I just installed it too. :)

You're right that you don't put the template name under "OR template to include...", but you are supposed to put it in the box called "Templates Used" (so it gets cached).

Cap'n Steve
04-14-2005, 06:13 PM
If you want to add the username to the random quote, in index.php find:
$randomquote = $DB_site->query_first('
SELECT quotes.* FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1
');

Replace that with:
$randomquote = $DB_site->query_first('
SELECT quotes.*, user.username FROM ' . TABLE_PREFIX . 'quotes AS quotes
LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON quotes.userid = user.userid
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1
');

I don't see what you mean about the tables being messy. Could you post a screenshot? That's an interesting redesign of the random quote you've got going there.

j_86
04-14-2005, 07:25 PM
Thanks Capn'

One question; when you do a vote on the randomquote display on forumhome, does it register the vote or are you just taken to the quote view page where you need to do it again?

Cap'n Steve
04-14-2005, 07:40 PM
In my version, it registers the vote and redirects you back the forumhome. Are you asking how to add that to your redesign? Just have a form that calls quotes.php with quoteid=$randomquote[quoteid], do=rate and vote=whatever number's in the select box (or the word "plus" or "minus" if you're using that system).

j_86
04-14-2005, 08:04 PM
Hi again;

Could you show me how to incorporate the above information to get this working (into my below form)? Thank you.

<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value="">Average Rating: $randomquote[average]</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</form>

Cap'n Steve
04-14-2005, 08:11 PM
Use this:
<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="do" id="do" value="rate" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value="">Average Rating: $randomquote[average]</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</form>

j_86
04-14-2005, 08:13 PM
Great! One last question I hope; any conditionals to use to see if the current user has voted yet (template conditionals)?

Cap'n Steve
04-14-2005, 08:48 PM
Just surround it with:
<if condition="$vboptions[ratequote]==2">
</if>

j_86
04-14-2005, 10:01 PM
Here is what i'm coming up with so far, in the re-drawing of the random quote template. It is complete for my needs, but if i'm allowed to release it (Cap'n), i'll make it compatiable with all other voting modes etc.

I'm also going to be releasing an addon, shortly, that adds a "X Quotes Pending Moderation" on the Quick Stats view on AdminCP Home (if enabled).

Thanks.

Please see the screenies so far - tell me if you like them.
One of them shows the quote view.
One of them shows the drop down menu after you have voted.
One of them shows the drop down menu with voting options.
(all whilst logged in with full admin perms)

j_86
04-14-2005, 10:11 PM
Capn' - I think I found a bug, in that there is nothing displayed on the nav tree at the top of the page when editing a quote (it would normaly show: "Forum name" and then "Quotes" underneath it).

Cap'n Steve
04-15-2005, 01:58 PM
Those templates look pretty cool. Go ahead and release them, you don't really need my permission to release an addon anyway.

Thanks for pointing out that bug. It's fixed in the installer now. If you want to fix it on your forum, go to the phrase manager in your administrator control panel, find the phrase called "quote_manager" and change the phrase type to global.

j_86
04-15-2005, 02:04 PM
Thank you, I will do soon.

Also been redesigning the listbit templates;

http://www.ugamer.net/forums/quotes.php

j_86
04-15-2005, 02:33 PM
I'd like to be able to generate the following information, but I do not know how to.

On quotes.php (when listing quotes), I want to be able to display the following information;

Total number of quotes
Total number of quotes in moderation queue

Anyone care to help? Thanks;

Jamie

Cap'n Steve
04-15-2005, 02:46 PM
$quotecount['quotes'] holds the number of quotes that are approved and meet the rating threshold the user has set.

If you want to add more, in quotes.php find:
$gradient2 = str_replace('#', '', $stylevar['alt2_bgcolor']);

Under that you can add:
$totalcount = $DB_site->query_first('
SELECT COUNT(*) AS all FROM ' . TABLE_PREFIX . 'quotes
');

or
$modcount = $DB_site->query_first('
SELECT COUNT(*) AS moderation FROM ' . TABLE_PREFIX . 'quotes
WHERE approved = 0
');

In this example, $totalcount['all'] will be the number of total quotes (add "WHERE approved = 1" to only count quotes that have been approved) and $modcount['moderation'] will be the number of quotes awaiting moderation.

j_86
04-16-2005, 04:27 PM
Thanks again Cap'n Steve.

I have a few more modifications i'd like to make (and release them as addons later, or maybe even give them back to you to release a Version3? :o).

I want to be able to send a PM to people who submitted a quote on approval/rejection.

I have this PM code;

function SendPM($message,$title,$to,$from)
{
global $DB_site;

// Permssions Crap XD your getting a damn PM!! XD
// Parse It Out
$title = addslashes(htmlspecialchars_uni(fetch_censored_tex t($title)));
$message = addslashes(fetch_censored_text($message));
$to=$DB_site->query_first("select * from ".TABLE_PREFIX."user where userid='{$to}'"); // Grab Member Its Going TO
$from=$DB_site->query_first("select * from ".TABLE_PREFIX."user where userid='{$from}'"); // Grab Member Its Coming FROM

// Insert The Message
$to_string["$to[userid]"] = $to['username'];
$now=time();
$DB_site->query("insert into ".TABLE_PREFIX."pmtext (fromuserid,fromusername,title,message,touserarray ,iconid,dateline,showsignature ,allowsmilie) values ('{$from['userid']}','".addslashes($from['username'])."','{$title}','{$message}','".addslashes(serialize($to_string))."','4','{$now}','1','1')");
// id thingy
$DB_site->query("insert into ".TABLE_PREFIX."pm (pmtextid, userid) values (".$DB_site->insert_id().", '{$to['userid']}')");

if ($to['pmpopup'])
{
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid='{$to['userid']}'");
}
else
{
$DB_site->shutdown_query("update ".TABLE_PREFIX."user set pmtotal=pmtotal+'1',pmunread=pmunread+'1' WHERE userid='{$to['userid']}'");
}


// Update pm count

}


But I need to know where to put this code, and I also need to know in what variable the USERID is stored, when approving quotes.

I'm looking at inserting the PM code here -

Find: $DB_site->query('
UPDATE ' . TABLE_PREFIX . 'quotes SET
approved = 1,
quote = "' . $quote[$quoteid] . '",
author = "' . $author[$quoteid] . '"
' . $contextval . '
WHERE quoteid = ' . intval($quoteid)
);
Add under; (pm code above).

Thank you;

Jamie

Cap'n Steve
04-17-2005, 02:24 AM
I've just updated the hack with a couple small bug fixes. If you use the "Submit to Quotes" feature for posts and have context enabled, you should replace your quotes.php and admincp/quoteadmin.php files with the new copies. Also, in the style manager in your administrator control panel, edit the template quote_addquote and delete all instances of maxlength="75"

JimpsEd -
In admincp/quoteadmin.php find:
$deleted[] = intval($quoteid);

Below that, add:
SendPM('Your quote "' . $quote[$quoteid] . '" has been rejected.', 'Quote ' . intval($quoteid) . ' rejected.', intval($user[$quoteid]), $bbuserinfo['userid']);

In the same file, find:
print_input_row($vbphrase['author'], 'author[' . $quote['quoteid'] . ']', $quote['author'], 0);

Below that, add:
construct_hidden_code('user[' . $quote['quoteid'] . ']', $quote['userid']);

In the same file, find:
$context = &$_REQUEST['context'];

Below that, add:
$user = &$_REQUEST['user'];

Finally, in the same file, find:
}
elseif ($action == -1) {

Above that, add:
SendPM('Your quote "' . $quote[$quoteid] . '" has been approved.', 'Quote ' . intval($quoteid) . ' approved.', intval($user[$quoteid]), $bbuserinfo['userid']);

Note: I haven't tested this, so keep a backup of your quoteadmin.php file just in case.

EDIT: I don't know where that SendPM function came from, so in admincp/quoteadmin.php, find:
require_once('./global.php');

and add your code below that.

YLP1
04-17-2005, 04:37 AM
Hey Cap'n Steve... something in the revised php pages and the text above fixed my timing out issue on edit.

Go figure....LOL LOL

Cap'n Steve
04-17-2005, 05:05 AM
That's really weird. The only thing that changed in the quote editing part was adding two more calls to str_replace(). I really think there must be something strange with the way your host has php set up.

j_86
04-17-2005, 11:03 AM
Thanks Cap'n - all the PM stuff works :)

YLP1
04-24-2005, 06:16 AM
That's really weird. The only thing that changed in the quote editing part was adding two more calls to str_replace(). I really think there must be something strange with the way your host has php set up.

Wouldn't surprise me as they hosed my db and site a few days ago and then decided they would try and fix it before I found out (my site was going down at least 3 times a day and I was complaining).

Well one of the ones with brains decided to figure out why my portal page and wasn't showing so found an old index backup in my file directory and used that.

They ended up hosing my navigation on the forums, breaking this mod, the arcade and my journal mod.

Can't wait for my own server to be ready....

anarchystar
04-25-2005, 04:31 AM
I upgraded from 3.0.5 to 3.0.7 and also upgraded VBACMPS to 1.0.1. I upgraded to quoteit1.2 to 2.0, everything seems to have installed just fine, all my phrases and templates and in place, but when I added the module I still can't get the mod to show up on the index page .... any suggestions?
The mod is active, and selected to appear on the index page, it just does'nt???

Cap'n Steve
04-25-2005, 09:05 PM
Did you set "Show random quote" to yes in the QuoteIt options? It won't show up if that's not enabled.

anarchystar
04-26-2005, 12:57 AM
Did you set "Show random quote" to yes in the QuoteIt options? It won't show up if that's not enabled.

yea, everything is set up corectly ... it just does'nt show up, not even the template. If I go to /quotes.php all my old quotes display, plus I can add quotes from that page, and from posts with the "submit to quotes" link.

I am completely stumped, I even went back and double checked all the code modifications, etc. Any tips on what the problem might be ? :ermm:

Cap'n Steve
04-26-2005, 05:00 AM
For some reason, the template isn't making it to the page. Either $showrandomquote is misspelled in the FORUMHOME template, or something's wrong with your quote_randomquote template. This is what should be in that template:

<style type="text/css">
.vote {
color:$stylevar[smallfont_fgcolor];
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:110%;
font-weight:bold;
background-color:$stylevar[button_bgcolor];
<if condition="$vboptions[ratequote]==1">
width:25px;
height:25px;
</if>
border-top-color:$stylevar[alt2_bgcolor];
border-left-color:$stylevar[alt2_bgcolor];
border-right-color:$stylevar[alt1_bgcolor];
border-bottom-color:$stylevar[alt1_bgcolor];
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#aa$gradient1',EndC olorStr='#aa$gradient2');}
}
</style>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat">
$vbphrase[random_quote]
</td><td class="tcat" align="right">
<div align="right">

(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>

<if condition="$bbuserinfo['permissions']['adminpermissions']">
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</if>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
</div>
</td><td class="tcat" style="width:15px;">
<div style="float:right;" align="right">
<a href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a></div>

</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if></p>
</div>
</td><td class="alt1" valign="top">
<a style="float:$stylevar[right];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
</td>

</tr>
<if condition="$vboptions[ratequote]==3">
<tr><td class="alt1" align="left" colspan="3">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
</if>

<if condition="$vboptions[ratequote]==1">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="rateplus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="plus" />
<input type="submit" value="+" class="vote" />
</form>
&nbsp;
<form name="rateminus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="minus" />
<input type="submit" value="-" class="vote" /></form>
</td>
</if>
<if condition="$vboptions[ratequote]==2">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value=""></option>
<option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
<option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
<option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
<option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
<option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
</select>
</form>
</td>
</if>

</tr>
</tbody>
</table><br />

anarchystar
04-26-2005, 07:26 AM
I will check that against what I have, and check the spelling of $showrandomquote also, but I am pretty sure I cut and paste about everything from teh install direstions. I'll give it another shot and let you know how it turns out. Thanks again :D

anarchystar
04-26-2005, 09:40 AM
well ... $showrandomquote was spelled alright and this is what was in my quote_randomquote template:

--- I will go back and check the code modifications again, just to make sure.


<style type="text/css">
.vote {
color:$stylevar[smallfont_fgcolor];
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:110%;
font-weight:bold;
background-color:$stylevar[button_bgcolor];
<if condition="$vboptions[ratequote]==1">
width:25px;
height:25px;
</if>
border-top-color:$stylevar[alt2_bgcolor];
border-left-color:$stylevar[alt2_bgcolor];
border-right-color:$stylevar[alt1_bgcolor];
border-bottom-color:$stylevar[alt1_bgcolor];
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#aa$gradient1',EndC olorStr='#aa$gradient2');}
}
</style>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat">
$vbphrase[random_quote]
</td><td class="tcat" align="right">
<div align="right">

(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>

<if condition="$bbuserinfo['permissions']['adminpermissions']">
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</if>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
</div>
</td><td class="tcat" style="width:15px;">
<div style="float:right;" align="right">
<a href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a></div>

</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if></p>
</div>
</td><td class="alt1" valign="top">
<a style="float:$stylevar[right];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
</td>

</tr>
<if condition="$vboptions[ratequote]==3">
<tr><td class="alt1" align="left" colspan="3">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
</if>

<if condition="$vboptions[ratequote]==1">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="rateplus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="plus" />
<input type="submit" value="+" class="vote" />
</form>
&nbsp;
<form name="rateminus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="minus" />
<input type="submit" value="-" class="vote" /></form>
</td>
</if>
<if condition="$vboptions[ratequote]==2">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value=""></option>
<option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
<option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
<option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
<option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
<option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
</select>
</form>
</td>
</if>

</tr>
</tbody>
</table><br />

anarchystar
04-26-2005, 10:18 AM
This is kicking my ass, I checked all the code again, it's perfect. My quoteit settings are good, it just won't show up.

here is the listbit page if you wanna look: http://forums.anarchystar.com/quotes.php

Like I said, I can add quotes, delete quotes, and edit them. It just won't display on the forum index page. I have even tried it on different places in the template.
Let me know if you think of anything else I can try.

Cap'n Steve
04-26-2005, 04:55 PM
Hmmm. The problem is that $showrandomquote ends up empty for some reason. That means either there's something wrong with the index.php code (although this wouldn't explain why it doesn't show up on your portal page either), or it's never getting the template for some reason.

Enable debug mode (by adding $DEBUG = 1; at the bottom of includes/config.php) and see if the quote_randomquote template is in the list of templates used on that page. If it is, click on "explain" and see if there are any queries that mention your quotes table. If there aren't, then it must be a problem with your settings.

anarchystar
04-27-2005, 07:12 AM
The quote_randomquote template is not listed anywhere on my index.php or in the portal. I will look at my settings again, but I am sure that everything is set up correctly.
Can you think of any other reason that cause the template not to appear?

anarchystar
04-27-2005, 07:39 AM
Hey, just so you know I am not completly nuts, I attached a screen shot of the FORUMHOME template where $showrandomquote is, and a shot of my settings from my AdminCP, and the html output of my index.php. Maybe you will see something I missed.
Meanwhile, I will go look at the code again ... is there any chance this is something in a data table?

Cap'n Steve
04-27-2005, 06:08 PM
In your admincp, go to vBulletin Options, then vBulletin Options and select Forums Home Page Options. There's a Display Random Quote option there that should also be set to yes. It should be already, since you set it from the QuoteIt! Options, but check to be sure.

If that doesn't work, click the debug mode explain link that I talked about in my previous post and see if it mentions your quotes table.

Besides that, the only thing that could be wrong is something with the index.php edit, although like I said, that wouldn't affect vBadvanced. Post the code you added to index.php and I'll check it out to be safe.

anarchystar
04-28-2005, 02:59 AM
bingo .... that looks like it may be the problem. When I went to that part of vBoptions I got the following error at the top of the page:

Parse error: parse error, unexpected T_STRING, expecting ']' in /var/www/forums/includes/adminfunctions_options.php(96) : eval()'d code on line 1


and, the setting to display the random quotes in that area was not there, also there were no options listed for the quote rating system value.

That must be where the problem is. Unfortunatly, I am on a friends computer now, so I will have to wait untill I get home to look at the code in adminfunctions_operations.php .

Hopefully I can get that fixed up later and get this thing working again.

Cap'n Steve
04-28-2005, 04:43 AM
That's weird, I'm getting that error now too, but my settings work fine. It's a problem with the options list for the quote ratings. Upload the attached file to your admincp and run it once to fix it.

anarchystar
04-28-2005, 06:00 AM
Alright, i ran that script and it did clear up that parse error that I posted earlier, but it does'nt show up anywhere where I put $showrandomquote ...

In the post you made earlier, you said that there should be an option to display random quote in the forum home page options. I don't have that option there, all I have is an option to select the rating scale for quoteit, random quote average threshhold, and random quote total threshhold. Am I missing an option there?

Also when I select a quote rating option from forum home page options and save it, it will always display disabled no matter what I pick, but it will diplay the option I chose in the quoteit options.

Cap'n Steve
04-28-2005, 07:54 AM
Yes, you are missing an option and I can't see how that would happen, since that option is actually left over from the old version. I've updated the quoteit_fix.php to fix the problem of the wrong option being selected. You can run it again to have it show the correct setting, although that's not what's causing your main problem.

To manually set the "showquote" variable, you can run this SQL query:
UPDATE $TPsetting SET value = 1
WHERE varname="showquote"

If for some reason you don't have that variable, the first query will
give you an error and you should run this one instead:
INSERT INTO $TPsetting
(varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES
("showquote", "forumhome", 1, 1, "yesno", 5, 0, 0)

Be sure to replace $TP with your table prefix.

anarchystar
04-28-2005, 03:08 PM
I ran the first query from your last post with no errors in my phpmyadmin.

It's still not showing up, lol .... on the bright side, I also ran the new fix script you made, and it cleared up that other issue ... at least it's progress, right? :D

Can you tell me specifically what code I need to look for to confirm that option that should be in forum home page settings?

I am going to re-check my code again, just to be extra, extra sure I have it all right ... would it help if I attached any of those .php files for you to look at yourself? If you want to check any of them just tell me which ones you need.

Cap'n Steve
04-28-2005, 06:26 PM
The first one is my fault, I forgot that it needs to rebuild the datastore. You can just run this query:
DELETE FROM $TPdatastore WHERE title = "options"

and it will rebuild it with the new options the next time someone loads a page. That should get the random quote to show up. To see if you have the appropriate options saved in the database, run these queries and post what they return:
SELECT * FROM $TPphrase WHERE varname = "setting_showquote_desc" OR varname = "setting_showquote_title"

SELECT * FROM $TPsetting WHERE varname = "showquote"

Don't forget to replace $TP with your table prefix.

anarchystar
04-28-2005, 09:07 PM
ok, I ran the first query, but the missing option is still MIA ... no luck with that :disappointed:

Ran the next 2 queries and did a screen capture of the output for you.

emtee
04-28-2005, 10:07 PM
anarchystar, note that you have to approve the quote after you add it. It's under Moderation/Moderate Quotes. If you don't approve, you won't see anything in forumhome.

anarchystar
04-28-2005, 10:16 PM
I have moderate quotes turned off

anarchystar
04-28-2005, 10:23 PM
and it will rebuild it with the new options the next time someone loads a page. That should get the random quote to show up. To see if you have the appropriate options saved in the database, run these queries and post what they return:
SELECT * FROM $TPphrase WHERE varname = "setting_showquote_desc" OR varname = "setting_showquote_title"

SELECT * FROM $TPsetting WHERE varname = "showquote"

Don't forget to replace $TP with your table prefix.

On a whim I went back and ran that 2nd query from this post even though I did not get an error from teh first query. That fixed the problem! I can see the mod now, thanks for the awesome support!

Cap'n Steve
04-28-2005, 10:37 PM
Whoops, that's right. I should have known that an update query wouldn't cause an error if the row didn't exist. :o I still have no idea why that setting disappeared in the first place, but as long as it works now I guess it doesn't matter.

mtha
04-29-2005, 05:10 AM
not running really smooth. you should add a Uninstall link in install_quoteit.php too.

it takes 3 queries when running :(, that's too much

Cap'n Steve
04-29-2005, 05:41 AM
Do you mean the random quote? You can skip one query by disabling the ratings system and one of the others is just a count query, so it should still be quite fast.

anarchystar
04-29-2005, 06:28 AM
Hey Cap'n'Steve ... I hate to bug you again, but I was wondering if you could give me a hand with a template question.
If you look at the block on my portal at www.anarchystar.com you can see how it is kinda divided into 3 table rows. How can I make the random quotes span across all 3 rows so it does'nt get sqeezed in the middle row?
I have been playing around with the html all night and can't seem to get it quite right.

Cap'n Steve
04-29-2005, 05:09 PM
In your quote_randomquote template, it looks like you have this right now:
<tr><td class="alt2"></td>
<td class="alt2" width="70%"><div margin-right:20%;>
<i><p>$randomquote[quote]</p></i>

<p style="font-weight:bold;margin-left:50%;">- $randomquote[author]</p>
</div>
</td><td class="alt2" valign="top">
<!-- no quoteid

<a style="float:right;" href="http://forums.anarchystar.com/quotes.php?do=view&quoteid=35">#35</a>

end no quoteid-->

</td>



</tr>

Replace that with this:
<tr>
<td class="alt2" colspan="3" width="70%"><div margin-right:20%;>
<i><p>$randomquote[quote]</p></i>

<p style="font-weight:bold;margin-left:50%;">- $randomquote[author]</p>
</div>
</td>
</tr>

I haven't tested it, but it should work.

anarchystar
04-30-2005, 03:56 AM
Sweet, that did the trick, thanks once again for the excellent support.

zetetic
05-01-2005, 02:46 AM
I just added this conditional (colored text below) to the quote_listquote template so the "show only quotes with ____ rating" stuff doesn't show up at the top of the page if you have ratings disabled. :)

<if condition="$settings[1] != 0">
<div align="center" style="color:$stylevar[smallfont_fgcolor];">
$vbphrase[show_only_quotes_with]
<form name="threshold" action="quotes.php">
<select class="form" name="type" id="type" onchange="document.threshold.elements[1].name=this.value;">
<option value="total">$vbphrase[total_rating]</option>
<option value="average">$vbphrase[average]</option>
</select>
$vbphrase[greater_than_or_equal_to]
<input type="text" class="form" name="total" size="5" />
<input type="submit" class="form" value="$vbphrase[show]" />
</form>
</div><br />
</if>

Cap'n Steve
05-01-2005, 04:12 AM
Wow, I can't believe I didn't put that in there. Thanks for pointing it out, it'll be included in the next version.

zetetic
05-01-2005, 04:26 PM
Wow, I can't believe I didn't put that in there. Thanks for pointing it out, it'll be included in the next version.
Glad to help. You've done a great job updating this. :)

angelicGrace
05-03-2005, 02:12 AM
Great hack. I just love it. I love the amount of countrol my admin staff have over it. I have a few members on my site that are less than scrupless, so this lets me make sure they aren't adding dubious quotes to the system.

Torqued
05-06-2005, 08:58 PM
Voting (1-5) from the random quotes box is not working for me.

Also, would be nice to have a way to edit/reset the votes for a quote.

Great hack, though! :)

* Torqued clicks install

Cap'n Steve
05-07-2005, 04:39 AM
Yep, you found another typo. I guess you're the first person to use the 1 to 5 rating style.

To fix it, replace your quote_randomquote template with this updated version:
<style type="text/css">
.vote {
color:$stylevar[smallfont_fgcolor];
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:110%;
font-weight:bold;
background-color:$stylevar[button_bgcolor];
<if condition="$vboptions[ratequote]==1">
width:25px;
height:25px;
</if>
border-top-color:$stylevar[alt2_bgcolor];
border-left-color:$stylevar[alt2_bgcolor];
border-right-color:$stylevar[alt1_bgcolor];
border-bottom-color:$stylevar[alt1_bgcolor];
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#aa$gradient1',EndC olorStr='#aa$gradient2');}
}
</style>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat">
$vbphrase[random_quote]
</td><td class="tcat" align="right">
<div align="right">

(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>

<if condition="$bbuserinfo['permissions']['adminpermissions']">
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</if>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
</div>
</td><td class="tcat" style="width:15px;">
<div style="float:right;" align="right">
<a href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a></div>

</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if></p>
</div>
</td><td class="alt1" valign="top">
<a style="float:$stylevar[right];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
</td>

</tr>
<if condition="$vboptions[ratequote]==3">
<tr><td class="alt1" align="left" colspan="3">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
</if>

<if condition="$vboptions[ratequote]==1">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="rateplus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="plus" />
<input type="submit" value="+" class="vote" />
</form>
&nbsp;
<form name="rateminus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="minus" />
<input type="submit" value="-" class="vote" /></form>
</td>
</if>
<if condition="$vboptions[ratequote]==2">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value=""></option>
<option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
<option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
<option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
<option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
<option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
</select>
</form>
</td>
</if>

</tr>
</tbody>
</table><br />

angelicGrace
05-07-2005, 12:28 PM
quote_randomquote is a template or a php file? sorry I am still rather new to hacking you have to talk like I am stupid when it comes to updates.

Cap'n Steve
05-07-2005, 06:46 PM
It's a template. Just go into your style manager, edit the quote_randomquote template and replace it with the code in the post above.

angelicGrace
05-07-2005, 07:18 PM
Coolness. All updated.

While I am thinking about it. in my quote display box on my forum home, the spacign seems funny. the quotes themselves start just left of center. leaveing over a 150 empty pixels of space to the left of the begining of the quote. Is there a way to make it more centered inside the display box?

To see what I am talking about you can visit my site at www.now-n-then.net/forum

Cap'n Steve
05-07-2005, 09:31 PM
In your quote_randomquote template, find:
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">

The 30% represents the margin on the left, the 10% is an additional margin for the quote amd the 25% is the margin for the author. You can adjust these numbers until it looks good. You probably want the margins instead of just centering it, since a centered multi-line quote looks weird.

angelicGrace
05-07-2005, 10:09 PM
Thank you so much. :) I am sorta a neat freak. I prefere centered on certian things. I even have the sigs auto-centered cause i can't stand them on the default left. lol

Cap'n Steve
05-08-2005, 04:08 AM
Well, if you really want it all centered (I'm warning you, though, it looks terrible) find this in your quote_randomquote template:
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if>

and replace it with this:
<tr>
<td class="alt1" colspan="2"><div style="font-style:italic;text-align:center;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if>

That should solve it, but I haven't had time to test it.

angelicGrace
05-08-2005, 03:15 PM
I was able to "center" the logn quotes, which is what I was wiggin over. :) but thanks for going the extra mile. rock on. and happy mother's day to the women in you life.

Torqued
05-09-2005, 06:58 PM
I would love to be able to put the quotes into categories and then browse quotes by category. :) Or only pull random quotes from a single category. This would be really cool to display random quotes in my image gallery for a specific theme/subject.

Here's my implementation of this mod: http://www.torqued.org/news

Cap'n Steve
05-10-2005, 04:32 AM
I actually thought about adding categories to this version but decided against it. Here's a list of what I hope to include in the next version (which will probably not be out for a while, though):

- quote categories
- dated quotes
- view only new quotes
- view only quotes you haven't rated

Any suggestions for other features would be appreciated!

Megareus Rex
05-12-2005, 09:33 PM
Ok, a problem:

The phrase mod part gives this error;

INSERT INTO vb3_phrase
(languageid, varname, text, phrasetypeid) VALUES
(0, "submitted_by", "Submitted by", 2),
(0, "number_of_quotes_to_moderate", "Number of quotes to moderate at one time", 2),
(0, "default_threshold", "Default Threshold", 2),
(0, "enable_context", "Enable Context", 2),
(0, "ratings", "Ratings", 2),
(0, "approve", "Approve", 2),
(0, "author", "Author", 1),
(0, "submit_to_quotes", "Submit to Quotes", 1),
(0, "moderate_quotes", "Moderate Quotes", 2),
(0, "disabled", "Disabled", 2),
(0, "plus_or_minus", "Plus or Minus", 2),
(0, "quoteit_options", "QuoteIt! Options", 2),
(0, "1_to_5", "1 to 5", 2),
(0, "show_random_quote", "Show random quote", 2),
(0, "average_threshold", "Average Threshold", 2),
(0, "total_threshold", "Total Threshold", 2),
(0, "quoteit", "QuoteIt!", 2),
(0, "context", "Context", 1),
(0, "edit_this_quote", "Edit this Quote", 1),
(0, "adding_a_quote", "Adding a quote.", 1),
(0, "editing_a_quote", "Editing or deleting a quote.", 1),
(0, "sort_by", "Sort by", 1),
(0, "quote_id", "Quote ID", 1),
(0, "user_id", "User ID", 1),
(0, "show", "Show", 1),
(0, "greater_than_or_equal_to", "greater than or equal to", 1),
(0, "total_rating", "Total rating", 1),
(0, "average", "Average", 1),
(0, "quotes", "Quotes", 1),
(0, "show_only_quotes_with", "Show only quotes with", 1),
(0, "vote", "Vote", 1),
(0, "added_by", "Added by", 1),
(0, "rate_this_quote", "Rate this quote", 1),
(0, "posted_in_thread", "Posted in thread", 1),
(0, "setting_ratequote_title", "Quote Ratings System", 5000),
(0, "setting_ratequote_desc", "This allows you to choose what ratings scale the quotes will use or disable the ratings completely.", 5000),
(0, "setting_averagethreshold_title", "Random Quote Average Threshold", 5000),
(0, "setting_averagethreshold_desc", "The minimum average rating necessary for a quote to show up as the random quote (leave blank to allow all quotes).", 5000),
(0, "setting_totalthreshold_title", "Random Quote Total Threshold", 5000),
(0, "setting_totalthreshold_desc", "The minimum total rating necessary for a quote to show up as the random quote (leave blank to allow all quotes).", 5000)

mysql error: Duplicate entry 'submitted_by-0-2' for key 2


Any ideas? (I'm looking through the thread right now, but I wanted to get this posted just in case.)

Also.....

I was wondering if there's a way to get it to look more like v1.2. I don't like how the Add Quote/View all part is on the category strip, and how the quote is centered. If so, what do I do? (It looks really really ugly right now, IMO :ermm: )

Megareus Rex
05-12-2005, 11:12 PM
Also, one more question. Is there any way to edit quotes after they've been accepted? (Other than going into the database and editing them directly).

Torqued
05-13-2005, 12:08 AM
Also, one more question. Is there any way to edit quotes after they've been accepted? (Other than going into the database and editing them directly).

Um. Go to view all quotes in the Random Quote box and then click on "edit" next to the quote you want to edit.

Megareus Rex
05-13-2005, 03:08 AM
Um. Go to view all quotes in the Random Quote box and then click on "edit" next to the quote you want to edit.
Oh, ok. Sorry, like I also said, the phrase mechanism of the installer won't work, so I didn't see the edit box :ermm:

Cap'n Steve
05-13-2005, 04:07 AM
You already had version 1.2 installed, right? It looks like you clicked on "install" when you ran the installer, you should click "upgrade" instead. As for the style, here's the quote_randomquote template from 1.2:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a>
$vbphrase[random_quote]
</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
<tr>
<td class="alt1" align="center" colspan="2">
<i>"$randomquote[quote]"</i>
</td>
</tr>
<tr>
<td class="alt1 smallfont" align="left">
<if condition="$bbuserinfo['userid']">(<a href=$vboptions[bburl]/quotes.php?do=addquote>$vbphrase[add_a_quote]</a><if condition="$bbuserinfo['permissions']['adminpermissions']"> | <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a></if> | <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)</if>
</td>
<td class="alt1" align="right">
- <b>$randomquote[author]</b>
</td>
</tr>
</tbody>
</table><br />

and here's the quote_listbit template from 1.2:
<table class="tborder" cellpadding="3" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<tr>
<td class="alt1 smallfont" align="left">
Added by: <a href="$vboptions[bburl]/member.php?userid=$randomquote[userid]">$randomquote[username]
</td>
<td class="alt1" align="right">
<a href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
</td>
</tr>
<tr>
<td class="alt1" align="center" colspan="2">
<i>"$randomquote[quote]"</i>
</td>
</tr>
<tr>
<td class="alt1 smallfont" align="left">
<if condition="$bbuserinfo['permissions']['adminpermissions']">(<a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a>)</if>
</td>
<td class="alt1" align="right">
- <b>$randomquote[author]</b>
</td>
</tr>
</table>

Keep in mind that you need to add $randomquote[average] or $randomquote[rating] to display the quotes rating and $ratethis to display the form for rating the quote. You should also add this:
<a href="$vboptions[bburl]/quotes.php?$session[sessionurl]&do=edit&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>

to be able to edit the quotes. Also, the quotes in the old version are centered, while the new ones just have margins.

Megareus Rex
05-13-2005, 05:52 AM
No, I clicked on Upgrade, not Install. It keeps giving me that error, and its driving me crazy, since half the hack is without phrases.

Here's the last part of the link to the error:

install_quoteit.php?do=upgrade&step=3

If that IS the right link for upgrading the phrases, it doesnt work.

EDIT: I just applied the template chages. THANK YOU :):):) I love the look of the v1.2 randomquote :P

Cap'n Steve
05-13-2005, 07:10 AM
Hmm, it must have gotten run twice since you somehow have that phrase already. In install_quoteit.php, find:
(0, "submitted_by", "Submitted by", 2),

and delete it (it should be there twice, delete both), then run the installer again, skipping to step 3.

Megareus Rex
05-13-2005, 07:50 AM
Now I get this error:

Invalid SQL:
INSERT INTO vb3_phrase
(languageid, varname, text, phrasetypeid) VALUES
(0, "number_of_quotes_to_moderate", "Number of quotes to moderate at one time", 2),
(0, "default_threshold", "Default Threshold", 2),
(0, "enable_context", "Enable Context", 2),
(0, "ratings", "Ratings", 2),
(0, "approve", "Approve", 2),
(0, "author", "Author", 1),
(0, "submit_to_quotes", "Submit to Quotes", 1),
(0, "moderate_quotes", "Moderate Quotes", 2),
(0, "disabled", "Disabled", 2),
(0, "plus_or_minus", "Plus or Minus", 2),
(0, "quoteit_options", "QuoteIt! Options", 2),
(0, "1_to_5", "1 to 5", 2),
(0, "show_random_quote", "Show random quote", 2),
(0, "average_threshold", "Average Threshold", 2),
(0, "total_threshold", "Total Threshold", 2),
(0, "quoteit", "QuoteIt!", 2),
(0, "context", "Context", 1),
(0, "edit_this_quote", "Edit this Quote", 1),
(0, "adding_a_quote", "Adding a quote.", 1),
(0, "editing_a_quote", "Editing or deleting a quote.", 1),
(0, "sort_by", "Sort by", 1),
(0, "quote_id", "Quote ID", 1),
(0, "user_id", "User ID", 1),
(0, "show", "Show", 1),
(0, "greater_than_or_equal_to", "greater than or equal to", 1),
(0, "total_rating", "Total rating", 1),
(0, "average", "Average", 1),
(0, "quotes", "Quotes", 1),
(0, "show_only_quotes_with", "Show only quotes with", 1),
(0, "vote", "Vote", 1),
(0, "added_by", "Added by", 1),
(0, "rate_this_quote", "Rate this quote", 1),
(0, "posted_in_thread", "Posted in thread", 1),
(0, "setting_ratequote_title", "Quote Ratings System", 5000),
(0, "setting_ratequote_desc", "This allows you to choose what ratings scale the quotes will use or disable the ratings completely.", 5000),
(0, "setting_averagethreshold_title", "Random Quote Average Threshold", 5000),
(0, "setting_averagethreshold_desc", "The minimum average rating necessary for a quote to show up as the random quote (leave blank to allow all quotes).", 5000),
(0, "setting_totalthreshold_title", "Random Quote Total Threshold", 5000),
(0, "setting_totalthreshold_desc", "The minimum total rating necessary for a quote to show up as the random quote (leave blank to allow all quotes).", 5000)

mysql error: Duplicate entry 'number_of_quotes_to_moderate-0-2' for key 2

mysql error number: 1062

Date: Friday 13th of May 2005 01:46:58 AM
Script: http://www.evermoreforums.com/forums/admincp/install_quoteit.php?do=upgrade&step=3

However, I did notice that more phrases were added, so it achieved some success, at least.

Cap'n Steve
05-13-2005, 08:16 AM
You already installed it, then. You should have all of those phrases. If they're not showing up, try going into your phrase manager, edit a phrase and then save it without changing anything.

Torqued
05-13-2005, 11:48 AM
I actually thought about adding categories to this version but decided against it. Here's a list of what I hope to include in the next version (which will probably not be out for a while, though):

- quote categories
- dated quotes
- view only new quotes
- view only quotes you haven't rated

Any suggestions for other features would be appreciated!

I'd like the ability to pull categories via a url. I'd like to display relevant quotes in different sections such as specific forums, photo galleries, etc.

Something like: http://www.mysite.com/forum/quote.php?cat=motorcycles for my motorcycle quotes, etc.

Megareus Rex
05-13-2005, 06:29 PM
Its still an incomplete installation. Some of the phrases that, by deduction, SHOULD be there aren't. Like Edit this Quote. It worked with Accept and Accept All, but thats it.

deb0
05-14-2005, 12:10 AM
I upgraded board to 307. Could not get qoute 1.2 to show up on forum home, does in acp. Tried to upgrade. Still can't get it to show up in in Forum home. All templates and file edits are correct.

Is there a way to start over without losing quote tables in database? What are my options at this point?

thx in advance.

Cap'n Steve
05-14-2005, 04:16 AM
deb0 - you need to run this query:

INSERT INTO $TPsetting
(varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES
("showquote", "forumhome", 1, 1, "yesno", 5, 0, 0)

Don't forget to replace $TP with your table prefix. The option should show up after that.

Megareus - the error it gives you is the
mysql error: Duplicate entry '$phrasename-0-$number'
part. Your only real choice is to find the two lines in install_quoteit.php that are in the form of
(0, "$phrasename", "$phrastext", $number),
and delete them. You'll just have to keep doing this and rerunning step 3 of the installer to make sure all the phrases are there. Sorry, but I don't know how it's possible to get a partial installation in the first place. :ermm:

deb0
05-14-2005, 04:25 AM
Thanks, Im making progress.

Now when I give a rating and hit the vote button at the bottom, I get a blank page.

Megareus Rex
05-14-2005, 05:13 AM
deb0 - you need to run this query:

INSERT INTO $TPsetting
(varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES
("showquote", "forumhome", 1, 1, "yesno", 5, 0, 0)

Don't forget to replace $TP with your table prefix. The option should show up after that.

Megareus - the error it gives you is the
mysql error: Duplicate entry '$phrasename-0-$number'
part. Your only real choice is to find the two lines in install_quoteit.php that are in the form of
(0, "$phrasename", "$phrastext", $number),
and delete them. You'll just have to keep doing this and rerunning step 3 of the installer to make sure all the phrases are there. Sorry, but I don't know how it's possible to get a partial installation in the first place. :ermm:

But why does it do that in the first place? Its like the script is trying to insert the same exact phrase TWICE. The phrases that it says are duplicates are NOT already in the database, so thast the only logical reason...:ermm:

Megareus Rex
05-14-2005, 05:29 AM
I think I figured out why, I already had SOME of the phrases in the database, so it duplicated them ,and gave the error. Perhaps I had one of the phrases in there already? (from a previous hack, or of my own creation perhaps). I'm checking each one right now, and apparently I had the first few in there. I'll post again when I've discovered more.

Cap'n Steve
05-14-2005, 05:35 AM
deb0 - What rating system are you using? Is it the random quote or the quotes list? Could you give me the link?

Megareus - Are you sure the phrase isn't already there? If you have access to phpMyAdmin, can you find it in there? Did you try editing and saving an existing phrase like I suggested earlier?

EDIT: You posted while I was typing. I don't think it's another hack, unless something you have uses a "number_of_quotes_to_moderate" phrase, which would be weird.

deb0
05-14-2005, 12:34 PM
The rating in radom works fine. The rating is not working on the quotelist.

Suggestion: I noticed that non-members can use the quote system. Is there a way to restrict it to members only?

Megareus Rex
05-14-2005, 05:35 PM
deb0 - What rating system are you using? Is it the random quote or the quotes list? Could you give me the link?

Megareus - Are you sure the phrase isn't already there? If you have access to phpMyAdmin, can you find it in there? Did you try editing and saving an existing phrase like I suggested earlier?

EDIT: You posted while I was typing. I don't think it's another hack, unless something you have uses a "number_of_quotes_to_moderate" phrase, which would be weird.

I dunno what happened, but they're all installed now. Except for one.

In QuoteIt options, the second line is missing the phrase. (Between Ratings and Show Random Quote). Do you happen to know what it is?

Cap'n Steve
05-14-2005, 07:08 PM
Megareus - that phrase is moderate_quotes. The value of it should be Moderate Quotes and the type should be control panel global.

deb0 - in quotes.php, find:
require_once('./global.php');

Below that, add
if (!$bbuserinfo['userid']) {
print_no_permission();
exit;
}

to not allow guests to see the quotes. I need more information before I can fix your rating problem.

Megareus Rex
05-14-2005, 07:40 PM
Thanks Cap'n Steve. It works wonderfully now :)

venomx
05-15-2005, 01:18 AM
What do these 3 things mean in the admin?

Average Threshold
Total Threshold
Enable Context

Cap'n Steve
05-15-2005, 05:31 AM
Average Threshold - the average rating a quote must have to show up as random quote

Total Threshold - the toal rating a quote must have to show up as random quote

Enable Context - stores extra information about the quote

venomx
05-15-2005, 06:55 AM
What extra information ? :)

Cap'n Steve
05-15-2005, 07:30 AM
Whatever they submit.

egyptsons
05-18-2005, 10:38 AM
thanks

Wifey
05-18-2005, 02:00 PM
Um, I don't see any of my controls. I ran the installer upgrade and did all of the template edits. It installed and I upgraded it perfectly but now I see no quotes when I click on view all (they quotes are still running randomly), and when I click on Quote It under vBulletin options it gives me the same type deal as when you would click Moderate Quotes before under moderation. Just one table with an approve or delete spot. My front doesn't even have the rating stuff. What did I do?

Cap'n Steve
05-18-2005, 06:22 PM
I can see all the quotes just fine. If you're still having problems, I suggest you redo all the file edits and reupload the files.

Wifey
05-18-2005, 07:17 PM
Well hot dog. I see the quotes now, but none of the controls in the admincp. I'll try reuploading the files.

Ah, I needed to upload the quote admincp file :) I didn't realize that. It's working perfectly, thanks!

trackpads
05-21-2005, 11:51 AM
Works great, thanks for the update!!!

dobbs
05-25-2005, 12:07 PM
Cap'n Steve,
Thanks for doing this hack, it installed perfectly and works just fine.
I have a minor cosmetic issue i was wondering if you could help me with.

The body looks like it is divided up into three blocks and i see a the line that divides them, i would like to get rid of that. I would also like to make the font in the bar smaller. Lastly, i would like to surround the whole thing with a black border to match the rest of the board. I have uploaded a screen shot.

edit:

never mind, i frankensteined the code into something new


My Board (http://315er.net)

Cap'n Steve
05-26-2005, 12:41 AM
Yeah, several styles seem to have some problems with the table having a border. It looks like you fixed it, but I'll try and correct it in the next version so it looks better with a wider range of styles.

dobbs
05-26-2005, 11:39 AM
Since i don't know PHP i cut and pasted chunks of code from the quoteit template into the forumhome template. Trial and error till i got what i wanted.

Torqued
05-27-2005, 05:48 PM
I actually thought about adding categories to this version but decided against it. Here's a list of what I hope to include in the next version (which will probably not be out for a while, though):

- quote categories
- dated quotes
- view only new quotes
- view only quotes you haven't rated

Any suggestions for other features would be appreciated!

Just a thought... but instead of categories, maybe a keyword type system kinda like the vBAdvanced Gallery and vBAdvanced Links Directory has... Some of my quotes could go in several categories/keywords. :)

I made a few tweaks to my randomquote template. have a look at http://www.torqued.org/news

B)

This mod is awesome, btw!

ged
06-01-2005, 03:55 PM
After I installed and saw nothing on my forum, I've read all the pages of this hack & topic and applied every possible way on my forum.

I see still nothing, nothing, nothing. :)

Link of my forum: http://www.dipsizkuyu.net/forum

Cap'n Steve
06-02-2005, 05:56 AM
I don't think you have any quotes. To add some, go to www.dipsizkuyu.net/forum/quotes.php (http://www.dipsizkuyu.net/forum/quotes.php). After you've added one, they should work normally.

dsboyce8624
06-06-2005, 12:40 AM
Can this system be made to just show random quotes that I want it to, without the rating system or user input?

Torqued
06-06-2005, 01:20 AM
Can this system be made to just show random quotes that I want it to, without the rating system or user input?

Yeah. You don't have to use the voting system...

dsboyce8624
06-06-2005, 03:46 AM
Yeah. You don't have to use the voting system...

Sweet. Installing tomorrow.

Cap'n Steve
06-07-2005, 05:34 AM
Can this system be made to just show random quotes that I want it to, without the rating system or user input?

Yes, but it'll either require some template edits or some small file edits depending on if you want the users to be able to view the whole quotes list or submit quotes to be added. Just ask here if you have problems.

dsboyce8624
06-07-2005, 05:39 AM
Yes, but it'll either require some template edits or some small file edits depending on if you want the users to be able to view the whole quotes list or submit quotes to be added. Just ask here if you have problems.

I just want to put in the quotes, and have one randomly displayed daily. No user interaction.

Cap'n Steve
06-08-2005, 06:48 AM
In quotes.php, find:
require_once('./global.php');

below that, add:
if (!$bbuserinfo['permissions']['adminpermissions']) {
print_no_permission();
exit;
}

In your quote_randomquote template, find:
(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>

<if condition="$bbuserinfo[\'permissions\'][\'adminpermissions\']">
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</if>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)

replace that with:
<if condition="$bbuserinfo[\'permissions\'][\'adminpermissions\']">
(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
</if>

That should do what you want.

zetetic
06-08-2005, 12:51 PM
One of my forum members just pointed out that the sort by rating and average rating options on the view all quotes page are still showing up, despite our having ratings disabled. So here's a little fix for that. :)

Find in quotes.php:
$sortby = $vbphrase['sort_by'] . ' - <a href="quotes.php?' . $querystring . '&sortby=quoteid&order=' . $orderof['quoteid'] . '">' . $vbphrase['quote_id'] . ' &nbsp; <img src="' . $image['quoteid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['quote_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=userid&order=' . $orderof['userid'] . '">' . $vbphrase['user_id'] . ' &nbsp; <img src="' . $image['userid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['user_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=author&order=' . $orderof['author'] . '">' . $vbphrase['author'] . ' &nbsp; <img src="' . $image['author'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['author'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=rating&order=' . $orderof['rating'] . '">' . $vbphrase['total_rating'] . ' &nbsp; <img src="' . $image['rating'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['total_rating'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=average&order=' . $orderof['average'] . '">' . $vbphrase['average'] . ' &nbsp; <img src="' . $image['average'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['average'] . '" border="0" /></a>';

Replace with:
if ($settings[1] == 1)
{
$sortby = $vbphrase['sort_by'] . ' - <a href="quotes.php?' . $querystring . '&sortby=quoteid&order=' . $orderof['quoteid'] . '">' . $vbphrase['quote_id'] . ' &nbsp; <img src="' . $image['quoteid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['quote_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=userid&order=' . $orderof['userid'] . '">' . $vbphrase['user_id'] . ' &nbsp; <img src="' . $image['userid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['user_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=author&order=' . $orderof['author'] . '">' . $vbphrase['author'] . ' &nbsp; <img src="' . $image['author'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['author'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=rating&order=' . $orderof['rating'] . '">' . $vbphrase['total_rating'] . ' &nbsp; <img src="' . $image['rating'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['total_rating'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=average&order=' . $orderof['average'] . '">' . $vbphrase['average'] . ' &nbsp; <img src="' . $image['average'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['average'] . '" border="0" /></a>';
}
else
{
$sortby = $vbphrase['sort_by'] . ' - <a href="quotes.php?' . $querystring . '&sortby=quoteid&order=' . $orderof['quoteid'] . '">' . $vbphrase['quote_id'] . ' &nbsp; <img src="' . $image['quoteid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['quote_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=userid&order=' . $orderof['userid'] . '">' . $vbphrase['user_id'] . ' &nbsp; <img src="' . $image['userid'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['user_id'] . '" border="0" /></a> |
<a href="quotes.php?' . $querystring . '&sortby=author&order=' . $orderof['author'] . '">' . $vbphrase['author'] . ' &nbsp; <img src="' . $image['author'] . '" alt="' . $vbphrase['sort_by'] . ' ' . $vbphrase['author'] . '" border="0" /></a>';
}

Cap'n Steve
06-09-2005, 05:19 AM
Man, the templates have caused me all sorts of trouble. :dead: Thanks for pointing that out, I'll add it in.

Bubble #5
06-10-2005, 12:14 AM
There wouldn't by any chance be update instructions from Version 1.2 to 2.0 would there? :ermm:

dsboyce8624
06-10-2005, 01:32 AM
Okay, did a clean install, so far.

Looks fine except that on quotes.php, the footer template opens in the top of the page and closes at the end.

I'm sure I did something wrong, but I can't figure it out.

And I have a vote button on the show all page, even though rating is off.

dsboyce8624
06-10-2005, 02:27 AM
There wouldn't by any chance be update instructions from Version 1.2 to 2.0 would there? :ermm:

I think they're in the zip.

Cap'n Steve
06-10-2005, 06:39 AM
I think I've fixed the button problem. I'll test it and upload the new file tomorrow. I still don't have a clue why your footer template is wandering up to the top, though. :ermm:

dsboyce8624
06-10-2005, 03:17 PM
I think I've fixed the button problem. I'll test it and upload the new file tomorrow. I still don't have a clue why your footer template is wandering up to the top, though. :ermm:

I think it's my custom style. All you need is one mees up on the bale tags and things go haywaire. I'll have a look at it too.

Cap'n Steve
06-11-2005, 05:13 AM
I've updated the zip file to fix the problems with the vote button and the "sort by" row showing up when they're not supposed to. Just overwrite the old quotes.php to take care of it.

dsboyce8624
06-11-2005, 06:10 AM
I've updated the zip file to fix the problems with the vote button and the "sort by" row showing up when they're not supposed to. Just overwrite the old quotes.php to take care of it.

Thanks. Any suggestions on the footer thing?

EDIT: Well, whatever you did, everything is fixed, even the footer issue. Thumbs up brotha!

Cap'n Steve
06-11-2005, 06:20 AM
Not yet. I saved a copy of your pages that had the problem, so I'll keep looking, but so far I'm stumped. Like I said on your site, I only see the footer in the wrong place when I view a single quote. Viewing a single quote and listing more than one both use the same templates, so I can't figure out why it doesn't happen on the quotes list page, even if you set it to only show only one quote per page. I don't see anything special with your footer, either. I'll let you know if I figure it out, it's annoying me too.

EDIT: You edited while I was typing. That's really bizarre, but I guess as long as it works that's what counts.

lange
06-24-2005, 08:27 PM
Thanks

seangworld
08-01-2005, 03:03 AM
Thanks

vb3.5 ???

Cap'n Steve
08-02-2005, 06:18 AM
vb3.5 ???

I haven't been able to renew my license yet, but I should be able to soon. It should be updated soon after the official release of 3.5.

Lea Verou
08-15-2005, 09:47 AM
Hi all.
I would like to add the username to the randomquote I have as a block in vbadvanced but I haven't made the changes needed in index.php cause I don't want it in the forumhome too.
What should I do?
Thanks in advance!

Cap'n Steve
08-16-2005, 04:13 AM
To add the username of the person who submitted the quote, just add $randomquote[username] in the quote_randomquote template.

Lea Verou
08-16-2005, 06:30 PM
I did!! It shows nothing! It just shows "added by:" with no username. Is that because I didn't make the changes in index.php? But I don't want it to display in the forum, just in the block cause I have the left column displayed in my forum as well.
Thanks in advance! :)

Cap'n Steve
08-18-2005, 05:16 AM
Does the rest of the quote appear? You shouldn't have to make any changes to index.php, but even if you did, the quote wouldn't show up on your forum home page unless you edited the FORUMHOME template.

Lea Verou
08-18-2005, 07:01 AM
Does the rest of the quote appear? You shouldn't have to make any changes to index.php, but even if you did, the quote wouldn't show up on your forum home page unless you edited the FORUMHOME template.


Yes yes it appears correctly. The username is the only thing that doesn't appear!

Cap'n Steve
08-19-2005, 03:42 AM
Sorry, I completely forgot that the random quote uses a different query. :o

What you need to do is open quote.php (the vbAdvanced module) and find this:
SELECT quotes.* FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1

replace that with this:
SELECT quotes.*, user.username FROM ' . TABLE_PREFIX . 'quotes AS quotes
LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON quotes.userid = user.userid
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1

Lea Verou
08-19-2005, 09:42 AM
Thanks so much!!! :)

Another question now... I would like to add the vba left column in the quotes module, like I did with forumhome. I made the appropriate changes but some thing in the template seem screwed up (the vote button in particular).
See what I mean here:

without vba: www.e-steki.com/forum/quotes.php
with vba: www.e-steki.com/forum/quotes2.php

Lea Verou
08-19-2005, 12:34 PM
Help! I tried to vote on some quotes and got the following SQL error!

Invalid SQL:
UPDATE vb3_quotes SET
votes = votes + 1,
rating = rating + 1,
average = rating / votes
WHERE quoteid IN ()

What can I do??? :'(

Cap'n Steve
08-20-2005, 04:27 AM
I don't get that error on your site. Did you select a quote rating before you clicked the vote button?

Lea Verou
08-20-2005, 11:11 AM
Probably it was temporary cause I don't get it now either but I can't vote! I just get a blank page! And yes I selected some quote ratings before I vote. :)

Oh, do you have any idea about the vba left column problem I mentioned above?

Cap'n Steve
08-22-2005, 06:49 AM
Well, the votes are actually getting recorded, but I'm not sure what's causing it to not redirect after you vote. My only advice would be to download the files again and replace your quotes.php. If that doesn't work, try changing any templates you might have changed back to their original version. Sorry, but it must be something you changed. :ermm:

Lea Verou
08-22-2005, 11:11 AM
Thanks I'll see what I can do... :)

What about the vba left column? What can I do with the Vote button that is ugly?

Cap'n Steve
08-23-2005, 04:47 AM
If you move it after the last </table> tag, it should be centered.

Snort_2005
08-25-2005, 07:57 PM
Is there a possability on getting this ported to vB 3.5 RC2? I used to have it on my vB 3.0.7 and my members loved it.. Now that I upgraded, It's not there anymore and my members are complaining. Is there a possibility on an upgrade?

Cap'n Steve
08-29-2005, 05:06 AM
It will be. I'm planning on waiting until the final release of 3.5 just to be sure nothing changes.

Lea Verou
08-29-2005, 05:07 AM
It will be. I'm planning on waiting until the final release of 3.5 just to be sure nothing changes.

Niceee!!! Another one of the mods I have that wont cause me trouble with the upgrade!
Thanks! :)

Snort_2005
08-30-2005, 04:10 AM
It will be. I'm planning on waiting until the final release of 3.5 just to be sure nothing changes.

Darn. :( Looks like my members will have to wait. :|

alyster4k
09-01-2005, 03:13 AM
My CMPS block is goofed up on install. Any ideas what I've done wrong? Thanks.

http://img326.imageshack.us/img326/9892/broke7si.jpg (http://imageshack.us)

alyster4k
09-02-2005, 06:27 PM
Does anyone else have this installed on CMPS that I can at least check out?

blackpheonix
09-04-2005, 09:37 AM
i installed this and it thru my styles mangaer out i get a blank page now wen i try to view template.php in admin cp any ideas

*fixed i added below

'aaa' => 'AAA Old Backup'

and not above

Cap'n Steve
09-07-2005, 05:51 AM
It's installed as a vbAdvanced module on monkeycrap.com. It looks like you're trying to put it on a side block or something that's too narrow to hold the default template.

alyster4k
09-07-2005, 01:25 PM
Doh... that should've been obvious to me. :) So this block has to be a center block then. Any ideas for converting to a side block? I think I may be able to do that with my limited skills if I find some time.

Cap'n Steve
09-08-2005, 05:38 AM
I'd just make the quote_randomquote template a one column table. You probably won't have room for all the information that's in the wider version, so you'll have to decide which bits (rating, average, links, etc.) are most important for your site.

stan111
09-15-2005, 01:47 PM
thanks a ton
this hacks is so kool :thumbup:

stan111
09-15-2005, 08:44 PM
i got one question
how do i remove this "submit to quote" because i have a hidden message, and when someone click on that, they will see all the hidden parts. Thanks in adance
http://img140.imageshack.us/img140/9600/untitled7ny.jpg

Cap'n Steve
09-17-2005, 03:02 AM
Just revert your postbit and postbit_legacy templates to the default ones and that link won't show up anymore.

Warrior
09-17-2005, 04:20 PM
Nice Hack!

I have a concern though... ever since the installation I have not been able to use the "submit" buttons in the admincp template editors using Firefox. Internet Explorer lost no functioality in this area... so I was able to finish the edits using that.

Why the lost of the submit buttons in the template editor using Firefox?

Cap'n Steve
09-18-2005, 04:57 AM
Make sure you didn't include any mistakes in the includes/adminfunctions_template.php modification. Other than that, your problem has nothing to do with the hack. What exactly is wrong? Is the button missing?

Warrior
09-18-2005, 10:56 AM
Make sure you didn't include any mistakes in the includes/adminfunctions_template.php modification. Other than that, your problem has nothing to do with the hack. What exactly is wrong? Is the button missing?
When I click to edit a template, the submit button is not responding. The button is not disabled or anything... it just doesn't submit. And the window that shows all the templates in admincp - I can't duble click to expand or open templates there either... this is all post installation of this hack. On a nearly virgin board - only a welcome panel was previously installed.

Have you tested the changes in Firefox? Has anyone else installed it per the directions using Firefox?

I'll triple check the includes/adminfunctions_template.php to see if I missed something there...

BTW - I really needed a hack like this... it's a great idea and I use it for motivational quotes. Just the minor issue now using the admincp in Firefox.

Cap'n Steve
09-19-2005, 12:42 AM
Look in the Javascript console (I think it's under the Tools menu) and see if there are any errors. If not, then completely undo the includes/adminfunctions_template.php changes.

apokphp
09-24-2005, 06:00 AM
It fried my style (my primary: ODN 2.0). Currently, my site is using a different style (Aria) due to the problem.

My default style (ODN 2.0) at www.onlinedebate.net & http://www.onlinedebate.net/forums/index.php?s=&styleid=8 which has an ID=8; got royally screwed in that everything disappeared except for the "quote" page. That is, the "index.php" defaults to show the quotes. But there is no style/css, no header, no footer, no forums, no main page, nothing...it got removed. This error happened PRIOR to ANY file or template edits btw. That is, this error showed after the install script. Nothing changed after I edited the files/templates.

So I changed styles (Aria, style ID=15) and everything shows, including the quote area (after I edited the templates).

But why does this work for all styles EXCEPT my ODN 2.0 style? I have changed default styles in the AdminCP...everything works fine as long as ODN 2.0, ID=8 is not used. The install script did install the quoteit templates in all my styles. It just doesn't work for my main style.

What gives?

Warrior
09-24-2005, 06:10 AM
Look in the Javascript console (I think it's under the Tools menu) and see if there are any errors. If not, then completely undo the includes/adminfunctions_template.php changes.
Yeah... thanks for the follow up, Firefox does some funny things sometimes... it says the following:

Error: tform is not defined
Sourcefile: http://www.domain.com/forums/clientscript/vbulletin_templatemgr.js
Line: 184

And line 184 in vbulletin_templatemgr.js reads:
selitem = eval("document.forms.tform.tl" + styleid);

Alien
09-25-2005, 12:20 AM
I still love this, only I'm waiting for the 3.5 version as we've recently upgraded one of our sites to 3.5.

Can't wait to be able to view my 2,000+ quotes again.. Get crackin'! ;)

lol

Cap'n Steve
09-25-2005, 04:54 AM
apokphp - I can only see one style on your site, so I'm not sure what's happening. Try deleting all the QuoteIt! templates (the ones beginning with quote_) and rebuilding all your styles.

sengerdw - That's not my Javascript, so I don't know what's wrong. I suggest you go back to the default includes/adminfunctions_template.php and see if that fixes it. Your QuoteIt! templates won't be so nicely organized, but it'll still work.

Alien - I recently became less poor, so hopefully I'll renew my license and get it started this week. :)

apokphp
09-25-2005, 05:43 AM
Cap'n, click here for styleid=8: http://www.onlinedebate.net/forums/index.php?s=&styleid=8

Also, how do I delete a specific template (specifically, the Quoteit ones)?

It's installed through the script which made it a "master template", so it cannot be deleted through the admincp.

Cap'n Steve
09-25-2005, 07:01 PM
The styleid 8 looks the same as your default style and I don't see any problems with it. You can turn on debug mode by adding $debug = 1; to includes/config.php and then you'll be able to see the Master Style.

apokphp
09-25-2005, 08:30 PM
The styleid 8 looks the same as your default style and I don't see any problems with it. You can turn on debug mode by adding $debug = 1; to includes/config.php and then you'll be able to see the Master Style.
I think you may need to refresh or something as style #8 is not the Aria style (which is the only active style atm). ODN 2.0 is the default style that was jacked from the install.

Below is a screenshot of what you would see if you were correctly seeing styleid=8 called "ODN 2.0"

And what is seen, is the quotelist...this will be true of ANY public url to my site (root, forumhome, etc..) while trying to use styleid=8 (ODN 2.0).

The template usage as per the debug (for styleid=8 / ODN 2.0):

Template Usage
navbar (1)
navbar_link (1)
phpinclude_start (1)
quote_listbit (6)
quote_listquote (1)


By going to the .../forum/ url, it wants to pull up the quote.php file it seems, instead of the index.php file. It's weird.

For instance, instead of the normal forum/index.php showing up and the forums being displayed when you go to :www.onlinedebate.net/forums/ it takes you to the quote page. It has a title page of:

<title>Online Debate Network Forums - Quotes</title>

This is what it was doing immediately after install before any template or file modifications were made. And doing those modifications didn't correct it. The other styles work fine..all but my default/primary style that happened to be the default at the time of the quoteit install.

FYI:

ODN 2.0 was my default/primary style at the time of installing the hack.
http://www.onlinedebate.net/forums/index.php?s=&styleid=8

It was a custom skin. It has a pic of a kid talking into a microphone in the header (this is how you know if you are looking at the right one).

New style: Aria...what is currently the DEFAULT due to my primary style not working. It's a light blue theme with a 4-pronged star in the header.
http://www.onlinedebate.net/forums/index.php?s=&styleid=15

Cap'n Steve
09-25-2005, 10:19 PM
I still can't see any other styles, have you tried it while not logged in?

You're right about it redirecting, I'm not sure what could possibly cause that. I would think it must be something on your server, but that doesn't explain why it only happens with one style.

Try going to http://web-sniffer.net/ and entering your forum URL. Attach the results page and I'll take a look at it.

apokphp
09-25-2005, 10:36 PM
I still can't see any other styles, have you tried it while not logged in?
Yes. There is no difference.


You're right about it redirecting, I'm not sure what could possibly cause that. I would think it must be something on your server, but that doesn't explain why it only happens with one style.

Try going to http://web-sniffer.net/ and entering your forum URL. Attach the results page and I'll take a look at it.
Here is the attached page using http://www.onlinedebate.net/forums/index.php?s=&styleid=8 as the url. It does show the /aria/ skin paths...despite that style being id15, and ODN2.0 being id8.

I input both urls for id8 and id15. The results came back the same. Weird.

FYI, the file has the extension .txt so I could attach it. However, you can view it in html by changing the extension from .txt to .html once you dl it.

Cap'n Steve
09-26-2005, 04:44 AM
Since you're the only one who can see the problem, I'll need to see the headers you see. If you use Firefox, you can use livehttpheaders (http://livehttpheaders.mozdev.org/) to see them.

One other thing: try it without having the quotes.php file on your server and see what happens.

apokphp
09-26-2005, 05:46 AM
When I remove the quotes.php file, I get this on the style=8 when I try to go to forumhome:

Warning: Unknown(quotes.php): failed to open stream: No such file or directory in /global.php(430) : eval()'d code on line 7

Warning: Unknown(quotes.php): failed to open stream: No such file or directory in /global.php(430) : eval()'d code on line 7

Fatal error: (null)(): Failed opening required 'quotes.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/onapok/public_html/forums/global.php(430) : eval()'d code on line 7

However, I get no such error on the style=15 style.

I'll mess around w/ the livehttpheaders tomorrow. Thanks for trying.

Cap'n Steve
09-26-2005, 07:25 AM
Is there anything in your phpinclude_start template?

apokphp
09-26-2005, 03:22 PM
Is there anything in your phpinclude_start template?
That was it!!

require("quotes.php");

was in there from the skin designer who was working on having random quotes be displayed IN the actual header itself. This was a custom skin I had created and he fell short on many features of the skin, including this quote feature. But he never took out the code.

Removing it now displays the default skin, check it: http://www.onlinedebate.net/forums/index.php?s=&styleid=8

Thanks for the help man. ;)


----------------------

HOWEVER (hehe)...I am having a table issue it seems with the quote list. I have this with ALL of my styles, not just ODN 2.0.

The problem is, when you make the quote list appear AND there are at least some quotes that need to be rated, the page is funky due to table issues it seems:

http://www.onlinedebate.net/forums/quotes.php?do=list

Alien
09-26-2005, 06:32 PM
Alien - I recently became less poor, so hopefully I'll renew my license and get it started this week. :)

KILLER! Thank you so much Steve!

* Alien slips Cap'n Steve a c note to get on the beta tester list.

Cap'n Steve
09-26-2005, 07:00 PM
HOWEVER (hehe)...I am having a table issue it seems with the quote list. I have this with ALL of my styles, not just ODN 2.0.

The problem is, when you make the quote list appear AND there are at least some quotes that need to be rated, the page is funky due to table issues it seems

The problems I see: Your vote button isn't centered, try moving it after the last </table> tag in the quote_listquote template. The footer is displaying at the top of the page for some reason. Someone had this problem earlier and we never figured it out, I'll have to try again when I get back from work.

apokphp
09-26-2005, 07:15 PM
Here is the last part of the quote_listquote template. I've not changed anything yet.

</tbody>
</table><br />
$votebutton
$pagenav
$footer
</body>
</html>
Are you saying to move the "$votebutton" reference? If so, it's already outside the last </table> tag.

Also, while the error displays in BOTH available styles, the footer is only at the top of the page in the Aria style...not ODN 2.0. This appears to fix the footer issue on Aria as well.

So while it doesn't "look" as good as it could...at least it fixes noticeable errors.

I've TEMPORARILY fixed it by placing $votebutton inside the table.

Cap'n Steve
09-27-2005, 05:22 AM
In quotes.php, find
$votebutton = '<tr><td><div align="center"><input type="button" class="form" name="vote" id="vote" onclick="document.ratings.submit();" value="' . $vbphrase['vote'] . '" /></div></td></tr>';

replace that with this (it's in there twice, replace both)
$votebutton = '<tr><td colspan="2" class="tcat"><div align="center"><input type="button" class="form" name="vote" id="vote" onclick="document.ratings.submit();" value="' . $vbphrase['vote'] . '" /></div></td></tr>';

That should fix the vote button. To fix the cell borders on the Aria style, try this:

In the quote_listquote template, find
<table class="tborder" cellpadding="2" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">

and replace that with
<table class="tborder" style="border-top: #DFE6EF 0px solid;border-left: #DFE6EF 0px solid;" cellpadding="2" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">

that should take care of it.

apokphp
09-27-2005, 03:41 PM
Thanks man, that looks like it took care of it.

Snort_2005
09-27-2005, 06:40 PM
When do you think we can get this for 3.5? I really would like to have my quotes system back. :)

Cap'n Steve
09-28-2005, 01:55 AM
I just started on it today, hopefully soon. :speechless:

kthlnwrnr
09-28-2005, 05:06 AM
Could you please tell me how I can setup the quote management system in a way that after voting and submitting a quote my members are taken to the quote.php page and not to my forum home?

Could you also post the content of "quote_randomquote" from the version 2.0. I changed it to 1.2 and accidentaly lost my 2.0 content.

Cap'n Steve
09-28-2005, 05:31 AM
To redirect them to the quotes page, in quotes.php, find
header('Location: ' . $vboptions['forumhome'] . '.php?' . $session['sessionurl']);

and replace that with (be sure to replace it twice)
header('Location: quotes.php?' . $session['sessionurl']);

Here's the quote_randomquote template:
<style type="text/css">
.vote {
color:$stylevar[smallfont_fgcolor];
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:110%;
font-weight:bold;
background-color:$stylevar[button_bgcolor];
<if condition="$vboptions[ratequote]==1">
width:25px;
height:25px;
</if>
border-top-color:$stylevar[alt2_bgcolor];
border-left-color:$stylevar[alt2_bgcolor];
border-right-color:$stylevar[alt1_bgcolor];
border-bottom-color:$stylevar[alt1_bgcolor];
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#aa$gradient1',EndC olorStr='#aa$gradient2');}
}
</style>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat">
$vbphrase[random_quote]
</td><td class="tcat" align="right">
<div align="right">

(<a href="$vboptions[bburl]/quotes.php?do=addquote">$vbphrase[add_a_quote]</a>

<if condition="$bbuserinfo['permissions']['adminpermissions']">
| <a href="$vboptions[bburl]/quotes.php?do=delquote&quoteid=$randomquote[quoteid]">$vbphrase[delete_this_quote]</a> | <a href="$vboptions[bburl]/quotes.php?do=editquote&quoteid=$randomquote[quoteid]">$vbphrase[edit_this_quote]</a>
</if>

| <a href="$vboptions[bburl]/quotes.php?do=list">$vbphrase[view_all_quotes]</a>)
</div>
</td><td class="tcat" style="width:15px;">
<div style="float:right;" align="right">
<a href="#top" onclick="return toggle_collapse('forumhome_randomquote')"><img id="collapseimg_forumhome_randomquote" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomquote].gif" alt="" border="0" /></a></div>

</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomquote" style="$vbcollapse[collapseobj_forumhome_randomquote]">
<tr><td class="alt1" width="30%"></td>
<td class="alt1"><div style="font-style:italic;margin-right:10%;">
<p>&quot;$randomquote[quote]&quot;</p>
<p style="font-weight:bold;margin-left:25%;">- $randomquote[author]<if condition="$randomquote[context]"> ($randomquote[context])</if></p>
</div>
</td><td class="alt1" valign="top">
<a style="float:$stylevar[right];" href="$vboptions[bburl]/quotes.php?do=view&quoteid=$randomquote[quoteid]">#$randomquote[quoteid]</a>
</td>

</tr>
<if condition="$vboptions[ratequote]==3">
<tr><td class="alt1" align="left" colspan="3">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
</if>

<if condition="$vboptions[ratequote]==1">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="rateplus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="plus" />
<input type="submit" value="+" class="vote" />
</form>
&nbsp;
<form name="rateminus" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<input type="hidden" name="vote" id="vote" value="minus" />
<input type="submit" value="-" class="vote" /></form>
</td>
</if>
<if condition="$vboptions[ratequote]==2">
<tr><td class="alt1" align="left">
$vbphrase[total_rating]: $randomquote[rating] - $vbphrase[average]: $randomquote[average]
</td>
<td class="alt1" align="right" colspan="2">$vbphrase[rate_this_quote]:
<form name="voting" id="voting" action="$vboptions[bburl]/quotes.php">
<input type="hidden" name="do" id="do" value="rate" />
<input type="hidden" name="quoteid" id="quoteid" value="$randomquote[quoteid]" />
<select name="vote" id="vote" onchange="document.voting.submit();">
<option value=""></option>
<option value="1">&nbsp;&nbsp;1&nbsp;&nbsp;</option>
<option value="2">&nbsp;&nbsp;2&nbsp;&nbsp;</option>
<option value="3">&nbsp;&nbsp;3&nbsp;&nbsp;</option>
<option value="4">&nbsp;&nbsp;4&nbsp;&nbsp;</option>
<option value="5">&nbsp;&nbsp;5&nbsp;&nbsp;</option>
</select>
</form>
</td>
</if>

</tr>
</tbody>
</table><br />

kthlnwrnr
09-28-2005, 03:57 PM
Thank you for the superb fast response. I actually found three instances of

header('Location: ' . $vboptions['forumhome'] . '.php?' . $session['sessionurl']);



in quotes.php. And changed all of them.

I get the following error when I try to save the 2.0 code after deleting the 1.2 codes from the quote_randomquote template:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_STRING, expecting ']' in /home/mysite/public_html/forum/includes/adminfunctions_template.php(3096) : eval()'d code on line 38

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

How would I make a page that has the "Quote database stat" and buttons that looks like the ones in UGN community (http://www.ugamer.net/forums/quotes.php) ? Thanks again.

Cap'n Steve
09-28-2005, 06:20 PM
I had a small copy and paste problem, but I've edited the post. Just overwrite your template again.

To do something like the stats, see this post.

Lea Verou
10-04-2005, 05:22 PM
When you make the quotes mod again will there be an upgrade script??

Also try to make a slighly better interface (eg for voting it would be nice to use the classic vb thread voting like some mods do)

Cap'n Steve
10-04-2005, 10:07 PM
Your old quotes database will still be compatible with the new version. I'll try and improve the interface for version 2.5, but 2.1 will just be for compatibility with vBulletin 3.5.

Lea Verou
10-04-2005, 10:11 PM
Oh...
When do you expect them to be finished?

Cap'n Steve
10-05-2005, 03:08 AM
Right about now. :)

QuoteIt! 2.1 for vBulletin 3.5

Lea Verou
10-05-2005, 03:19 AM
Wow, and it's not a beta!
Man, you rock! :)

lexx27
10-05-2005, 03:20 PM
Before i started using the quote it hack i had a quotation database with images. When i tried to link the images in this hack it was like this:

"<img> quote"

I didnt like it. But as you can see there is a big gap on the left of the quote where there is enough space for a picture. How can i do this? It will be great if there is a way.
Thank you by the way for this great hack! ;)

platnum
10-14-2005, 06:15 PM
For some reason it's not showing a quote for me??? Any clue why? :-?

Cap'n Steve
10-14-2005, 11:35 PM
Did you set "Show Random Quote" to yes and edit the FORUMHOME template?

docvader
10-30-2005, 06:14 PM
I have that same issue with respect to the "voting" on the quotes list page redirecting to a blank page.

http://x.russbo.com/vb/index.php
http://x.russbo.com/vb/quotes.php?do=list&styleid=18

It "holds" the vote, but it is not redirecting properly.

All my file edits are correct, the install process went very smoothly (kudos to you).

Not sure if you're still giving advice on this, but, because of what I've done with my forums, it's going to be a while before I venture into version 3.5. Appreciate any suggestions you might have.

rich

Cap'n Steve
11-01-2005, 05:50 AM
Try opening quotes.php, finding this
header('Location: ' . $_ENV['HTTP_REFERER']);

and replacing it with this
header('Location: ' . $_ENV['HTTP_REFERER'], true);

Let me know if that works.

docvader
11-01-2005, 06:32 AM
Nope, sorry capn Steve, that didn't work for me. Still getting the white screen of death. I'm wondering if I'm missing a template somewhere. I get the white screen with all of my styles, (the default one too) so I'm wondering if something got missed during the install.

What template should call up after you vote?

Cap'n Steve
11-03-2005, 03:25 AM
It should redirect you to the page you came from, but for some reason it's never getting sent. I think it might have something to do with the way your server is set up. I can't help you at the moment, but I'm investigating further. :ermm:

docvader
11-05-2005, 03:57 AM
Not sure if this weill help, but I'm using Mac OS X, which is UNIX behind a pretty GUI interface. I download directly to the server, and unzip, using Stuffit, and place files directly. No FTP stuff. Which, depending upon how you write things, may have something to do with line breaks and the like.

However, I've installed tons of programs and hacks, without any problems, without FTP. And, it all works great.

let me know what I can do to help. The quote thing is a popular part of my site.

Cap'n Steve
11-06-2005, 02:28 AM
Redownload the hack and replace your quotes.php file with the new one. Let me know if that improves things.

docvader
11-06-2005, 02:46 AM
Looks like that did it Cap'n. Thanks for the awesome support!

Greebo
04-02-2006, 10:48 AM
I'm trying to use the CMPS module for this - it used to work perfectly - now its not showing up at all.

I redid everything using the CMPS instructions in the 2nd or 3rd reply and still no joy. Are there updated instructions?

Cap'n Steve
04-03-2006, 05:35 AM
Have you updated vBadvanced? Can I get a link to where it's supposed to be showing up?

Greebo
04-03-2006, 11:47 AM
Yes CMPS is on the most recent version afaik:

http://www.pilotsofamerica.com

Its supposed to be center column at the top...

Thanks so much.

Greebo
04-03-2006, 12:21 PM
Oh bother. I'm in the wrong thread. I meant to be in the 3.5 thread...

The-Ensemble
07-23-2006, 02:33 PM
I want to put quotes in the footer. And when i put the code there it doesnt show up.
Can someone tell me why and how i can fix it?

Cap'n Steve
07-23-2006, 11:36 PM
So you put the $showrandomquote in the footer template? You'll need to do the modifications to global.php instead of index.php. Add "quote_randomquote" to the list of templates to be cached and then add the main chunk of code after "require_once('./global.php');"

The-Ensemble
07-24-2006, 10:21 PM
ok . . . what?
Sorry im new at this could you explain that in depth for me?
what does cached mean?
Yes i added $showrandomquote in the footer.
Will i be able to quotes after that?

Bubble #5
07-24-2006, 10:32 PM
what does cached mean?

This is computer 101 stuff. Do a google on how your computer works ;)

Cap'n Steve
07-25-2006, 12:36 AM
Sorry, I was trying to do it from memory so I didn't have to go dig up a copy of 3.0. Anyway, here's more detailed instructions:

In global.php, find
define('VB_AREA', 'Forum');

below that, add
$globaltemplates = array_merge($globaltemplates, array('quote_randomquote'));

Also in global.php, find
$logincode = construct_login_code();

below that, add
// ############## Start QuoteIt Hack ###############################
if ($vboptions['showquote']) {
$gradient1 = str_replace('#', '', $stylevar['alt1_bgcolor']);
$gradient2 = str_replace('#', '', $stylevar['alt2_bgcolor']);

list($usec, $sec) = explode(' ', microtime());
mt_srand((float) $sec + ((float) $usec * 100000));
if ($vboptions['averagethreshold'] != '') {
$threshold = 'AND quotes.average >= ' . floatval($vboptions['averagethreshold']) . ' ';
}
if ($vboptions['totalthreshold'] != '') {
$threshold .= 'AND quotes.rating >= ' . intval($vboptions['totalthreshold']) . ' ';
}
$count = $DB_site->query_first('
SELECT COUNT(*) AS count FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold
);
$row = mt_rand(0, $count['count'] - 1);
$randomquote = $DB_site->query_first('
SELECT quotes.* FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1
');
if ($vboptions['ratequote'] AND $randomquote['quoteid'] AND $bbuserinfo['userid'] AND $DB_site->query_first('SELECT * FROM ' . TABLE_PREFIX . 'quoteratings WHERE quoteid = ' . $randomquote['quoteid'] . ' AND userid = ' . $bbuserinfo['userid'])) {
$vboptions['ratequote'] = 3;
}
eval('$showrandomquote = "' . fetch_template('quote_randomquote') . '";');
}
// ############## End QuoteIt Hack ###############################

The-Ensemble
07-25-2006, 04:18 AM
Thanks for the reply.
I can't find
$logincode = construct_login_code();
Does anyone have any idea what line its on?

Cap'n Steve
07-25-2006, 04:58 AM
It should be near the end. If you can't find it, just add that code above the last line, which is this:
?>

The-Ensemble
07-25-2006, 02:48 PM
Ok i've added that code to the bottom.
Add "quote_randomquote" to the list of templates to be cached and then add the main chunk of code after "require_once"
Ok so where in VB do i cach things? and what does this part mean exactly i dont understand it very well
then add the main chunk of code after "require_once"

Cap'n Steve
07-26-2006, 03:38 AM
Just ignore the first post I made. Those two edits should be all you need to do.

The-Ensemble
07-26-2006, 10:24 AM
ok thank you Cap'm Steve
BTW how would you change the text size?
I tried using a div smallfont and it has no effect.

Cap'n Steve
07-26-2006, 07:33 PM
To tweak the font size, before the text you want to change in the template, put this

<span style="font-size: 12pt;">

and after it, add

</span>

Just change the number 12 until you get the size you want.