Hi
I've installed the Gallery Mod in a subdirectory of www using a clean install of:-
phpwcms v1.2.6-DEV 19.11.2005
Using:-
PHP 5.05
MySQL 5.0.15
But I always get this error on the module page after clicking on Gallery Mod:-
0){ foreach ($admins as $line){ if ($line['hash']==md5($_REQUEST['mghash'])) $logged=true; } } return $logged; } function clearoldadmins($logfile, $now, $adminexpire) { include($logfile); if (count($admins)>0){ $i=0; $fp=fopen($logfile, "w"); fputs($fp, "data[$i]['id']=substr($file, 0, strpos($file, ".")); $pictures->data[$i]['pic']=$pathtoscript."images/$gal/$file"; if ($thumbnails) $pictures->data[$i]['thumb']=$pathtoscript."images/$gal/thumb_$file"; $i++; } } } if ($i>0){ $pictures->sortkeys = array(array('id','ASC')); $pictures->sort(); return $pictures->data; }else return false; } function getpictures($gal, $imgdir, $pathtoscript, $thumbnails){ $row_pict_dir=getVariable(); $dir="$imgdir$gal"; $dp=opendir($dir); $pictures= new mdasort; $i=0; while ($file=readdir($dp)){ if ($file!="." && $file!=".."){ if (strpos($file, "thumb")===false && $file!="captions.dat"){ $pictures->data[$i]['id']=substr($file, 0, strpos($file, ".")); $pictures->data[$i]['pic']=$pathtoscript.$mygaldir."$gal/$file"; if ($thumbnails) $pictures->data[$i]['thumb']=$pathtoscript.$row_pict_dir['imagedir']."$gal/thumb_$file"; $i++; } } } if ($i>0){ $pictures->sortkeys = array(array('id','ASC')); $pictures->sort(); return $pictures->data; }else return false; } function getcaps($gal, $imgdir){ $caps=false; $cappath=$imgdir.$gal."/captions.dat"; if (file_exists($cappath)){ $stuff=file($cappath); foreach ($stuff as $line){ $cap=explode("|", rtrim($line)); $caps[$cap[0]]=$cap[1]; } } return $caps; } function getcaption($gal){ $query="SELECT picture, caption FROM " . $GLOBALS['tables']['gal_caption'] . " WHERE Album = '$gal'"; $result = mysql_query($query) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $query); while ($row=mysql_fetch_array($result)){ $caps[$row['picture']]=$row['caption']; } return $caps; } function nltobr($str){ return str_replace(array("\n", "\r"), array("
", ""), $str); } function brtonl($str){ return str_replace("
", "\n", $str); } function isBiggerWidth($path, $size){ if ($size!==false){ $foo=getimagesize($path); if ($foo[0]>$size) return true; else return false; }else return false; } function getTemplate($tpl, $html){ $match="/<\!\-\-$tpl\-\->(.*?)<\!\-\-$tpl\-\->/s"; preg_match($match, $html, $tmp); return $tmp[1]; } function paging( $pages, $pagevar="page", $ppv=10, $first ="««« ", $firsts ="««« ", $prev ="«« ", $prevs ="«« ", $num ="{page}", $nums ="{page}", $sep =" | ", $more ="[...]", $next =" »»", $nexts =" »»", $last =" »»»", $lasts =" »»»"){ // get URI parameters $getvars=$_SERVER['PHP_SELF']."?"; foreach ($_GET as $key => $val){ if ($key!=$pagevar) $getvars.="$key=$val&"; } $page=(is_numeric($_GET[$pagevar])) ? $_GET[$pagevar] : 1; $page=($page>$pages) ? $pages : $page; $prevpage=($page>1) ? $page-1 : 1; $nextpage=($page < $pages) ? $page+1 : $pages; $paging=""; if ($pages>1){ // first $paging.=($page>1) ? str_replace("{url}", "$getvars$pagevar=1", $first) : $firsts; // prev $paging.=($page>1) ? str_replace("{url}", "$getvars$pagevar=$prevpage", $prev) : $prevs; // pages $ppvrange=ceil($page/$ppv); $start=($ppvrange-1)*$ppv; $end=($ppvrange-1)*$ppv+$ppv; $end=($end>$pages) ? $pages : $end; $paging.=($start>1) ? str_replace("{url}", "$getvars$pagevar=".($start-1), $more).$sep : ""; for ($i=1; $i<=$pages; $i++){ if ($i>$start && $i<= $end){ $paging.=($page==$i) ? str_replace("{page}", $i, $nums).(($i<$end) ? $sep : "") : str_replace(array("{url}", "{page}"), array("$getvars$pagevar=$i", $i), $num).(($i<$end) ? $sep : ""); } } $paging.=($end<$pages) ? $sep.str_replace("{url}", "$getvars$pagevar=".($end+1), $more) : "" ; // next $paging.=($page<$pages) ? str_replace("{url}", "$getvars$pagevar=$nextpage", $next) : $nexts; // last $paging.=($page<$pages) ? str_replace("{url}", "$getvars$pagevar=$pages", $last) : $lasts; } return $paging; } function getIndex(){ $sql = "SELECT id FROM " . $GLOBALS['tables']['gal_albums'] . " as albums order by id desc"; $result = mysql_query($sql) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $sql); $index=mysql_fetch_assoc($result); return $index['id']; } function getAlbum($album){ $sql = "SELECT * FROM " . $GLOBALS['tables']['gal_albums'] . " as albums where id='".$album."'"; $result = mysql_query($sql) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $sql); $index=mysql_fetch_array($result); return $index; } function getPictureCount ($album){ $sql = "SELECT pic_count FROM " . $GLOBALS['tables']['gal_albums'] . " as albums where id=$album"; $result = mysql_query($sql) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $sql); $index=mysql_fetch_assoc($result); if ($index) return $index['pic_count']; else return 0; } function upload_image($originalsize, $jpgquality, $thumbhv, $thumbsize, $counter, $filepath, $album){ $filepath.=$album; if (copy($_FILES['mgfile']['tmp_name'], "$filepath/$counter.jpg")){ $query = "INSERT INTO " . $GLOBALS['tables']['gal_caption'] . " (Album,picture) VALUES ('$album','$counter')"; $result = mysql_query($query) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $query); chmod("$filepath/$counter.jpg", 0777); if (isBiggerWidth("$filepath/$counter.jpg", $originalsize)) mkthumbnail("$filepath/$counter.jpg", "$filepath/$counter.jpg", "w", $originalsize, $jpgquality); if (true) //create thumbnails mkthumbnail("$filepath/$counter.jpg", "$filepath/thumb_$counter.jpg", $thumbhv, $thumbsize, $jpgquality); $query = "UPDATE " . $GLOBALS['tables']['gal_albums'] . " SET pic_count = '$counter' where id='$album.'"; $result = mysql_query($query) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $query); $check=true; } else $check=false; return $check; } function getVariable(){ $query="SELECT * FROM " . $GLOBALS['tables']['gal_config']; $result = mysql_query($query) or die("Error: ".mysql_errno().": ".mysql_error()."
--------------------------------------------------------------------------------
" . $query); $row = mysql_fetch_array($result); return $row; } function htmldecode($encoded) { return strtr($encoded,array_flip(get_html_translation_table(HTML_ENTITIES))); } ?>
Once installed I was able to create the tables in the database:-
phpwcms_gal_albums
phpwcms_gal_caption
phpwcms_gal_config
Using the setup process. But I still get the error above the mod control.
Do you know what could be wrong? I really want to get this to work, as it perfect for a site I have coming up.
Thanks and best - mac[/code]