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)
-   -   Quick Thread hack (like quick reply, on forumdisplay!) (https://vborg.vbsupport.ru/showthread.php?t=61502)

Gary King 02-12-2004 10:00 PM

Quick Thread hack (like quick reply, on forumdisplay!)
 
This hack is like the quick reply hack but on forumdisplay, so when viewing a forum, if the user has proper permissions to make a new thread then this quick thread box will show up for them.

Also view the screenshot to see how it looks :)

Features
  • Shows the user's signature if they have one!
  • subscribes to the thread according to what the user specified in their user options!

AdditionsInstructions

OPEN forumdisplay.php AND FIND
PHP Code:

$phrasegroups = array('forumdisplay'); 

REPLACE WITH
PHP Code:

$phrasegroups = array('forumdisplay','posting'); 

Find
PHP Code:

require_once('./includes/functions_forumdisplay.php'); 

Add below
PHP Code:

require_once('./includes/functions_newpost.php'); 

FIND
PHP Code:

// check if there is a forum password and if so, ensure the user has it set 

ABOVE, ADD
PHP Code:

$foruminfo fetch_foruminfo($forumid);

if (!(
$foruminfo['allowposting']==or !($forumperms CANVIEW) or !($forumperms CANPOSTNEW)))
{
    require_once(
'./includes/functions_editor.php');

    
// get the checked option for auto subscription
    
$emailchecked fetch_emailchecked($threadinfo$bbuserinfo$newpost);

    if (
$emailchecked[9999])
    {
        
$emailupdate '9999';
    }
    if (
$emailchecked[0])
    {
        
$emailupdate '0';
    }
    if (
$emailchecked[1])
    {
        
$emailupdate '1';
    }
    if (
$emailchecked[2])
    {
        
$emailupdate '2';
    }
    if (
$emailchecked[3])
    {
        
$emailupdate '3';
    }

    
$textareacols fetch_textarea_width();
    eval(
"\$quickthread = \"" fetch_template('forumdisplay_quickthread')."\";");


CREATE A NEW TEMPLATE CALLED forumdisplay_quickthread
WITH THE FOLLOWING CONTENT
HTML Code:

<form action="newthread.php" method="post" name="vbform">
<input type="hidden" name="s" value="$session[sessionurl]" />
<input type="hidden" name="forumid" value="$forumid" />
<input type="hidden" name="do" value="postthread" />
<input type="hidden" name="parseurl" value="1" />

<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0"  width="100%">
<tr>
        <td class="thead" colspan="2">$vbphrase[quick_new_thread]</td>
</tr>
<tr>
        <td class="alt1" colspan="2"><span class="smallfont"><phrase 1="$session[sessionurl]" 2="$foruminfo[forumid]">$vbphrase[more_options_newthread]</phrase></span></td>
</tr>
<tr class="alt2">
        <td class="alt2"><b>$vbphrase[subject]:</b></td>
        <td class="alt2"><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
</tr>
<tr>
        <td class="alt1" valign="top" nowrap="nowrap"><b>$vbphrase[message]:</b></td>
        <td class="alt1">
                <table cellpadding="0" cellspacing="0" border="0">
                <tr valign="top">
                        <td><textarea name="message" rows="7" cols="$textareacols" tabindex="2">$message</textarea></td>
                </tr>
                </table>
        </td>
</tr>
</table>
</td></tr></table>

<br />

<table cellpadding="2" cellspacing="0" border="0" width="95%"  align="center">
<tr>
        <td align="center">
        <input type="submit" class="bginput" name="submit" value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="3" />
        <input type="submit" class="bginput" name="preview" value="$vbphrase[preview_post]" accesskey="p" tabindex="4" />
        </td>
</tr>
</table>
<input type="hidden" name="signature" value="1" />
<input type="hidden" name="emailupdate" value="$emailupdate" />
</form>




OPEN forumdisplay TEMPLATE AND FIND
HTML Code:

<!-- / controls below thread list -->
BELOW ADD
HTML Code:

<br />$quickthread
CREATE THE FOLLOWING PHRASES
(They're in the form of 'phrase_name' / 'phrase_content')
(ALL IN 'Forum Display' CATEGORY!):
Code:

quick_new_thread / Quick New Thread
more_options_newthread / <a href="newthread.php?{1}do=newthread&amp;f={2}">Click here</a> for more posting options.

THE HACK IS NOW INSTALLED, ENJOY!

Scope 02-13-2004 01:48 AM

awesome. good lookin out.

Logikos 02-13-2004 02:18 AM

Nice!

FleaBag 02-13-2004 04:42 AM

This will probably come in handy for a lot of users - surprised nobody thought of it before!

Boofo 02-13-2004 05:41 AM

There was a vB2 hack of the same thing. I think nakkid did it.

Erwin 02-13-2004 06:32 AM

Groovy. :)

colicab-d 02-13-2004 06:46 AM

ooooh interesting.... dunno if i,ll install tho im just a bit unsure about even more quickness lol

freakyshiat 02-13-2004 02:35 PM

this is not working for me. I have rechecked it over and over. Is it working for anyone?

Gary King 02-13-2004 02:40 PM

Quote:

Originally Posted by Fazle
this is not working for me. I have rechecked it over and over. Is it working for anyone?

What doesn't work?

gmarik 02-13-2004 03:31 PM

How much queris does this adds>?

version2 02-13-2004 04:34 PM

Quote:

Originally Posted by Gary W
What doesn't work?

Hmm. The box isnt showing up. Added all the code and templates. *scratches head*

version2 02-13-2004 04:37 PM

Quote:

Originally Posted by version2
Hmm. The box isnt showing up. Added all the code and templates. *scratches head*

Wait a sec. I am looking at the instructions and everything. Wouldnt we need to place:

$quickthread

somewhere in the FORUMDISPLAY templates?

Gary King 02-13-2004 04:40 PM

Quote:

Originally Posted by version2
Wait a sec. I am looking at the instructions and everything. Wouldnt we need to place:

$quickthread

somewhere in the FORUMDISPLAY templates?

Thanks, I missed adding that step. Fixed now, just find the part in the instructions where you have to modify the forumdisplay template :)

