vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   QuoteIt! Quote Management System v1.2 (https://vborg.vbsupport.ru/showthread.php?t=62470)

memobug 11-23-2004 12:44 AM

This looks like fun. I'd like to see three additional fields for classic quotes

1) Who said it
2) Date of quote
3) Link to quote in context

Who submitted the quote doesn't matter so much to me...

Regards,

Matt

trackpads 11-23-2004 01:29 AM

Quote:

Originally Posted by memobug
This looks like fun. I'd like to see three additional fields for classic quotes

1) Who said it
2) Date of quote
3) Link to quote in context

Who submitted the quote doesn't matter so much to me...

Regards,

Matt

Ditto.

Great Hack!

TwinsForMe 12-07-2004 03:53 AM

[high]* TwinForMe clicks install. :)
[/high]

Love it!

I modified the global.php instead of the index.php, then changed the Forumdisplay, Forumhome, Showthread, and search_results templates. I also took out the 2 /br's at the end of the navbar template and I took out the final /br from the randomquote template so my forums and threads don't get too pushed down. Plus I took out the "Random Quote" bar in the table of the randomquote template.

You can take a look here:

http://www.twinteresting.com/forums/index.php?

mtha 12-08-2004 02:11 AM

nice job.

I think admin should be able to
- list all of quotes in AdminCP
- edit/delete quote in AdminCP
- set a quote status active/inactive (bring an active quote back to moderating list)
- select and delete multiple quotes in AdminCP

and, the quote manager in AdminCP right now, just list only one quote at a time? I think all quotes (waiting for moderated) should listed

Right now, you (admin) can delete quote in the quote list, but that shouldnt be the place where you manage things though :)
and, sometime, people just have some typo, or you want to change something, you should be able to change both quote and author

mtha 12-08-2004 02:33 AM

Quote:

Originally Posted by turbidblue
Okay, I was wondering if anyone could help me out with the "view all" page. Mine is all jumbled together and looks not so good.


Screenshot of the mess:

http://turbidblue.com/images/random.jpg

I saw Magnus posted that it was done with template edits, but what are the edits to get each quote in its own little box??

Thanks for any help/advice you can provide :)

xoxo

The quickest way is adding a horizontal line bellow each quote.


Edit template quotelistbit

add
HTML Code:

        <tr>
                <td class="alt1" align="center" colspan="2"><hr></td>
        </tr>

above the last </table>


I would suggest to use alt1 and alt2 for each quote too, just like they are for posts. :)

The Dok 12-11-2004 12:36 AM

Is there anyway to have two different quote boxes pulling qoutes from separate databases of quotes?

deb0 12-19-2004 07:54 PM

Anyone got this working in 3.03?

trackpads 12-19-2004 10:19 PM

Yes, works great on mine!

MTHA: Thanks for that!!

-Jason

CtrlAltDel 12-26-2004 09:55 PM

i wrote my own quote hack for 2.x and i had a button that allowed people to submit a post for a quote. do you plan on adding this to your hack or should i just add it onto it?

CtrlAltDel 12-30-2004 01:54 AM

ok after looking at this the code used to pick the random quote is flat out wrong

Code:

SELECT * FROM quotes WHERE approved=1 ORDER BY rand() LIMIT 1
change it to this
Code:

SELECT *, rand() AS r FROM quotes WHERE approved='1' ORDER BY r LIMIT 1
This is a more accurate and more server friendly query.

memobug 12-30-2004 05:05 AM

What is wrong or inaccurate about it? ORDER BY RAND() has worked since MySQL 3.23.3 and initialization was dubugged in 3.23.56. Select RAND() might have some other issues:

http://www.sitepoint.com/forums/show...01&postcount=3

What makes it more server friendly?

Regards,

Matt

CtrlAltDel 12-30-2004 05:19 AM

I have added a to this addon and given it the ability to have a button in each post that will submit the post to the quote database for approval. What happens is that you see the button in the post, I have a button by the 'edit post' button and the user presses the button. They are then sent to the 'add quote' page with the username/quote text all filled in from the post. The user can then proofread the submission and then hit the submit button. All works great, and you dont have to worry about search bots automatically submitting quotes this way either.

Here is what you'll need to do.

Find this in quotes.php
PHP Code:

?> 

Add this above it
PHP Code:

