View Single Post
  #212  
Old 12-30-2004, 05:19 AM
CtrlAltDel CtrlAltDel is offline
 
Join Date: Feb 2002
Location: Ohio
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01174 seconds
  • Memory Usage 1,779KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete