1
AndreyRa
X2 NewBB: QuickReply Form
  • 2003/6/18 23:49

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


This and other hacks available to download here: Some useful hacks

X2 NewBB: QuickReply Form.

Tested with XOOPS 2.0.2, 2.0.3.

File: modules/newbb/viewtopic.php, line 251, after $key1 = $eachpost->postid();:
Quote:

//Begin: QuickReply Hack
$post_id=$key1;
//End: QuickReply Hack


line 309, after foreach ( $postsArray as $eachpost ) {:
Quote:

//Begin: QuickReply Hack
$post_id=$eachpost->postid();
//End: QuickReply Hack


and pre-last line of viewtopic.php, before include XOOPS_ROOT_PATH.'/footer.php';:
Quote:

//Begin: QuickReply Hack
if (!empty($post_id)){
$sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";
if ( !$result = $xoopsDB->query($sql) ) {
} else {
$forumdata = $xoopsDB->fetchArray($result);
$myts =& MyTextSanitizer::getInstance();
if ( $forumdata['forum_type'] == 1 ) {
$accesserror = 0; //initialize
if ( $xoopsUser ) {
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
if ( !check_priv_forum_auth($xoopsUser->uid(), $forum, true) ) {$accesserror = 1;};
};
} else {$accesserror = 1;};
} else {
$accesserror = 0;
if ( $forumdata['forum_access'] == 3 ) {
if ( $xoopsUser ) {
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
if ( !is_moderator($forum, $xoopsUser->uid()) ) {$accesserror = 1;};
};
} else {$accesserror = 1;};
} elseif ( $forumdata['forum_access'] == 1 && !$xoopsUser ) {$accesserror = 1;};
};
if ( $accesserror != 1 ) {
include_once 'class/class.forumposts.php';
$forumpost = new ForumPosts($post_id);
$r_message = $forumpost->text();
$r_date = formatTimestamp($forumpost->posttime());
$r_name = ($forumpost->uid() != 0) ? XoopsUser::getUnameFromId($forumpost->uid()) : $xoopsConfig['anonymous'];
$r_content = _MD_BY." ".$r_name." "._MD_ON." ".$r_date."

";
$r_content.= $r_message;
$r_subject = $forumpost->subject();
if (!preg_match("/^Re:/i",$r_subject)) {$qa['subject'] = 'Re: '.$myts->htmlSpecialChars($r_subject);} else {$qa['subject'] = $myts->htmlSpecialChars($r_subject);};
$q_message = $forumpost->text("Quotes");
$hidden = "["."quote]\n";
$hidden .= sprintf(_MD_USERWROTE,$r_name);
$hidden .= "\n".$q_message."["."/quote]";
$message = "";
$pid = $post_id;
unset($post_id);
$topic_id = $forumpost->topic();
$forum = $forumpost->forum();
$isreply =1;
$istopic = 0;
include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
include XOOPS_ROOT_PATH."/include/xoopscodes.php";

$lists = new XoopsLists;
$filelist = $lists->getSubjectsList();

$count = 1;
$qa['icons_list'] = '';
while ( list($key, $file) = each($filelist) ) {
$checked = "";
if ( isset($icon) && $file==$icon ) {$checked = " checked='checked'";}
$qa['icons_list'].=" ";
$qa['icons_list'].=" ";
if ( $count == 8 ) {
$qa['icons_list'].="
";
$count = 0;
};
$count++;
};

ob_start();
xoopsCodeTarea("message");

if ( !empty($isreply) && isset($hidden) && $hidden != "" ) {
echo "";
echo "
 ";
}
xoopsSmilies("message");
$qa['message_area']=ob_get_contents();
ob_clean();

//-- Options
if ( $xoopsUser && $forumdata['forum_access'] == 2 && !empty($post_id) ) {
echo " if ( isset($noname) && $noname ) {
echo " checked='checked'";
};
echo " /> "._MD_POSTANONLY."
\n";
};

echo " if ( isset($nosmiley) && $nosmiley ) {
echo " checked='checked'";
};
echo " /> "._MD_DISABLESMILEY."
\n";

if ( $forumdata['allow_html'] ) {
echo " if ( $nohtml ) {
echo " checked='checked'";
};
echo " /> "._MD_DISABLEHTML."
\n";
} else {
echo "";
};

if ( $forumdata['allow_sig'] && $xoopsUser ) {
echo " if (isset($HTTP_POST_VARS['contents_preview'])) {
if ( $attachsig ) {
echo " checked='checked' /> ";
} else {
echo " /> ";
};
} else {
if ($xoopsUser->getVar('attachsig') || !empty($attachsig)) {
echo " checked='checked' /> ";
} else {
echo "/> ";
};
};

