*

insha

  • **
  • 12 posts
Only logged users
« on: March 23, 2016, 03:15:20 PM »
How can i setup than only logged users can se this option?

*

MB Themes

Re: Only logged users
« Reply #1 on: March 23, 2016, 03:16:50 PM »
@insha

Code: [Select]
<?php
  
if(osc_is_web_user_logged_in()) {
    ... 
button code
  
}
?>

  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

insha

  • **
  • 12 posts
Re: Only logged users
« Reply #2 on: March 23, 2016, 03:38:28 PM »
If i insert like this i get blank page :

<?php
  if(osc_is_web_user_logged_in()) {
<?php if(function_exists('sp_buttons')) { echo sp_buttons( osc_item_id() ); } ?>
  }
?>

*

insha

  • **
  • 12 posts
Re: Only logged users
« Reply #3 on: March 23, 2016, 03:42:21 PM »
I figured out

<?php
  if(osc_is_web_user_logged_in()) {
    echo sp_buttons( osc_item_id() );
  }
?>

*

insha

  • **
  • 12 posts
Re: Only logged users
« Reply #4 on: March 23, 2016, 03:42:54 PM »
Is there a option that user that post ad only can promote their ads?

*

MB Themes

Re: Only logged users
« Reply #5 on: March 23, 2016, 03:54:04 PM »
@insha
In your if statement change from:
Code: [Select]
( osc_is_web_user_logged_in() )
to:
Code: [Select]
( osc_is_web_user_logged_in() && osc_item_user_id() == osc_logged_user_id() )
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

insha

  • **
  • 12 posts
Re: Only logged users
« Reply #6 on: March 23, 2016, 08:57:11 PM »
It works, i slowly start to figure how this works. You should make tutorials how to make plugin

*

MB Themes

Re: Only logged users
« Reply #7 on: March 23, 2016, 10:41:05 PM »
@insha
Well, code I have posted has nothing to do with plugin, it is just customization in osclass :)
Anyway, this is reason why we provide support via forum, because now everyone can see how to do some tricks with buttons now.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots