";
if ($GLOBALS[SUPEND_NEW_BANNERS] && $details[b_a]=='n')
{
echo "
Place the link on your site that points to:
|
{$GLOBALS[URL_IN]}?{$vars[login]} |
|
If you need to make changes to your account, or want
to see your statistics use the following direct links:
|
For statistics click at: |
{$GLOBALS[URL_ACCOUNTS]}?go=stat&login={$vars[login]}&pass={$vars[pass]} |
For make changes click at : |
{$GLOBALS[URL_ACCOUNTS]}?go=modify&login={$vars[login]}&pass={$vars[pass]} |
Since ".OurTimeToStr($today_start).''.($GLOBALS[RANK_RESET]?" (Last {$GLOBALS[RANK_RESET]}h)":'')."
|
Raw hits |
$array[raw_today] |
In | $array[in_today] |
Out | $array[out_today] |
Ratio |
".($array[in_today]?round($array[out_today]*100/$array[in_today]):'0')."% |
Total
|
Raw |
$array[raw_total] |
In |
$array[in_total] |
Out |
$array[out_total] |
Ratio |
".($array[in_total]?round($array[out_total]*100/$array[in_total]):'0')."% |
";
}
//-- END: show_statistic
function create()
{
global $fields_checked, $vars, $SUSPEND_NEW, $SUSPEND_NEW_BANNERS, $saved;
if ($vars[change]=='yes')
{
if($fields_checked=check_field_values())
{
// echo join(',',$vars);
$vars[review]=1;
if($SUSPEND_NEW)
$vars[status]='s';
else
$vars[status]='a';
if($SUSPEND_NEW_BANNERS)
$vars[b_a]='n';
else
$vars[b_a]='y';
$vars[signup_date]=time();
$vars[pass_hash]=my_crypt($vars[pass],$GLOBALS[SECRET_STRING]);
// saving
$a_s_fields=array(
'login',
'wm_nick',
'wm_icq',
'wm_email',
'url',
'description',
'title',
'url_fake',
'url_recip',
'url_banner',
'url_sample',
'sample_width',
'sample_height',
'id_cat',
'signup_date',
'status',
'pass_hash',
'review',
'b_a');
if ($GLOBALS[BACK_CHECK])
{
$a_s_fields[]='backlink';
$a_s_fields[]='backchecked';
}
$query="INSERT INTO accounts_s(".join(',',$a_s_fields).") VALUES(";
$first=true;
foreach($a_s_fields as $field)
{
if($first)
$first=false;
else
$query.=', ';
$query.="'".addslashes($vars[$field])."'";
}
$query.=')';
// echo $query;
$result=db_query($query);
if(!$result)
{
$msg="Sorry, unable to create account. Try later";
return false;
}
else
{
$saved=1;
$vars[id]=mysql_insert_id();
// sending emails
send_email('add',$vars);
if ($GLOBALS[SENDMAILNEW])
send_email('add_admin',$vars);
}
}
show_header();
if($saved)
show_account_created();
else
show_details_form($vars);
}
else
show_details_form();
}
// -- 'modify' functions
function modify()
{
global $accounts_s_details, $fields_checked, $vars, $SUSPEND_NEW, $SUSPEND_NEW_BANNERS,$msg;
$fields_checked=false;
$loadfromdb=true;
show_header();
if ($vars[change]=='yes')
{
if($fields_checked=check_field_values())
{
$accounts_s_details=load_details('accounts_s', $vars[id]);
if ($accounts_s_details[review])
$review=$accounts_s_details[review];
else
$review=2;
$accounts_u_details=load_details('accounts_u', $vars[id]);
if ($SUSPEND_NEW)
$u_data=$vars;
else
$u_data=$accounts_s_details;
/*
$vars[b_a]=$accounts_s_details[b_a];
if ($SUSPEND_NEW_BANNERS)
{
if($accounts_s_details[url_banner]!=$vars[url_banner])
$vars[b_a]='n';
}
*/
// setting password
if($vars[pass]!='')
$vars[pass_hash]=my_crypt($vars[pass],$GLOBALS[SECRET_STRING]);
// setting login and email
$vars[login]=$accounts_s_details[login];
// $vars[wm_email]=$accounts_s_details[wm_email];
// saving old info
$accounts_u_fields=array('id','url','description','title','url_fake','url_recip','url_banner');
if ($GLOBALS[USE_CATEGORIES])
{
array_push($accounts_u_fields,'id_cat');
}
if ($GLOBALS[SAMPLE_SHOW])
{
array_push($accounts_u_fields,'url_sample');
array_push($accounts_u_fields,'sample_width');
array_push($accounts_u_fields,'sample_height');
}
if (!$accounts_u_details)
{
$query="INSERT INTO accounts_u(".join(',',$accounts_u_fields).") VALUES(";
$first=true;
foreach($accounts_u_fields as $field)
{
if($first)
$first=false;
else
$query.=', ';
$query.="'".addslashes($u_data[$field])."'";
}
$query.=')';
$result=db_query($query,1);
if(!$result)
{
$msg="Sorry, unable to modify account. Try later";
return false;
}
}
else
{
$parts=array();
foreach($accounts_u_fields as $field)
{
if ($SUSPEND_NEW)
{
if ($accounts_u_details[$field]!=$vars[$field])
{// новое изменение
$parts[]="$field='".addslashes($vars[$field])."'";
}
}
else
{
if ($accounts_s_details[$field]!=$vars[$field])
{// новое изменение
$parts[]="$field='".addslashes($accounts_s_details[$field])."'";
}
}
}
if (count($parts))
{
$query="UPDATE accounts_u SET ".join(',',$parts)." WHERE id='{$vars[id]}'";
$result=db_query($query);
if(!$result)
{
$msg="Sorry, unable to modify account. Try later";
return false;
}
}
}
/////////////////////////////////////////
// Saving accounts_s
$parts=array("review='$review'");
if ($GLOBALS[ASK_NICK] && $accounts_s_details[wm_nick]!=$vars[wm_nick])
$parts[]="wm_nick='$vars[wm_nick]'";
if ($GLOBALS[ASK_ICQ] && $accounts_s_details[wm_icq]!=$vars[wm_icq])
$parts[]="wm_icq='$vars[wm_icq]'";
if ($vars[pass_hash])
$parts[]="pass_hash='$vars[pass_hash]'";
if ($vars[wm_email])
$parts[]="wm_email='$vars[wm_email]'";
if ($SUSPEND_NEW && $accounts_s_details[status]=='a')
{
}
else
{
if ($SUSPEND_NEW_BANNERS && $accounts_s_details[url_banner]!=$vars[url_banner])
$parts[]="b_a='n'";
foreach($accounts_u_fields as $field)
{
if ($accounts_s_details[$field]!=$vars[$field])
{// новое изменение
$parts[]="$field='".addslashes($vars[$field])."'";
}
}
}
if (count($parts))
{
$query="UPDATE accounts_s SET ".join(',',$parts)." WHERE id='{$vars[id]}'";
$result=db_query($query);
if(!$result)
{
DisplayMessage('Sorry, unable to modify account. Try later');
return false;
}
$msg='