osDate Forum - osDate Dating Script

osDate => Feature Requests => Topic started by: divtechs on September 06, 2014, 12:52:34 PM

Title: fake online users
Post by: divtechs 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
Title: Re: fake online users
Post by: chrissio 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.

Title: Re: fake online users
Post by: Pharg on October 13, 2014, 09:47:28 PM
Thanks for sharing chrissio  ;)
Title: Re: fake online users
Post by: scvoyager 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! :)
Title: Re: fake online users
Post by: Pharg 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
Title: Re: fake online users
Post by: scvoyager 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
Title: Re: fake online users
Post by: Pharg 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
Title: Re: fake online users
Post by: divtechs on October 15, 2014, 03:41:24 PM
hi is this code putting some users online?
Title: Re: fake online users
Post by: Vink on October 15, 2014, 05:02:28 PM
Hi

This is allso a way:
https://www.osdateforum.com/configuration-installation-4/manipulate-users-online/msg1005/#msg1005 (https://www.osdateforum.com/configuration-installation-4/manipulate-users-online/msg1005/#msg1005)

 
Title: Re: fake online users
Post by: chrissio 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 ;)
Title: Re: fake online users
Post by: divtechs 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
Title: Re: fake online users
Post by: chrissio 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...
Title: Re: fake online users
Post by: divtechs 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
Title: Re: fake online users
Post by: Pharg on October 16, 2014, 12:02:38 AM
Hi

This is allso a way:
https://www.osdateforum.com/configuration-installation-4/manipulate-users-online/msg1005/#msg1005 (https://www.osdateforum.com/configuration-installation-4/manipulate-users-online/msg1005/#msg1005)

 
Thanks Vink for the link, had lost this in the many files.
Title: Re: fake online users
Post by: chrissio 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
Title: Re: fake online users
Post by: divtechs on October 19, 2014, 01:18:37 PM
Thanks a lot , i'm gonna try it out now and get back
Title: Re: fake online users
Post by: divtechs on October 26, 2014, 04:42:31 PM
Hi , please LOL man how do i use it with the osdate 2.6.5 version

REGARDS
Title: Re: fake online users
Post by: chrissio on October 27, 2014, 12:30:14 AM
Hi , please LOL man how do i use it with the osdate 2.6.5 version

REGARDS

Hey,

i wrote, the script was written for v 2.5.4 - i haven't tested on V 2.6.5 because i dont have it.

I'm working on V 3.0.1 called osDatePDO...
Title: Re: fake online users
Post by: CBG on October 27, 2014, 08:18:16 AM
2.6.5 is like 2.5.4 but with a few bug fixes.
Title: Re: fake online users
Post by: divtechs on October 27, 2014, 10:46:02 PM
Hi, i have used those code on 2.6.5 without seeing ant profile online.

what could i be doing wrong/?

Regards
Title: Re: fake online users
Post by: divtechs on October 31, 2014, 12:29:50 AM
Thanks bro, i tried that and after tried to open the visit admin/fake.php. what displayed was this{ include...just that code i added in the init.php

kind regards :D
Title: Re: fake online users
Post by: divtechs on October 31, 2014, 05:12:58 AM
i rtied to visit the admin/fake.php and landed at the  code i inserted in the init.php.

what could i be doing wrong

didn't meant to stress  you much sir
Title: Re: fake online users
Post by: scvoyager on November 02, 2014, 04:09:29 AM
i rtied to visit the admin/fake.php and landed at the  code i inserted in the init.php.

what could i be doing wrong

didn't meant to stress  you much sir
I tried it myself on 2.65 and it didn't work. As the author says it works on 2.54 but since 2.65 has php fixes added to it this code may not work.
Title: Re: fake online users
Post by: divtechs on November 02, 2014, 10:05:51 AM
That could be the cause as i am using the 2.65.

cracking brains to see if it may work though
Title: Re: fake online users
Post by: scvoyager on November 02, 2014, 09:09:48 PM
Ok it works very nice on 2.65. Thanks chrissio

In your osdate root folder not the admin folder add the attached fake.php file.

In the init.php file add;
Code: [Select]
include_once( 'fake.php' );
(http://*******/images/members-online.png)
Title: Re: fake online users
Post by: divtechs on November 05, 2014, 03:24:45 AM
Hi sir,  i uploaded the attached file to the root, inserted the second code in the init.php but still no profile came online on my 2.65 site.

please   sir, what can i do to put few profiles online

here is where i added the other code in init.php :                   

 }
}include_once( 'fake.php' );?>     

or sir can you configure it to put at list 5 profils online

 Regards
Title: Re: fake online users
Post by: scvoyager on November 05, 2014, 06:25:44 AM
If you want send me a PM with FTP login details and a link to your site and I will take a look.
Title: Re: fake online users
Post by: scvoyager on November 06, 2014, 10:38:31 AM
I got your login details and made a couple of changes. You did everything correct and your site now shows many online.
Title: Re: fake online users
Post by: divtechs on November 07, 2014, 07:51:54 AM
Yeah sir thanks a lot , i can see that i have it now.
the only thing i see now is that when i click on the online user link in the special offer the  result is mixed with online today users.

best regards
Title: Re: fake online users
Post by: mafabel on July 12, 2015, 03:10:43 PM
Ok it works very nice on 2.65. Thanks chrissio

In your osdate root folder not the admin folder add the attached fake.php file.

In the init.php file add;
Code: [Select]
include_once( 'fake.php' );
(http://*******/images/members-online.png)
should I just add the code in the init.php file or must be after a perticular line or text in the init file?
Title: Re: fake online users
Post by: Pharg on July 20, 2018, 01:52:17 AM
Hi Members,

The fake.php has been update to work in PHP 7.2 and only adds profiles with photos now.

Download the new fake.php in the folder fake-members and extract it then upload the fake.php over the old version if you use it.

If you don't use it, upload the fake.php to the root directory then go to the init.php
and add this at the bottom before the ?> like this:
Code: [Select]
include('fake.php');

That's it, now when you refresh your site, it will put members online ONLY if you have a list of a lot of Profiles added.

If your site is new, then generate some fake profiles by using the Autogenprofile Plugin in the admin, to make your
site look bigger and busy, you will see the online count go up.