Warning: session_start(): open(/var/cpanel/php/sessions/ea-php74/sess_l2pai4dnfor0072upog2ces6lu, O_RDWR) failed: No such file or directory (2) in /home/mssoftpc/iqra.mssoftpc.com/admin/function.php on line 3

Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php74) in /home/mssoftpc/iqra.mssoftpc.com/admin/function.php on line 3
Global Functions | IQRA CMS

Global Functions

Want a successful Modern site?

Start with IQRA training; it’s easy and quick to your needs.

Global Functions
 
 

By using this function you can fetch the Global data of the site.

Parametors

  1. Key (Required);

Key Names

  1. title (For Site Name)
  2. url (For Site URL)
  3. shortname (For Shortname)
  4. email (For Site Email)
  5. phone (For Site Phone)
  6. logo (For Site Logo)
  7. social_media (For Social Media (serialize) )
  8. maintenance (For Maintenance Mode (0-1))
  9. active_theme (For Active Themes)
  10. active_addons (For Active Addons)
  11. front_page (For Front Page (id))
  12. smtp_host (For SMTP Host)
  13. smtp_port (For SMTP Port)
  14. smtp_username (For SMTP username)
  15. smtp_password (For SMTP Password)
  16. Enter any custom Name (For Get Custom Site Options)

 

Note: You Can use return for return key and for echo use direct key;

example: return_title or title

 

How to use 

site_options('return_keyname')

 

 

Use this function for Get Loggedin (current Loggedin User) Data .

Parametors

  1. Key (Required);

Key Names

  1. full_name (For Full Name)
  2. email (For Email)
  3. phone (For phone)
  4. password (For Password)
  5. featured_img (For User Profile Pic)
  6. Banner (For User Profile Banner Image)
  7. Status (For Status (0 - 1) )
  8. Role (For User Role )
  9. Enter any custom Key (For Get Custom User Data)

 

Note: You Can use return for return key and for echo use direct key;

example: return_key or key

 

How to use 

loggedinuser('return_key')

 

 

Use this function to Get Site Url / Admin Url .

Parametors

  1. Key (required);
  2. targeturl (optional);

 

Key

  1. admin (For Admin Url)
  2. "" (Blank) (For site url)
  3. currentURL (For current url)

 

targeturl

  1. any targeted url.

 

How to use 

site_url($url = null,$link = null)

 

 

Use this back function to redirect Site Url / Admin Url .

Parametors

  1. Key (required);
  2. targeturl (optional);

 

Key

  1. admin (For Redirect Admin url)
  2. "" or "/" (Blank) (For referred page redirect)
  3. reload (For reload current url)

 

targeturl

  1. any targeted url.

 

Note

  1. leave all parametors for redirect referred url.

 

How to use 

back($redirect = null, $path = null)

// if you want to redirect referred url then use

back();

 

 

 

Use this function for Restrict area only for login users .

Parametors

  1. Key (required);
  2. role (optional);

 

Key

  1. "''" (For loggedin users can access this area)
  2. Logout (For loggedout users can access this area)

Role

  1. Role (Only this role can access this area)

 

How to use 

loginonly($logout = null, $role=null);

// for loggedin users only
loginonly('')

// for logout users only 
loginonly('logout')

 

6. filedownloadfromanotherserver($data)
download any file from other server.
 
parametors
  1. data

 

data

  1. url (target file ) (required)
  2. location_path (save location ) (required)
  3. rename_file (required)