From: Peter Sch?bl <sc...@us...> - 2002-01-01 14:31:33
|
Update of /cvsroot/pn-modules/PN_Image_Gallery/html/modules/PN_Image_Gallery In directory usw-pr-cvs1:/tmp/cvs-serv20914/html/modules/PN_Image_Gallery Modified Files: gal_classes.php index.php Log Message: rogue updates Index: gal_classes.php =================================================================== RCS file: /cvsroot/pn-modules/PN_Image_Gallery/html/modules/PN_Image_Gallery/gal_classes.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gal_classes.php 2001/11/24 15:55:30 1.2 --- gal_classes.php 2002/01/01 14:31:27 1.3 *************** *** 118,122 **** function readDbInfo() { ! global $pntable; $sql = "select img_id from ". $pntable['gal_images'] ." where img_name = '$this->name'"; --- 118,122 ---- function readDbInfo() { ! global $pntable, $dbconn; $sql = "select img_id from ". $pntable['gal_images'] ." where img_name = '$this->name'"; *************** *** 126,132 **** } //print $sql . "<br>"; ! $result = mysql_query($sql) or die(mysql_error()) ; ! if (list($img_id) = mysql_fetch_row($result)) { $desc = getDescription($img_id, "img"); $this->id = $img_id; --- 126,136 ---- } //print $sql . "<br>"; ! //$result = mysql_query($sql) or die(mysql_error()) ; ! $result = $dbconn->Execute($sql) or die($dbconn->ErrorNo() . ": ". $dbconn->ErrorMsg() . ":$sql"); ! //if (list($img_id) = mysql_fetch_row($result)) ! //if (list($img_id) = mysql_fetch_row($result)) ! if (!$result->EOF) { + list($img_id) = $result->fields; $desc = getDescription($img_id, "img"); $this->id = $img_id; *************** *** 146,150 **** return $this->title; } ! return $this->name; } --- 150,156 ---- return $this->title; } ! $name = $this->name; ! // \todo remove .jpg at end of name ! return $name; } *************** *** 232,236 **** function Gallery($id) { ! global $ig_config, $pntable; $this->id = $id; --- 238,242 ---- function Gallery($id) { ! global $ig_config, $pntable, $dbconn; $this->id = $id; *************** *** 239,245 **** $sql = "select gal_image, gal_image_dir, gal_image_dir_full, gal_image_cols"; $sql .= " from " . $pntable['gal_galleries'] . " where gal_id = $id"; ! $result = mysql_query($sql) or die (mysql_error()); ! //list($this->image, $this->image_dir, $this->image_dir_full, $this->image_filter, $this->image_cols) = mysql_fetch_row($result); ! list($this->image, $this->image_dir, $this->image_dir_full, $this->image_cols) = mysql_fetch_row($result); $errors = $this->validate(); if (! $this->is_useable) --- 245,253 ---- $sql = "select gal_image, gal_image_dir, gal_image_dir_full, gal_image_cols"; $sql .= " from " . $pntable['gal_galleries'] . " where gal_id = $id"; ! //$result = mysql_query($sql) or die (mysql_error()); ! $result = $dbconn->Execute($sql) or die($dbconn->ErrorNo() . ": ". $dbconn->ErrorMsg() . ":$sql"); ! ! //list($this->image, $this->image_dir, $this->image_dir_full, $this->image_cols) = mysql_fetch_row($result); ! list($this->image, $this->image_dir, $this->image_dir_full, $this->image_cols) = $result->fields; $errors = $this->validate(); if (! $this->is_useable) *************** *** 383,387 **** function getDescription($key, $type) { ! global $ModName, $currentlang, $language, $lang, $ig_config, $pntable; $langarray = array_unique(array($currentlang, $language, $lang, "eng")); // read description for object --- 391,395 ---- function getDescription($key, $type) { ! global $ModName, $currentlang, $language, $lang, $ig_config, $pntable, $dbconn; $langarray = array_unique(array($currentlang, $language, $lang, "eng")); // read description for object *************** *** 390,394 **** $sql_desc .= " and des_lang in ('" . implode("', '", $langarray) . "')"; // print $sql_desc; ! $desc_result = mysql_query($sql_desc) or die(mysql_error()); // <chg date="27.10.2001" author="schup" msg="default to blank -> img can choose FileName as default"> ///$desc_title = _IG_GALNOTITLE; --- 398,403 ---- $sql_desc .= " and des_lang in ('" . implode("', '", $langarray) . "')"; // print $sql_desc; ! //$desc_result = mysql_query($sql_desc) or die(mysql_error()); ! $desc_result = $dbconn->Execute($sql_desc) or die($dbconn->ErrorNo() . ": ". $dbconn->ErrorMsg() . ":$sql_desc"); // <chg date="27.10.2001" author="schup" msg="default to blank -> img can choose FileName as default"> ///$desc_title = _IG_GALNOTITLE; *************** *** 397,402 **** $desc_text = ""; ! while (list($desc_lang, $desc_title_temp, $desc_text_temp) = mysql_fetch_row($desc_result)) { if ($desc_lang == $currentlang) { --- 406,413 ---- $desc_text = ""; ! //while (list($desc_lang, $desc_title_temp, $desc_text_temp) = mysql_fetch_row($desc_result)) ! while (list($desc_lang, $desc_title_temp, $desc_text_temp) = $desc_result->fields) { + $desc_result->MoveNext(); if ($desc_lang == $currentlang) { *************** *** 420,424 **** } ! mysql_free_result($desc_result); return array($desc_title, $desc_text); } --- 431,435 ---- } ! //mysql_free_result($desc_result); return array($desc_title, $desc_text); } Index: index.php =================================================================== RCS file: /cvsroot/pn-modules/PN_Image_Gallery/html/modules/PN_Image_Gallery/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 2001/11/24 15:55:30 1.2 --- index.php 2002/01/01 14:31:27 1.3 *************** *** 187,191 **** if (isset($ig_images)) { ! ksort($ig_images); //print "Imagecount $count<br>"; --- 187,191 ---- if (isset($ig_images)) { ! asort($ig_images); //print "Imagecount $count<br>"; *************** *** 278,282 **** function showSingleImage($image_name, $gal_id) { ! global $ModName, $currentlang, $language, $lang, $ig_config, $ig_images, $pntable, $admin; include ('header.php'); $isAdmin = is_admin($admin); --- 278,282 ---- function showSingleImage($image_name, $gal_id) { ! global $ModName, $currentlang, $language, $lang, $ig_config, $ig_images, $pntable, $admin, $dbconn; include ('header.php'); $isAdmin = is_admin($admin); *************** *** 312,318 **** $sql .= " where img_name='$image->name' and img_gal_id='$image->gal_id'"; //print "[$sql]\n"; ! $result = mysql_query($sql) or die(mysql_error()) ; ! list($img_date, $img_artist, $img_location) = mysql_fetch_row($result); //print '<center><font class="pn-title">' . printSelfLink("&mop=gallery&gal_id=$gal_id"); --- 312,320 ---- $sql .= " where img_name='$image->name' and img_gal_id='$image->gal_id'"; //print "[$sql]\n"; ! //$result = mysql_query($sql) or die(mysql_error()) ; ! $result = $dbconn->Execute($sql) or die($dbconn->ErrorNo() . ": ". $dbconn->ErrorMsg() . ":$sql"); ! //list($img_date, $img_artist, $img_location) = mysql_fetch_row($result); ! list($img_date, $img_artist, $img_location) = $result->fields; //print '<center><font class="pn-title">' . printSelfLink("&mop=gallery&gal_id=$gal_id"); *************** *** 359,363 **** if (strlen($img_date) > 0) { ! print "<tr><td align=\"right\">" . _IG_IMG_DATE . ":</td><td> <b>$img_date</b></td></tr>\n"; } if (strlen($img_location) > 0) --- 361,373 ---- if (strlen($img_date) > 0) { ! // <cr date="08.12.2001" msg="format Date and ignore Date = 0000-00-00"> ! $parts = explode("-", $img_date); // date from DB: YYYY-MM-DD ! $timestamp = gmmktime(0, 0, 0, $parts[1], $parts[2], $parts[0]); ! $img_date = strftime(_DATEBRIEF, $timestamp); ! // </cr> ! if (strlen($img_date > 0)) ! { ! print "<tr><td align=\"right\">" . _IG_IMG_DATE . ":</td><td> <b>$img_date</b></td></tr>\n"; ! } } if (strlen($img_location) > 0) *************** *** 440,443 **** --- 450,454 ---- { global $ModName, $currentlang, $language, $lang, $ig_config, $ig_images, $pntable, $admin; + global $dbconn; //printDebugInfo(); *************** *** 454,465 **** //$sql = "select gal_id, gal_image, gal_image_dir, gal_image_dir_full from nuke_eur_gallery"; $sql = "select gal_id from " . $pntable['gal_galleries']; ! $result = mysql_query($sql) or die(mysql_error()) ; $count = 1; print "<table width=\"100%\" border=\"$dborder\">\n"; print " <tr>\n"; ! //while (list($gal_id, $gal_image, $gal_image_dir, $gal_image_dir_full) = mysql_fetch_row($result)) ! while (list($gal_id) = mysql_fetch_row($result)) { $gal = new Gallery($gal_id); if ($gal->is_useable) --- 465,478 ---- //$sql = "select gal_id, gal_image, gal_image_dir, gal_image_dir_full from nuke_eur_gallery"; $sql = "select gal_id from " . $pntable['gal_galleries']; ! //$result = mysql_query($sql) or die(mysql_error()) ; ! $result = $dbconn->Execute($sql) or die($sql); $count = 1; print "<table width=\"100%\" border=\"$dborder\">\n"; print " <tr>\n"; ! //while (list($gal_id) = mysql_fetch_row($result)) ! while (list($gal_id) = $result->fields) { + $result->MoveNext(); $gal = new Gallery($gal_id); if ($gal->is_useable) |