Advertisement:

Author Topic: [SOLVED] Turn off "MARK AS" for non logged in users on bender black  (Read 3950 times)

alzamls

  • Newbie
  • *
  • Posts: 31
Wonder if one of us could help me to turn off and/or remove the "MARK AS" for non logged users on a bender black theme.

THANKS in advance for your KIND SUPPORT!
« Last Edit: October 01, 2014, 10:25:05 pm by alzamls »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #1 on: September 30, 2014, 11:43:14 pm »
@alzamls
- go to item-sidebar.php

find this code:
Code: [Select]
    <?php if(!osc_is_web_user_logged_in() || osc_logged_user_id()!=osc_item_user_id()) { ?>
        <form action="<?php echo osc_base_url(true); ?>" method="post" name="mask_as_form" id="mask_as_form">
            <input type="hidden" name="id" value="<?php echo osc_item_id(); ?>" />
            <input type="hidden" name="as" value="spam" />
            <input type="hidden" name="action" value="mark" />
            <input type="hidden" name="page" value="item" />
            <select name="as" id="as" class="mark_as">
                    <option><?php _e("Mark as..."'bender_black'); ?></option>
                    <option value="spam"><?php _e("Mark as spam"'bender_black'); ?></option>
                    <option value="badcat"><?php _e("Mark as misclassified"'bender_black'); ?></option>
                    <option value="repeated"><?php _e("Mark as duplicated"'bender_black'); ?></option>
                    <option value="expired"><?php _e("Mark as expired"'bender_black'); ?></option>
                    <option value="offensive"><?php _e("Mark as offensive"'bender_black'); ?></option>
            </select>
        </form>
    <?php ?>

replace with:
Code: [Select]
    <?php if(osc_is_web_user_logged_in()) { ?>
        <form action="<?php echo osc_base_url(true); ?>" method="post" name="mask_as_form" id="mask_as_form">
            <input type="hidden" name="id" value="<?php echo osc_item_id(); ?>" />
            <input type="hidden" name="as" value="spam" />
            <input type="hidden" name="action" value="mark" />
            <input type="hidden" name="page" value="item" />
            <select name="as" id="as" class="mark_as">
                    <option><?php _e("Mark as..."'bender_black'); ?></option>
                    <option value="spam"><?php _e("Mark as spam"'bender_black'); ?></option>
                    <option value="badcat"><?php _e("Mark as misclassified"'bender_black'); ?></option>
                    <option value="repeated"><?php _e("Mark as duplicated"'bender_black'); ?></option>
                    <option value="expired"><?php _e("Mark as expired"'bender_black'); ?></option>
                    <option value="offensive"><?php _e("Mark as offensive"'bender_black'); ?></option>
            </select>
        </form>
    <?php ?>

alzamls

  • Newbie
  • *
  • Posts: 31
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #2 on: October 01, 2014, 01:28:50 am »
THANKS! I am gonna try it in a while...

APPRECIATE IT VERY MUCH!

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #3 on: October 01, 2014, 02:57:06 am »
Hi,

I beleive this would be the correct if condition, since owner will also have access to mark his own items otherwise:

Code: [Select]
<?php if(osc_is_web_user_logged_in() && osc_logged_user_id()!==osc_item_user_id()) { ?>

Also, this recent topic is related: http://forums.osclass.org/general-help/i-have-no-comment-field-but-receiving-comments/

Regards

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #4 on: October 01, 2014, 12:17:58 pm »
@dev101
If you think about it, there is no reason why owner could not mark it's listing, because he could mark it as Expired for example. There is no hurt in this.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #5 on: October 01, 2014, 01:08:29 pm »
Hi frosticek,

Unfortunately, that option is only used as notification for admin, you cannot use it to actually hide or mark item as expired, since it requires admin check first. Even if you create a custom function that checks marked status in db, it would be unreliable since someone (yes, even registered user) could erroneously mark it as expired and the item would become "expired" instantly in such case. There is no difference who reported it, owner or some random user. Simply, this is meant as a feedback only tool the way I see it. And I beleive there is a plugin for such feature (possibly made by you).

Regards

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #6 on: October 01, 2014, 02:38:14 pm »
@dev101
I know that :)
Was thinging about some checklist, when there is too many reports that listing is spam or similar, it could be disabled, but then I checked my test server and this button is loved by spam bots etc, so currently it is more-less useless  :-X

alzamls

  • Newbie
  • *
  • Posts: 31
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #7 on: October 01, 2014, 09:58:40 pm »
... ?? THANKS for the CLARIFICATION frosticek... I'll keep your SOLUTION...  :) APPRECIATE IT VERY MUCH!

BTW could you be able to tell me a solution also for my post regarding; Turn off "NAME/USER TITLE" for non logged in users on bender black theme..?

Again, THANKS!

alzamls

  • Newbie
  • *
  • Posts: 31
Re: Turn off "MARK AS" for non logged in users on bender black
« Reply #8 on: October 01, 2014, 10:21:31 pm »
... Sadly to say when testing frosticek's solution, it didn't work... But @dev101's one did work!

THANKS SO MUCH to both of YOU for ALL YOUR SUPPORT! :)

Wonder if one of you could also help me with the 'NAME/USER TITLE" for non logged in users on bender black theme'

Take care!

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [SOLVED] Turn off "MARK AS" for non logged in users on bender black
« Reply #9 on: October 01, 2014, 10:27:27 pm »
@alzamls
Our solutions are same, but in @dev101 is as addition "Owner of listing cannot mark this listing". :)

What user title you mean?

alzamls

  • Newbie
  • *
  • Posts: 31
Re: [SOLVED] Turn off "MARK AS" for non logged in users on bender black
« Reply #10 on: October 02, 2014, 01:05:45 am »
This one... Please see screen print attached.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [SOLVED] Turn off "MARK AS" for non logged in users on bender black
« Reply #11 on: October 02, 2014, 01:32:24 am »
@alzamls
This means, that user (unregistered) has not entered it's name when publishing new listing. Means name is empty and was replaced with "Anonymous". You can change this string in translation file or directly in item.php (or item-sidebar.php for bender theme) ;)

alzamls

  • Newbie
  • *
  • Posts: 31
THANKS!
I am unable to identify the string on the item-sidebar.php :(
Would it be possible to help me identify that string... Please :)
Your HELP will be GREATLY APPRECIATED!
Take care!
« Last Edit: October 02, 2014, 02:07:54 am by alzamls »

alzamls

  • Newbie
  • *
  • Posts: 31
Re: [SOLVED] Turn off "MARK AS" for non logged in users on bender black
« Reply #13 on: October 02, 2014, 02:10:38 am »
Found string... THANKS for ALL your SUPPORT!