当前位置:编程学习 > html/css >>

dfgallery 2.0 安装配置

最近几天一直郁闷dfgallery2.0的配置,原打算用作图片展示程序,1.0用过没问题,放在opencms上运行很给力。由于图片展示电脑很多情况下是单机运行,考虑采用独立平台的2.0.但是一直没配置成功。

今天大神来了,一切都改变了。原来老外的程序也有bug(毕竟BUG这个词是他们发明的),现在把问题表述一下,并且给使用dfgallery2.0的网友提供方便。

1、程序配置成功后不能放在httpd的根目录,需要配置虚拟目录或者放到子目录里边。然后修改.htaccess

原来配置:

[html] 
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$"> 
  Order allow,deny 
</FilesMatch> 
 
Options -Indexes 
Options +FollowSymLinks 
 
ErrorDocument 404 /index.php 
DirectoryIndex index.php 
 
<IfModule mod_rewrite.c> 
  RewriteEngine on 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

修改配置:
[html] 
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$"> 
  Order allow,deny 
</FilesMatch> 
 
Options -Indexes 
Options +FollowSymLinks 
 
ErrorDocument 404 /index.php 
DirectoryIndex index.php 
 
<IfModule mod_rewrite.c> 
  RewriteEngine on 
  RewriteBase /gallery 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 
增加配置:RewriteBase /gallery   #重写到子目录

2、程序默认不支持中文目录和中文文件名

经过大神检查后发现程序编码为utf-8,但是新建数据库的编码居然为欧洲编码(¥#%……%¥)

通过这个脚本新建后,问题解决


[sql] 
DROP TABLE IF EXISTS `content`; 
/*!40101 SET @saved_cs_client     = @@character_set_client */; 
/*!40101 SET character_set_client = utf8 */; 
CREATE TABLE `content` ( 
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
  `uid` int(10) unsigned NOT NULL, 
  `pid` int(10) unsigned DEFAULT NULL, 
  `type` varchar(32) NOT NULL, 
  `title` varchar(128) NOT NULL, 
  PRIMARY KEY (`id`), 
  KEY `FK__pid_id` (`pid`), 
  KEY `FK__uid_uid` (`uid`), 
  CONSTRAINT `FK__pid_id` FOREIGN KEY (`pid`) REFERENCES `content` (`id`) ON DELETE CASCADE, 
  CONSTRAINT `FK__uid_uid` FOREIGN KEY (`uid`) REFERENCES `users` (`id`) ON DELETE CASCADE 
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 
/*!40101 SET character_set_client = @saved_cs_client */; 
 
-- 
-- Dumping data for table `content` 
-- 
 
LOCK TABLES `content` WRITE; 
/*!40000 ALTER TABLE `content` DISABLE KEYS */; 
INSERT INTO `content` VALUES (1,1,NULL,'gallery','aaaaa'),(2,1,1,'album','aaaaa'),(3,1,1,'album','aaaaa'); 
/*!40000 ALTER TABLE `content` ENABLE KEYS */; 
UNLOCK TABLES; 
 
-- 
-- Table structure for table `contentprop` 
-- 
 
DROP TABLE IF EXISTS `contentprop`; 
/*!40101 SET @saved_cs_client     = @@character_set_client */; 
/*!40101 SET character_set_client = utf8 */; 
CREATE TABLE `contentprop` ( 
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
  `cid` int(10) unsigned NOT NULL, 
  `name` varchar(100) NOT NULL, 
  `value` longtext, 
  PRIMARY KEY (`id`), 
  KEY `FK__cid_id` (`cid`), 
  CONSTRAINT `FK__cid_id` FOREIGN KEY (`cid`) REFERENCES `content` (`id`) ON DELETE CASCADE 
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 
/*!40101 SET character_set_client = @saved_cs_client */; 
 
-- 
-- Dumping data for table `contentprop` 
-- 
 
LOCK TABLES `contentprop` WRITE; 
/*!40000 ALTER TABLE `contentprop` DISABLE KEYS */; 
INSERT INTO `contentprop` VALUES (1,1,'theme','standard'),(2,1,'skin','standard.png'),(3,2,'album_type','flickr'),(4,3,'album_type','custom'); 
/*!40000 ALTER TABLE `contentprop` ENABLE KEYS */; 
UNLOCK TABLES; 
 
-- 
-- Table structure for table `systemprop` 
-- 
 
DROP TABLE IF EXISTS `systemprop`; 
/*!40101 SET @saved_cs_client     = @@character_set_client */; 
/*!40101 SET character_set_client = utf8 */; 
CREATE TABLE `systemprop` ( 
  `name` varchar(100) NOT NULL, 
  `value` longtext,  www.zzzyk.com
  PRIMARY KEY (`name`) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8; 
/*!40101 SET character_set_client = @saved_cs_client */; 
 
-- 
-- Dumping data for table `systemprop` 
-- 
 
LOCK TABLES `systemprop` WRITE; 
/*!40000 ALTER TABLE `systemprop` DISABLE KEYS */; 
INSERT INTO `systemprop` VALUES ('flickr_api_key','dc123ae6ab78886c452b7ad44ec171c6'); 
/*!40000 ALTER TABLE `systemprop` ENABLE KEYS */; 
UNLOCK TABLES; 


作者:xuaa
补充:web前端 , HTML 5 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,