[ PHPXref.com ] [ Generated: Sun Jul 20 21:13:33 2008 ] [ YaPiG 0.95b ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> admin_func.php (summary)

This module contains all funtions used by all admin modules. I.e: admin.php, add_gallery.php, modify_gallery.php, delete_gallery.php

File Size: 766 lines (22 kb)
Included or required: 7 times
Referenced: 0 times
Includes or requires: 1 file
 view_func.php

Defines 19 functions

  load_gd()
  get_dirs()
  get_all_gid_dirs()
  login_form()
  print_admin_taskbar()
  print_gallery_form()
  create_thumb()
  create_all_thumbs()
  get_all_image_filenames()
  create_phid_filenames_file()
  create_info_file()
  get_gid_counter()
  gid_dir_being_used()
  add_to_gid_dirs()
  print_modify_gid()
  print_delete_gallery_form()
  get_images_without_thumb()
  new_index_file()
  rotate_image()

Functions
Functions that are not part of a class:

load_gd($debug=false)   X-Ref
load_gd tries to load gd library in case it is not automatically loaded.
Then checks the availability of some functions included in this library.

Note: this function does not check if gd library is 2 or higher.

param: bool $debug if true shows some debug messages. Used in installation.
return: bool true if library loaded, false if not.

get_dirs($dirname, &$dir)   X-Ref
No description

get_all_gid_dirs()   X-Ref
Gets all dirs of a directory
except '.','..' and the ones that begin with 'yapig_data'

return: array with the dirs or false if any problem

login_form()   X-Ref
Prints admin login form. Uses login_form.

return: none

print_admin_taskbar()   X-Ref
Admin task bar contains all possible task the YaPiG admin can do.
This function prints this task bar. Uses admin_task_bar.php


print_gallery_form($D_ACTION, $gallery_info=array()   X-Ref
No description

create_thumb($path_dest,$path_origen)   X-Ref
Creates a thumbnail image from a jpeg file.

It takes as arguments the paths to the source image and the path/name of
the destination image. Uses the global variables to set the destination
image size.

returns: bool false if there was any problem :)
param: string $path_dest Destination Path + name of output file
param: string $path_origen Source image path. Includes de name of the image

create_all_thumbs($dest_dir,$src_dir,$array_filenames)   X-Ref
This function creates all thumbnails

files are stored in src_dir and will be stored in dest_dir prefixing $THUMB_PREFIX
to de image name.

param: string $dest_dir  Path to destination dir
param: string $src_dir   Path to source dir
param: array $array_filenames  Contains the names of the source images (ex: file.jpg)
return: bool

get_all_image_filenames($dir)   X-Ref
Gets all image filenames of the dir

This function scans all filenames that are in a directory and
returns the names of the image files that are cotained in.

param: string $dir path of the dir.
return: array With the image filenames that the directory contains.

create_phid_filenames_file($gid_dir,$filenames)   X-Ref
creates phid filenames correspondence file with this line format:
phid $EQUAL filename\n

This is just an alias of create_data_file

param: string $gid_dir directory where images are stored (with $BASE_DIR)
param: array $filenames array with this format: array[phid]=filename.
return: bool true if ok, false if not.

create_info_file($gallery_path,$new,$update=true)   X-Ref
Creates file which contains information about the gallery.Called
$GID_INFO_FILE which is a php file that contains

$new array has these keys:

- root_gid: not used
- title: gallery title
- author: author of the gallery.
- gallery_password: password of the gallery.
- thumb_phid : thumbnail phid.
- no_comments: do not allow, comments (1|0)
- num_images : number of images
- num_subgids: number of sub galleries. Not used
- date: date of creation
- desc: lines describing the contents of the gallery.

if file does not exist => all keys need to be set.
param: string $gallery_path path to gallery, includes $BASE_DIR
param: array $new array with gallery information
return: bool true if ok, false if error :D

get_gid_counter()   X-Ref
Gets the value of the gid counter and increases it one unit.

return: integer valid gallery identificator., that is,one not being used.

gid_dir_being_used($dir)   X-Ref
Checks if dir is being used by other gallery.

Searchs in $GID_DIR file if $dir is being used by another
gallery.

param: string $dir to check. Ended in '/'. Without $BASE_DIR
return: bool true if dir is being used. false if not.

add_to_gid_dirs($dir)   X-Ref
Adds $dir to file $GID_DIRS, which contains gid->dir correspondence

param: string $dir dir name without $BASE_DIR
return: bool true if ok, false if error.

print_modify_gid($gid_dir,$gid,$gallery_bar=false)   X-Ref
shows modify gid options (links)

param: string $gid_dir gallery directory with $BASE_DIR
param: integer $gid gallery identificator
param: bool $gallery_bar if true then prints prev and next gallery bar.
return: bool true if ok false if not.

print_delete_gallery_form($D_GID)   X-Ref
Shows form when admin wants to delete a gallery.

Uses 'delete_gallery_form.php'

param: integer $D_GID gallery identificator

get_images_without_thumb($gid_dir,$all_list)   X-Ref
Obtains the images from a list that do not have a thumbnail already
created

param: array $all_list list with filenames
param: string $gid_dir is the directory where images are stored
return: mixed false if problem. array with images without thumb if ok.

new_index_file($dir_path, $refresh_url='../', $filename='index.html')   X-Ref
Creates a new file with the contents of $TEMPLATE_DIR . index_file.php
(default template content of this file is a meta refresh).
User should include a refresh url where this file will point.

Default output filename is index.html.

param: string $dir_path Path where filename will be created
param: string $refresh_url URL where filename will be redirected.
param: string $filename Output filename.
return: boolean True if success.

rotate_image($imagePath, $rtt=90)   X-Ref
rotates an image. Got from PHP.net

param: string $imagePath - path to image; rotated image overwriting the
param: int $rtt MUST be 90 or -90 - cw/ccw



[ Powered by PHPXref - Served by Debian GNU/Linux ]