Modifications made to forum software

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
corny
Junior Member
Junior Member
Posts: 96
Joined: 2003-02-07, 10:06 UTC

Post by *corny »

I tested it at my forum in development (www.eilandenrijk.com), it works as expected :lol:
Regards,
Cornelis
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

$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
User avatar
MPS
Junior Member
Junior Member
Posts: 90
Joined: 2004-07-27, 15:57 UTC
Location: Poland
Contact:

Post by *MPS »

christian, can we underline or otherwise highlight the links on the forum? it's really hard to find where they are...
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

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]
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
MPS
Junior Member
Junior Member
Posts: 90
Joined: 2004-07-27, 15:57 UTC
Location: Poland
Contact:

Post by *MPS »

i use
phpvb2

i only see if sth is a link if i hover on it and it becomes pink which is really annoying.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Regarding phpBB software:
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!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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'] . ":&nbsp;<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']."' />&nbsp;
	<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
User avatar
corny
Junior Member
Junior Member
Posts: 96
Joined: 2003-02-07, 10:06 UTC

Post by *corny »

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.
Found a small error, for 8 days timeout you should use 691200 seconds I think...

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) 
should be

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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
corny
Junior Member
Junior Member
Posts: 96
Joined: 2003-02-07, 10:06 UTC

Post by *corny »

how much is 86400*cool? ;-)

Did you implement it already in the mainforum?
Regards,
Cornelis
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hehe, stupid smily creator 8+) = 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.
Author of Total Commander
https://www.ghisler.com
User avatar
corny
Junior Member
Junior Member
Posts: 96
Joined: 2003-02-07, 10:06 UTC

Post by *corny »

I see you also made a change to the template, so that the edit button is not shown uberhaupt. Can you point me this change? I really like it!
Regards,
Cornelis
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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.

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 = '';
	}
Don't forget to add a similar check to posting.php, otherwise users could submit the post directly with some tricks.
Author of Total Commander
https://www.ghisler.com
User avatar
corny
Junior Member
Junior Member
Posts: 96
Joined: 2003-02-07, 10:06 UTC

Post by *corny »

Thanks, I implemented it directly. Above, I made the number of days a configurable setting 8)
Regards,
Cornelis
Post Reply