Here is a Quick post to Any Board Panel based on a request made here.
Please Note: Due to my personal issues, I have not been able to test this much. So chances are that this might be buggy. Any Feedback will be greatly appreciated.
Also I want to say that, I recommend using this for a specific member Group or 2 as this can result a spam session on your forums.
Features :
# Does Permission checks, A User can post only where he/she can post
# Support Smileys and BBC
# Notify the people who are watching that board where the post is posted(Wasn't able to test this, hopefully it should work)
# Made sure of security
# Have ability to hide/show BBC and Smileys without page refresh(Using JavaScript)
Implementation :
Step 1 : Download QuickPost.php(Attached) and upload to /Sources directory
Step 2 : In Index.php(The one in Root folder of your SMF) Find:
$actionArray = array(
'activate' => array('Register.php', 'Activate'),
Add After
'quickpost' => array('QuickPost.php', 'QuickPost_Action'),
Step 3 : In a PHP Block Add
/***********************************
* Quick Post to any Board Panel
* By Dragooon
* Version 1.0
* www.gforumx.com
* Block Code
************************************/
// Make the globals
global $sourcedir;
// And call the file.
require_once($sourcedir . '/QuickPost.php');
/***********************************
* About
************************************/
/* This snippet is made by Dragooon based on a Request made over TinyPortal.net. Unlikely my other snippets, currently it does not have any customization options(Well Why would we needing one on a Quick Post Panel ?) */
/***********************************
* End About
************************************/
// Call the function and finish this thing
QuickPost_Template();
// Thank you for using this snippet :)
And it is done
A Special Thanks to.....
IchBinâ,,¢ for making me remind about ensuring security
J.A.Cortina for helping me with permission checks and reminding me about Notification
tamasir for releasing his Show/Hide Code which I used as Show/Hide BBC
Quick Post to any board panel
By Dragooon
Version 1.0
Please use this thread to report any bugs/errors, feedbacks or questions.
Again Please Note: Due to my personal issues, I have not been able to test this much. So chances are that this might be buggy. Any Feedback will be greatly appreciated.
Isn't working for me... all I got was an empty block.
I copied the file and pasted all the code... isn't working.
Started over and tried it again, still nothing.
Did you put the Quickpost.php file in the Sources directory?
Sure did.
If one of you would like to/are willing to take a look at my setup, I don't mind making you an acct
PM Me FTP and Admin Info and I'll see what is wrong.
Would it be possible to use this as quick post to a certain topic within the specific board??
Hmmm...Not Sure I think so it will be But I have no intension on doing it.
Wow, this is a nice handy little script. Nice work Dragooon.
Thank you :)
Thank you, this is great!
Hi, is it possible to get an ajaxbased popup screen to post, so that I only have a link to the popupscreen on my index???
It is I think But I got no idea how to do that :)
It would be great if someone is able to make something like that!
Sweeeet! This looks awesome can't wait to try it.
Quote
8: Undefined variable: message
File: /home/butuanon/public_html/forums/Sources/QuickPost.php
Line: 126
Line 126 of QuickPost.php
QuoteMessage:
<textarea id="message" class="editor" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' style="border: 1px solid red;"' : '', '>', $message, '</textarea>
Error when I post a topic using quick post.
Quote8: Undefined index: icon
File: /home/butuanon/public_html/forums/Sources/QuickPost.php
Line: 490
Line 490 of QuickPost.php
Quote'icon' => preg_replace('~[\./\\\\*\':"<>]~', '', $_POST['icon']),
OK, I'll soon upload a bugfix release.
Is it possible to send post only to a specific board ?
Open QuickPost.php
Find :
$query = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel, b.boardOrder
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]
$check"
, __FILE__, __LINE__) or die(mysql_error());
And replace it with
$query = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel, b.boardOrder
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]
AND b.ID_BOARD = 1
$check"
, __FILE__, __LINE__) or die(mysql_error());
Replace that 1 with ID of that board.
Thanx.. that will be useful !
This looks like something I could put to good use.
I gave it a try and get this error message showing up on my site in the phpbox.
QuoteParse error: parse error, unexpected T_DEC, expecting T_VARIABLE or '$' in /home/content/a/p/p/appliancejunk/html/forums/Sources/Load.php(1753) : eval()'d code(35) : eval()'d code on line 25
Did I not get something correct?
Thanks
Are you sure you pasted the whole code?
Is it possible to remove certain boards from the list ?
Like.. adding an exclude list ?
You got a code like this
$query = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel, b.boardOrder
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]
$check"
, __FILE__, __LINE__) or die(mysql_error());
Replace the part with
$exclude_boards = array(1,2,3);
$query = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel, b.boardOrder
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]
$check
AND b.ID_BOARD NOT IN('".implode(',',$exclude_boards)."')"
, __FILE__, __LINE__) or die(mysql_error());
Quote from: Dragooon on February 18, 2008, 07:18:58 AM
Are you sure you pasted the whole code?
Looks like that was the trouble.
Now it's working. :)
This is awesome!
A couple more questions.
I have this is a center box and the word "Subject:" is to the right of the "Select a board:" Drop down menu and not to the left of the subject box that is below the drop down menu.
Also in my regular posting box I have a second text box show up like the "Subject:" box that is called "Model Number:".
Would it be easy for me to find and add this to the quick post too.
Thanks,
You need to edit quickpost.php, I did to make it suitable to my need.
Quote from: Angelotus on January 18, 2008, 10:09:40 AM
Hi, is it possible to get an ajaxbased popup screen to post, so that I only have a link to the popupscreen on my index???
I have on my site (http://www.klifix.eu) on the top right site (link calls 'direct posten'). Give it a try. If you register you can see the whole function.
It uses the greybox function: http://www.orangoo.com/labs/GreyBox/
Hi... seems there is a glitch, actually I found that if user select certain forum then it is actually posting in some different forum..
Also, how do I make "forum" listing box little bigger as I am using it in article page but not in side bar. ie. I want to use full forum name instead of short one..
I'm unable to understand what does your "glitch" means?
I asked your previously that how to remove certain boards from the list.
I did that and removed some board.
But still I found that member are able to post in those forum using "Quick Post" block code you gave.
so glitch is that, somehow people are able to post on those boards which are not even listed in the FORM.
this is almost working bob on for me. the 1 little problem that i do have is that the drop down catergory box is hanging out of my side block. i have had a good look in the QuickPost.php to see if i can see where to make this box a bit smaller but had no luck so would just like to ask if this can be done and if so how ?
regards
Dave