Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

wikimedia class class for communication with Wikimedia Commons API

Author: Dongsheng Cai <dongsheng@moodle.com>, Raul Kern <raunator@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 236 lines (10 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

wikimedia:: (7 methods):
  __construct()
  login()
  logout()
  get_image_url()
  get_images_by_page()
  get_thumb_url()
  search_images()


Class: wikimedia  - X-Ref

__construct($url = '')   X-Ref
No description

login($user, $pass)   X-Ref
No description

logout()   X-Ref
No description

get_image_url($titles)   X-Ref
No description

get_images_by_page($title)   X-Ref
No description

get_thumb_url($image_url, $orig_width, $orig_height, $thumb_width = 75, $force = false)   X-Ref
Generate thumbnail URL from image URL.

param: string $image_url
param: int $orig_width
param: int $orig_height
param: int $thumb_width
param: bool $force When true, forces the generation of a thumb URL.
return: string

search_images($keyword, $page = 0, $params = array()   X-Ref
Search for images and return photos array.

param: string $keyword
param: int $page
param: array $params additional query params
return: array