Advertisement:

Author Topic: difference between the Company and the User?  (Read 3361 times)

Philll

  • Newbie
  • *
  • Posts: 22
difference between the Company and the User?
« on: April 10, 2013, 12:19:10 am »
What is the difference between the user and the company? I created a user and group and placed two identical listings on your behalf and on behalf of the company. and I did not notice any difference between them. What is generally the difference between the Company and the User?

Gilden

  • Sr. Member
  • ****
  • Posts: 464
  • Availability: 30%
Re: difference between the Company and the User?
« Reply #1 on: April 10, 2013, 03:33:43 am »
I think there is not really a difference between them, but you could use this information in your theme to make the companies ads stand out, for example.

Like this:

Ad number 1
Ad number 2
Ad number 3 <professional
Ad number 4
Ad number 5
...

Luca

  • Hero Member
  • *****
  • Posts: 584
  • CentOs 6.4 - Virtualmin - OSC 3.0 - Custom Theme
Re: difference between the Company and the User?
« Reply #2 on: April 10, 2013, 02:27:20 pm »
@gilden
This is a good idea. Thank you


Luca

Philll

  • Newbie
  • *
  • Posts: 22
Re: difference between the Company and the User?
« Reply #3 on: April 10, 2013, 07:09:43 pm »
Can I set different output of the announcements, one for companies look for other users?
Well, that would be in full display of listings was for example, and different styles, or other fields, or elements on the page have been designed differently?

Gilden

  • Sr. Member
  • ****
  • Posts: 464
  • Availability: 30%
Re: difference between the Company and the User?
« Reply #4 on: April 11, 2013, 03:12:30 pm »
@gilden
This is a good idea. Thank you
Luca

You're welcome.

Can I set different output of the announcements, one for companies look for other users?
Well, that would be in full display of listings was for example, and different styles, or other fields, or elements on the page have been designed differently?

Yes, you could do it by setting a specific CSS rule for example, and styling it in a different way. Or you can change the html completely with a PHP if statement.

Philll

  • Newbie
  • *
  • Posts: 22
Re: difference between the Company and the User?
« Reply #5 on: April 11, 2013, 07:58:47 pm »
Quote

Yes, you could do it by setting a specific CSS rule for example, and styling it in a different way. Or you can change the html completely with a PHP if statement.

You can follow any responses suggest how to do this? I just looked through firebug code announcement from the company and from the user. But the code is exactly the same way may Primin styles to specific Announcement of Companies

Translated using Google translator
« Last Edit: April 11, 2013, 08:02:15 pm by trains58554 »

Gilden

  • Sr. Member
  • ****
  • Posts: 464
  • Availability: 30%
Re: difference between the Company and the User?
« Reply #6 on: April 12, 2013, 04:08:25 am »
I am writing by heart, but maybe something like:

Code: [Select]
<?php
if(isset($user['b_company']) && $user['b_company'] == 1) {
  
// show code for company
} else {
  
// show code for regular user
}
?>


Philll

  • Newbie
  • *
  • Posts: 22
Re: difference between the Company and the User?
« Reply #7 on: April 12, 2013, 09:52:32 pm »
I am writing by heart, but maybe something like:

Code: [Select]
<?php
if(isset($user['b_company']) && $user['b_company'] == 1) {
  
// show code for company
} else {
  
// show code for regular user
}
?>


Thanks for the code !
tried - always returns "0"
Code: [Select]
<? php
if (isset ($ user ['b_company']) && $ user ['b_company'] == 1) {
   echo "1"
} Else {
   echo "0"
}
?>
created two ads - one of the company's face, and one of the user's face. Went to your site without a login, ie as unregistered user, and opened both ads - in both cases led to "0".
Translated using Google Translator

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: difference between the Company and the User?
« Reply #8 on: April 12, 2013, 10:55:24 pm »
Hi Phill,

It is more than likely not working because $user is not defined. Try this


<?php
if(isset(osc_user_field('b_company')) && osc_user_field('b_company') == 1) {
  
// show code for company
} else {
  
// show code for regular user
}
?>


Jay

Philll

  • Newbie
  • *
  • Posts: 22
Re: difference between the Company and the User?
« Reply #9 on: April 12, 2013, 11:32:44 pm »
Hi Phill,

It is more than likely not working because $user is not defined. Try this


<?php
if(isset(osc_user_field('b_company')) && osc_user_field('b_company') == 1) {
  
// show code for company
} else {
  
// show code for regular user
}
?>


Jay


Thanks - trains58554, I tried your code. But I have the error:

Fatal error: Can't use function return value in write context in Z:\home\MY_DOMAIN.Com\www\oc-content\themes\modern\item.php on line 2

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: difference between the Company and the User?
« Reply #10 on: April 12, 2013, 11:37:08 pm »
Change the if statement like this

if(osc_user_field('b_company') == 1) {


Then the error will go away.

Jay

Philll

  • Newbie
  • *
  • Posts: 22
Re: difference between the Company and the User?
« Reply #11 on: April 12, 2013, 11:43:59 pm »
Change the if statement like this

if(osc_user_field('b_company') == 1) {


Then the error will go away.

Jay

Looks like it works!, Thanks again, trains58554 !

Gilden

  • Sr. Member
  • ****
  • Posts: 464
  • Availability: 30%
Re: difference between the Company and the User?
« Reply #12 on: April 13, 2013, 12:32:37 am »
It is more than likely not working because $user is not defined. Try this

You're right Jay. Thanks :)