CASH MOD (stale nejde)

Vaše dotazy, potíže nebo diskuze k phpBB3 MODům patří sem
Pravidla fóra
Nikdy na fóru nezveřejňujete své údaje (uživ. jméno a heslo) k vaší databázi a FTP, riskujete tím mnoho věcí. Od zneužití po zničení vašeho systému. Pokud je to opravdu nutné, tak doporučujeme vytvořit dočasný FTP účet pro ty potřebné soubory.

Oficiální podpora je z technických důvodů poskytována pouze MODům, které byly schváleny na phpBB.com, jejich seznam najdete zde.
Zamčeno
DonkeyKong
Příspěvky: 3
Registrován: ned 22. črc 2007 18:27:40

CASH MOD (stale nejde)

Příspěvek od DonkeyKong » čtv 22. lis 2007 21:41:42

no takze ameeck vravel ze ked mam dalsi problem nech zalozim new tema tak som zalozil a jedna sa o cash mod
si vravel ze ak tam je 2-kova uprava ze hned s tym prec no neviem ci tam je posud sam...

Kód: Vybrat vše

############################################################## 
## MOD Title: Cash Mod
## MOD Author: Handyman < Francis@michaellewismusic.com > (Francis Lewis) http://startrekguide.com
## MOD Description:	Allows users to gain points/cash for posts they make.
##
## MOD Version:		0.3.2
## 
## Installation Level: 	Intermediate
## Installation Time:  	20 Minutes 
## Files To Edit: 6
##			includes/constants.php
##			includes/functions_posting.php
##			viewtopic.php
##			memberlist.php
##			styles/subSilver/template/viewtopic_body.html
##			styles/subSilver/template/memberlist_body.html
##
## Included Files: 5
##			cash_db.php
##			includes/acp/acp_cash.php
##			includes/acp/info/acp_cash.php
##			adm/styles/acp_cash.html
##			language/en/acp/cash.php
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
##############################################################
## For security purposes, please check: http://startrekguide.com/forum/mods/
## Or http://phpbb.com/community/viewforum.php?f=70
## for the latest version of this MOD. No support
## will be given for MODs not found within the MODs Database
##############################################################
## Author Notes: 
## 
##  Copyright 2007 © Handyman.
##
##############################################################
## History:
##  (yyyy-mm-dd)
##   2006-10-12 - Version 0.0.1 (BETA)
##      - Beta release
##   2007-02-03 - Version 0.1.0
##      - Added display on viewtopic and memberlist
##   2007-03-03 - Version 0.2.0
##      - Added cash toggle switches so it only works if you have it set in the ACP
##
##   2007-05-27 - Version 0.3.0
##      - Added view all users cash amounts in profile
##      - Added Bank Management for Admins and Mods with permission to edit users cash
##      - Added permissions for admins and mods to edit users cash
##      - Added prosilver and subsilver2 instructions
##      - Updated to work with RC1
##      - Cash on/off on per forum basis
##      - Limit Cash per time period
##
##	2007-6-26 - Version 0.3.2
##		- Serious code cleanup and overhaul
##		- Made all cash instances into functions for easy upgrading
##		- Finished the ACP so it now controls all currently available options
##		- Made link to Bank in viewtopic
##############################################################

#
#-----[ COPY ]----------------------
#
root/adm/style/acp_cash.html to adm/style/acp_cash.html
root/cash_db.php to cash_db.php
root/includes/acp/acp_cash.php to includes/acp/acp_cash.php
root/includes/acp/info/acp_cash.php to includes/acp/info/acp_cash.php
root/includes/mods to includes/mods
root/ucp/ucp_bank.php to ucp/ucp_bank.php
root/ucp/info/ucp_bank.php to ucp/info/ucp_bank.php
root/language/en/mods/cash.php to language/en/mods/cash.php
#
#-----[ DIY ]----------------------
#
before you go any further, make sure you run the db script.
browse to cash_db.php?mode=install
#
#-----[ OPEN ]----------------------
#
adm/index.php
#
#-----[ FIND ]----------------------
#
$user->setup('acp/common');
#
#-----[ AFTER, ADD ]----------------------
#
$user->add_lang('mods/cash');
#
#-----[ OPEN ]----------------------
#
includes/constants.php
#
#-----[ FIND ]----------------------
#
define('BOTS_TABLE',				$table_prefix . 'bots');
#
#-----[ AFTER, ADD ]----------------------
#
define('CASH_TABLE',				$table_prefix . 'cash');
define('CASH_AMT_TABLE',			$table_prefix . 'cash_amt');
#
#-----[ OPEN ]----------------------
#
includes/functions_posting.php
#
#-----[ FIND ]----------------------
#
// We do not handle erasing posts here
#
#-----[ BEFORE, ADD ]----------------------
#
//include the cash mod functions file here
	include("{$phpbb_root_path}includes/mods/functions_cash.$phpEx");
#
#-----[ FIND ]----------------------
#
$sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : '');
#
#-----[ IN-LINE FIND ]----------------------
#
+ 1' : '')
#
#-----[ IN-LINE AFTER, ADD ]----------------------
#
 . cash_post($data['forum_id'])
#
#-----[ FIND ]----------------------
#
$sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : '');
#
#-----[ IN-LINE FIND ]----------------------
#
+ 1' : '')
#
#-----[ IN-LINE AFTER, ADD ]----------------------
#
 . cash_post($data['forum_id'])
