source: extensions/ContestResults/include/functions.php @ 9200

Last change on this file since 9200 was 9200, checked in by mistic100, 13 years ago

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
File size: 699 bytes
RevLine 
[6768]1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
[6782]4// Racourcis un texte et ajoute une ellipse
[9200]5function CR_cut_string($string, $limit) {
[6782]6        include_once(CR_PATH . 'include/cutstring.class.php');
[9200]7        if (strlen(str_replace("\r\n", "\n", strip_tags($string))) > $limit) {
[6782]8                $output = new HtmlCutString($string, $limit);
9                return ($output->cut()).'...';
[9200]10        } else {
[6782]11                return $string;
[6768]12        }
13}
14
[6782]15// Recupère le nom d'un coucours à partir de l'id
[9200]16function get_contest_name($id) {
17        $contest = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $id . ";");
18        if (pwg_db_num_rows($contest)) {
19                $contest = pwg_db_fetch_assoc($contest);
20                return $contest['name'];
21        } else {
[6782]22                return null;
[6768]23        }
24}
25?>
Note: See TracBrowser for help on using the repository browser.