
Modifications made to forum software
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
$post_data['first_post'] is what I was looking for! I will try it out first with the beta forum, and then add it here too.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
what board style do you use? With Subsilver the Links are indeed underlined and coloured blue.
sheepdog
[edit]
Oh I just see: They are only underlined if I hover with the mouse over it.
[/edit]
sheepdog
[edit]
Oh I just see: They are only underlined if I hover with the mouse over it.
[/edit]
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Regarding phpBB software:
Can someone help in the AutoHotkey forum? Here is the info:
http://www.autohotkey.com/forum/viewtopic.php?p=47981#47981
Can someone help in the AutoHotkey forum? Here is the info:
http://www.autohotkey.com/forum/viewtopic.php?p=47981#47981
I switched to Linux, bye and thanks for all the fish!
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Here is the code which I'm current lusing:
Code: Select all
##############################################################
## MOD Title: Quick Reply with Quote
## MOD Author: Smartor (Hoang Ngoc Tu)
## MOD Author2: Ghisler (Removed Javacript part, added fix for Firefox 1.5)
## MOD Description: This will add a quick-reply form below every topics
## It will only display when user has the Reply access
## MOD Version: 1.1.3
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: 3
## viewtopic.php
## language/lang_XX/lang_main.php
## templates/template_XX/viewtopic_body.tpl
## Included Files: N/A
##############################################################
## Author Notes:
##
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
#
#-----[ BEFORE, ADD ]------------------------------------
#
//
// Quick Reply Mod
//
if ( ((!$is_auth['auth_reply']) or ($forum_topic_data['forum_status'] == FORUM_LOCKED) or ($forum_topic_data['topic_status'] == TOPIC_LOCKED)) and ($userdata['user_level'] != ADMIN) )
{
$quick_reply_form = "";
}
else
{
if ( $can_watch_topic && $is_watching_topic )
{
$notify = 1;
}
else
{
$notify = $userdata['user_notify'];
}
$bbcode_uid = $postrow[$total_posts - 1]['bbcode_uid'];
$last_poster = $postrow[$total_posts - 1]['username'];
$last_msg = $postrow[$total_posts - 1]['post_text'];
$last_msg = str_replace(":1:$bbcode_uid", "", $last_msg);
$last_msg = str_replace(":u:$bbcode_uid", "", $last_msg);
$last_msg = str_replace(":o:$bbcode_uid", "", $last_msg);
$last_msg = str_replace(":$bbcode_uid", "", $last_msg);
$last_msg = str_replace("'", "'", $last_msg);
$last_msg = "[QUOTE=\"$last_poster\"]" . $last_msg . "[/QUOTE]";
$quick_reply_form = "
<script language='JavaScript' type='text/javascript'>
<!--
var quickreply_paste_text = '';
function copyQ() {
txt='';
if (document.getSelection) txt = document.getSelection();
else if (document.selection) txt = document.selection.createRange().text;
if (txt!='')
quickreply_paste_text=txt;
}
function pasteQ() {
txt='';
if (document.getSelection) txt = document.getSelection();
else if (document.selection) txt = document.selection.createRange().text;
if (txt=='')
txt=quickreply_paste_text;
if (txt=='')
alert('".$lang["No_Text_Selected"]."');
else
document.post.message.value = document.post.message.value + '[quote]' + txt + '[/quote]\\n';
}
//-->
</script>
<form action='".append_sid("posting.$phpEx")."' method='post' name='post'>
<span class='genmed'><b>".$lang["Quick_Reply"].":</b>
<a href=\"javascript:pasteQ()\" onMouseOver=\"copyQ()\">".$lang["Quote"]."</a>
<br />";
if (!$userdata['session_logged_in'])
{
$quick_reply_form .= $lang['Username'] . ": <input class='post' type='text' name='username' size='25' maxlength='25' value='' /><br />";
}
$quick_reply_form .= "<textarea name='message' rows='12' cols='56' wrap='virtual' class='post''></textarea><br />
<input type='checkbox' name='attach_sig' checked='checked' />".$lang["Attach_signature"]."<br />
<input type='hidden' name='mode' value='reply' />
<input type='hidden' name='sid' value='" . $userdata['session_id'] . "' />
<input type='hidden' name='t' value='" . $topic_id . "' />
<input type='hidden' name='notify' value=" . $notify . " />
<input type='hidden' name='last_msg' value='" . $last_msg . "' />
<input type='submit' name='preview' class='liteoption' value='".$lang['Preview']."' />
<input type='submit' name='post' class='mainoption' value='".$lang["Submit"]."' />
</form></span>";
}
$template->assign_vars(array(
'QUICK_REPLY_FORM' => $quick_reply_form)
);
//
// END Quick Reply Mod
//
#
#-----[ OPEN ]------------------------------------------
#
lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------
#
// Quick Reply Mod
$lang['Quick_Reply'] = 'Quick Reply';
$lang['No_Text_Selected'] = 'No text selected!';
#
#-----[ OPEN ]------------------------------------------
#
viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{S_TOPIC_ADMIN}
#
#-----[ AFTER, ADD ]------------------------------------
#
{QUICK_REPLY_FORM}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Found a small error, for 8 days timeout you should use 691200 seconds I think...ghisler(Author) wrote:$post_data['first_post'] is what I was looking for! I will try it out first with the beta forum, and then add it here too.
Code: Select all
// 8 days timeout --> 60 seconds * 60 minutes * 24 hours * 8 days.
if(!$post_data['first_post'] && (time() - $post_info['post_time']) > 300691200)
Code: Select all
// 8 days timeout --> 60 seconds * 60 minutes * 24 hours * 8 days.
if(!$post_data['first_post'] && (time() - $post_info['post_time']) > 691200)
Regards,
Cornelis
Cornelis
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
That's correct, in my code I use ( $post_age<86400*8 ).
Last edited by ghisler(Author) on 2006-02-14, 14:45 UTC, edited 1 time in total.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Hehe, stupid smily creator 8+) = 
Yes, the 8 days limit has been in the main forum for quite a while, and the editing of the first post was re-enabled just recently.

Yes, the 8 days limit has been in the main forum for quite a while, and the editing of the first post was re-enabled just recently.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Here is the modification to the relevant part of viewtopic.php. Just search for the string
$images['icon_edit']
to find the correct location, it's the edit button icon.
Don't forget to add a similar check to posting.php, otherwise users could submit the post directly with some tricks.
$images['icon_edit']
to find the correct location, it's the edit button icon.
Code: Select all
$post_age = time() - $postrow[$i]['post_time'];
$is_first_post = ($start==0) && ($i==0);
if (((($post_age<86400*8) || $is_first_post) && ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] )) || $is_auth['auth_mod'])
{
$temp_url = append_sid("posting.$phpEx?mode=editpost&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$edit_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>';
$edit = '<a href="' . $temp_url . '">' . $lang['Edit_delete_post'] . '</a>';
}
else
{
$edit_img = '';
$edit = '';
}
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com