Currency Converter

  • Currency
  • US$ Amount

User functions

  • verify_id($idname, &$id, $alert = true, $selall = false, $options = 0)

This function is used to ensure the availability of content in the database and returning it as data. If it isn't found, the function will return 'false'.


$idname (mandatory): the name of the table within the database where the search will be conducted.
      -  $id (mandatory): the value of the table whose index will be searched.
      -  $alert (optional): the value 'boolean true/false' is set to 'true', the function will print an error
             message if it isn't available for the user.
      -  $selall (optional): the value 'boolean true/false' is used to determine whether all columns will
             be returned from the table or not.
      -  $options(optional): this is assigned if the '$idname' parameter value was 'user' to search within the 'user' table
             as it would then call the function 'fetch_userinfo'; you can get back to this function to learn more about its
             parameters in order to clarify the advantage of using the '$option' parameter.


{* php buffer start *} $userinfo verify_id('user', $dimofinf->GPC['userid'], true, true);
$fetch_userinfo_options = (ADD_USER_AVATAR ADD_USER_PROFILE);
$user verify_id('user', $dimofinf->GPC['userid'], 1, 1, $fetch_userinfo_options); 
{* php buffer end *}

  • fetch_userinfo(&$userid, $option = 0)

This function returns a matrix which includes the user data of the chosen ID or returns 'false' if the desired ID has no user. Please note, the data comes from the 'user' and 'userprofile' tables if the '$option' parameter is assigned.


$userid (mandatory): the user ID.
      -  $option (optional): to get additional information about the user from the 'userprofile' table
             which is connected to the 'user' table, these constants must be defined:

{* php buffer start *} define('ADD_USER_AVATAR', 0x02);
define('ADD_USER_PROFILE', 0x04); 
{* php buffer end *}

- When the first constant is defined, it gets information about the user's avatar, for example:

      -  avatarpath: it gets the avatar path.
      -  title: the avatar title.

- The second constant, when defined, gets information from the 'userprofile' table which includes optional user data and the most important parts of this table are:

      -  pusername: the public user name used in the profile URL (if assigned).
      -  country: the country code which the user comes from and it is a two letter code. For example, SA and EG.
      -  city: the user's city.
      -  verified: an option chosen by the administration and it indicates whether the user is trusted or not.
      -  privacy: determines the user's profile privacy when it is viewed.
      -  bio: a summary about the user
      -  views: the number of views for the user's profile.
      -  phone: the user's phone number.


{* php buffer start *} define('ADD_USER_AVATAR', 0x02);
define('ADD_USER_PROFILE', 0x04);
$fetch_userinfo_options = (ADD_USER_AVATAR ADD_USER_PROFILE);
$userid = (int) $userinfo['userid'];
$userarray fetch_userinfo($useridfetch_userinfo_options); 
{* php buffer end *}

Was this answer helpful?

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

Also Read

Email functions (Views: 951)

[php]DIM_mail($remail, $rname, $message, $subject, $semail ="", $sname ="", $priority = 3, $mass...

Content functions (Views: 844)

recursive($dynamic_cat_id,$module,$rate)This function is important and should be added at the end...

Numbers and dates functions (Views: 865)

DIM_date($format, $timestamp = TIMENOW, $doyestoday = false, $datemethod ="", $adjust = true,...

Editor functions (Views: 842)

Dim_editor($area, $text ="", $rows = 26, $showresize = false, $dimcp = false, $editor_id = 0,...

Files functions (Views: 1250)

file_extension($filename)This function is used to return the file extension.Parameters: ...