[DEV] jQ Who is where

[DEV] 3.2.* Mod Base

[DEV] jQ Who is where

Postby Sekuro » 10 Apr 2015, 21:03

jQ Who is where

MOD-Title: jQ Who is where
MOD-Version: none
MOD-Author: 4seven

phpBB-Version: phpBB 3.2.*
phpBB-Languages: multilingual
phpBB-Styles: prosilver

MOD-Description: This Mod adds a "who is where" and "who is online" feature without site-reload

Features:
- Ajaxed list of reg user movements in near realtime
- Ajaxed "In total there are" and "Registered users:" list
- Country flags api with cookie based "provider load prevent"
- Reg with viewonline rights see country, city in title on flag img hover
- Admins/mods have also the current IP in title tag on flag img hover
- Reg with viewonline rights can use google map link on flag img click
- Blacklist array for citys, which never be shown:
· Those citys have also no google map link
- Lightweight browser detect script (major browsers:
· FF, IE, Opera, Chrome, Safari and much bots)
- Optional guest display (take care of site / provider load)
- More detailed information as in "who is online"
- Various modes:
· Topic mode
· Forum/Topic mode
· Post Mode
- Various additions and expands:
· Addition # 1 / phpBB Annuaire / ErnadoO / 2011
· Addition # 2 / Profile Views List / lefty74 / 2009
· Real user page 1.1.0 / Senky / 2009*
· *Shows all UCP Modes
· jQ [img] upload
· Unfrequently User Manager
- Slim "which profile is watching" script
- Fileinfo with link instead of just 'Downloading File'
- Show all search modes (egosearch, unanswered, unreadposts, newposts, active_topics)
- Show all post modes (reply, quote, edit, delete) with topic-name and -link
- For a more detailed view of features visit main topic:
· viewtopic.php?f=3&t=86
- Engine is slim as possible to have minimum site load
- Reasonable refresh values: 20000-40000 msec.
- xhtml 1.0 strict

Screens: (3.0.* Version)
viewtopic.php?f=3&t=86#p621
viewtopic.php?f=3&t=86#p923

Video: http://4seven.bplaced.net/w_i_w/1.htm (v.0.0.1) (3.0.* Version)

MOD-Demo: index.php (3.0.* Version)
- un: test / pw: testuser / ~ 20 sec. refresh
to check it out, you have to use two browser. one to surf with user test within forum/topics/posting/profile etc. and one, who is monitoring forum index.

Download: none yet..
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Re: [DEV] jQ Who is where for 3.2.*

Postby Sekuro » 16 Oct 2016, 14:16

Who is where for 3.1*

with some transformings from martin
so thanks to him...

you can change some settings in the who is where.php file
look for the config section.

Install

Open: index.php[install]Find This may be a partial find and not the whole line (spaces may differ)
Code: Select all
$user->setup('viewforum');
[/install]
[install]Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
// JQ Who is where / 4seven / 2013
$who_base = $config['cookie_name'] . '_base';   
setcookie("$who_base", 'base', time()+3600*24);
// JQ Who is where / 4seven / 2013
[/install]

Open: viewtopic.php
[install]Find This may be a partial find and not the whole line (spaces may differ)
Code: Select all
      'U_EDIT'         => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '',
      'U_QUOTE'         => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '',
[/install]
[install]Replace with Replace the preceding lines with the following
Code: Select all
      // 'U_EDIT'         => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '',
      'U_EDIT'         => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&t=$topic_id&p={$row['post_id']}") : '',
      // 'U_QUOTE'         => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '',
      'U_QUOTE'         => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&t=$topic_id&p={$row['post_id']}") : '',
[/install]
[install]Find This may be a partial find and not the whole line (spaces may differ)
Code: Select all
      'U_DELETE'         => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=' . (($softdelete_allowed) ? 'soft_delete' : 'delete') . "&f=$forum_id&p={$row['post_id']}") : '',
[/install]
[install]Replace with Replace the preceding lines with the following
Code: Select all
//'U_DELETE'         => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=' . (($softdelete_allowed) ? 'soft_delete' : 'delete') . "&f=$forum_id&p={$row['post_id']}") : '',
        'U_DELETE'         => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=' . (($softdelete_allowed) ? 'soft_delete' : 'delete') . "&f=$forum_id&t=$topic_id&p={$row['post_id']}") : '',
[/install]

Open: language/en/common.php
[install]Find This may be a partial find and not the whole line (spaces may differ)
Code: Select all
$lang = array_merge($lang, array(
[/install]
[install]Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
   // JQ Who is where / 4seven / 2013
   'WIW_SZ_1_E'         => 'Set max-height to 280px (default)',
   'WIW_SZ_1'           => '280', // next value -10
   'WIW_SZ_1M1'         => '270',

   'WIW_SZ_2_E'         => 'Set max-height to 360px',         
   'WIW_SZ_2'           => '360', // next value -10
   'WIW_SZ_2M1'         => '350',   

   'WIW_SZ_3_E'         => 'Set max-height to 440px',
   'WIW_SZ_3'           => '440', // next value -10
   'WIW_SZ_3M1'         => '430',

   'WIW_SZ_N_E'         => 'No Limit, no max-height',
   'WIW_SZ_N'           => '0',
   'WIW_SZ_NS'          => 'FULL SIZE',   

   'CITY'               => 'City',   
   'UCITY'              => 'Unknown',   
   'NO_ACCESS'          => 'No access',

   'WIW_COUNTRY'        => 'Country',
   'WIW_ARRIVED'        => 'Arrived',
   'WIW_BROWSER'        => 'Browser',
   'WIW_NO_COOKIE'      => 'You must accept cookies, to use this function.<br /> Reload this site after activating.',
   'WIW_FF'             => 'Firefox',
   'WIW_IE'             => 'Internet Explorer',
   'WIW_OPERA'          => 'Opera',   
   'WIW_CHROME'         => 'Chrome',
   'WIW_SAFARI'         => 'Safari',
   'WIW_OPERA'          => 'Opera',   
   'WIW_NO_BROWSER'     => 'Another Browser/Bot',

   'READING_IN_TOPIC'   => 'Reading topic: %s',
   'READING_IN_FORUM'   => ' in forum: %s',   
   'READING_IN_POST'    => 'Reading post: %s',
   'READING_IN_POSTS'   => ' in post: %s',

   'DOWNLOAD_FILE'      => 'Downloading file: %s',

   'EDIT_MESSAGE'       => 'Edit message in %s',   
   'QUOTE_MESSAGE'      => 'Quote message in %s',
   'DELETE_MESSAGE'     => 'Delete message in %s',   

   'SEARCH_EGOSEARCH'   => 'Viewing own posts',   
   'SEARCH_NEWPOSTS'    => 'View new posts',
   'SEARCH_ACTIVE'      => 'View active posts',

   'POSTING_MESSAGE_JQ' => 'Ajax or jQuery present: Replying, quoting or editing message',   

   // Real user page 1.1.0 / Senky / 2009
   'VO_VIEWING_SUBSCRIBED'  => 'UCP: Viewing subscribtions',
   'VO_VIEWING_BOOKMARKS'   => 'UCP: Viewing bookmarks',
   'VO_VIEWING_DRAFTS'      => 'UCP: Viewing drafts',
   'VO_VIEWING_ATTACHMENTS' => 'UCP: Viewing attachments',
   'VO_EDITING_PROFILE'     => 'UCP: Editing profile',
   'VO_EDITING_SIGNATURE'   => 'UCP: Editing signature',
   'VO_EDITING_AVATAR'      => 'UCP: Editing avatar',
   'VO_EDITING_AS'          => 'UCP: Editing account settings',
   'VO_EDITING_GS'          => 'UCP: Editing global settings',
   'VO_EDITING_PD'          => 'UCP: Editing posting defaults',
   'VO_EDITING_DO'          => 'UCP: Editing display options',
   'VO_MANAGE_PM_DRAFTS'    => 'UCP: Manage private messages drafts',
   'VO_PM_INBOX'            => 'UCP: Viewing PM inbox',
   'VO_PM_OUTBOX'           => 'UCP: Viewing PM outbox',
   'VO_PM_SENTBOX'          => 'UCP: Viewing PM sentbox',
   'VO_PM_OPTIONS'          => 'UCP: Editing PM options',
   'VO_EDITING_MEMBERSHIP'  => 'UCP: Editing memberships',
   'VO_EDITING_GROUP'       => 'UCP: Editing group',
   'VO_EDITING_FRIENDS'     => 'UCP: Editing friends',
   'VO_EDITING_FOES'        => 'UCP: Editing foes',
   'VIEWING_HANGMAN'         => 'Is playing hangman',
        'VIEWING_KNUFFEL'                       => 'Is playing knuffel',
        'VIEWING_DOWNLOADSYSTEM'                => ' Is viewing downloads page',
        'VIEWING_QUOTESCOLLECTION'              => 'Is reading quotes',
        'VIEWING_PARTNER'                       => 'Is in the parnter pages',
        'VIEWING_ADD'                           => 'Is viewing partner add page',
        'VIEWING_PUZZLE'                        => 'is playing a puzzle',
        'VIEWING_CHAT_LOGS'                     => 'Is viewing mchat logs',
        'VIEWING_CHAT_ARCHIVE'                  => 'Is viewing mchat archive',
   'VIEWING_VIDEO_INDEX'                   => 'Watching in the gallery',
        'VIEWING_EMAILLIST'                     => 'Is trying to view emails',
        'VIEWING_DONOR_LIST'                     => 'Is viewing the donors list',
   'VISIT_WEBSITE'            => 'Visit website',
   
   // Real user page 1.1.0 / Senky / 2009

   // JQ WIW Addition #1 / 4seven / 2012
   'VIEWING_PROFILE_VIEWS'  => 'Viewing Profile Views',   
   'VIEWING_ANNUAIRE'       => 'Viewing Annuaire',   
   'VIEWING_ANNUAIRE_CAT_1' => 'Viewing Annuaire Cat 1',
   'VIEWING_ANNUAIRE_CAT_2' => 'Viewing Annuaire Cat 2',
   'VIEWING_ANNUAIRE_CAT_3' => 'Viewing Annuaire Cat 3',
   // JQ WIW Addition #1 / 4seven / 2012
   
   // JQ WIW Addition #2 / 4seven / 2012
   'VIEWING_PROFILE_VIEWS'  => 'Viewing Profile Views',   
   // JQ WIW Addition #2 / 4seven / 2012     

   'GEO_CREDIT_LINE'        => ' | Geolocation by <a href="http://www.geoplugin.com/">geoPlugin</a>',   
   // JQ Who is where / 4seven / 2013
[/install]

Open: styles/prosilver/template/index_body.html
[install]Find This may be a partial find and not the whole line (spaces may differ)
Code: Select all
<!-- IF S_DISPLAY_ONLINE_LIST -->
   <div class="stat-block online-list">
      <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
      <p>
         <!-- EVENT index_body_block_online_prepend -->
         {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
         <!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF -->
         <!-- EVENT index_body_block_online_append -->
      </p>
   </div>
<!-- ENDIF -->
[/install]
[install]Replace with Replace the preceding lines with the following
Code: Select all
<!-- IF S_DISPLAY_ONLINE_LIST || U_VIEWONLINE -->

<script type="text/javascript">
// <![CDATA[
!window.jQuery && document.write('<script type="text\/javascript" src="https:\/\/code.jquery.com\/jquery-latest.min.js"><\/script>');
// ]]>
</script>

<script type="text/javascript">
// <![CDATA[
function set_{L_WIW_SZ_1}(){
$('.navbar11').css({
'max-height' : '{L_WIW_SZ_1}px'
});
$('.navbar22').css({
'max-height' : '{L_WIW_SZ_1M1}px',
'overflow-x' : 'hidden',
'overflow-y' : 'auto' 
});}

function set_{L_WIW_SZ_2}(){
$('.navbar11').css({
'max-height' : '{L_WIW_SZ_2}px'
});
$('.navbar22').css({
'max-height' : '{L_WIW_SZ_2M1}px',
'overflow-x' : 'hidden',
'overflow-y' : 'auto' 
});}

function set_{L_WIW_SZ_3}(){
$('.navbar11').css({
'max-height' : '{L_WIW_SZ_3}px'
});
$('.navbar22').css({
'max-height' : '{L_WIW_SZ_3M1}px',
'overflow-x' : 'hidden',
'overflow-y' : 'auto' 
});}

function set_{L_WIW_SZ_N}(){
$('.navbar11').css({
'max-height' : '100%'
});
$('.navbar22').css({
'max-height' : '100%',
'overflow'   : 'visible'
});}

 $(document).ready(function() {
    <!-- IF S_DISPLAY_ONLINE_LIST -->
    $('#who_is_online_total').load('{ROOT_PATH}who_is_online_total.php?sid={SESSION_ID}', {dol : '{S_DISPLAY_ONLINE_LIST}'});
    $('#who_is_online_reg').load('{ROOT_PATH}who_is_online_reg.php?sid={SESSION_ID}', {dol : '{S_DISPLAY_ONLINE_LIST}'});
    <!-- ENDIF -->
     <!-- IF U_VIEWONLINE -->
    $('#who_is_where').load('{ROOT_PATH}who_is_where.php?sid={SESSION_ID}');
    <!-- ENDIF -->

    var refreshId = setInterval(function() {
    <!-- IF S_DISPLAY_ONLINE_LIST -->
    $('#who_is_online_total').load('{ROOT_PATH}who_is_online_total.php?sid={SESSION_ID}', {dol : '{S_DISPLAY_ONLINE_LIST}'});
    $('#who_is_online_reg').load('{ROOT_PATH}who_is_online_reg.php?sid={SESSION_ID}', {dol : '{S_DISPLAY_ONLINE_LIST}'});
    <!-- ENDIF -->   
    <!-- IF U_VIEWONLINE -->
    $('#who_is_where').load('{ROOT_PATH}who_is_where.php?sid={SESSION_ID}');
    <!-- ENDIF -->
    }, 5000);
   $.ajaxSetup({ cache: false });
 });
// ]]>
</script>
<!-- ENDIF -->

<!-- IF S_DISPLAY_ONLINE_LIST -->
<div style="padding-top:3px;"> </div>

<div class="navbar">
<div class="inner"><span class="corners-top"><span></span></span>
   <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
   <p>
   <!-- {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})-->{RECORD_USERS}<br /><!-- {LOGGED_IN_USER_LIST} -->
   <!-- IF LEGEND --><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF -->
   </p>
   <span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->

<!-- IF U_VIEWONLINE -->

   <div style="padding-top:5px;"> </div>
   <!-- 40er steps -->
   <div class="navbar navbar11" style="max-height:{L_WIW_SZ_1}px;"><span class="corners-top"><span></span></span>   
   <div class="inner navbar22" style="max-height:{L_WIW_SZ_1M1}px; overflow-x:hidden; overflow-y:auto;">

   <span style="cursor:pointer; color:white;" title="{L_WIW_SZ_1_E}" onclick="set_{L_WIW_SZ_1}()">{L_WIW_SZ_1}</span>
   <span style="cursor:pointer; color:white;" title="{L_WIW_SZ_2_E}" onclick="set_{L_WIW_SZ_2}()">{L_WIW_SZ_2}</span>
   <span style="cursor:pointer; color:white;" title="{L_WIW_SZ_3_E}" onclick="set_{L_WIW_SZ_3}()">{L_WIW_SZ_3}</span>
   <span style="cursor:pointer; color:white;" title="{L_WIW_SZ_N_E}" onclick="set_{L_WIW_SZ_N}()">{L_WIW_SZ_NS}</span>

   <h3 style="position:relative; top:-10px;">Who is where</h3>
   <table class="table1">
   
   <thead>
   <tr style="font-size:11px;">
   <th class="name"   style="width:15%; padding-left:5px; color:#536482;">{L_USERNAME}</th>
   <th class="name"   style="width:5%; padding-left:5px; color:#536482; text-align:center;">{L_WIW_COUNTRY}</th>
   <th class="info"   style="width:40%; padding-left:5px; color:#536482;">{L_LOCATION}</th>
   <th class="active" style="width:15%; padding-left:5px; color:#536482;">{L_WIW_ARRIVED}</th>
   <th class="active" style="width:25%; padding-left:5px; color:#536482;">{L_WIW_BROWSER}</th>
   </tr>
   </thead>
   <tbody id="who_is_where" style="font-size:10px; color:grey;"><tr style="display:none;"><td style="display:none;"></td></tr></tbody>
   </table>
   </div><span class="corners-bottom"><span></span></span>
   </div>
   <span class="corners-bottom"><span></span></span>
   
<!-- ELSE -->   

   <div style="padding-top:3px;"> </div>
   
   <div class="navbar">
   <div class="inner"><span class="corners-top"><span></span></span>
   <h3>Who is where</h3>
   <table class="table1">
   <thead>
   <tr style="font-size:11px;">
   <th class="name"   style="width:15%; padding-left:5px; color:#536482;">{L_USERNAME}</th>
   <th class="name"   style="width:5%; padding-left:5px; color:#536482; text-align:center;">{L_WIW_COUNTRY}</th>
   <th class="info"   style="width:40%; padding-left:5px; color:#536482;">{L_LOCATION}</th>
   <th class="active" style="width:15%; padding-left:5px; color:#536482;">{L_WIW_ARRIVED}</th>
   <th class="active" style="width:25%; padding-left:5px; color:#536482;">{L_WIW_BROWSER}</th>
   </tr>   
   </thead>
   <tbody style="font-size:10px; color:grey;">
<tr class="bg1">
   <td class="name" style="width:10%;">{L_NO_ONLINE_USERS}</td>
   <td class="name" style="width:5%; text-align:center;"><img src="images/74t.gif" style="margin-bottom:3px; width:8px;" alt="" /></td>
   <td class="info" style="width:45%; text-align:center;"><img src="images/74t.gif" style="margin-bottom:3px; width:8px;" alt="" /></td>
   <td class="active" style="width:15%;"><img src="images/74t.gif" style="margin-bottom:3px; margin-left:3px; width:8px;" alt="" /></td>
   <td class="active" style="width:25%;"><img src="images/74t.gif" style="margin-bottom:3px; margin-left:3px; width:8px;" alt="" /></td>
</tr>     
   </tbody>
   </table>
   <span class="corners-bottom"><span></span></span></div>
    </div>
   
   <div style="padding-top:3px;"> </div>   

<!-- ENDIF -->
[/install]

Open styles/prosilver/theme/colours.css
add at the bottom of the file
Code: Select all
table1 {
     display: table;
     margin-top:10px;
    margin-bottom:5px;
     border-spacing: 1px;
     
}

extract and upload the contents of the root folder

root.zip
(303.69 KiB) Downloaded 146 times


You can change the refresh rate in the index_body.html find 5000 change to what ever you want.
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Return to phpbb 3.2.* St@ff

Who is online

Users browsing this forum: No registered users and 1 guest

cron