Page 1 of 1

PHP programmer

Posted: Mon Dec 31, 2007 12:13 am
by Max Brown
I can't answer Fooli in the topic http://www.theuniversal.net/forum/viewtopic.php?t=5401
I answer here.

To add a "Report post" button, you need 1st to edit the viewtopic_body.tpl in each template folder:
/forum/templates/GlSet2/viewtopic_body.tpl
/forum/templates/SubSilver/viewtopic_body.tpl
Replace in this files the following string:

Code: Select all

<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
with

Code: Select all

<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG} {postrow.REPORT_IMG}</td>
2nd, edit the /forum/viewtopic.php file.
Find the following block:

Code: Select all

	$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
	$quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
	$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';
Insert after this block the following:

Code: Select all

	$temp_url = append_sid("report.php?" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
	$report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_report'] . '" alt="' . $lang['Report this post'] . '" title="' . $lang['Report this post'] . '" border="0" /></a>';
	$report = '<a href="' . $temp_url . '">' . $lang['Report_this_post'] . '</a>';
then find the block

Code: Select all

		'QUOTE_IMG' => $quote_img,
		'QUOTE' => $quote,
and insert after it the block:

Code: Select all

		'REPORT_IMG' => $quote_img,
		'REPORT' => $quote,
3rd, edit the /forum/language/lang_english/lang.main.php
find the string

Code: Select all

$lang['Reply_with_quote'] = 'Reply with quote';
and insert after it:

Code: Select all

$lang['Report_this_post'] = 'Report this post';
4th, create the forum/report.php file that will do report (for example, will send a email to moderator).

If you can't write this file, or if you need some other PHP-programming - ask me.

P.S. And don't forget
0. Create the image icon_report.gif and place its copyes into directories
/forum/templates/GlSet2/images/lang_english/ and
/forum/templates/subSilver/images/lang_english/

P.P.S. Happy New Year!
(or, in russian, С Новым Годом!)