Osclass Support Forums

Osclass plugin support => Online Chat Plugin => Topic started by: nijamutheen on August 06, 2017, 09:00:50 PM

Title: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: nijamutheen on August 06, 2017, 09:00:50 PM
how to show Instant Messenger Plugin icon & online chat icon on listings

Example For
online chat plugin:
http://prntscr.com/g53yxg

Instant Messenger Plugin
http://prntscr.com/g5414l

following For Grid views
http://prntscr.com/g54bat

---Mb-theme can take this future development
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: MB Themes on August 07, 2017, 09:36:39 AM
@nijamutheen
You have it in plugin configuration in section Plugin setup.

Code: [Select]
If you want to place initiate chat button on specific place, you can use built-in function. This function has optional parameter $user_id that does not need to be used.
<?php if(function_exists('oc_chat_button')) { echo oc_chat_button(); } ?>

If you want to show circle with user status (online - green, offline - gray), you can use built-in function. This function has optional parameter $user_id that does not need to be used.
<?php if(function_exists('oc_user_status')) { echo oc_user_status(); } ?>

If you want to use it in different way, take a look on function oc_user_status how to retrieve if user is online or offline.
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: nijamutheen on August 08, 2017, 09:00:48 PM
Sorry for reply I know that function  but I didn't know where to put that function means which file and which place
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: MB Themes on August 08, 2017, 10:57:19 PM
@nijamutheen
File: loop-single.php, loop-premium.php
Place: trial & error
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: nijamutheen on August 09, 2017, 05:07:44 PM
i did successfully thanks  frosticek
but gallery view will not shown it shows only list views
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: annunci on September 20, 2017, 05:31:09 PM
@nijamutheen
File: loop-single.php, loop-premium.php
Place: trial & error
Where i find this file, i want active this function but i no find php file, i see only email.php functions.php index.php
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: annunci on September 20, 2017, 05:36:43 PM
@nijamutheen
File: loop-single.php, loop-premium.php
Place: trial & error
Where i find this file, i want active this function but i no find php file, i see only email.php functions.php index.php
ok i now find loop.php and loop-single-premium.php in where line i need to paste this <?php if(function_exists('oc_user_status')) { echo oc_user_status(); } ?> please help me only in that
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: MB Themes on September 20, 2017, 09:00:52 PM
@annunci
In premium loop it will not work if you do not place id of user into function:
Code: [Select]
oc_user_status(osc_premium_user_id())
It may not show status to logged user (if user browse own listings), you can try in file:
oc-content/plugins/online_chat/functions.php

Find line (inside above mentioned function):
 
Code: [Select]
if($registered == 1 && $user_id <> osc_logged_user_id() && !oc_check_bans($user_id)) {
and change it to:
Code: [Select]
  if($registered == 1 && !oc_check_bans($user_id)) {
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: annunci on September 21, 2017, 12:05:13 PM
@annunci
In premium loop it will not work if you do not place id of user into function:
Code: [Select]
oc_user_status(osc_premium_user_id())
It may not show status to logged user (if user browse own listings), you can try in file:
oc-content/plugins/online_chat/functions.php

Find line (inside above mentioned function):
 
Code: [Select]
if($registered == 1 && $user_id <> osc_logged_user_id() && !oc_check_bans($user_id)) {
and change it to:
Code: [Select]
  if($registered == 1 && !oc_check_bans($user_id)) {

Where should I copy the code in single loop? In single loop Do you need the user ID to work?
 
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: MB Themes on September 21, 2017, 12:23:15 PM
@annunci
Answer is in quoted text.
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: abhkhan on March 02, 2018, 09:32:47 AM
1. In which file the above code should be added?

/public_html/oc-includes/osclass/gui/loop-single.php

OR

/public_html/oc-content/themes/veronika/loop-single.php
 and in which line?

2. I found this code

Code: [Select]
if($registered == 1 && $user_id <> osc_logged_user_id() && !oc_check_bans($user_id)) {
at two places on function.php
line 71 and 137
where should I replace?
Title: Re: how to show Instant Messenger Plugin icon & online chat icon on listings
Post by: MB Themes on March 02, 2018, 09:50:15 AM
@abhkhan
I do not know on what line - on that one you want to show it in theme. Put it there and try.