Notice: Undefined variable: s_offline in /homepages/6/d168803796/htdocs/officetrio.com/o3/o3start.php on line 314
OfficeTrio: O3 Functions - User Manual OfficeTrio: The Integrated ECommerce Solution OfficeTrio: The Integrated ECommerce Solution OfficeTrio: Features OfficeTrio: User Manual OfficeTrio: Testimonials OfficeTrio: The Demo is Offline! OfficeTrio: Order O3 Now
EWS is no longer available


Notice: Undefined variable: us_name in /homepages/6/d168803796/htdocs/officetrio.com/right-menu.php on line 35

Notice: Undefined variable: us_email in /homepages/6/d168803796/htdocs/officetrio.com/right-menu.php on line 35
U:
P:

Login Page

Introduction
Payments
Users
Login
Access
Categories
Products
Downloads
Deliveries
Containers
Catalog
Cart
Search
Orders
Emails
IPN
Stats

Modules
Affiliates
Content
Types
List Items
Image Upload
Scheduler
File Browser
Stock Control

Appendices
Settings
Functions
Actions
Caching



Forums
Members Area
Customers Area
Affiliates

Contribute
Installation
Contact Details
Terms
FAQ
Testimonials

Free Tutorials
Free EBooks
Free Scripts

PayPal - Accept Credit Cards Online

StormPay - Accept Credit Cards Online

PHP: Open-Source Server-Side Scripting Language

MySQL: Fast Relational Database



O3 comes with a full 30-day, no-quibble money back guarantee.



The toughest part of getting to the top of the ladder, is getting through the crowd at the bottom.
    unknown




Functions

Introduction | ECommerce | Products | Categories | Items | Schedules | Content | Miscellaneous

Introduction

These functions are all used internally by O3 itself to display the various elements of the website, but you can access them directly if you want - and even create new code which uses them as building blocks.

An example of running one of these functions within an HTML page is: <? echo show_products(); ?>

This is not a complete list of all the functions in O3 - far from it - it's just a list of the ones you're more likely to need. You can always browse the code to see what else is available to you. We believe our code is written in possibly the easiest to manage style in the known universe - because we want to make maintaining it easy for ourselves too!

Important Notes:

  • All fields which are searched by Regular Expression are converted to lowercase prior to the test. So a category called 'HiFi' will match a regexp of 'hi'. This means you don't have to cater for uppercase characters in the parameters below. It also means that you should make the names of your things unique without using case-differences.

  • ALL these functions return HTML. They do not display it - you must precede them with the PHP 'echo' command if you want to see the results in your page (this is done so these functions can be used as building blocks in other code).
  • For a list of Login Functions see the Login page in the user manual.

3rd Party ECommerce Functions

These functions all reside in the file button-wiz.php.