if ($_REQUEST['do'] == 'post')
{
    
$post_quote $DB_site->query("SELECT username, pagetext FROM post WHERE postid=$postid");
    
    while (
$postinfo $DB_site->fetch_Array($post_quote))
    {
        
$author $postinfo[username];
        
$quote $postinfo[pagetext];
    }
    
    eval(
'print_output("' fetch_template(quote_addquote) . '");');
    


You now need to make some template changes.

First open quote_addquote

Find
Code:

<input type="text" class="bginput" name="author" size="25" maxlength="75" /></td>
Replace it with
Code:

<input type="text" class="bginput" name="author" size="25" maxlength="75" value="$author" /></td>
Find
Code:

<td class="alt1"><textarea name="quote" rows="10" cols="50"></textarea>
Replace it with
Code:

<td class="alt1"><textarea name="quote" rows="10" cols="50">$quote</textarea>
Now open your postbit or postbit_legacy template, whichever you use. You can choose to put your button/text wherever you would like, but I'll show you where I put mine. My code also has a button that I put in there too, so dont be suprised if you just cut/paste/upload and there is a mysterious redx :) I know I should have added a phrase, but I didn't, you can if you would like as well.

Find
Code:

<if condition="$post['editlink']">
Add above it
Code:

<a href="/forum/quotes.php?do=post&postid=$post[postid]"><img src="$stylevar[imgdir_button]/quoteit.gif" alt="Submit post for quote database" align="middle" border="0">
And thats about it, now your users should have the abilty to automatically fill in an 'add quote' request form, straight from a post. A feature that is a huge hit on my website so I thought I'd share it.

Questions/Problems, shoot me a PM.

docvader 12-30-2004 06:23 AM

Very well done. Also like CtrAltDel's addition, should be added into v2 in my opinion.

I have a problem; my add quote page does not put the input author box next to the author; for some reason, it sits above it. Here's the template code:

Quote:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - $vbphrase[add_a_quote]</title>
$headinclude
</head>
<body>
$header
$navbar

<form action="quotes.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />

<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center"><tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="thead" colspan="2"><b>$vbphrase[add_a_quote]</b></td>
</tr>
$logincode
<tr>
<td class="alt2"><b>$vbphrase[quote_author]</b></td>
<input type="text" class="bginput" name="author" size="25" maxlength="75" value="$author" /></td>
</tr>
<tr>
<td class="alt1" valign="top"><b>$vbphrase[quote_text]</b></td>
<td class="alt1"><textarea name="quote" rows="10" cols="50">$quote</textarea>
</tr>
</table>
</td></tr></table>

<br />

<table cellpadding="2" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<tr>
<td align="center">
<input type="submit" class="button" value="Submit" accesskey="s" />
<input type="hidden" name="do" value="add" />
</td>
</tr>
</table>

</form>

$footer

</body>
</html>
Any reason why the "input author" box does not line up next to the "author" designation?? Stock install, did not hack this hack at all.

Thanks,
rich
http://x.russbo.com/vb/index.php

docvader 12-30-2004 06:39 AM

Quote:

Originally Posted by CtrlAltDel
ok after looking at this the code used to pick the random quote is flat out wrong

Code:

SELECT * FROM quotes WHERE approved=1 ORDER BY rand() LIMIT 1
change it to this
Code:

SELECT *, rand() AS r FROM quotes WHERE approved='1' ORDER BY r LIMIT 1
This is a more accurate and more server friendly query.

What file is this change in? Can't seem to find it in quote.php

CtrlAltDel 12-30-2004 06:45 AM

Quote:

Originally Posted by docvader
What file is this change in? Can't seem to find it in quote.php

it'd be in index.php or wherever you decided to put that code from the install file.

docvader 12-30-2004 07:02 AM

Thanks. That was fast. It was in the install file. Love your addition, with respect to the postbit. Do you have any idea why my tables are screwed up in the "add quote" section?
You can see it in action at http://x.russbo.com/vb/index.php

rich

CtrlAltDel 12-30-2004 07:36 AM

I'd try and help but maybe you could post a screenshot of your issue, since you have to register to get to see that on your site.

docvader 12-30-2004 12:30 PM

I believe that this:

Quote:

<input type="text" class="bginput" name="author" size="25" maxlength="75" value="$author" /></td>
should be this:
Quote:

<td class="alt1"><input type="text" class="bginput" name="author" size="25" maxlength="75" value="$author" /></td>
Otherwise, the author input box gets put above and out of the table.

And, to keep the colors consistent, I make this:
Quote:

<td class="alt2"><b>$vbphrase[quote_author]</b></td>
td class="alt1". But that's my preference.

This seems to work for me.

Deyth 12-30-2004 02:44 PM

Has anyone tried to use this with 3.0.3?

trackpads 12-30-2004 02:59 PM

Quote:

Originally Posted by Deyth
Has anyone tried to use this with 3.0.3?

Yup, works great on my 3.03

Deyth 12-30-2004 03:50 PM

I added the hack, followed the instructions, turned it on, and I don't see anything. Is it because there are no quotes in the table? If so, how are quotes to be submitted?

Deyth 12-30-2004 04:10 PM

It's showing up in one style but not the other yet I modified the FORUMHOME template in both the same way.

Edit:
Turns out the installation only put in custom templates for one style instead of all. Anyone know a quick fix for this?

Deyth 12-30-2004 04:46 PM

I found a hack that does this easily and am sharing it here for anyone else that will encounter this same problem later. You have to copy over quotelistbit, quote_addquote, quote_delquote, quote_listquote, randomquote.

Deyth 12-30-2004 08:22 PM

Your query isn't checking quotes.approved = 1

[QUOTE=Giveit2u43]Yeah just noticed that as I was looking at the code.. I changed your query to:
Code:

$result_quote = $DB_site->query("
                        SELECT quotes.*,user.username AS quotename FROM ".TABLE_PREFIX."quotes AS quotes
                        LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = quotes.userid)
                        ORDER BY rand() LIMIT 1
                ");
       
                while ($quote = $DB_site->fetch_Array($result_quote)) {
                        $randomquote[quoteid] = $quote[quoteid];
                        $randomquote[quote] = $quote

       
Quote:

       
       
               
       
       

                       

                       
                                ;
                        $randomquote[author] = $quote[author];
                        $randomquote[username] = $quote[quotename];
                }
                $DB_site->free_result($result_quote);
       
                eval('$showrandomquote .= "' . fetch_template('randomquote') . '";');
                       
                       

               


Quote:

and then you can place $randomquote[username] where you want the submitters username to show :)

