Site icon Osclass Documentation & Knowledge Base

hPreference.php

osc_time_cookie() – Gets cookie’s life

osc_comments_enabled() – Gets if comments are enabled or not

osc_comments_per_page() – Gets comments per page

osc_timezone() – Gets comments per page

osc_reg_user_post_comments() – Gets if only users can post comments

osc_reg_user_can_contact() – Gets if only users can contact to seller

osc_users_enabled() – Gets if users are enabled or not

osc_user_registration_enabled() – Gets if user registration is enabled

osc_user_validation_enabled() – Gets is user validation is enabled or not

osc_logged_user_item_validation() – Gets if validation for logged users is required or not

osc_moderate_comments() – Gets how many comments should be posted before auto-moderation

osc_notify_new_comment() – Gets if notification of new comments is enabled or not to admin

osc_notify_new_comment_user() – Gets if notification of new comments is enabled or notto users

osc_rewrite_enabled() – Gets if nice urls are enabled or not

osc_mod_rewrite_loaded() – Gets if mod rewrite is loaded or not (if apache runs on cgi mode, mod rewrite will not be detected)

osc_keep_original_image() – Gets if original images should be kept

osc_auto_cron() – Gets if autocron is enabled

osc_recaptcha_items_enabled() – Gets if recaptcha for items is enabled or not

osc_items_wait_time() – Gets how many seconds should an user wait to post a second item (0 for no waiting)

osc_moderate_items() – Gets how many items should be moderated to enable auto-moderation

osc_can_deactivate_items() – Returns true if user is enabled to disable / deactivate its listing

osc_reg_user_post() – Gets if only registered users can publish new items or anyone could

osc_price_enabled_at_items() – Gets if the prices are o not enabled on the item’s form

osc_images_enabled_at_items() – Gets if images are o not enabled in item’s form

osc_max_images_per_item() – Gets how many images are allowed per item (o for unlimited)

osc_notify_contact_friends() – Gets if notification are sent to admin when a send-a-friend message is sent

osc_notify_contact_item() – Gets if notification are sent to admin when a contact message is sent

osc_item_attachment() – Gets item attachment is enabled

osc_contact_attachment() – Gets if contact attachment is enabled

osc_notify_new_item() – Gets if notification are sent to admin with new item

osc_notify_new_user() – Gets if notification are sent to admin with new user

osc_mailserver_auth() – Gets if the mail server requires authentication

osc_mailserver_pop() – Gets if the mail server requires authentication

Other function to get information of preferences

osc_rewrite_rules() – Gets the rewrite rules (generated via generate_rules.php at root folder)

osc_max_size_kb() – Gets max kb of uploads

osc_allowed_extension() – Gets allowed extensions of uploads

osc_use_imagick() – Gets if use of imagick is enabled or not

osc_thumbnail_dimensions() – Gets thumbnails’ dimensions

osc_preview_dimensions() – Gets preview images’ dimensions

osc_normal_dimensions() – Gets normal size images’ dimensions

osc_last_version_check() – Gets when was the last version check

osc_version() – Gets current version

osc_page_title() – Gets website’s title

osc_language() – Gets website’s default language

osc_admin_language() – Gets website’s admin default language

osc_theme() – Gets current theme

osc_admin_theme() – Gets current admin theme

osc_page_description() – Gets website description

osc_contact_email() – Gets contact email

osc_date_format() – Gets date format

osc_time_format() – Gets time format

osc_week_starts_at() – Gets week start day

osc_num_rss_items() – Gets number of items to display on RSS

osc_currency() – Gets default currency

osc_akismet_key() – Gets akismet key

osc_recaptcha_private_key() – Gets recaptcha private key

osc_recaptcha_public_key() – Gets recaptcha public key

osc_mailserver_type() – Gets mailserver’s type

osc_mailserver_host() – Gets mailserver’s host

osc_mailserver_port() – Gets mailserver’s port

osc_mailserver_username() – Gets mailserver’s username

osc_mailserver_password() – Gets mailserver’s password

osc_mailserver_ssl() – Gets if use SSL on the mailserver

osc_active_plugins() – Gets list of active plugins

osc_installed_plugins() – Gets list of installed plugins

osc_default_order_field_at_search() – Gets default order field at search

osc_default_order_type_at_search() – Gets default order type at search

osc_default_show_as_at_search() – Gets default show as at search

osc_max_results_per_page_at_search() – Gets max results per page at search

osc_default_results_per_page_at_search() – Gets default results per page at search

osc_max_latest_items() – Gets max latest items

osc_save_latest_searches() – Gets if save searches is enabled or not

osc_purge_latest_searches() –

osc_item_spam_delay() – Gets how many seconds between item post to not consider it SPAM

osc_comment_spam_delay() – Gets how many seconds between comment post to not consider it SPAM

osc_selectable_parent_categories() – Gets if parent categories are enabled or not

osc_max_latest_items_at_home() – Return max. number of latest items displayed at home index

osc_get_preference($key, $section = ‘osclass’) – generic function to retrieve preferences

osc_set_preference($key, $value = , $section = ‘osclass’, $type = ‘STRING’) – generic function to insert/update preferences

osc_delete_preference($key = , $section = ‘osclass’) -generic function to delete preferences

osc_reset_preferences() – Reload preferences

osc_is_watermark_text() – Return if need mark images with text

osc_is_watermark_image() – Return if need mark images with image

osc_watermark_text_color() – Return watermark text color

osc_watermark_text() – Return watermark text

osc_watermark_place() – Return watermark place

Helpers for subdomains

osc_subdomain_type() – Returns type of subdomain. It’s empty string when subdomains are disabled. There are multiple types: category, user, country, region, city

osc_subdomain_host() – Returns subdomain host defined in Settings > Advanced. It should be base domain format. If you run Osclass on https://yourdomain.com, then subdomain host will be yourdomain.com (and subdomains will be *.yourdomain.com)

osc_subdomain_landing_enabled() – Returns true when top-domain page is converted to subdomains navigation/landing page.

osc_subdomain_redirect_enabled() – Returns true when automatic redirect of users to subdomains is enabled. Only available for country-based subdomains.

osc_subdomain_restricted_ids() – Returns list of resticted country IDs those can be accessible only by visitors from that country. Only available for country-based subdomains.

Private functions

getBoolPreference($key , $section = ‘osclass’ ) – Gets preference as boolean.

getPreference($key, $section = ‘osclass’) – Gets preference as string.