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 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


All times are GMT. The time now is 01:54 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.01237 seconds
  • Memory Usage 1,764KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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