0 Members and 1 Guest are viewing this topic.

*

Olaf Klausen

  • **
  • 55
  • osDate Version: osDate v2.7
Fake Check
« on: September 07, 2017, 07:25:16 AM »
Since I've been getting help from you all along, I want to give something now.
I call it Fake-Check

It's not by myself, but I took the basic structure and adapted it.

I put it in my system and it works fine.

Please remember to make a backup of your database and files first.

The following files are to be processed:

nickpage_basic_address.tpl
showprofile.php
lang_main.php
admin/modifyprofile.php
admin/profileedit.tpl


Go to PhpMyAdmin

Create a new table with the following command:
Code: [Select]
ALTER TABLE `osdate_user` ADD `cert` char(1) NOT NULL AFTER `id` ;
Open "nickpage_basic_address.tpl":

Look for:
Code: [Select]
<tr><td >
{mylang mkey='signup_gender_values' skey=$user.gender}
{if ($user.gender == 'C' or $user.gender =='G') && $user.cplusers|@count > 0}
&nbsp;(
{foreach from=$user.cplusers key=k item=usr}
{if $k > 0}, {/if}
{if $config.enable_mod_rewrite == 'Y'}
<a href="javascript:popUpScrollWindow2('{$docroot}{if

$config.seo_username == 'Y'}{$usr.username}{else}{$usr.uid}.htm{/if}','top',650,600)">
{else}
<a href="javascript:popUpScrollWindow2('{$docroot}showprofile.php?

{if $config.seo_username == 'Y'}username={$usr.username}{else}id={$usr.uid}{/if}','top',650,600)">
{/if}
{$usr.username}</a>
{/foreach}
)
{/if}</td></tr>

Add below it:
Code: [Select]
<tr class="signup_line_outer evenrow" >
  <td ><b>{lang mkey='verifi_user'}</b> </td>
  <td >
                   {if $user.cert == 1}
 <img src="{$image_dir}check.gif" height="15" width="15" alt="Proofed Member" />
 {else}
 <img src="{$image_dir}nocheck.gif" height="10" width="10" alt="Unproofed Member" />
 {/if}
</td>
  </tr>

Open showprofile.php

Look for:
Code: [Select]
$user =& $osDB->getRow('SELECT id, username , level, country , firstname , lastname, gender , lookgender, state_province , lastvisit,

about_me, couple_usernames,
picture , city , county, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
FROM ! WHERE id = ? AND status <> ?' ,array( USER_TABLE, $_REQUEST['id'], 'suspend' ));

Replace with:
Code: [Select]
$user =& $osDB->getRow('SELECT id, cert , username , level, country , firstname , lastname, gender , lookgender, state_province ,

lastvisit, about_me, couple_usernames,
picture , city , county, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
FROM ! WHERE id = ? AND status <> ?' ,array( USER_TABLE, $_REQUEST['id'], 'suspend' ));

Open language/your_language/lang_main.php

Look for:
Code: [Select]
$lang['location_col'] = 'Place:';
Add below:
Code: [Select]
$lang['verifi_user'] = 'Membership Status:';
Open admin/modifyprofile.php:

Look for:
Code: [Select]
$modified['country'] = $from = isset($_POST['txtfrom'])

? strip_tags($_POST['txtfrom']) : '';

Add below:
Code: [Select]
$modified['cert'] = $cert = isset($_POST[ 'txtcert' ])

? $_POST[ 'txtcert' ] : '';

Search in the same file:
Code: [Select]
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $ziprec['latitude'], $ziprec['longitude'], $userid ) );
Replace with:
Code: [Select]
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, adress_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, cert=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $cert, $ziprec['latitude'], $ziprec['longitude'], $userid ) );
Open /admin/profileedit.tpl

Look for:
Code: [Select]
<tr><td>
{lang mkey='profile_birthday'}
<font class="required_info">{$smarty.const.REQUIRED_INFO}</font></td>
<td>
{html_select_date_translated prefix="txtbirth" start_year=$config.start_year

month_value_format="%m" time=$user.birth_date}
</td></tr>

Add below:
Code: [Select]
<tr>
      <td>Real-Check:
      <font color="{lang mkey='required_info_indicator_color'}">{lang mkey='required_info_indicator'}</font></td>


         </td><td>
                        <input class="radio" type="radio" {if $user.cert=='1'}checked {/if} value="1"  name="txtcert" />


         {lang mkey='yes'}


         <input class="radio" type="radio" value="0" {if $user.cert=='0'}checked {/if}
         name="txtcert" />


         {lang mkey='no'} </td>
         </tr>


      </td>
   </tr>

------------------------------------------------------------------------------
Then create the images check. gif and nockeck. gif and load them into your template folder
------------------------------------------------------------------------------------
- Reload language
- empty template_c und cache

If you now select a profile in the admincenter and go to profile editing, you will see -->> birthday: * a new entry:


By default, the user is not checked, which can also be seen in the profile view as a user, red cross.
After clicking (Yes) via the admincenter, the red cross will now turn into a green hack and the user is checked, so that

anyone can see it.

This is not a fsk16 protection, but rather a possibility to perform a fake check.
« Last Edit: September 17, 2017, 03:17:31 AM by Pharg »