echo _MD_ATTACHSIG."
\n";
};

if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) {
echo "";
echo " // Check previous subscribed status...
$notification_handler =& xoops_gethandler('notification');
if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) {
echo ' checked="checked"';
};
echo " /> "._MD_NEWPOSTNOTIFY."
\n";
};
$qa['options_area']=ob_get_contents();
ob_clean();
//--Ñàáìèò è õèääåíû
$post_id = isset($post_id) ? intval($post_id) : '';
$topic_id = isset($topic_id) ? intval($topic_id) : '';
$order = isset($order) ? intval($order) : '';
$pid = isset($pid) ? intval($pid) : 0;

echo "





 
} else {
echo "viewforum.php?forum=".intval($forum)."\"'";
};
echo " class='formButton' value='"._MD_CANCELPOST."' />";
$qa['submit_area']=ob_get_contents();
ob_end_clean();

$xoopsTpl->assign("qa",$qa);
};
};
};
//Begin: QuickReply Hack


4. Goto Control Panel->Administration->Template Editor->Forum->newbb_viewtopic_flat.html (and newbb_viewtopic_thread.html)
insert there you like, closer to end (for example before <{include file='db:system_notification_select.html'}>):
Quote:









<{$qa.icons_list}>
<{$qa.message_area}>
<{$qa.options_area}>
<{$qa.submit_area}>



That's all.

PS. Ðóññêóþ âåðñèþ õàêà - ÷èòàéòå íà xoops.ru

2
Anonymous
Re: X2 NewBB: QuickReply Form
  • 2003/6/24 22:40

  • Anonymous

  • Posts: 0

  • Since:


Your code gives me parse errors, something about expecting a , or ; on line 442 or something. And what's with those weird symbols?

3
AndreyRa
Re: X2 NewBB: QuickReply Form
  • 2003/6/24 23:10

  • AndreyRa

  • Just popping in

  • Posts: 17

  • Since: 2003/3/16


Quote:

bozzy wrote:
Your code gives me parse errors, something about expecting a , or ; on line 442 or something. And what's with those weird symbols?

It because I have taken advantage of tags [ code]. Now I know how many in them of bugs (correction is in the same forum) - I have replaced all tags [ code] with tags [ quote]. Now should work.

PS. Example of generating html from tag "code":
sql "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page,hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHEREforum_id = $forum";<br />


and tag "quote":
$sql "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";<br />


As someone spoke, that at him Mozilla carries of lines is work. The bug whether or not - who knows...

4
knight
Re: X2 NewBB: QuickReply Form
  • 2003/7/20 1:38

  • knight

  • Just popping in

  • Posts: 29

  • Since: 2002/12/29


just notice one bug, it can actually can reply the post which been lock

5
Hober
Re: X2 NewBB: QuickReply Form
  • 2003/8/5 22:14

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


Quote:

bozzy wrote:
Your code gives me parse errors, something about expecting a , or ; on line 442 or something. And what's with those weird symbols?

I think the symbols are russian...

6
kotis
Re: X2 NewBB: QuickReply Form
  • 2004/5/2 12:34

  • kotis

  • Just popping in

  • Posts: 82

  • Since: 2002/12/23


Is there a workaround to make the quick reply form not to appear when the topic is locked? The code is unusable as is because there is no way for a moderator to lock a topic...

7
phppp
Re: X2 NewBB: QuickReply Form
  • 2004/5/2 16:51

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


yes
it has been fixed for the next version (being tested).

8
Kerjin
Re: X2 NewBB: QuickReply Form
  • 2004/6/3 16:05

  • Kerjin

  • Just popping in

  • Posts: 48

  • Since: 2004/3/10


And when is this next version being released? The last post in this thread was a month ago.

9
Matas
Re: X2 NewBB: QuickReply Form
  • 2004/9/6 7:26

  • Matas

  • Just popping in

  • Posts: 6

  • Since: 2004/3/21


just add
<{if $viewer_can_post == true}>
//quick reply table
<{/if}>

10
limecity
Re: X2 NewBB: QuickReply Form
  • 2004/9/15 18:26

  • limecity

  • Friend of XOOPS

  • Posts: 1602

  • Since: 2003/7/6 0


Anyone using this hack on the latest XOOPS version?

i need a quick reply function in newsbb..
i don't know when newsbb pro going to be realeased
so just use this as a temp.



Login

Who's Online

339 user(s) are online (243 user(s) are browsing Support Forums)


Members: 0


Guests: 339


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits