fake online users
« on: September 06, 2014, 12:52:34 PM »
this fake online users is another great way to entice visitors to signup ,its a great help for new sites.

this code was also in the former forum

Re: fake online users
« Reply #1 on: October 13, 2014, 09:42:10 PM »
Hello, this is written by myself for 2.5.4 - copy code to /admin/fake.php

Code: [Select]
<?php

// init.php includieren
if ( !defined'SMARTY_DIR' ) ) {
   include_once( 
'../init.php' );
}

// ist folgende zeile auskommentiert, muss man sich zur Ausführung des Scriptes als Admin einloggen.
// default-einstellung ist "Ausführung als Cronjob vom Server aus
// include( 'sessioninc.php' );

// Eingeloggte User für Anzeige im Frontend vorbereiten
$psize getPageSize();

$sql 'SELECT SQL_CALC_FOUND_ROWS distinct  u.*, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age FROM ! u, ! ou WHERE u.allow_viewonline=? AND u.status in (?,?) AND u.id = ou.userid   ';

$cpage = isset($_GET['page'])?$_GET['page']:1;

$data $osDB->getAll$sql.'limit '.$psize, array( USER_TABLEONLINE_USERS_TABLE'1'get_lang('status_enum','active'), 'active') );

$rcount $osDB->getOne('select FOUND_ROWS()');

if( 
$rcount ) {

// Übergabe der online-User an die Variable im Template
   
$t->assign'totalrecs'$rcount );

}

// online User Table delete

//  $osDB->query( 'TRUNCATE TABLE !',array( ONLINE_USERS_TABLE ) );

// random Usererzeugung

// user with random created  UserID (siehe Datenbanktabelle osdate_user) like to go online
$numbers = array();
  do
  {
   
$rand mt_rand(128150); // in this case the space from user-id 128 to 150 are Fake- user (possible your fake user have other user-ids
   
if(!in_array($rand$numbers))
    
$numbers[] = $rand;
  } while(
count($numbers) < 5);// there must 15 Profiles go online 

  
list(   ) = $numbers;

$inids implode(', ',$numbers);

//echo "Userids der User, die online gesetzt wurden: $inids ";

$data $osDB->getAll'SELECT id FROM ! WHERE id in ( ' .$inids' )', array( USER_TABLE  ));

foreach( 
$data as $index => $row ) {

   
// user online table
  
$deluseronline $osDB->query'delete from  ! where userid = ? ', array( ONLINE_USERS_TABLE$row['id'] ) );
  
$useronlinetmp $osDB->query'insert into ! ( userid, lastactivitytime, is_online, last_ping , session_id) values ( ?, ?, ?, ?, ?)', array( ONLINE_USERS_TABLE$row['id'], time(), 1time() -time() ) );
   
  
// lastvisit
  
$lastvisittmp $osDB->query'update ! set lastvisit = ? WHERE id = ? ', array( USER_TABLEtime(), $row['id'] ) );
   
   
$id "";
   
$id++;
   
   }

?>


Search in init.php for

Code: [Select]
?>
Insert before:

Code: [Select]
include( 'admin/fake.php' );
if you want that an user switches online fakes by himself, or you use a cronjob.

osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: fake online users
« Reply #2 on: October 13, 2014, 09:47:28 PM »
Thanks for sharing chrissio  ;)
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

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

Re: fake online users
« Reply #3 on: October 14, 2014, 05:04:50 AM »
Very nice though I have not tried it yet. This is just me but don't you think it should use "fid" instead of "id"?  With using "id" you are per say using members real profiles to show online which could lead to some legal problems on a live site. Using fid would generate from "Auto Profiles".

Just my two cents on it...

Looks good and wish we had a thumbs up icon instead of just a smile! :)

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: fake online users
« Reply #4 on: October 14, 2014, 07:01:29 AM »
That's only if your using Auto profiles that is ;)

Just my 10 cents worth ( inflation) Hehe
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

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

Re: fake online users
« Reply #5 on: October 15, 2014, 08:21:57 AM »
That's only if your using Auto profiles that is ;)

Just my 10 cents worth ( inflation) Hehe
LOL man, still need to stick with the proverb "my two sents".
If you care to add currency exchange I'm up this year. LOL

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: fake online users
« Reply #6 on: October 15, 2014, 09:15:04 AM »
That's only if your using Auto profiles that is ;)

Just my 10 cents worth ( inflation) Hehe
LOL man, still need to stick with the proverb "my two sents".
If you care to add currency exchange I'm up this year. LOL

Hehe only problem is in our country two cents or sents lol is no longer a valid
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

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

Re: fake online users
« Reply #7 on: October 15, 2014, 03:41:24 PM »
hi is this code putting some users online?

*

Vink

  • *****
  • 329
    • NedDate.nl
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: fake online users
« Reply #9 on: October 15, 2014, 05:59:13 PM »
Hehe, the script was my solution from, i think, 2007 or 2008..., and it puts only users online i've defined in the script.

...and this are my 2 Euro-Cent

(or in old german Marks)

... meine 2 Pfennige ;)
osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!

Re: fake online users
« Reply #10 on: October 15, 2014, 06:49:29 PM »
OKAY, PLEASE SIR HOW CAN I USE IT NOW TO WORK WITH THE 2.6.5 VERSION OF OSDATE


REGARDS

