Osclass Support Forums

Osclass plugin support => Online Chat Plugin => Topic started by: calm on September 04, 2017, 10:46:24 AM

Title: Only in dating category
Post by: calm on September 04, 2017, 10:46:24 AM
Hello!
My idea is: online chat available only in dating categories!
Because there is now different communication forms (email, instant messages, whatsapp, phone number etc.) and why chat, If user can, for example, send sms or simply call (it's from my point of view and I think - most of this topic readers will agree with that.)., but in dating category things are different.  :)
But for that we have to 1)
A) show chat (right bottom corner) only in dating categories
B) show 'chat available. user online.' only on items which are in dating categories.

2) hide phone number for items which are in dating categories.

In osc market You post:
Code: [Select]
if(osc_item_category() in array(1,2,3,4,5)) { echo oc_chat(); }
I think (hope) I could it implement.
And, if understand correct, in this way its possible to show only in dating categories both - chat on bottom right corner and on item 'chat aivalable'.?

Last night I was trying to hide phone for specific category, but till now without results (but, sure I will try more.)

Maybe someone know how to hide phone?

@frosticek
If You could clarify (or even explain little bit precisely) about 1) A and B and help resolve problem 2)  I'm bying this plugin and I'm sure - many of osclass users would find this info useful.
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 11:23:11 AM
@calm
code you have placed is correct and will restrict to show specific code in selected categories.
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 12:55:17 PM
@frosticek
How far from truth am I?
Code: [Select]
<?php if($mobile_found) && (osc_item_category() in array(1,2,3,4,5))  { ?>
                        <a href="#" class="phone-show" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>"><?php _e('Show''veronika'); ?></a>
                      <?php ?>
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 01:28:04 PM
Code: [Select]
<?php if($mobile_found && in_array(osc_item_category(), array(1,2,3,4,5)))  { ?>
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 02:40:44 PM
@frosticek
thanks for answer!
code works, but in general, if look on topic probl., it's senseless - it hide only the word "show"  near the 1234XXXX.

Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 02:58:10 PM
@calm
wrap whole section or create in that way styles that hide phone.
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 03:48:21 PM
I tryed, but can't. can't figure out.

thanks for Your time and support @frosticek

If someone get it done, please, share.
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 03:57:56 PM
@calm
Code: [Select]
<?php if($mobile_found && in_array(osc_item_category(), array(1,2,3,4,5)))  { ?>
  <style>
    #contact_form .phone.no-number {display:none!important;}
  </style>
<?php ?>
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 06:00:21 PM
@frosticek
famous question:
where exatly I have to put that code?

At first I put where I was sure, then everywhere. nothing. each time cleared cookies and reloaded css.

thanks and respect for Your patience.
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 06:36:29 PM
Item.php
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 06:47:06 PM
no doubt!
here is block of code from item.php from fieldset:
Code: [Select]
<div class="phone<?php if(!$mobile_found) { ?> no-number<?php ?>">
                      <a href="#" class="phone-block" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>">
                        <i class="fa fa-phone"></i>
                        <span>
                          <?php 
                            
if(strlen($mobile) >= && $mobile <> __('No phone number''veronika')) {
                              echo 
substr($mobile0strlen($mobile) - 4) . 'xxxx'
                            } else {
                              echo 
$mobile;
                            }
                          
?>

                        </span>
                      </a>

                      <?php if($mobile_found) { ?>
                        <a href="#" class="phone-show" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>"><?php _e('Show''veronika'); ?></a>
                      <?php ?>
                    </div>
I think it should be there. First, I put it before "phone" class. now, Im not even thinking and trying to understad. Im just surfing with this code all over item.php :) :(
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 07:25:08 PM
In code I have sent you is .no-phone .... remove it
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 08:12:37 PM
@frosticek
could You clarify:
in code You sent me isnt  ".no-phone".
there are: .phone.no-number

I tryed remove first ".no-number", then ".phone", then both: ".phone.no-number".
code I placed before
Code: [Select]
<div class="phone<?php if(!$mobile_found) { ?> no-number<?php ?>">. No success.
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 09:15:44 PM
@calm
Code: [Select]
<?php if($mobile_found && in_array(osc_item_category(), array(1,2,3,4,5)))  { ?>
  <style>
    #contact_form .phone {display:none!important;}
  </style>
<?php ?>
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 09:30:40 PM
@frosticek
so, this is edit:
Code: [Select]
<fieldset>
                <div class="phone-mail">
                  <div class="wrap">
 
  <?php if($mobile_found && in_array(osc_item_category(), array(104)))  { ?>
  <style>
    #contact_form .phone {display:none!important;}
  </style>
<?php ?>
 
                    <div class="phone<?php if(!$mobile_found) { ?> no-number<?php ?>">
                      <a href="#" class="phone-block" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>">
                       


should be, but isn't.
Title: Re: Only in dating category
Post by: MB Themes on September 04, 2017, 09:42:38 PM
@calm
Sorry, you do not understand to basics, if you have moded block with phone outside #contact_form, then you need to change CSS as well. Please find some developers to do such work for you.
Title: Re: Only in dating category
Post by: calm on September 04, 2017, 11:09:55 PM
@frosticek
yes, i'm just learning this all. now, I even dont understand where is my mistake - because I told You before what Im doing even few times.    :-\
I'll consider about hiring developer for that css changes.
thanks for support, time and patience.

if there is anyone who can clearer explain, point or guide for dumb like me, please, write. 

Title: Re: Only in dating category
Post by: MB Themes on September 05, 2017, 08:14:58 AM
@calm
In this code:
Code: [Select]
<?php if($mobile_found && in_array(osc_item_category(), array(104)))  { ?>
  <style>
    #contact_form .phone {display:none!important;}
  </style>
<?php ?>
 
                    <div class="phone<?php if(!$mobile_found) { ?> no-number<?php ?>">
                      <a href="#" class="phone-block" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>">
                       


This part:
Code: [Select]
#contact_form .phone {display:none!important;}
Should be probably changed into:
Code: [Select]
.phone {display:none!important;}
As I cannot see div with ID #contact_form anymore.


+ condition:
Code: [Select]
<?php if($mobile_found && in_array(osc_item_category(), array(104)))  { ?>

should be changed to:
Code: [Select]
<?php if(in_array(osc_item_category_id(), array(104)))  { ?>
Title: Re: Only in dating category
Post by: calm on September 05, 2017, 06:30:47 PM
"As I cannot see div with ID #contact_form anymore."
if I understand right -hmm, my site is clean, - I have made css modifications, but that modifications didnt touched item.php.  And I checked with 'beyond compare' my actual item.php with untached veronikas item.php - I cant see any #contact_form which would be dissapeared in my actual item.php. (?)
now Im trying to understand Your code. before I was thinking, that I understand css basics ok.

thanks for Your extra support @frosticek! works like a charm!