*

Pharg

  • *****
  • 2,923
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: Fake Check
« Reply #1 on: September 07, 2017, 09:26:32 AM »
Hi Olaf,

Thanks for the share, will test this code out on my test site, might make it's way into the osDateEvo system  ;)
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Pharg

  • *****
  • 2,923
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: Fake Check
« Reply #2 on: September 17, 2017, 03:06:52 AM »
Hi olaf,

You need to change this error also $user =& $osDB-> wrong, it should be $user = $osDB-> correct.

Open showprofile.php

Look for:
Code: [Select]
$user = $osDB->getRow('SELECT id, username , level, country , firstname , lastname, gender , lookgender, state_province , lastvisit,

about_me, couple_usernames,
picture , city , county, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
FROM ! WHERE id = ? AND status <> ?' ,array( USER_TABLE, $_REQUEST['id'], 'suspend' ));

Replace with:
Code: [Select]
$user = $osDB->getRow('SELECT id, cert , username , level, country , firstname , lastname, gender , lookgender, state_province ,

lastvisit, about_me, couple_usernames,
picture , city , county, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
FROM ! WHERE id = ? AND status <> ?' ,array( USER_TABLE, $_REQUEST['id'], 'suspend' ));


Then there is a typo error in the code above here adress_line1=?, it should be like this:
Search in the same file:
Code: [Select]
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $ziprec['latitude'], $ziprec['longitude'], $userid ) );
Replace with:
Code: [Select]
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, cert=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $cert, $ziprec['latitude'], $ziprec['longitude'], $userid ) );
Plus I have changed it to this:
Code: [Select]
if (isset($ziprec) && (isset($ziprec['latitude']) && $ziprec['latitude'] != '')  && (isset($ziprec['longitude']) && $ziprec['longitude'] != '' ) ) {
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $ziprec['latitude'], $ziprec['longitude'], $userid ) );
} else {
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $userid ) );
}

Code: [Select]
if (isset($ziprec) && (isset($ziprec['latitude']) && $ziprec['latitude'] != '')  && (isset($ziprec['longitude']) && $ziprec['longitude'] != '' ) ) {
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, cert=?, zip_latitude=?, zip_longitude=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames,  $mlevel, $cert, $ziprec['latitude'], $ziprec['longitude'], $userid ));
} else {
$osDB->query( 'update ! set username=?, active=?,  email = ?, country=?, firstname=?, lastname=?, gender=?, timezone=?, address_line1=?, address_line2=?, state_province=?, city=?, zip=?, county=?, birth_date=?, levelend=?, about_me=?, couple_usernames=?,  level=?, cert=? where id = ?', array( USER_TABLE, $username, $active, $email, $from, $firstname, $lastname, $gender, $timezone, $address1, $address2, $state_province, $city, $zip, $county, $birthdate, $levelend, $about_me, $couple_usernames, $mlevel, $cert, $userid ) );
}

« Last Edit: September 17, 2017, 03:19:49 AM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Olaf Klausen

  • **
  • 55
  • osDate Version: osDate v2.7
Re: Fake Check
« Reply #3 on: September 17, 2017, 07:52:32 AM »
Thats strange, cause it is working in my system :D

*

Pharg

  • *****
  • 2,923
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: Fake Check
« Reply #4 on: September 17, 2017, 08:52:08 AM »
Hi Olaf,

I never said it didn't work it just has errors in it, plus has old PHP code =& that is now depreciated, will and can cause errors.

This adress_line1=?, isn't that important as it doesn't get used very often but it would have caused a error if trying to post in the address area. It should be address_line1=?,

I have cleaned the code up plus added some missing code in the admin area.
I will post it as a Mod later on, but won't be including it into the main script as I can see people wanting it removed.

The reason it wont be added in the main script is because the admin has to check every new profile and mark it as
checked all manually.

If people want it they can add it themselves later on.

« Last Edit: September 17, 2017, 10:20:12 AM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Olaf Klausen

  • **
  • 55
  • osDate Version: osDate v2.7
Re: Fake Check
« Reply #5 on: September 17, 2017, 09:54:26 AM »
Hi Pharg,

Thanks

*

Pharg

  • *****
  • 2,923
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: Fake Check
« Reply #6 on: September 17, 2017, 11:04:00 AM »
Hi all Members,

Fake Profile Check Mod

Here attached is the fully updated Mod created by Olaf Klausen for osDateEvo v1.2

This mod is excellent for those that have their site set to all new members have to be approved by the admin as you can do
the profile check at the same time.

Step 1:
Upload all the rest of the mod into your scripts files.

Step 2:
Go to PhpMyAdmin

Create a new table with the following command:
ALTER TABLE `osdate_user` ADD `cert` char(1) NOT NULL AFTER `id` ;
Or
import the Fake_Check_mod.sql into your osdate database from the sql folder.

Step 3:
In the language of your choice please add these 2 lines at the bottom before the ?>

$lang['verifi_user'] = 'Profile Status';

$lang['real-check-user'] = 'Real Profile Check';

Please remember to then go to the admin under Language Management and load the language again so
the changes show in your site.

I have added the english english version to show you how it looks.

« Last Edit: September 17, 2017, 10:09:43 PM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35