8 require_once(
'header.inc.php');
9 require_once(CH_DIRECTORY_PATH_INC .
'admin.inc.php');
10 require_once(CH_DIRECTORY_PATH_INC .
'protected.inc.php');
11 require_once(CH_DIRECTORY_PATH_INC .
'db.inc.php');
12 require_once(CH_DIRECTORY_PATH_INC .
'languages.inc.php');
13 require_once(CH_DIRECTORY_PATH_INC .
'prof.inc.php');
14 require_once(CH_DIRECTORY_PATH_INC .
'banners.inc.php');
15 require_once(CH_DIRECTORY_PATH_INC .
'membership_levels.inc.php');
16 require_once(CH_DIRECTORY_PATH_INC .
'params.inc.php');
17 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChRSS.php');
19 require_once(CH_DIRECTORY_PATH_ROOT .
"templates/tmpl_{$tmpl}/scripts/ChTemplMenu.php");
20 require_once(CH_DIRECTORY_PATH_ROOT .
"templates/tmpl_{$tmpl}/scripts/ChTemplFunctions.php");
34 return '<img src="' . CH_WSB_URL_ROOT .
'templates/base/images/spacer.gif" width="' . $width .
'" height="' . $height .
'" alt="" />';
46 $percent = ($max_pos) ? $curr_pos * 100 / $max_pos : $percent = 0;
59 $ret .=
'<div class="rate_block" style="width:' . $width .
'px;">';
60 $ret .=
'<div class="rate_text"' . ($id ?
" id=\"{$id}_text\"" :
'') .
'>';
63 $ret .=
'<div class="rate_scale"' . ($id ?
" id=\"{$id}_scale\"" :
'') .
'>';
64 $ret .=
'<div class="rate_bar" ' . ($id ?
"id=\"{$id}_bar\"" :
'') .
' style="width:' . round($percent) .
'%;"></div>';
78 function DesignBoxContent($title, $content, $db_num = 0, $caption_item =
'', $bottom_item =
'')
80 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'designbox_' . (
int)$db_num .
'.html', array(
82 'caption_item' => $caption_item,
83 'designbox_content' => $content,
84 'bottom_item' => $bottom_item
93 chPageCode($oTemplate);
101 $now = gmdate(
'D, d M Y H:i:s') .
' GMT';
104 header(
"Last-Modified: $now");
105 header(
"Cache-Control: no-cache, must-revalidate");
106 header(
"Pragma: no-cache");
119 foreach ($aValues
as $sKey => $sValue) {
121 $sSelected = ($sKey == $sDefault) ?
'selected="selected"' :
'';
122 $sRet .=
"<option value=\"$sKey\" $sSelected>$sStr</option>\n";
132 $sValues =
db_value(
"SELECT `Values` FROM `sys_profile_fields` WHERE `Name` = '$sField'");
134 if (substr($sValues, 0, 2) ==
'#!') {
136 $sKey = substr($sValues, 2);
140 $aMyPreValues = $aPreValues[$sKey];
141 if (!$aMyPreValues) {
145 foreach ($aMyPreValues
as $sVal => $aVal) {
146 $sMyUseLKey = $sUseLKey;
147 if (!isset($aMyPreValues[$sVal][$sUseLKey])) {
148 $sMyUseLKey =
'LKey';
151 $aValues[$sVal] = $aMyPreValues[$sVal][$sMyUseLKey];
154 $aValues1 = explode(
"\n", $sValues);
157 foreach ($aValues1
as $iKey => $sValue) {
158 $aValues[$sValue] =
"_$sValue";
167 return $GLOBALS[
'oFunctions']->getMemberThumbnail(
$ID, $float, $bGenProfLink, $sForceSex,
true,
'medium', $aOnline);
172 return $GLOBALS[
'oFunctions']->getMemberIcon(
$ID, $float, $bGenProfLink);
177 return $GLOBALS[
'oFunctions'] -> msgBox($sText, $iTimer);
182 return $GLOBALS[
'oFunctions'] -> advMsgBox($sText, $aOptions);
195 return $GLOBALS[
'oFunctions']->getTemplateIcon($sFileName);
200 return $GLOBALS[
'oFunctions']->getTemplateImage($sFileName);
206 $aVer = explode(
'.',
$site[
'ver']);
210 $aVerR[0] = $aVer[0];
211 $aVerR[1] = rand(0, 100);
212 $aVerR[2] = $aVer[1];
213 $aVerR[3] = rand(0, 100);
214 $aVerR[4] =
$site[
'build'];
217 while ($aVerR[4][0] ===
'0') {
218 $aVerR[4] = substr($aVerR[4], 1);
221 return '<!-- ' . implode(
' ', $aVerR) .
' -->';
231 $sCode =
'<div class="siteStatMain">';
233 foreach ($aStat
as $aVal) {
237 $sCode .=
'<div class="clear_both"></div></div>';
242 function genAjaxyPopupJS($iTargetID, $sDivID =
'ajaxy_popup_result_div', $sRedirect =
'')
244 $iProcessTime = 1000;
247 $sRedirect =
"window.location = '$sRedirect';";
251 <script
type=
"text/javascript">
253 setTimeout(
function(){
254 $(
'#{$sDivID}_{$iTargetID}').
show({$iProcessTime})
255 setTimeout(
function(){
256 $(
'#{$sDivID}_{$iTargetID}').hide({$iProcessTime});
268 $iAllowed = $iNumElements * $iUnitWidth;
269 if ($iAllowed > $iAllWidth) {
270 $iMax = (int)floor($iAllWidth / $iUnitWidth);
271 $iAllowed = $iMax*$iUnitWidth;
278 if (
getParam(
'reg_by_inv_only') ==
'on' &&
getID($_COOKIE[
'idFriend']) == 0) {
279 return MsgBox(
_t(
'_registration by invitation only'));
287 $sCode = $oJoin->process();
290 $oAlert =
new ChWsbAlerts(
'profile',
'show_join_form', 0, 0, array(
'oJoin' => $oJoin,
'sParams' => &$sParams,
'sCustomHtmlBefore' => &$sCodeBefore,
'sCustomHtmlAfter' => &$sCodeAfter,
'sCode' => &
$sCode));
296 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'login_join_form.html', array(
298 'ch_if:show_auth' => array(
299 'condition' => !
empty($sAuthCode),
304 'custom_code_before' => $sCodeBefore,
306 'custom_code_after' => $sCodeAfter,
307 'ch_if:show_text' => array(
308 'condition' =>
false,
311 'text' =>
_t(
'_join_form_note', CH_WSB_URL_ROOT)
320 'form_attrs' => array(
322 'action' => CH_WSB_URL_ROOT .
'member.php',
324 'onsubmit' =>
"validateLoginForm(this); return false;",
330 'caption' =>
_t(
'_NickName'),
333 'type' =>
'password',
334 'name' =>
'Password',
335 'caption' =>
_t(
'_Password'),
337 'rememberme' => array(
339 'name' =>
'rememberMe',
344 'name' =>
'relocate',
345 'value'=> isset(
$_REQUEST[
'relocate']) ?
$_REQUEST[
'relocate'] : CH_WSB_URL_ROOT .
'member.php',
351 'value' =>
_t(
'_Login'),
357 'class' =>
'ch-form-element-forgot'
359 'content' =>
'<a href="' . CH_WSB_URL_ROOT .
'forgot.php">' .
_t(
'_forgot_your_password') .
'?</a>',
368 $sCustomHtmlBefore =
'';
369 $sCustomHtmlAfter =
'';
370 $oAlert =
new ChWsbAlerts(
'profile',
'show_login_form', 0, 0, array(
'oForm' =>
$oForm,
'sParams' => &$sParams,
'sCustomHtmlBefore' => &$sCustomHtmlBefore,
'sCustomHtmlAfter' => &$sCustomHtmlAfter));
376 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'login_join_form.html', array(
378 'ch_if:show_auth' => array(
379 'condition' => !
empty($sAuthCode) &&
false === strpos($sParams,
'disable_external_auth'),
384 'custom_code_before' => $sCustomHtmlBefore,
385 'form' =>
$oForm->getCode(),
386 'custom_code_after' => $sCustomHtmlAfter,
387 'ch_if:show_text' => array(
388 'condition' => strpos($sParams,
'no_join_text') ===
false,
391 'text' =>
_t(
'_login_form_description2join', CH_WSB_URL_ROOT)
399 $aAuthTypes =
$GLOBALS[
'MySQL']-> fromCache(
'sys_objects_auths',
'getAll',
'SELECT * FROM `sys_objects_auths`');
400 if (
empty($aAuthTypes) || !is_array($aAuthTypes)) {
404 $aTmplButtons = array();
405 foreach ($aAuthTypes
as $iKey => $aItems) {
408 $aTmplButtons[] = array(
409 'href' => !
empty($aItems[
'Link']) ? CH_WSB_URL_ROOT . $aItems[
'Link'] :
'javascript:void(0)',
410 'ch_if:show_onclick' => array(
411 'condition' => !
empty($aItems[
'OnClick']),
413 'onclick' =>
'javascript:' . $aItems[
'OnClick']
416 'ch_if:show_icon' => array(
417 'condition' => !
empty($aItems[
'Icon']),
419 'icon' => $aItems[
'Icon']
426 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'login_join_auth.html', array(
427 'ch_repeat:buttons' => $aTmplButtons