Провайдер / Provider

PheRum

Разработчик
#1
PHP:
##############################################################
## MOD Title: Провайдер / Provider
## MOD Author: PheRum http://reactorr.org
## MOD Description: Мод даёт возможность указать используемого провайдера + выводит в топик и профиль.
## Installation Level: Easy
## Installation Time: ~2 Minutes
## MOD Compatibility: TorrentPier II
## Files To Edit:
## viewtopic.php
## includes/ucp//usercp_register.php
## includes/ucp/usercp_viewprofile.php
## lang_russian/lang_main.php
## templates/default/usercp_register.tpl
## templates/default/usercp_viewprofile.tpl
## templates/default/viewtopic.tpl
##
##############################################################

#
#-----[ SQL ]------------------------------------------
#

ALTER TABLE `bb_users` ADD `user_prov` VARCHAR( 100 ) NOT NULL DEFAULT '';

#
#-----[ OPEN ]------------------------------------------
#

ajax/edit_user_profile.php

#
#-----[ FIND ]------------------------------------------
#

case 'ignore_srv_load':
$value = ($this->request['value']) ? 0 : 1;
$this->response['new_value'] = ($profiledata['user_level'] != USER || $value) ? $lang['NO'] : $lang['YES'];
break;

#
#-----[ AFTER, ADD ]------------------------------------------
#

case 'user_prov':
if (!IS_SUPER_ADMIN) $this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']);
$value = $this->request['value'];
$this->response['new_value'] = ($value);
break;

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
, u.user_from
#
#-----[ AFTER, ADD ]------------------------------------------
#

, u.user_prov

#
#-----[ FIND ]------------------------------------------
#

$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_from'] : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$poster_prov = ( $postrow[$i]['user_prov'] != ANONYMOUS ) ? $postrow[$i]['user_prov'] : '';
#
#-----[ FIND ]------------------------------------------
#

'EDITED_MESSAGE' => $l_edited_by,

#
#-----[ AFTER ADD ]------------------------------------------
#

'POSTER_PROV' => $poster_prov,

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#

'user_avatar_type' => true,

#
#-----[ AFTER, ADD ]------------------------------------------
#

'user_prov' => true,

#
#-----[ FIND ]------------------------------------------
#

$tp_data['USER_OCC'] = $pr_data['user_occ'];
break;

#
#-----[ AFTER, ADD ]------------------------------------------
#
/**
* Провайдер
**/
case 'user_prov':
$prov = isset($_POST['user_prov']) ? (string) $_POST['user_prov'] : $pr_data['user_prov'];
$prov = htmlCHR($prov);
if ($submit)
{
if ($prov != $pr_data['user_prov'])
{
$pr_data['user_prov'] = $prov;
$db_data['user_prov'] = (string) $prov;
}
}
$tp_data['USER_PROV'] = $pr_data['user_prov'];
break;

#
#-----[ OPEN ]------------------------------------------
#

includes/ucp/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#

$location = ($profiledata['user_from']) ? $profiledata['user_from'] : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$prov = ($profiledata['user_prov']) ? $profiledata['user_prov'] : '';

#
#-----[ FIND ]------------------------------------------
#

'LOCATION' => $location,

#
#-----[ AFTER, ADD ]------------------------------------------
#

'PROV' => $prov,

#
#-----[ OPEN ]------------------------------------------
#

lang_russian/lang_main.php

#
#-----[ ADD ]------------------------------------------
#

$lang['PROV'] = 'Провайдер';

#
#-----[ OPEN ]------------------------------------------
#

templates/default/usercp_register.tpl

#
#-----[ FIND ]------------------------------------------
#

<tr>
<td>{L_LOCATION}:</td>
<td><input type="text" name="location" size="50" value="{LOCATION}" /></td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<tr>
<td>{L_PROV}:</td>
<td><input type="text" name="user_prov" size="50" value="{USER_PROV}" /></td>
</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/default/usercp_viewprofile.tpl

#
#-----[ FIND ]------------------------------------------
#

<var class="ajax-params">{action: "edit_user_profile", id: "user_lastvisit"}</var>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<var class="ajax-params">{action: "edit_user_profile", id: "user_prov"}</var>

#
#-----[ FIND ]------------------------------------------
#

<!-- IF INTERESTS -->
<tr>
<th>{L_INTERESTS}:</th>
<td><b>{INTERESTS}</b></td>
</tr>
<!-- ENDIF -->

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- IF PROV -->
<tr>
<th class="vBottom">{L_PROV}:</th>
<td id="user_prov">
<span class="editable bold">{PROV}</span>
</td>
</tr>
<!-- ENDIF -->

#
#-----[ OPEN ]------------------------------------------
#
templates/default/viewtopic.tpl
#
#-----[ FIND ]------------------------------------------
#

<!-- IF postrow.POSTER_FROM --><p class="from"><em>{L_LOCATION}:</em> {postrow.POSTER_FROM}</p><!-- ENDIF -->

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- IF postrow.POSTER_PROV --><p class="prov"><em>{L_PROV}:</em> {postrow.POSTER_PROV}</p><!-- ENDIF -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

Please Login or Register to view hidden text.

 

frost444

Пользователь
#5
ищем по аналогии... у меня на пример все есть... ток я пользуюсь своим кодом
 

frost444

Пользователь
#7
хм ну не знай я свой код писал так что есть но не аналогичная строка ( старую снес, к чертям по дальше )
 

XANDER-CAGE

Пользователь
#9
PHP:
$location = ($profiledata['user_from']) ? $profiledata['user_from'] : '';
нет такого
найти
PHP:
$template->assign_vars(array(
    'PAGE_TITLE'           => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
перед вставить

PHP:
$prov = ($profiledata['user_prov']) ? $profiledata['user_prov'] : '';