Re: fake online users
« Reply #11 on: October 15, 2014, 07:28:38 PM »
OKAY, PLEASE SIR HOW CAN I USE IT NOW TO WORK WITH THE 2.6.5 VERSION OF OSDATE


REGARDS

Your shift key apparently jammed.

Copy Code to a file, upload it in /admin folder.

Configure Nr. of profiles to switch online
configure user id's for the fake profiles .

And  the best it: Do not cheat your users with faked numbers online.

In many user forums of single sites they discuss about tools like fake profile generator or faked online users and tell the name of sites are using this tools...
« Last Edit: October 15, 2014, 07:36:14 PM by chrissio »
osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!

Re: fake online users
« Reply #12 on: October 15, 2014, 07:58:27 PM »
PLEASE SIR IM A NOB IN CODING, CAN YOU PLEASE TEACH ME STEP BY STEP WHERE AND HOW TO CONFIGURE

BEST REGARDS

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: fake online users
« Reply #13 on: October 16, 2014, 12:02:38 AM »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

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

Re: fake online users
« Reply #14 on: October 19, 2014, 09:50:28 AM »
PLEASE SIR IM A NOB IN CODING, CAN YOU PLEASE TEACH ME STEP BY STEP WHERE AND HOW TO CONFIGURE

BEST REGARDS

Your shift key apparently jammed. Please don't scream at us so loud.

Please read the lines marked with // in the code, because this are comments to install or configure. With // marked lines aren't executed by PHP

Code: [Select]
<?php

// init.php include
if ( !defined'SMARTY_DIR' ) ) {
   include_once( 
'../init.php' );
}

// if the following line is not commented out, you have to login as an admins to execute the script. Default-setting is "automatically as Cronjob by server "
// include( 'sessioninc.php' );


$psize getPageSize();

$sql 'SELECT SQL_CALC_FOUND_ROWS distinct  u.*, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age FROM ! u, ! ou WHERE u.allow_viewonline=? AND u.status in (?,?) AND u.id = ou.userid   ';

$cpage = isset($_GET['page'])?$_GET['page']:1;

$data $osDB->getAll$sql.'limit '.$psize, array( USER_TABLEONLINE_USERS_TABLE'1'get_lang('status_enum','active'), 'active') );

$rcount $osDB->getOne('select FOUND_ROWS()');

if( 
$rcount ) {

// Handover of online users to the variable in the template
   
$t->assign'totalrecs'$rcount );

}

// delete of online User Table 
//  $osDB->query( 'TRUNCATE TABLE !',array( ONLINE_USERS_TABLE ) );

// create random UserIDs
// user with random created  UserID (look databasetable osdate_user ) like to go online
$numbers = array();
  do
  {
// in this case the space from user-id 128 to 150 are Fake- user in Database (possible your fake user have other user-ids)   
         
$rand mt_rand(128150); // Users 128, 129, 130 ... up to 150 must exist in database

   
if(!in_array($rand$numbers))
    
$numbers[] = $rand;
  } while(
count($numbers) < 15);// there should 15 Profiles go online 

  
list(   ) = $numbers;

$inids implode(', ',$numbers);

// for debugging only
//echo "Userids from use should go online : $inids ";

$data $osDB->getAll'SELECT id FROM ! WHERE id in ( ' .$inids' )', array( USER_TABLE  ));

foreach( 
$data as $index => $row ) {

   
// first delete user online table, than insert online users + faked online users
  
$deluseronline $osDB->query'delete from  ! where userid = ? ', array( ONLINE_USERS_TABLE$row['id'] ) );
  
$useronlinetmp $osDB->query'insert into ! ( userid, lastactivitytime, is_online, last_ping , session_id) values ( ?, ?, ?, ?, ?)', array( ONLINE_USERS_TABLE$row['id'], time(), 1time() -time() ) );
   
  
// fake the lastvisit field in user table for show lastonline in smallprofiles
  
$lastvisittmp $osDB->query'update ! set lastvisit = ? WHERE id = ? ', array( USER_TABLEtime(), $row['id'] ) );
   
   
$id "";
   
$id++;
   
   }

?>



Thats all to configure

If you have saved the file in /admin folder as fake.php, you can test it with http://yourdomain.com/admin/fake.php in another browser window; Your normal osdate site should show you now "15 Users are online" and the profiles of online-users .

And the text in profiles "last online ..." is updated permanently to the time of last use of fake.php...

Search in init.php for

Code: [Select]
?>
Insert before:

Code: [Select]
include( 'admin/fake.php' );if you want that the user who visit your site switches the fakes online automatically.

The best at last: The script was coded 2007 and in php 4 - it must not run in php 5 so i think it needs some changes to run in actually php-versions

You are a noob in coding?

Then please learn the basics of php coding if you want to operate this script or osdate. And please do not cry to us, forum users somtimes react allergic and give no hints to loudmouths.

TRY A LOOK TO NETTIQUETTE BEFORE YOU USE SHIFTLOCK!

This was the last hint to you from me.

Best regards, Christian
« Last Edit: October 19, 2014, 10:02:18 AM by chrissio »
osDate 3.0 (osDatePDO) based on original Developer Copy of osDatePDO 3.0 | PHP: 5.7 | MySQL: 5.5.24 | Apache 2.2.22 | Debian 7.8 |

Please ask questions in forum - no pm support!
If you write a pm, use german oder english language, please!