#
#-----[ OPEN ]----------------------
#
language/en/acp/permissions_phpbb.php
#
#-----[ FIND ]----------------------
#
'actions'		=> 'Actions',
#
#-----[ AFTER, ADD ]----------------------
#
'bank'			=> 'Bank',
#
#-----[ OPEN ]----------------------
#
language/en/memberlist.php
#
#-----[ FIND ]----------------------
#
'ABOUT_USER'			=> 'Profile',
#
#-----[ AFTER, ADD ]----------------------
#
'ACCOUNT'				=> 'Account',
#
#-----[ OPEN ]----------------------
#
memberlist.php
#
#-----[ FIND ]----------------------
#
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
#
#-----[ AFTER, ADD ]----------------------
#
include($phpbb_root_path . 'includes/mods/functions_cash.' . $phpEx);
#
#-----[ FIND ]----------------------
#
$user_id = (int) $member['user_id'];
#
#-----[ AFTER, ADD ]----------------------
#
$member['cash'] = member_cash($user_id);
#
#-----[ FIND ]----------------------
#
WHERE ' . $db->sql_in_set('user_id', $user_list);
#
#-----[ AFTER, ADD ]----------------------
#
cash_sql($sql, $user_list);
#
#-----[ FIND ]----------------------
#
// Generate page
#
#-----[ BEFORE, ADD ]----------------------
#
cash_vars();
#
#-----[ FIND ]----------------------
#
return array(
#
#-----[ REPLACE WITH ]----------------------
#
//put this here… maybe somebody else can use it as well
	$show_profile_ary = array();
	$show_profile_ary = array_merge(cash_array($data, $user_id), $show_profile_ary);

	return array_merge($show_profile_ary, array(
#
#-----[ FIND ]----------------------
#
'L_VIEWING_PROFILE'	=> sprintf($user->lang['VIEWING_PROFILE'], $username),
	);
#
#-----[ IN-LINE FIND ]----------------------
#
);
#
#-----[ IN-LINE BEFORE, ADD ]----------------------
#
)
#
#-----[ OPEN ]----------------------
#
ucp.php
#
#-----[ FIND ]----------------------
#
$user->setup('ucp');
#
#-----[ AFTER, ADD ]----------------------
#
$user->add_lang('mods/cash');
#
#-----[ OPEN ]----------------------
#
viewtopic.php
#
#-----[ FIND ]----------------------
#
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
#
#-----[ AFTER, ADD ]----------------------
#
include($phpbb_root_path . 'includes/mods/functions_cash.' . $phpEx);
#
#-----[ FIND ]----------------------
#
'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));
#
#-----[ AFTER, ADD ]----------------------
#
viewtopic_cash($sql);
#
#-----[ FIND ]----------------------
#
$user_cache[$poster_id] = array(
#
#-----[ REPLACE WITH ]----------------------
#
//put this here... maybe somebody else can use it as well
			$user_cache[$poster_id] = array();
			$user_cache[$poster_id] = array_merge(user_cash($poster_id), $user_cache[$poster_id]);
		
			$user_cache[$poster_id] = array_merge($user_cache[$poster_id], array(
#
#-----[ FIND ]----------------------
#
'allow_pm'			=> 0,
			);
#
#-----[ IN-LINE FIND ]----------------------
#
);
#
#-----[ IN-LINE BEFORE, ADD ]----------------------
#
)
#
#-----[ FIND ]----------------------
#
$user_cache[$poster_id] = array(
#
#-----[ REPLACE WITH ]----------------------
#
//put this here... maybe somebody else can use it as well
			$user_cache[$poster_id] = array();
			$user_cache[$poster_id] = array_merge(user_cash($poster_id, $row), $user_cache[$poster_id]);

			$user_cache[$poster_id] = array_merge($user_cache[$poster_id], array(
#
#-----[ FIND ]----------------------
#
'search_author=' . urlencode($row['username']) .'&showresults=posts') : '',
			);
#
#-----[ IN-LINE FIND ]----------------------
#
);
#
#-----[ IN-LINE BEFORE, ADD ]----------------------
#
)
#
#-----[ FIND ]----------------------
#
$postrow = array(
#
#-----[ REPLACE WITH ]----------------------
#
//put this here... maybe somebody else can use it as well
	$postrow = array();
	$postrow = array_merge(postrow_cash($user_cache, $poster_id), $postrow);

	$postrow = array_merge($postrow, array(
#
#-----[ FIND ]----------------------
#
'L_IGNORE_POST'		=> ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
	);
#
#-----[ IN-LINE FIND ]----------------------
#
);
#
#-----[ IN-LINE BEFORE, ADD ]----------------------
#
)

ameeck
Příspěvky: 6425
Registrován: ned 06. lis 2005 1:00:00

Re: CASH MOD (stale nejde)

Příspěvek od ameeck » čtv 22. lis 2007 21:57:59

Tu úpravu z 2.0.x jsem zmínil proto, že si zkošuel nainstalovat ten předchozí MOD, úpravy z tohoto MODu by měli být v pořádku, pokud ti to vyhazuje chybu, tak ten postup projed znovu, obzvlaste ty upravy ktere se tykaji souboru zmineneho v te chybe..

DonkeyKong
Příspěvky: 3
Registrován: ned 22. črc 2007 18:27:40

Re: CASH MOD (stale nejde)

Příspěvek od DonkeyKong » čtv 22. lis 2007 22:57:07

len to je to ze mne to pisalo aj v index.php aj v memberlist.php aj v viewtopic.php nemohol by si mi to skusit ty upravit a hodil by som to uz tam rovno? pls. lebo ja to asi nikdy nespravim

Zamčeno