create_paypal_buttons (name, image, type)
Return a PayPal 'Buy' or 'Add To Cart' button. I.e. the function returns the HTML which describes the button - similar to PayPal's 'Button Wizard':
  • name - The product name.
  • image - (optional) Override image for the button.
  • type - (optional) PayPay button Type: (Default: INSTANT, else CART - uses PayPal's own cart)


create_stormpay_buttons (name, image, type)
Return a StormPay 'Buy' or 'Add To Cart' button (as above):
  • name - The product name.
  • image - (optional) Override image for the button.
  • type - (optional) PayPay button Type: (Default: INSTANT, else CART - uses StormPay's own cart)


create_viewcart_button (provider)
Return a 'View Cart' button for one of the listed providers:
  • provider - (optional) The payment provider name (Default: 'PayPal', else 'StormPay').



OfficeTrio Cart - ECommerce Functions

These functions reside in the file cart-func.php.

in_cart (product_name, item_name)
Return TRUE if the product or item is in the current user's cart:
  • product_name - The name of the product to add to the cart. (One of these must be supplied!)
  • item_name - The name of the item to add to the cart. (One of these must be supplied!)


create_addtocart_form (product_name, item_name, text, image)
Return a 'Add To Cart' button for one of the listed providers:
  • product_name - The name of the product to add to the cart. (One of these must be supplied!)
  • item_name - The name of the item to add to the cart. (One of these must be supplied!)
  • image - (optional) Override image for the button.
  • text - (optional) Override text for the button


create_removefromcart_form (cart, product, item, option1, option2, form)
Return a 'Remove From Cart' button for the specified cart item:
  • cart - The ID of the cart.
  • product - The name of the product to remove from the cart. (One of these must be supplied!)
  • item - The name of the item to remove from the cart. (One of these must be supplied!)
  • option1 - (optional) The name of the item to remove from the cart.
  • option2 - (optional) The name of the item to remove from the cart.
  • form - (optional) The name of the item to remove from the cart.


create_emptycart_form (cart, item)
Return a 'View Cart' button for one of the listed providers:
  • cart - (optional) The ID of the cart. If blank - the current user's cart.


create_checkout_form (provider)
Return a 'Checkout' button for one of the listed providers:
  • provider - (optional) The payment provider name (Default: 'PayPal', else 'StormPay', 'iKobo').


show_cart (container, mode)
Returns the current user's cart :
  • container - (optional) The container to use.
  • mode - (optional) Show: 'P' for products or 'I' for items.



Product Functions

These functions all reside in the file show-func.php.

show_products (name, category, creator, type, status, order, price, recurring, mode, container, incols)
Return a list of products matching these criteria. ALL parameters are optional:
  • name - Where the product name matches this Regular Expression
  • category - Where the category name matches this Regular Expression
  • creator - Where the creator (email addr) matches this Regular Expression
  • type - Where the type matches this Regular Expression
  • status - Where the status matches this Regular Expression
  • order - A column, or list of column names to order the results by
  • price - A specification for a price range. I.e. '>100' or 'between 1000 and 4999'
  • recurring - Show subscriptions? 'Y' or 'N' or ''
  • mode - AND (default) or OR. This makes the search an AND or OR search. Anything else won't work.
  • container - The container to use to display the list.
  • incols - The number of columns to display the results in (formatted as a table)


show_product(name, container)
Return an individual product:
  • name - The exact, case-sensitive product name.
  • container - the container to show it in (optional). If not specified - uses the default as defined in the setting.

Category Functions

These functions all reside in the file show-func.php.

show_tree (category, options, container, maxlevels)
Return a list of categories. ALL parameters are optional.
  • parent - >starting at the 'parent': category.

  • options - Blank or 'C' - to suppress the display of the parent (Children only).
  • maxlevels defines how deep into the hierarchy to go - i.e. '0' just show the immediate children of the parent.
It uses the Menu container defined in the settings if none is supplied.
show_categories (parent, name, status, order, mode, container, incols)
Return a list of categories matching these criteria ALL parameters are optional:
  • parent - Where the parent category matches this Regular Expression
  • name - Where the category name matches this Regular Expression
  • status - Where the category status matches this Regular Expression
  • order - A column, or list of column names to order the results by
  • mode - AND (default) or OR. This makes the search an AND or OR search.
  • container - The container to use to display the list.
  • incols - The number of columns to display the results in (formatted as a table)


show_category(name, container)
Return an individual category:
  • name - The exact, case-sensitive category name.
  • container - (optional) Container to show it in . If not specified - uses the default as defined in the setting.

Item Functions

These functions all reside in the file list/list-func.php.

show_items (name, category, creator, type, status, order, typedata, mode, container, incols)
Return a list of items matching these criteria. ALL parameters are optional:
  • name - Where the item name matches this Regular Expression
  • category - Where the category name matches this Regular Expression
  • creator - Where the creator (email addr) matches this Regular Expression
  • type - Where the type matches this Regular Expression
  • status - Where the status matches this Regular Expression
  • order - A column, or list of column names to order the results by
  • typedata - SQL where clause to define the type-data required. Type must also be specified. This is usedby the advanced search scripts to allow searching by the type-data.
  • mode - AND (default) or OR. This makes the search an AND or OR search. Anything else won't work.
  • container - The container to use to display the list.
  • incols - The number of columns to display the results in (formatted as a table)
show_item(name, container)
Return an individual item:
  • name - The exact, case-sensitive item name.
  • container - the container to show it in (optional). If not specified - uses the default as defined in the setting.

Schedule Functions

These functions all reside in the file sch/sch-func.php.

show_schedules (name, category, creator, type, status, order, mode, container, incols)
Return a list of schedules matching these criteria. ALL parameters are optional:
  • name - Where the schedule name matches this Regular Expression
  • category - Where the category name matches this Regular Expression
  • creator - Where the creator (email addr) matches this Regular Expression
  • type - Where the type matches this Regular Expression
  • status - Where the status matches this Regular Expression
  • order - A column, or list of column names to order the results by
  • starttime / endtime - The schedule must overlap the interval specified by these dates. Format: YYYY-MM-DD HH:MI:SS
  • mode - AND (default) or OR. This makes the search an AND or OR search.
  • container - The container to use to display the list.
  • incols - The number of columns to display the results in (formatted as a table)
show_schedule(name, container)
Return an individual schedule:
  • name - The exact, case-sensitive schedule name.
  • container - the container to show it in (optional). If not specified - uses the default as defined in the setting.

Content Functions

These functions all reside in the file spaw/content-func.php.

show_contents (name, category, creator, status, order, mode, container, incols)
Return a list of content items matching these criteria. ALL parameters are optional:
  • name - Where the content name matches this Regular Expression
  • category - Where the category name matches this Regular Expression
  • creator - Where the creator (email addr) matches this Regular Expression
  • status - Where the status matches this Regular Expression
  • order - A column, or list of column names to order the results by
  • mode - AND (default) or OR. This makes the search an AND or OR search.
  • container - The container to use to display the list.
  • incols - The number of columns to display the results in (formatted as a table)
show_content(name, container)
Return an individual content item:
  • name - The exact, case-sensitive content name.
  • container - the container to show it in (optional). If not specified - uses the default as defined in the setting.

Miscellaneous Functions

show_bc()
Returns the 'breadcrumb trail' to the current thing. No parameters, but it only works in the catalog page.

This function resides in the file show-func.php.

show_breadcrumb(item, category, separator)
Returns the breadcrumb trail for the specifed item and category:

This function resides in the file show-func.php.

  • item - The item name. This is just use to provide the current page text at the end.
  • category - The category the thing resides in.
  • separator - The text or HTML to use to separate items (i.e. '>').
count_downloads(product, mode)
Returns a count of the number of times a product (file) has been downloaded:

This function resides in the file dl/dl-func.php.

  • product - Where the content name matches this Regular Expression
  • mode - If set to anything other than 'unique' gets the total number of downloads, else the total number of users who have downloaded the file.
show_cal(schedule)
Returns a (month-view) calendar for the specified schedule:

This function resides in the file sch/cal.php.

  • schedule - The schedule the calendar links will point to. .
Notes:
  • Links to the schedule won't be shown if the calendar display is outside the schedule's date range. The days are still shown, but they are not links.
  • The calendar always defaults to the current month, but has links to previous and next months.


Powered By OfficeTrio