Gary King 02-13-2004 04:41 PM

Quote:

Originally Posted by gmarik
How much queris does this adds>?

Add 0 extra queries ;)

version2 02-13-2004 04:44 PM

Quote:

Originally Posted by Gary W
Add 0 extra queries ;)

New little error:

When you click to post the new tread it throws a javascript error:

Line: 2857
Error: Object Expected

Gary King 02-15-2004 02:40 PM

Quote:

Originally Posted by version2
New little error:

When you click to post the new tread it throws a javascript error:

Line: 2857
Error: Object Expected

Fixed in the new attachment now :)

Erwin 02-26-2004 09:24 AM

What would be good is if you can incorporate the WYSIWYG interface... but I like it like this since it loads quickly. :)

NexVision 02-29-2004 05:53 AM

this is a neat hack however how would we restrict this for certain groups only like admins and mods or vice versa

Gary King 02-29-2004 01:33 PM

Quote:

Originally Posted by NexVision
this is a neat hack however how would we restrict this for certain groups only like admins and mods or vice versa

Replace the else in the new code with
PHP Code:

elseif ($bbuserinfo[usergroupid] == X

Don't forget to replace X with the usergroupids!

Add the following for more usergroups :)
PHP Code:

 or $bbuserinfo[usergroupid] == 


NexVision 02-29-2004 09:20 PM

sweet im gonna install this as soon as i finish with the bugs in vbadvanced thanx

Steve123 03-14-2004 02:00 AM

You mite wanna add

PHP Code:

forumdisplay_quickthread 

to the $actiontemplates array at the start of the forumdisplay.php..

Or when it calls for the template it will create a query..

maverick1236 03-25-2004 12:23 PM

how can i add smilies to this?

Red Blaze 03-26-2004 03:54 PM

Gary, when I add

PHP Code:

or $bbuserinfo[usergroupid] == 

I get an parse error. I want to add only the staff to see the quick post. Right now, I only have admins viewing it.

Gary King 03-26-2004 07:31 PM

Quote:

Originally Posted by Sonikku
Gary, when I add

PHP Code:

or $bbuserinfo[usergroupid] == 

I get an parse error. I want to add only the staff to see the quick post. Right now, I only have admins viewing it.

You have to change X to the usergroupid.

Red Blaze 03-26-2004 09:28 PM

I did. :p But still got that error.

Gary King 03-26-2004 10:42 PM

You didn't even tell us what error you get ;)

Red Blaze 03-27-2004 02:13 AM

It's a parse error. Doesn't tell me anything else but that there's wrong coding on that line. Sheesh, nevermind, I'll just use it for admin use.

Gary King 03-27-2004 03:08 AM

Quote:

Originally Posted by Sonikku
It's a parse error. Doesn't tell me anything else but that there's wrong coding on that line. Sheesh, nevermind, I'll just use it for admin use.