CtrlAltDel 12-31-2004 04:17 AM

Quote:

Originally Posted by Deyth
It's showing up in one style but not the other yet I modified the FORUMHOME template in both the same way.


Edit:
Turns out the installation only put in custom templates for one style instead of all. Anyone know a quick fix for this?

yeah just make your default style another style
run the install script and just install the templates and they'll get laid down

it runs on 3.0.3, thats what im running and my addon works with that too

yeah my addon wasnt perfect, thanks for the clean up guys

anarchystar 01-09-2005 07:23 AM

I tried to install quote-it 1.2 in vB 3.0.5 into my test site and got the following error when I turned the option on.

Code:

Database error in vBulletin 3.0.5:

Invalid SQL:
                        SELECT * FROM quotes WHERE approved=1 ORDER BY rand() LIMIT 1
               
mysql error: Table 'database_-_test.quotes' doesn't exist

mysql error number: 1146

I turned it off again, and everything is fine. I'm wondering if this problem is specific to 3.0.5?

Deyth 01-09-2005 03:27 PM

Quote:

Originally Posted by anarchystar
I tried to install quote-it 1.2 in vB 3.0.5 into my test site and got the following error when I turned the option on.

Code:

Database error in vBulletin 3.0.5:

Invalid SQL:
                        SELECT * FROM quotes WHERE approved=1 ORDER BY rand() LIMIT 1
               
mysql error: Table 'database_-_test.quotes' doesn't exist

mysql error number: 1146

I turned it off again, and everything is fine. I'm wondering if this problem is specific to 3.0.5?

It's saying the quotes table doesn't exist. I don't think any vBulletin upgrades would drop tables it doesn't even expect to be there.

Silverdawn222 01-09-2005 03:31 PM

Edit: Never mind, fixed my own problem.

Deyth 01-09-2005 04:29 PM

Looks like the upgrade from 3.0.3 to 3.0.5 knocked it out for me too although I can't figure out why yet. Did anyone else do the upgrade?

Deyth 01-09-2005 04:39 PM

Ok it knocked out the settings. Just rerun these 2 queries:
Code:

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

