[svn r19385] minor - logic style changes - changed word mysql by equivalent in class Database - (partial FS#3909)

skala
Isaac Flores 17 years ago
parent 13ad28f3a6
commit 47cf7d4a10
  1. 6
      main/document/document.php
  2. 4
      main/document/downloadfolder.inc.php
  3. 8
      main/document/slideshow.php
  4. 6
      main/document/upload.php

@ -1,4 +1,4 @@
<?php // $Id: document.php 19016 2009-03-12 21:43:04Z herodoto $
<?php // $Id: document.php 19385 2009-03-27 20:48:57Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
@ -85,7 +85,7 @@ if(isset($_GET['id_session']))
$table_course_tool = Database::get_course_table(TABLE_TOOL_LIST, $_course['dbName']);
$tool_sql = 'SELECT visibility FROM ' . $table_course_tool . ' WHERE name = "'. TOOL_DOCUMENT .'" LIMIT 1';
$tool_result = api_sql_query($tool_sql,__FILE__,__LINE__);
$tool_row = mysql_fetch_array($tool_result);
$tool_row = Database::fetch_array($tool_result);
$tool_visibility = $tool_row['visibility'];
if ($tool_visibility == '0' && $to_group_id == '0' && !($is_allowed_to_edit || $group_member_with_upload_rights))
{
@ -288,7 +288,7 @@ $image_files_only='';
-----------------------------------------------------------
*/
$interbreadcrumb[]= array ('url'=>'#', 'name'=> get_lang('Document'));
$interbreadcrumb[]= array ('url'=>'', 'name'=> get_lang('Document'));
//------interbreadcrumb for the current directory root path

@ -1,4 +1,4 @@
<?php // $Id: downloadfolder.inc.php 10195 2006-11-25 15:26:00Z pcool $
<?php // $Id: downloadfolder.inc.php 19385 2009-03-27 20:48:57Z iflorespaz $
/**
==============================================================================
* Functions and main code for the download folder feature
@ -115,7 +115,7 @@ else
//2nd: get all folders that are invisible in the given path
$query2 = api_sql_query("SELECT path FROM $doc_table AS docs,$prop_table AS props WHERE `props`.`tool`='".TOOL_DOCUMENT."' AND `docs`.`id`=`props`.`ref` AND `docs`.`path` LIKE '".$querypath."/%' AND `props`.`visibility`<>'1' AND `docs`.`filetype`='folder'",__FILE__,__LINE__);
//if we get invisible folders, we have to filter out these results from all visible files we found
if(mysql_num_rows($query2)>0)
if(Database::num_rows($query2)>0)
{
//add tem to an array
while($invisible_folders = mysql_fetch_assoc($query2))

@ -1,4 +1,4 @@
<?php // $Id: slideshow.php 18899 2009-03-09 21:37:00Z herodoto $
<?php // $Id: slideshow.php 19385 2009-03-27 20:48:57Z iflorespaz $
/*
==============================================================================
@ -39,7 +39,7 @@ http://icto.UGent.be
*/
/*
==============================================================================
Improve by Juan Carlos Raña Trabado
Improve by Juan Carlos Ra<EFBFBD>a Trabado
herodoto@telefonica.net
January 2008
==============================================================================
@ -242,7 +242,7 @@ if ($slide_id !== "all")
{
$height_width_tags = 'width="'.$image_width.'" height="'.$image_height.'"';
//adjust proportions. Juan Carlos Raña Trabado TODO: replace resize_image function ?
//adjust proportions. Juan Carlos Ra<EFBFBD>a Trabado TODO: replace resize_image function ?
$size = @ getimagesize($image);
$height_width_tags = (($size[1] > $image_width) ? 'width="'.$image_width.'"' : '');
$height_width_tags = (($size[1] > $image_height) ? 'height="'.$image_height.'"' : '');
@ -262,7 +262,7 @@ if ($slide_id !== "all")
}
$sql = "SELECT * FROM $tbl_documents WHERE path='".$pathpart.$image_files_only[$slide]."'";
$result = api_sql_query($sql,__FILE__,__LINE__);
$row = mysql_fetch_array($result);
$row = Database::fetch_array($result);
echo '<table align="center" border="0">';
echo '<tr>';

@ -1,4 +1,4 @@
<?php // $Id: upload.php 19254 2009-03-24 22:18:53Z cvargas1 $
<?php // $Id: upload.php 19385 2009-03-27 20:48:57Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
@ -313,8 +313,8 @@ if(isset($_FILES['user_upload']))
if ( (api_get_setting('search_enabled')=='true') && ($docid = DocumentManager::get_document_id($_course, $new_path))) {
$table_document = Database::get_course_table(TABLE_DOCUMENT);
$result = api_sql_query("SELECT * FROM $table_document WHERE id = '$docid' LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($result) == 1) {
$row = mysql_fetch_array($result);
if (Database::num_rows($result) == 1) {
$row = Database::fetch_array($result);
$doc_path = api_get_path(SYS_COURSE_PATH) . $courseDir. $row['path'];
//TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
// now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while

Loading…
Cancel
Save