Even posting the parse error will help; if you don't want to post it, we can't help you. If we can't help you because you don't want to post the parse error, there isn't any reason to get angry at us :)

Red Blaze 03-27-2004 06:04 PM

Here

Parse error: parse error in /home/thesonic/public_html/home/forum/forumdisplay.php on line 205

Is that really that much help? It only tells you what line it is and it's

elseif ($bbuserinfo[usergroupid] == 6)or $bbuserinfo[usergroupid] == 5

I also tried:

elseif ($bbuserinfo[usergroupid] == 6) or $bbuserinfo[usergroupid] == 5

and

elseif ($bbuserinfo[usergroupid] == 6)
or $bbuserinfo[usergroupid] == 5

Still got that same error.

The elseif code works, it's the "or" that doesn't.

Gary King 03-27-2004 07:45 PM

Quote:

Originally Posted by Sonikku
Here

Parse error: parse error in /home/thesonic/public_html/home/forum/forumdisplay.php on line 205

Is that really that much help? It only tells you what line it is and it's

elseif ($bbuserinfo[usergroupid] == 6)or $bbuserinfo[usergroupid] == 5

I also tried:

elseif ($bbuserinfo[usergroupid] == 6) or $bbuserinfo[usergroupid] == 5

and

elseif ($bbuserinfo[usergroupid] == 6)
or $bbuserinfo[usergroupid] == 5

Still got that same error.

The elseif code works, it's the "or" that doesn't.

Glad you posted that, next time please remember to post the line and error instead of just saying 'no it won't help' :)

Try this and I'm sure it will help ;) (replace your old line)
PHP Code:

elseif ($bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == 5


MGM 03-28-2004 06:14 PM

hey Gary, there's a small problem... whenever we use the Quick Thread, it automatically adds that thread to the subscribed threads list for the user who created it..... any way to stop this?

MGM out

Gary King 03-28-2004 08:52 PM

Add this before </form>:
HTML Code:

<input type="hidden" name="emailupdate" value="9999" />

Chris Blount 03-29-2004 04:48 AM

Very nice Hack Gary! Installed with no problems. Thanks!

One question. Is there a way to get the signature to work when posting with the quick thread box?

Gary King 03-29-2004 07:03 PM

Quote:

Originally Posted by Chris Blount
Very nice Hack Gary! Installed with no problems. Thanks!

One question. Is there a way to get the signature to work when posting with the quick thread box?

Add this before </form>:
HTML Code:

<input type="hidden" name="signature" value="1" />

Chris Blount 03-29-2004 08:27 PM

Quote:

Originally Posted by Gary W
Add this before </form>:
HTML Code:

<input type="hidden" name="signature" value="1" />

That did the trick! Thanks again!

Gary King 04-01-2004 11:30 PM

I have updated this hack! HUGE changes made, including visual enhancements (text changes, made things look better) and also I added support for signatures and email updates / notifications, depending on what the user's options are in his user cp! :)

Steve123 04-02-2004 12:28 AM

There is no update instuctions?

I tried to update and now im getting no output and this in error logs..

[Fri Apr 2 12:21:32 2004] [error] PHP Parse error: parse error in /path/to/forum/forumdisplay.php on line 203
[Fri Apr 2 12:22:59 2004] [error] PHP Fatal error: Call to undefined function: fetch_emailchecked() in /path/to/forum/forumdisplay.php on line 210

Which is

$emailchecked = fetch_emailchecked($threadinfo, $bbuserinfo, $newpost);

Im using vb3..

Gary King 04-02-2004 01:07 AM

Quote:

Originally Posted by Steve123
There is no update instuctions?

I tried to update and now im getting no output and this in error logs..

[Fri Apr 2 12:21:32 2004] [error] PHP Parse error: parse error in /path/to/forum/forumdisplay.php on line 203
[Fri Apr 2 12:22:59 2004] [error] PHP Fatal error: Call to undefined function: fetch_emailchecked() in /path/to/forum/forumdisplay.php on line 210

Which is

$emailchecked = fetch_emailchecked($threadinfo, $bbuserinfo, $newpost);

Im using vb3..

Add this code in forumdisplay.php:
PHP Code:

require_once('./includes/functions_newpost.php'); 


Steve123 04-02-2004 01:12 AM

heh.. i swear i added it... oh well :P works now :P ta

Slave 04-03-2004 01:03 AM

Cool .. installed .. :)


All times are GMT. The time now is 04:49 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.01521 seconds
  • Memory Usage 1,874KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_html_printable
  • (13)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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