Currency Converter

  • Currency
  • US$ Amount


These objects have already been defined in the system and you don't need to redefine them but it is duly noted that in order to call them inside a function, you will need to define them as 'global' in the beginning of the function, for example, global $dimofinf,$tpl,...

  • $dimofinf

This is the most important primary script object and it is considered a parent for several other inheriting objects and matrices and they will be clarified in the following points:

  • $dimofinf->db

This object is the way to dealing with the database and it includes more than one function with several jobs giving you full control dealing with the database script.

  • $dimofinf->input

This object includes functions that clean data inputs inserted to the script where the following function is used to clean the script:


{* php buffer start *} $dimofinf->input->clean_array_gpc 
{* php buffer end *}

It accepts two parameters:

- The first parameter is a value that identifies the method by which the inputs were sent and it can be:

      -  r :  for the REQUEST method.

      -  p : for the POST method.

      -  g : for the GET method.

-The second parameter is a matrix which includes the index like the input name and the value like the input type, for example:

{* php buffer start *} $dimofinf->input->clean_array_gpc('r', array
{* php buffer end *}

   Input types list:

      -  TYPE_INT: to filter inputs as numbers.
      -  TYPE_UINT:to filter inputs as numbers not less than zero.
      -  TYPE_NUM: to filter inputs as numbers and return them as text.
      -  TYPE_UNUM: to filter inputs as numbers not less than zero and return them as text
      -  TYPE_STR:to filter inputs as text and delete spaces at the beginning and end.
      -  TYPE_NOTRIM:to filter inputs as text without spaces at the beginning and end.
      -  TYPE_NOHTML: to filter inputs from HTML codes.
      -  TYPE_BOOL: to filter inputs as true or false or as 1 and 0.
      -  TYPE_ARRAY: to filter inputs as a matrix.  
      -  TYPE_FILE: to filter inputs as a file.  
      -  TYPE_ARRAY_FILE: to filter inputs as a matrix of files.
      -  TYPE_UNIXTIME: to filter inputs as a date in the Unix Timestamp form. 

  • $dimofinf->datastore

This object includes functions which deal with temporary storage of general data, it is a fast cache system that stores fixed data which is used a lot and edited rarely in order to lessen the database dealings and relief the stress and usage off of it. Cache storage can be divided into two types:

        - Files system: this stores data within the file whose path is 'contents/datastore/datastore_cache.php' .
        - Database system: which stores data in the 'datastore' table in the database.
  • $dimofinf->session

This object includes functions that deal with sessions. Please note that the sessions system in Dimofinf is saved within the two tables 'session' and 'cpsessions' in the database. To get data from the current user or visitor session, the following function is used:


{* php buffer start *} $dimofinf->session->vars["varname"] 
{* php buffer end *}

Where 'varname' includes the name of the column you want to get the value of, as the most important parts of the session table are:

      -  sessionhash: the session hash number.
      -  userid: the user ID if it is a member or a number if it is a visitor.
      -  host: the IP address.  
      -  country: the country of the IP address.
      -  lastactivity :the time of last activity in the Unix Timestamp form. 
      -  styleid: the style ID the user chose to view the website.
      -  loggedin: varies between 0 and 1 and it indicates whether the user signed in to the website or not.

  • $tpl

This object is for dealing with blocks files and it is defined automatically when the function 'mk_template' is called and it will be explained later when we mention all the functions related to this object and their jobs.

  • $hook

This object is related to dealing with hooks and their points and will be explained later.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Matrices (Views: 718)

$dimofinf->userinfoThis matrix includes the current user information after signing in and this...