译者注:wordpress是最受欢迎的博客发布平台之一,具有免费,高度可定制、容易安装和使用等特色。由于wordpress是如此流行和受欢迎,你可以找到大量的wordpress开发以及管理等方面的资源,丰富的用户指南让你能够快速的上手使用。参考资料:
有很多天才设计师选择发表免费的主题。大多数时候,对于他们来说唯一的一点小要求就是保留他们的设计元素,并链接到他们的网站(非常合理的要求)。
在本文中,我们整理了50个优秀的、高质量的、给大家。这些主题包含了制作精细且华丽的主题,也有简洁清爽的主题,你可以找到适合你的设计品位的wordpress主题。
说明: 请务必检查主题的许可协议,不要违反使用限制(如果有的话),并且保留设计师的设计属性[footer中的设计信息],即使设计师没有要求你这么做。[注:设 计一个漂亮的wordpress theme,需要花费设计师很多的时间和精力,如果你喜欢这些免费的wordpress主题,请尊重设计师的劳动成果。]
译者注:在本文中介绍的wordpress主题均为英文模板,对于使用英文写博客的朋友来说,这里还有我收集的3个英文写作软件可以参考,都有免费试用版本可供下载:1、 - 最适合esl使用的英文写作和语法纠错软件,支持mac os。2、 - 最适合公司,组织,作家使用的plain english写作软件。3、 - 英文拼写和语法检查软件,和whitesmoke差不多,但更为专业的英文写作工具。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drupal 实在是一个很强大的网络操作系统,它内建的多站点安装机制非常强大,但也比较复杂,下面我来总结一下本站(robinlord.org)的多站点安装方案。
很多朋友购买的虚拟主机对数据库或者空间或者可以绑定的域名或者能够设置的子域名限制非常厉害,但是使用 drupal 这一切将不再是问题。drupal 可以使用一个数据库来安装多个站点,这个只要在安装过程中设定数据表前缀即可。
我来分析下本站(robinlord.org)的结构。本站目前共使用同一套 drupal 代码搭建了三个独立的站点:blogs.robinlord.org、drupal.robinlord.org、 drupal.robinlord.org/hanhua。是的,没错,最后那个是独立的站点,不是一个路径,这个是利用 drupal 的子目录来做独立站点的,本文的关键也就在这一切的实现。
本站是采用泛域名解析 .htacess的方案来实现的。
首先需要了解什么是泛域名解析,然后把所有的 *.roginlord.org 解析到站点的 web 根目录(public_html),接着在根目录下建立 drupal 目录做为 drupal 的代码目录,接着在根目录下的 .htacess 添加 urlrewrite 规则,把对 drupal.robinlord.org 和 blogs.robinlord.org 的请求全部定向到 drupal 目录,其它的二级域名目录这样做。至于 drupal.robinlord.org/hanhua ,则是建立一个名为 hanhua 软链接到 drupal 目录(linux 主机,windows 主机再行研究)。比如 /public_html/hanhua 就是到 /public_html/drupal 的软链接,同时在给 drupal.robinlord.org 做url重写时避开对 hanhua 的重写,就实现了。
下面是站点的目录结构:
public_html/ --|
|-- drupal/ #[目录]这个是 drupal 的程序目录
|--hanhua/ #[目录]这个是到 drupal 的软链接
|--.htacess #[文件]这里配置目录的 url 重写规则
下面是根目录下 .htacess 的内容:
rewriteengine on
#重写二级域名的路径
rewritecond %{http_host} ^blogs".robinlord".org$
rewriterule ^(.*)$ drupal/$1 [l]
rewritecond %{http_host} ^drupal".robinlord".org$
#对于子目录独立站点的配置
rewritecond %{request_uri} !^hanhua
rewriterule ^(.*)$ drupal/$1 [l]
这样就实现了多个站点的访问,下面是多站点的安装及公用用户数据的设置。
首先,在安装之前手动建立好各个站点的配置文件,遵循多站点目录的命名规则。本站则建立了如下几个目录:
sites/--|
|-- blogs.robinlord.org
|-- drupal.robinlord.org
|-- drupal.robinlord.org.hanhua
在每个目录手动建立相应的 settings.php ,下面是 blogs.robinlord.org 的 settings.php 配置文件中需要手动设定的地方,其他配置在安装过程中会自动设置。
$db_url = 'mysql://username:password@localhost/databasename';
$db_prefix = array(
'default' => 'blogs_',
'users' => 'shared_',
'access' => 'shared_',
'authmap' => 'shared_',
'sessions' => 'shared_',
'profile_fields' => 'shared_',
'profile_values' => 'shared_',
'languages' => 'shared_',
'locales_source' => 'shared_',
'locales_target' => 'shared_',
);
$base_url = 'http://blogs.robinlord.org';
$cookie_domain = 'robinlord.org';
$db_url 是数据库配置。
$db_prefix 设定表前缀,default 设定站点默认的表前缀,其他的则是数据表的名称及其对应的前缀设定,一般都设为 'shared_'。
$base_url 设定站点根域名,这个必须根据具体情况设置,负责站点路径可能会出错。
$cookie_domain 这个就是多站点公用登陆的关键,设置为站点的根域,即可实现在多站点登陆一次即可。当然还需要公用 user 和 session 相关的表,这个前面已经配置好了。
设定好配置文件后,就可以开始安装进程。因为已经设定了数据库配置,所以安装程序会直接跳过这些设置的页面而直接开始安装。
安装好zen cart v1.2.1或更高版本,并且你在安装zen cart时没有选择集成phpbb。
2. 安装phpbb并保证能正常工作。为了容易配置,建议在根目录下安装phpbb,例如:http://mysite.com/forums或者http://mysite.com/phpbb
3. 编辑文件/includes/configure.php,在下面这行定义phpbb目录的路径:define(‘dir_ws_phpbb’, ‘/phpbb2/’);
路径必须是物理路径,如 /var/www/client/public_html/ 这样的格式。可以参照 dir_fs_catalog,然后加上phpbb 或 forum 或相应目录名。
必须以 / 结尾。
4. 在zen cart的管理页面,configuration->my store下,设置”enable phpbb linkage?” 为 true
设置完成后,新用户注册时,系统会让用户输入一个论坛的用户名.
看了一个网站关于zen-cart安装集成phpbb3的步骤和方法,基本都有些错误及不正确的地方,我了自己记录方便,我将步骤及方法介绍如下:
1 到 官方下载一个最新版,然后根据需要在,下载指定的语言,并把相应的目录language下.
2 在指定的zen-cart目录下建立一个forums或bbs的目录,将phpbb3代码放入目录中,找到指定的数据库用户名密码资料,就可以安装,安装过程中可选择指定的语言,当然安装后也可重新选择默认的语言.
3 由了phpbb3需要将zencart的一个类文件换掉,网上流传的代码有问题,我做了修正和补充./includes/classes/
4 在configure.php中的define(‘dir_ws_phpbb’, ‘/home/网站名/public_html/forums/’);设置完整的路径
5 在admin/基本设置 中 将 打开phpbb链接? 设置成true.
完成上述5个步骤,即可在用户注册时,将注册信息同时注入到phpbb3的数据库中
on the drupal end, you will need the services, the xml-rpc server, and the node service modules enabled (these are all bundled with ). in addition you will have to disable keys and sessid in services (site building > services > settings). also you have to allow anonymous access to services, and allow anonymous creation of story nodes (both in user management > permissions). so you really do not want to do this on any kind of production site.
the iphone calls the node.save method by posting the following xml:
the iphone app provides two ways to accomplish this. the first (commented out in the code) creates a http post request with the xml above as the body. this is not very useful since you have to provide the raw xml, but it shows how to execute an http post which is useful for many other things. the second uses xml-rpc functionality borrowed from the open-source (which itself is a version of the ). this makes it much easier to formulate and execute xml-rpc calls, and the whole thing boils down to this:
xmlrpcrequest *request =
[[xmlrpcrequest alloc] initwithhost:[nsurl urlwithstring:
@"http://192.168.1.14/drupal-6.6/services/xmlrpc"]];
nsmutabledictionary *postparams = [nsmutabledictionary dictionary];
[postparams setobject:@"story" forkey:@"type"];
[postparams setobject:titlestring forkey:@"title"]; // title input from iphone
[postparams setobject:bodystring forkey:@"body"]; // body input from iphone
[request setmethod:@"node.save" withobject:postparams];
xmlrpcresponse *nodesaveresponse = [xmlrpcconnection sendsynchronousxmlrpcrequest:request];
the full app below. developed with iphone sdk 2.2.
attachment | size |
---|---|
899.47 kb |
开启简洁链接(clean urls)
开启 path 模块 (从 drupal 4.3 开始进入 drupal 核心模块)
path 模块可以让您通过添加路径别名(path alias),来达到自定义链接名的效果。例如 可以定义为 。
开启 pathauto 模块 (http://drupal.org/project/pathauto)
pathauto 模块能够为不同类型的页面(nodes, categories, users)自动生成路经别名(path alias),而不在需要用户手动定义路径别名。
设置 pathauto 模块,在修改 node 的标题时,禁止 pathauto 模块二次修改路径别名。
开启 global redirect 模块(http://drupal.org/project/globalredirect)
global redirect 模块在页面拥有路径别名的情况下,移除该页面的原始路径,这样可以减少网站的重复内容页面,有利于 seo。
开启 meta tags (nodewords)模块(http://drupal.org/project/nodewords)
meta tags 模块可以让您为每个 node、user、view 或 panel 页面设置多种 meta tags,例如:keywords 和 description,有利于 seo。
开启 page title 模块(http://drupal.org/project/page_title)
page title 模块能让您自定义页面标题,有利于 seo。
使用 drupal xml sitemap 模块
调整 .htaccess 文件to redirect to "www" or remove the "www" subdomain.
调整您网站主题的 html headers -- 许多主题设置不正确。
调整您网站的 robots.txt 文件。在 drupal 6 中 drupal 默认的 robots.txt 文件还是有一些问题。
检查安装的第三方模块是否新增了一些重复的链接,如果有,使用在 robots.txt 添加规则对搜索引擎的爬虫进行屏蔽。
updated for drupal 5.1! see the bottom of the article.
i have a growing backlog of stories that i've been meaning to type up here, including several articles of interest for folks getting started with drupal, but i've just finished setting up , so i thought i'd share my experience while it's fresh on the mind.
you'll notice that you can now play the "two out of three" mp3 from direct from the site without the need to download, and this is thanks to the audio module. since it utilizes drupal's node model for content types, this module is able to harness much of the power and flexibility inherent in the cms, including the and automatic rss/podcast feed generation. it can also be readily extended through modules like for sites with sophisticated audio needs.
my intent here, though, is just to offer a quick step-by-step guide for a simpler application: a blog or some other site seeking to include audio files attached to other content types (pages and stories, for instance). still, this should be helpful for anyone getting started with the audio module.
> tar xzvf audio-4.7.0.tar.gz
> unzip getid3-1.7.7.zip -d
version 1.7.7 of getid3 is recommended in the audio module's documentation.
of course, if audio plays a more prominent role at your site, there's much more that you can do with the audio module, incorporating taxonomy, changing the look of the player, and so on. here are some links to get you started.
for the most part, updating my audio module for use as outlined above was intuitive, with one exception: the audio_attach module has just been contributed to cvs for 5.x by . he's also contributed a new audio_playlist module, but i haven't tried that out yet. to get audio_attach (and get my existing nodes with attached audio back to working order), i checked out the audio module from cvs with the following commands:
> cd
> cvs -z6 -d:pserver:anonymous::/cvs/drupal-contrib checkout -d audio contributions/modules/audio
i installed the modules as normal and ran update.php. at this point i received an sql error as the script attempted to set multiple primary keys for the audio_attach table. i manually set nid, aid and weight as primary keys using phpmyadmin, and i was back in business. i've found that my flash players are not visible when using , but that probably shouldn't effect many of your users.
i'll try to update all of these instructions soon. in the meantime, comment if you have questions!
first, from the linux command line, enable the rewrite module for apache with this command:
sudo a2enmod rewrite
you can check to see if this worked by running:
apache2ctl -m
and seeing if it is on the list.
next, use an editor (such as nano
) to edit the appropriate apache configuration file for your drupal site in the /etc/apache2/sites-available/
directory. for a single site, the file is /etc/apache2/sites-available/default
;
if you have multiple sites, the file names should reflect the names of
the sites to which they refer. thus, to edit the default site
configuration, use
sudo nano /etc/apache2/sites-available/default
look for the directory
section referring to the folder where your drupal site lives (in /etc/apache2/sites-available/default
, this is typically
), and change the line:
allowoverride none
to allowoverride all
(this directive permits an .htaccess file, such as drupal's, to be used to override apache's default settings, and is necessary to allow the url rewriting to work. see for more information).
save this file and then reload apache as follows:
sudo /etc/init.d/apache2 reload
instead of creating multiple virtual host files, you can create one virtual host file that uses a wildcard in the serveralias. both a simple multi-site drupal setup and multiple drupal versions can run this way, if the different subdomains are defined for each site in settings.php.
consider the following and modify your configuration file to fit your needs.
here is a partial listing of a virtual host configuration file that would support the last two lines in the above example. note this is not intended to be a complete configuration file, but rather provide guidance for your development setup.
documentroot "/www/dr6"
servername example
serveralias *.dr6.example
allowoverride all
edit & save your config file to suit your development needs. assuming the site is already enabled, then reload apache.
in apache version 2, httpd.conf has been deprecated and the new file is located at:
/etc/apache2/apache2.conf
.
thus, it's no longer necessary to do the following in httpd.conf to enable the rewrite module (mod_rewrite):
loadmodule rewrite_module modules/mod_rewrite.so
addmodule mod_rewrite.c
simply run the following from the linux command line:
sudo a2enmod rewrite
to disable the module you can run:
sudo a2dismod rewrite
(note that this would cause clean urls to break.)
once mod_rewrite is enabled, open apache2.conf in a text editor. note
that it will probably be read-only, so you will need sudo privileges to
edit it. use a command such as:
sudo nano /etc/apache2/apache2.conf
find where the sections are in your apache2.conf and add another one for your drupal site similar to this:
allowoverride all
after you edit apache2.conf as listed above, you need to restart the server by:
sudo /etc/init.d/apache2 reload
if you do not wish to allow .htaccess overrides, you can add the rewrite rules directly to a virtual host file or apache2.conf. the following should work:
rewriteengine on
rewritebase /
rewritecond %{request_filename} !-f
rewritecond %{request_filename} !-d
rewriterule ^(.*)$ index.php?q=$1 [l,qsa]
this can provide slightly faster server performance since apache will not look in every directory for an .htaccess file.
note that, for proper security, you will need to add in the rules from the drupal files directory's .htaccess file as well.
if you are having problems with getting your rewrite to work you can
set apache to log rewrite errors. to do that add this to the end of /etc/apache2/apache2.conf
:
rewritelog "/var/log/apache2/rewrite.log"
rewriteloglevel 3
level 0 does no logging. level 9 logs everything. choose the level necessary for resolving your issue.
security warning: make sure to either remove or comment the logging code out when finished, or else put the log file in a directory that can't be read by normal users (such as /var/log/apache2). if this is not done, it can result in a security breach. also, note that rewrite logging adds somewhat to server load, and can easily generate large amounts of output not needed on a production server.
now go to http://yoursite.com/?q=admin/settings/clean-urls
, and run the test for "clean urls" (in drupal 4.6 - 5.x this is buried in the paragraph explaining what "clean urls" are).
then, select the radio button to set clean urls to "enabled" and submit the form. you should now be able to access your site using urls without the query string in them.
go to . give your new view the name 'user_list', description 'a simple user listing.', tag 'users', type 'user' and click next.
you have been brought to the views user interface. as you start, you are editing the "default" options for the view. in the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. in the remaining columns, you will be able to add or change options by clicking on links or icons. these options will then appear below this main area. most likely, you will need to scroll to see the options appear. as you make changes, these options will appear in bold until you save your view.
at this point, you have done enough to create a valid view. if you scroll down, you will see a preview of your view. if it doesn't show already, click the preview button; but generally this display updates automatically whenever you finish working in one of the mini forms.
finally, click the save button to save your work. at the very top, click view "page" to go to your new view!
the best media file handle is embedded media field module
the problem: one needs to modify: zzz_custom_url.inc
to play mp3.
sample site:
another module is jquery media module
1. install modules
jquery media module
jq module
2. install player
flv (mp3) player:
download the player something like: mediaplayer-3-16.zip
you only need one file: mediaplayer.swf
copy that file to your drupal directory,
3. configure
admin/settings/jq
select "auto-invoke media class"
setting player
flve player:
mp3 player:
default settings
media width: 320
media height: 240
4. create a page use link (a class="media" href=)
example:
drupal默认的凯发k8网页登录首页像是一个博客的文章列表,如何定制成自己想要的样子呢?有以下几种方法来实现:
大多数人实现某个功能时首先想到的就是用模块(凯发k8网页登录首页模块),但个人并不认同动不动就使用模块,太多模块增加系统负担,下面的方法同样解决了定制凯发k8网页登录首页的问题而不必使用模块。
page-front.tpl.php是凯发k8网页登录首页的页面模板,把page.tpl.php复制并改名为page-front.tpl.php,修改里面的内容就可以定制凯发k8网页登录首页了。
如果只是更改凯发k8网页登录首页节点显示的样式,仅更改节点级别的模板即可。把node.tpl.php复制并改名为node-front_page.tpl.php,修改里面的节点显示样式。
新建一个page页面,加入html代码,然后选择full html,记住id号。导航到admin/settings/site-information,在最下面的“default front page”输入框中,现在默认为node,我们把它改为node/1(注1改为设为凯发k8网页登录首页的page页面的id号)。
在admin/build/block中逐个定义block的显示属性,把需要显示在凯发k8网页登录首页block的页面可见性(只在下列页面中显示)中填
入
$mission变量最大的特点就是只能显示在凯发k8网页登录首页,利用这个特性,我们就可以轻松定制凯发k8网页登录首页了。在admin/settings/site- information中定义mission任务(把凯发k8网页登录首页代码写进去),然后编辑page.tpl.php文件,把$mission移动到想要的位置,如 果文件中没有这个变量,加入以下代码即可:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
以上方法可以单独使用,也可以按需要结合起来使用。还有一种办法就是直接使用index.html静态页面,但这已经脱离了drupal,因此并不推荐。
声明:如蒙转载,请以超链接的形式标明文章原始出处和作者信息。
来自:图个啥 | http://tugesha.com
标题:定制drupal凯发k8网页登录首页
链接:http://tugesha.com/blog/drupal/dp-design/dp-design-theme/custom-drupal-front-page/
also you may want to check out this video in the section of the handbook: .
(this will install apache, mysql, and php in one step.)
find the latest version here:
download and drag to applications folder to install. open mamp and click "start servers," then "open start page."
find the latest drupal release here: .
move the directory containing the drupal files into the mamp htdocs directory:
mv drupal-x.x.x/* drupal-x.x.x/.htaccess /applications/mamp/htdocs/yourdrupaldir
where yourdrupaldir is whatever you want the directory to be called.
note: if you use finder you may miss moving the .htaccess file which is necessary for clean urls to work. it is generally best to download and unzip drupal directly in the document root (default is htdocs) so you don't miss the .htaccess.
to create a database for drupal
you can also use a gui such as , just remember to use this as your socket:
/applications/mamp/tmp/mysql/mysql.sock
the default username/password for your mysql install is now root/root! for security purposes, it's always best to change this. if you're connected to the internet, this is a must.
when you are changing the default user/password from root/root, you need to do two things. only the first is documented in the mamp start page faq, but if you don't do the second then you get an error message when you try to access anything from the mamp start page.
open the terminal and type the following:
/applications/mamp/library/bin/mysqladmin -u root -p password [newpassword]
it will ask for the current password after you hit enter. once you have entered that, the mysql password is changed.
/applications/mamp/bin/phpmyadmin-x.x.x/config.inc.php
find the line that reads...
$cfg['servers'][$i]['password'] = 'root';
...and change the value 'root'
to your new password, retaining the quotes.
/applications/mamp/bin/mamp/index.php
find the line that reads...
$link = @mysql_connect(':/applications/mamp/tmp/mysql/mysql.sock', 'root', 'root');
...and change the last parameter to your new password.
/applications/mamp/bin/stopmysql.sh
replace the -proot
with your password. (if you
don't change this one you can have zombie mysqld's running after you
thought you stopped the server)
by default, mamp has the memory limit that a script can use set at 8mb, which is the php default. looking at php's php.ini-recommended file, this memory limit is normally set at 128mb. to adjust this amount, open the php.ini file in a text editor and change the following line (approximately on line 232):
memory_limit = 8m ; maximum amount of memory a script may consume (8mb)
php.ini file locations:
/applications/mamp/conf/php4/php.ini
/applications/mamp/conf/php5/php.ini
in mamp pro, don't alter the file directly since it will be recreated at each server start. please edit the appropriate template (menu file > edit template > ...) instead.
even with larger php memory limits you can get timeout errors trying to import large drupal databases into mysql. these issues are discussed at length elsewhere with regards to the and . generally the solution is to empty the drupal cache before importing/exporting databases to/from mysql.
navigate to and fill in the installation fields using the information provided on the mamp start page and the name you used for the database you created in step 3.
go to and create the first account.
continue with instructions in install.txt.
if you changed your mysql username and password you will need to modify that in your local drupal settings.php file as well.
by default the file system settings (admin/settings/file-system) will place the temporary files directory inside /applications/mamp/tmp/php which should be changed to something like files/tmp or sites/files/tmp to avoid later confusion.
if you would like to shorten your url from "http://localhost:8888" to "http://localhost" follow these instructions: