first sorry about my very Bad English. So, here i go.
I have made yesterday this mod and it works good, but i have some prob. with the viewtopic_body.tpl and viewtopic.php. This script add 2 new fields in the profile and it can be only changed by the Admin thru the Admin panel. In my Forum Users sell or buy Games from other Users, so they can rate the user in a tread and i put it then in this new script. Here is a screen:
This works perfect. But i have some problem to put this in viewtopic_body.tpl. Does someone know what i made wrong ?
Here is the Code of the script (sorry, its in German) :
Code: Select all
##
## MOD Titel: Trading Community Points Hack
## MOD Version: Alpha
## Autor: gamesbay@webmaster.de
## Demo : http://forum.gamesbay.de
## Beschreibung: Dieser Hack soll Uebersicht bringen, wenn ihr in eurem Forum
## ne Kauf/Verkauf/Tausch Ecke habt. Admin kann übers
## Administrations-Bereich (Benutzer-> Einstellungen) Trading
## Punkte vergeben (positive und negative).
##
## Dateien zu ändern: 6
## admin/admin_users.php
## language/lang_xxx/lang_main.php
## language/lang_xxx/lang_admin.php
## includes/usercp_viewprofile.php
## templates/xxx/admin/user_edit_body.tpl
## templates/xxx/profile_view_body.tpl
##
###############################
##
## Notiz:
## Vor jeglichen Aenderungen an Datenbank/Dateien sollten dieser gesichert werden.
## Dieser Hack fuegt zwei weitere Spalten zur 'phpbb_user' Tabelle hinzu.
####################################
SQL QUERY:
ALTER TABLE phpbb_users ADD user_positiv INT(5);
ALTER TABLE phpbb_users ADD user_negativ INT(5);
#######################################
usercp_viewprofile.php
----------------------
>>FINDE:
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&',
>>DANACH EINFUEGEN:
'POSITIV' => ( $profiledata['user_positiv'] ) ? $profiledata['user_positiv'] : '0',
'NEGATIV' => ( $profiledata['user_negativ'] ) ? $profiledata['user_negativ'] : '0',
----------------------------------------------------
>>FINDE:
'L_INTERESTS' => $lang['Interests'],
>>DANACH EINFUEGEN:
'L_POSITIV' => $lang['Positiv'],
'L_NEGATIV' => $lang['Negativ'],
#######################################
admin_users.php
---------------
>>FINDE:
$interests = (!empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags($HTTP_POST_VARS['interests']) ) : "";
>>DANACH EINFUEGEN:
$positiv = ( !empty($HTTP_POST_VARS['positiv']) ) ? trim(strip_tags( $HTTP_POST_VARS['positiv'] ) ) : '';
$negativ = ( !empty($HTTP_POST_VARS['negativ']) ) ? trim(strip_tags( $HTTP_POST_VARS['negativ'] ) ) : '';
--------------------------------------------
>>FINDE:
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
>>FINDE IN DIESER ZEILE:
$interests
>>DANACH EINFUEGEN:
, $positiv , $negativ
------------------------------
>>FINDE:
$interests = stripslashes($interests);
>>DANACH EINFUEGEN:
$positiv = stripslashes($positiv);
$negativ = stripslashes($negativ);
---------------------------------------------
>>FINDE:
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
>>FINDE IN DIESER ZEILE:
$interests) . "'
>>DANACH EINFUEGEN:
, user_positiv = '" . str_replace("\'", "''", $positiv) . "', user_negativ = '" . str_replace("\'", "''", $negativ) . "'
------------------------------------------
>>FINDE:
$interests = stripslashes($interests);
>>DANACH EINFUEGEN:
$positiv = stripslashes($positiv);
$negativ = stripslashes($negativ);
-----------------------------------
>>FINDE:
$interests = $this_userdata['user_interests'];
>>DANACH EINFUEGEN:
$positiv = $this_userdata['user_positiv'];
$negativ = $this_userdata['user_negativ'];
------------------------------------
>>FINDE:
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", "&", $interests) . '" />';
>>DANACH EINFUEGEN:
$s_hidden_fields .= '<input type="hidden" name="positiv" value="' . str_replace("\"", "&", $positiv) . '" />';
$s_hidden_fields .= '<input type="hidden" name="negativ" value="' . str_replace("\"", "&", $negativ) . '" />';
--------------------------------------------------
>>FINDE:
'INTERESTS' => $interests,
>>DANACH EINFUEGEN:
'POSITIV' => $positiv,
'NEGATIV' => $negativ,
-------------------------------
>>FINDE:
'L_INTERESTS' => $lang['Interests'],
>>DANACH EINFUEGEN:
'L_POSITIV' => $lang['Positiv'],
'L_NEGATIV' => $lang['Negativ'],
#############################
lang_admin.php
-------------
>>FINDE:
//
// That's all Folks!
>>ADD BEFORE:
$lang['Positiv'] = "Positiv";
$lang['Negativ'] = "Negativ";
###################################
lang_main.php
-------------
>>FINDE:
//
// That's all Folks!
>>ADD BEFORE:
$lang['Positiv'] = "Positiv";
$lang['Negativ'] = "Negativ";
#################################
profile_view_body.tpl
---------------------
>>FINDE:
<tr>
<td valign="top" align="right"><span class="gen">{L_INTERESTS}:</span></td>
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>
>>DANACH EINFUEGEN:
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">
Trading Points:</span></td>
<td valign="top" align="left" nowrap="nowrap"><b><span class="gen">{POSITIV}&{L_POSITIV}<br />{NEGATIV}&{L_NEGATIV}</span></b></td>
</tr>
###############
user_edit_body.tpl
------------------
>>FINDE:
<tr>
<td class="row1"><span class="gen">{L_SIGNATURE}</span><br />
<span class="gensmall">{L_SIGNATURE_EXPLAIN}<br />
<br />
{HTML_STATUS}<br />
{BBCODE_STATUS}<br />
{SMILIES_STATUS}</span></td>
<td class="row2">
<textarea name="signature" rows="6" cols="45">{SIGNATURE}</textarea>
</td>
</tr>
>>DANACH EINFUEGEN:
<tr>
<td class="row1" colspan="2"><b><span class="gensmall">Trading Punkte:</span></b></td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_POSITIV}</span></td>
<td class="row2">
<input type="text" name="positiv" size="5" maxlength="5" value="{POSITIV}" />
</td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_NEGATIV}</span></td>
<td class="row2">
<input type="text" name="negativ" size="5" maxlength="5" value="{NEGATIV}" />
</td>
</tr>
################################
And this are the two scripts who doesent work.
viewtopic_body.tpl
Code: Select all
<!-- BEGIN postrow -->
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br />
<br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}{postrow.POINTS}<br /><a href="{postrow.ITEMSNAME}" class=\"nav\">Items</a>{postrow.ITEMS}{postrow.DONATE_POINTS}<br />
<br />Trading Points</br>Positiv&:&{postrow.POSITIV}<br />Negativ&:&{postrow.NEGATIV}<br /></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&</span>& &{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
<td valign="top" align="right" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.REPORT_IMG} {postrow.IP_IMG}</td>
</tr>
Code: Select all
'MSN' => $msn,
'YIM_IMG' => $yim_img,
'YIM' => $yim,
'POSITIV' => ( $postrow[$i]['user_positiv'] ) ? $postrow[$i]['user_positiv'] : '0',
'NEGATIV' => ( $postrow[$i]['user_negativ'] ) ? $postrow[$i]['user_negativ'] : '0',
'EDIT_IMG' => $edit_img,
'EDIT' => $edit,