INSERT INTO setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder, advanced, volatile) VALUES ('moderatequotes', 'forumhome', '0', '1', 'yesno', 6, 0, 1)

That will get them to display at least. I'm still getting errors when I try to add, it's missing the value for $vboptions[moderatequotes] even though I figured the above would insert it.

anarchystar 01-10-2005 04:34 AM

I did'nt do an upgrade, I tried to install quote-it on a fresh copy of vb3.0.5 ... but for some reason, it looks like the install script did'nt insert the table into my database. ... weird ...
:rolleyes:

Mr.Monkey 01-10-2005 02:30 PM

The database is there if you ran the script (try using phpmyadmin to see it), but the script appears unable to call it after the 305 patch is installed.

Deyth 01-10-2005 02:57 PM

I still haven't figured out why the values in $vboptions aren't there. I can get the quotes to show up but when someone tries to do an add it fails because the $vboptions[moderatequotes] value is blank. Maybe that's all related.

Cap'n Steve 01-13-2005 04:56 AM

I don't want to complain, but magnus hasn't posted in this thread in 8 months. Maybe it's time for someone else to try making a rating system?

anarchystar 01-13-2005 06:20 AM

I eventually did get this to work just fine in 3.0.5, I just had to add the sql table prefixs, and correct one one line in quotes.php.

I am trying to find the the line now that redirects the user after the quote is added. i want to change it to go to my homepage, and not the forum index page. hav'nt found it yet though ... any ideas?

memobug 01-13-2005 10:14 AM

I apologize for not knowing the ins and outs of your hack. However, I wanted to have a Quote of the Day that will remain the same throughout the day. I was thinking that this would allow people the opportunity to think about the quote, contemplate and reply to it rather than having different quotes fly by with every refresh.

I gather from the mysql I see that yours does not do this (from INDEX.PHP mod step 4a. in part:
Code:

SELECT * FROM quotes WHERE approved=1 ORDER BY rand() LIMIT 1
This appears to be a simple random query that would change on every refresh? Anyway, after researching this a little, I have the following suggestion as an alternative, using the date as a seed to give a consistent quote throughout the day:

Code:

SELECT * FROM quotes WHERE approved=1 ORDER BY RAND(TO_DAYS(NOW())) LIMIT 1
Which I believe will produce this result The problem I have found in other applications is: if someone adds a quote to the database, the quote of the day will shift because the total number of rows changes. At least that is what I have found to be true in another hack. This isn't necessarily a terrible result, but it is not the intended operation, and I would be interested if anyone knows a method to keep the quote random but changing daily.

Anyway if someone wants to try this it would be of interest to me. I am not currently using this hack, but would be interested in the result.

Regards,

Matt

Deyth 01-13-2005 01:39 PM

Quote:

Originally Posted by anarchystar
I eventually did get this to work just fine in 3.0.5, I just had to add the sql table prefixs, and correct one one line in quotes.php.

I am trying to find the the line now that redirects the user after the quote is added. i want to change it to go to my homepage, and not the forum index page. hav'nt found it yet though ... any ideas?

Can you post the details of what you did? I still get errors when someone tries to add a quote.

docvader 01-14-2005 05:27 AM

Quote:

Originally Posted by Deyth
Can you post the details of what you did? I still get errors when someone tries to add a quote.

Yes, I wiped mine out too with the 3.05 upgrade. Would greatly appreciate a nicely detailed explanation as to how you fixed it anarchystar.

Nice name, by the way. You'll have to tell us how you came up with that one.
rich

Cyn 01-16-2005 11:39 AM

I upgraded to vB 3.0.5 and lost Quoteit in part. I have made the changes to the php files as outlined in the quoteit_readme_txt file and have verified that the custom templates for QuoteIt are still present as well as the template changes necessary. But I'm still not getting a display of QuoteIt on the forum. Any idea what's missing? If I runa reinstall will I lose our database of quotes? Where are the quotes located?

nineball 01-16-2005 01:58 PM

I had the same problem.

I went into the install script for quote php and copied and pasted the insert of the settings and put them into phpmysql and reinserted them. It seems that as part of the upgrade the settings get wriped out.

I then go into the forum home settings and set it to display on the forum home.

That is the only change I made and everything works fine


All times are GMT. The time now is 01:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01661 seconds
  • Memory Usage 1,870KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete