[ABD] Trading Community Points Hack **Need Help**

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

[ABD] Trading Community Points Hack **Need Help**

Post by Nicola »

Hi!
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:
Image
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>
viewtopic.php

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,
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

into your MOD install, i suggest you to use the correct MOD Template and also, use the english language :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Post by Nicola »

morpheus2matrix wrote: into your MOD install, i suggest you to use the correct MOD Template and also, use the english language :wink:


I used the correct Template.
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

i think you should take a look here and here :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Post by Nicola »

morpheus2matrix wrote: i think you should take a look here and here :wink:

Thanks, i find the Prob. I Fix it, now work :D
User avatar
jvini
Registered User
Posts: 300
Joined: Tue Sep 24, 2002 11:20 pm
Contact:

Re: [MOD-Alpha] Trading Community Points Hack **Need Help**

Post by jvini »

Nicola wrote: 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.


This sounds promising, although I couldn't see the screen shot...I'm not exactly sure what this script does...however, I have a buy/sell/trade forum too, and this looks like what I was looking for! Can you elaborate? Or fix the screen shot? Looking good, keep us informed!
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

Nicola wrote:
morpheus2matrix wrote:i think you should take a look here and here :wink:

Thanks, i find the Prob. I Fix it, now work :D



Good :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Re: [MOD-Alpha] Trading Community Points Hack **Need Help**

Post by Nicola »

jvini wrote:
Nicola wrote: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.


This sounds promising, although I couldn't see the screen shot...I'm not exactly sure what this script does...however, I have a buy/sell/trade forum too, and this looks like what I was looking for! Can you elaborate? Or fix the screen shot? Looking good, keep us informed!


Thr screenshot is going :)
User avatar
jvini
Registered User
Posts: 300
Joined: Tue Sep 24, 2002 11:20 pm
Contact:

Re: [MOD-Alpha] Trading Community Points Hack **Need Help**

Post by jvini »

Nicola wrote: Thr screenshot is going :)


Nice. This looks cool, but what about different language files?
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Re: [MOD-Alpha] Trading Community Points Hack **Need Help**

Post by Nicola »

jvini wrote:
Nicola wrote:Thr screenshot is going :)


Nice. This looks cool, but what about different language files?


Sorry, my englisch ist very bad :-/

If help, here is the fixed Version:

Code: Select all

##############################################################################################
## 
## Hack Titel:		Trading Community Points Hack
## Hack Version:	1.0
## Autor:		gamesbay@webmaster.de
## Demo :		http://forum.gamesbay.de
## PHPBB Version:	2.0.X
## Beschreibung:	Dieser Hack soll Uebersicht bringen, sofern 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:	8
##			viewtopic.php
##			admin/admin_users.php
##			language/lang_xxx/lang_main.php
##			language/lang_xxx/lang_admin.php 
##			includes/usercp_viewprofile.php
##			templates/xxx/viewtopic_body.tpl
##			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); 


##############################################################################################

viewtopic.php
-------------

>>FINDE:
$sql = "SELECT u.username, u.user_id, u.user_privs, u.user_effects, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile,  pt.post_text, pt.post_subject, pt.bbcode_uid

>>FINDE IN ZEILE:
u.user_id,

>>DANACH EINFUEGEN:
u.user_negativ, u.user_positiv,

----------------------------------------------------------------------------------------------

>>FINDE:
		'YIM' => $yim,

>>DANACH EINFUEGEN:
		'POSITIV' => ( $postrow[$i]['user_positiv'] ) ? $postrow[$i]['user_positiv'] : '0', 
		'NEGATIV' => ( $postrow[$i]['user_negativ'] ) ? $postrow[$i]['user_negativ'] : '0', 


###############################################################################################

viewtopic_body.tpl
------------------

>>FINDE:
	<!-- 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}<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>

>>FINDE IN ZEILE:
<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}

>>DANACH EINFUEGEN:
<br /><br />Trading Points</br>Positiv&:&{postrow.POSITIV}<br />Negativ&:&{postrow.NEGATIV}<br /></td>


################################################################################################



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>




##############################################################################################
##############################################################################################
##############################################################################################
In This Version the Users can see the Trading Points now in the Profil in the Topic too. See here the pic:

Image
kip2001
Registered User
Posts: 313
Joined: Sun Sep 15, 2002 9:44 am

Post by kip2001 »

This seems very promising, but one thing, in english it's negative and positive with the "e" at the end :wink:
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Post by Nicola »

kip2001 wrote: This seems very promising, but one thing, in english it's negative and positive with the "e" at the end :wink:


Yes, but i have a German Board :P :)
User avatar
jvini
Registered User
Posts: 300
Joined: Tue Sep 24, 2002 11:20 pm
Contact:

Post by jvini »

First of all, this is looking good....however, I'm a little confused on exactly how this mod works...is it only good for the Mod assinging the points? Or can user's 'rate' others and assign them points? Is this achieved by donations? Can you explain in a little more detail how exactly this mod works? Also, is the only difference between this and the Points System Mod the ability to give negative points?

I've translated your mod into (slightly) better english...enjoy!
NOTE: The word 'hack' is now mod...please use this word!

Code: Select all

############################################################################################## 
## 
## Mod Title:      Trading Community Points Mod 
## Mod Version:   1.0 
## Author:      gamesbay@webmaster.de 
## Demo :      http://forum.gamesbay.de 
## phpBB Version:   2.0.X 
## Description:   This mod is used for phpBB boards that are trading ##communities. Admin can assign positive or negative points to user's 
## from the Admin CP.
##          
## Files to edit:   8 
##         viewtopic.php 
##         admin/admin_users.php 
##         language/lang_xxx/lang_main.php 
##         language/lang_xxx/lang_admin.php 
##         includes/usercp_viewprofile.php 
##         templates/xxx/viewtopic_body.tpl 
##         templates/xxx/admin/user_edit_body.tpl 
##         templates/xxx/profile_view_body.tpl 
## 
############################################################################################## 
## 
## Note: 
## You should back up all files before installing this mod.
## This mod adds two more columns to ' phpbb_user ' table.
############################################################################################## 

SQL QUERY: 

ALTER TABLE phpbb_users ADD user_positive INT(5); 
ALTER TABLE phpbb_users ADD user_negative INT(5); 


############################################################################################## 

viewtopic.php 
------------- 

>>FIND: 
$sql = "SELECT u.username, u.user_id, u.user_privs, u.user_effects, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile,  pt.post_text, pt.post_subject, pt.bbcode_uid 

>>FIND IN LINE: 
u.user_id, 

>>ADD AFTER: 
u.user_negative, u.user_positive, 

---------------------------------------------------------------------------------------------- 

>>FIND: 
      'YIM' => $yim, 

>>ADD AFTER: 
      'positive' => ( $postrow[$i]['user_positive'] ) ? $postrow[$i]['user_positive'] : '0', 
      'negative' => ( $postrow[$i]['user_negative'] ) ? $postrow[$i]['user_negative'] : '0', 


############################################################################################### 

viewtopic_body.tpl 
------------------ 

>>FIND: 
   <!-- 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}<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> 

>>FIND IN LINE: 
<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM} 

>>ADD AFTER: 
<br /><br />Trading Points</br>positive&:&{postrow.positive}<br />negative&:&{postrow.negative}<br /></td> 


################################################################################################ 



usercp_viewprofile.php 
---------------------- 

>>FIND: 
   'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&', 

>>ADD AFTER: 
   'positive' => ( $profiledata['user_positive'] ) ? $profiledata['user_positive'] : '0', 
   'negative' => ( $profiledata['user_negative'] ) ? $profiledata['user_negative'] : '0', 

---------------------------------------------------------------------------------------------- 

>>FIND: 
'L_INTERESTS' => $lang['Interests'], 

>>ADD AFTER: 
'L_positive' => $lang['positive'], 
'L_negative' => $lang['negative'], 


############################################################################################## 

admin_users.php 
--------------- 

>>FIND: 
$interests = (!empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags($HTTP_POST_VARS['interests']) ) : ""; 

>>ADD AFTER: 
$positive = ( !empty($HTTP_POST_VARS['positive']) ) ? trim(strip_tags( $HTTP_POST_VARS['positive'] ) ) : ''; 
$negative = ( !empty($HTTP_POST_VARS['negative']) ) ? trim(strip_tags( $HTTP_POST_VARS['negative'] ) ) : ''; 

---------------------------------------------------------------------------------------------- 

>>FIND: 
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature); 

>>FIND IN LINE: 
$interests 

>>ADD AFTER: 
, $positive , $negative 

---------------------------------------------------------------------------------------------- 

>>FIND: 
$interests = stripslashes($interests); 

>>ADD AFTER: 
$positive = stripslashes($positive); 
$negative = stripslashes($negative); 

---------------------------------------------------------------------------------------------- 

>>FIND: 
$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 . " 

>>FIND IN LINE: 
$interests) . "' 

>>ADD AFTER: 
, user_positive = '" . str_replace("\'", "''", $positive) . "', user_negative = '" . str_replace("\'", "''", $negative) . "' 

---------------------------------------------------------------------------------------------- 

>>FIND: 
$interests = stripslashes($interests); 

>>ADD AFTER: 
$positive = stripslashes($positive); 
$negative = stripslashes($negative); 

---------------------------------------------------------------------------------------------- 

>>FIND: 
$interests = $this_userdata['user_interests']; 

>>ADD AFTER: 
$positive = $this_userdata['user_positive']; 
$negative = $this_userdata['user_negative']; 

---------------------------------------------------------------------------------------------- 

>>FIND: 
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", "&", $interests) . '" />'; 

>>ADD AFTER: 
$s_hidden_fields .= '<input type="hidden" name="positive" value="' . str_replace("\"", "&", $positive) . '" />'; 
$s_hidden_fields .= '<input type="hidden" name="negative" value="' . str_replace("\"", "&", $negative) . '" />'; 

---------------------------------------------------------------------------------------------- 

>>FIND: 
'INTERESTS' => $interests, 

>>ADD AFTER: 
'positive' => $positive, 
'negative' => $negative, 

---------------------------------------------------------------------------------------------- 

>>FIND: 
'L_INTERESTS' => $lang['Interests'], 

>>ADD AFTER: 
'L_positive' => $lang['positive'], 
'L_negative' => $lang['negative'], 

############################################################################################## 

lang_admin.php 
------------- 

>>FIND: 
// 
// That's all Folks! 


>>ADD BEFORE: 
$lang['positive'] = "positive"; 
$lang['negative'] = "negative"; 

############################################################################################## 

lang_main.php 
------------- 

>>FIND: 
// 
// That's all Folks! 

>>ADD BEFORE: 
$lang['positive'] = "positive"; 
$lang['negative'] = "negative"; 


############################################################################################## 

profile_view_body.tpl 
--------------------- 

>>FIND: 
      <tr> 
        <td valign="top" align="right"><span class="gen">{L_INTERESTS}:</span></td> 
        <td> <b><span class="gen">{INTERESTS}</span></b></td> 
      </tr> 

>>ADD AFTER: 
      <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">{positive}&{L_positive}<br />{negative}&{L_negative}</span></b></td> 

        </tr> 


############################################################################################## 

user_edit_body.tpl 
------------------ 

>>FIND: 
   <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> 

>>ADD AFTER: 
        <tr> 
     <td class="row1" colspan="2"><b><span class="gensmall">Trading Points:</span></b></td> 
   </tr> 
        <tr> 
          <td class="row1"><span class="gen">{L_positive}</span></td> 
          <td class="row2"> 
                <input type="text" name="positive" size="5" maxlength="5" value="{positive}" /> 
        </td> 
         </tr> 
        <tr> 
          <td class="row1"><span class="gen">{L_negative}</span></td> 
          <td class="row2"> 
                <input type="text" name="negative" size="5" maxlength="5" value="{negative}" /> 
        </td> 
         </tr> 

############################################################################################## 
############################################################################################## 
##############################################################################################
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

What does this actually do?
Nicola
Registered User
Posts: 19
Joined: Fri Jan 31, 2003 6:02 pm

Post by Nicola »

jvini wrote: First of all, this is looking good....however, I'm a little confused on exactly how this mod works...is it only good for the Mod assinging the points? Or can user's 'rate' others and assign them points? Is this achieved by donations? Can you explain in a little more detail how exactly this mod works? Also, is the only difference between this and the Points System Mod the ability to give negative points?


Ok, lets try.
This mod has nothing to do with other Points Mod's.
I have a corner in my Forum where the Members can Use/sell and deal with there used Videogames.
Then I have a Topic " User Rating" where the Board Members can Rate the other Member if they Deal together. Like so:
+1 Nicola - Dreamcast Game - Nice Dealing Partner, no problem

But if now many Board Members used this Thread and rate the other Members the overview of this Topic goes down. Then i made this mod and i put the ratings from the " User Rating Topic" in this mod. So the overview is much better, because the Members can now see if the other member have a positive or negative Rating from other Members. To add the Points (only Admin can do) you can do it thru the user setting Menu:

Image


I hope this was helpful.
Locked

Return to “[2.0.x] MODs in Development”