How to start a blog (WordPress basics)
Quick and dirty notes for:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
==================================================================================
Chapter 15 - Starting to Blog and Building Your Community
==============================================
- what is trackback uri??
- allow pings?
- shoudl use excerpt for SEO reasons - used in feeds, etc.
- post slug - part of permanent URI -- used for SEO
- custom fields - use depends on plugin
Categories
---
- can have parents
- slugs
Post Slugs:
Post Slug
This is where WordPress will "clean up" your post title to create a link, if you are using Permalinks. The commas, quotes, apostrophes, and other non-HTML favorable characters are changed and a dash is put between each word. If your title is "My Site - Here's Lookin' at You, Kid", it will be cleaned up to be "my-site-heres-lookin-at-you-kid" as the title. You can manually change this, maybe shortening it to "my-site-lookin-at-you-kid".
There are three significant differences between pingbacks and trackbacks, though.
1. Pingbacks and trackbacks use drastically different communication technologies (XML-RPC and HTTP POST, respectively).
2. Pingbacks support auto-discovery where the software automatically finds out the links in a post, and automatically tries to pingback those URLs, while trackbacks must be done manually by entering the trackback URL that the trackback should be sent to.
3. Pingbacks do not send any content.
Category slugs:
Category Slug
The Category slug must be unique. The Category Slug is used in the URL. For example, setting a Category Name of "Recipes" and a Category Slug of "food" would show all "Recipes" posts with a URL like example.com/blog/food/.
During the many Save and Continue Editing page reloads, your post title is not permanently set in stone. You can change it at any time during the editing process. However, once you hit Publish the title is cleaned up and turned into a post slug, if you are using permalinks.
take look at RSS Link List Plug-in for wordperss
SEO
---
when search engine crawls category pages, it will get excerpt of your posts rather than full content. if you provided the excerpts, then you're in good shape for keyword density
Go for SEO-friendly permalinks -- i would take out the dates, etc. and move the keywords closer to the front of hte URL. the thing is that if you change your permalink structure apparently it changes your old posts too and then you'll have broken links so you have to install a plugin that will handle that with a 301 redirect
apprently howeer the 301 redirect does not transfer your PR. but maybe it saves the existence of the old page with its old PR. i suppose that's how it works.
http://scott.yang.id.au/code/permalink-redirect/
(personally I recommend /%category%/%postname%/)
redirect_canonical
apparently this is now in core. but how do you use it?
http://www.htaccesselite.com/canonical-url-improvements-wordpress-vt296.html
http://trac.mu.wordpress.org/changeset/1218?new_path=trunk%2Fwp-includes%2Fcanonical.php
the thing is that i don't see any redirects though. i tried changing permalink on a wpmu localhsot intallation, and i get a 404 if i change the url.
add_action('template_redirect', 'redirect_canonical');
how do you use it???
http://svn.automattic.com/wordpress/trunk/wp-includes/canonical.php
Fixing URL redirects
Edit wp-includes/canonical.php
Insert this after the 4th row ("function redirect_canonical(...) {"):
$do_redirect = false;
This will set do_redirect always be false, whatever the caller tries to do.
This should take care of most problems, but not all.
http://blinkenshell.org/wiki/Howto/Webpage/Wordpress
Fixing the trailing slash problem
Save the plugin found here to your WordPress plugin directory, like this:
cd ~/public_html/blog/wp-includes/plugins
wget http://flipjarg.blinkenshell.org/share/slashFix.txt
mv slashFix.txt slashFix.php
Open slashFix.php and change line 22 to use your Blinkenshell login name:
$user = "YOUR_USERNAME";
Now just go to your WordPress panel and activate the plugin.
yeah using category/postslug is a good way to do it becuase you get the category in there which is an importnat keyword (unless it's 'uncategorized')
wonder if being on localhost has anything do with redirect_canonical not working
the good thing is that if whatever you do doesn't work you can easily reverse it without consequences.
Labels: blog, blogger, blogging, wordpress
Posted at 8:37 AM | 4 comments read on
Maintaining Your Drupal Site ( Drupal 6 Introduction - Part 5)
Quick and dirty notes for:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
==================================================================================
Chapter 6 - Maintaining Your Site
==================================
cron program runs on unix-based machines -- so maybe that's why we can't get it to work in windows
we can run it manually just fine. but it hink actually scheduling it is probalby n ot possible in windows.
http://localhost/drupal/cron.php
that will run cron, because cron.php is in the root directory
basically you could run it manually without logging in apprenty. but the page doesn't reutrn anything ecept an empty page.
you MUST run chron periodically.
core modules rely on chron:
- aggregator
- drupal
- node
- pint
- poll
- search
- statistics
- watchdog
cron.php is publicly accessible and can be called, but it doesn' resul tin server overload because individual stuff is scheduled according to their own schedule. each task has its own schedule. only the first call ro cron.php will make all scheduled tasks run.
still if you want you can disable it from publicly accessibley by adding a driective to httpd.conf file see p187
when figuring how often, use he lowest frequency possible, yo can only do this if you know how often each scheduled task needs to run.
Poormanscron module -- will call cron based on site visitors, so depends on having visitors regulary
You need to call cron.php using soimeting like wget, lynx, curl, etc
just as we had done in media temple.
importnat to allow web server to handle request because it gives more information. dont' use php command line he says
There are two options for running CGI scripts with a cron:
1. You can execute a HTTP client via a cron job, and have it retrieve the URL of the cron script. Thus, the request is processed as if the cron script is opened in a browser. For example:
wget -O /dev/null http://yourdomain.com/your/cron-script.php 2>/dev/null
If you want to get verbose output of the cron execution, use:
wget -O - http://yourdomain.com/your/cron-script.php
2. You can run the script directly from the command line. For this to work, you have to invoke it with the php interpreter, like this:
/usr/bin/php -q /home/USERNAME/public_html/your/cron-script.php
Make sure you substitute USERNAME with your cPanel login name. Also, note that everything in this line is case sensitive.
so the example in the book is:
30 * * * /usr/bin/wget -q -0 /dev/null http://www.example.com/cron.php
it uses wget and discards the output. you have t put that into the crontab file. in linux,
crontab -e
that opens up the file and you just append that line and you're set.
mediatemple divorces us from that which is sort of unfortunate. and we have a limited number of cron jobs we can run in mediatemple.
ther eare cron for windows options:
http://cronw.sourceforge.net/
http://www.visualcron.com/
http://sourceforge.net/projects/pycron/
You can also try using windows task scheduler
http://drupal.org/node/31506
Running Multiple Drupal Sites
-------------------------
very interesting because you can have one drupal installation and run muiltlipe sites with it. that's hte idea behind having a sites folder where you store themes and modules, because for each site you have you can have a directory there. while also sharing the core drupal, which is very useful becuase otherwise you would have to update and manage many instances of drupal.
so your difft domains have to reoslve to the same documen troot. you can do it with apache and virtual hosts. so tha's what VH is about?
hosting companies use terms like ALIASED DOMAINS and PARKED DOMAINS to describe this configuration.
so i guess this is partially at least what MT has in mind. i think they use the term aliased domains
if your sites get sent to the sam document root, then you just need to configure drupal to load the configuration file.
virutal hosts or vhosts is what this is all about. confiruing apache to direct multiple domains to the same document root.
so the apache httpd.conf file is where it happens apaprently. where you set up vhosts.
example:
#subsitite your IP address
NameVirtualHost 111.22.33.444
DocumentRoot /absolute/path/to/drupal
ServerName yoursite.com
DocumentRoot /absolute/path/to/drupal
ServerName secondsite.com
if host doesn't let you edit httpd.conf then you just have tuse what system they have for setting up aliased/parked domains.
Sites Subdirectory
--------------
create subdirectiry in sites folder for each site you want to run with this installation. each bears name of domain. each has a separate settings.php file.
examples :
sites/default/settings.php
sites/domain.com/settings.php
to get settings.php in those directories. copy the one from default and modify it. change database settings, base url etc
also create af iles directoiry:
sites/domain.com/files to keep uploaded file separate fro mother sites
Also create modules and themes folders
site/domain.com/modules
site/domain.com/themes
Sharing Database
-------------------
use prefix if you want in same database. but same database is not recommended.
skipping most of thist stuff:
- sharing database
- sharing user information (user table)
- sharing spam tables
- sharing other tables
Making Backups
---------------
- never lose data
- always have mirror ready to replace site if it goes down
two things to back up:
- file system (uploaded files etc.)
- database
Database backups
------------
Options:
- dba module will use cron to do dumps and email it to you
- civicspace script see p201
- phpmyadmin
- mysql console
File System backups
----------
- program files, modules, themes are easy to backup
- uploaded files can grow to gargantuan sizes
options:
- filesystem backup module (emails you attachments)
- linux cp command
- -u flag will replace only if file is newer
- zip it up and then download it
Maintaining Test Site
---------------------
- copy files to subfolder or alternate document root (using vhost)
- create test database, import data
- update config sites
- best to clone production server
- use a subdomain and seprate document root (what about vhosts??0
- can also try subdirectory
- use localhost
- try to keep close as possible to production environment
Subdirectory method for test site
----------
- domain.com/test_site/
- password protect using http authentication or drupal securesite module
- copy site database
- copy files to subdirectory
- update config in settings.php
- $db_url
- $base_url
Updating Drupal
---------------
- maintain some kind of version control to make sure you track what changes you make
- also keep a SITE-CHANGELOG.txt to track
- record when you downloaded and installed drupal, difft modules, etc.
- test the update on a clone/mirror
- keep a full backup before any update
procedure
- replace files
- run update.php
that sounds like sort of primitive.
- make sure that your modules are also updated to the new version
- deactivate contributed modules before updating the core drupal site
if htey say remoave all old drupal files, they mean just what came with the original drupal download obviously.
acess update.php in browser
Support
----
use the drupal forums and #drupal-support
Posted at 8:30 AM | 1 comments read on
Adding and Customizing Themes for Drupal ( Drupal 6 Introduction - Part 4)
Quick and dirty notes for:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
==================================================================================
Chapter 5 - Adding and Customizing Themes
==========================================
themes may have different features and options because they're based on difft theming engines
theming engines:
- phptemplate
- Smarty
- PHPTal
- XTemplate
look in templates/engines -- actually i don't think that exists any more in drupal 6
but apaprntye theare are difft theming engines.
iwell now he says that PHPTemplate is now the standard theming engine
never hack on files outside of your theme folder!
the book is pretty much dated, obsolete. i don't see any reason to use it, considering that the documetnation online is reasonably complete.
http://drupal.org/node/171194
i guess use it to get an overivew...
best to star tout by modifying theme. don't start from scratch.
drupal 6 theme anatomy:
-------------
http://drupal.org/node/171194
- folder with theme name
- .info file with theme name (better be unique to both themes and modules)
- template files (.tpl.php)
- template.php (not rquired, but use to keep logic out of templates -- preprocessors; override theme functions here), omit the closing php tag
Themable functions
----------
- can be overwriteten
- starts with theme_
# The contents of the .info file is cached in the database so altering it will not be noticed by Drupal. (Do not confuse this with the theme registry.) To clear it, do one of the following:
1. Clear button located at "Administer > Site configuration > Performance".
2. With devel block enabled (comes with devel module), click the "Empty cache" link.
3. Simply visit the theme select page at "Administer > Site building > Themes".
maybe that hd to do with our problem with the image assist and stuff?
.info file
-----
http://drupal.org/node/171205
To suppress a check box, omit the entry for it. However, if none are defined, all the check boxes will display due to the assumed defaults.
The example below lists all the available elements controlled by the features key. By commenting out the primary_links and secondary_links elements, their check boxes are suppressed and are not seen by site administrators.
features[] = logo
features[] = name
features[] = slogan
features[] = mission
features[] = node_user_picture
features[] = comment_user_picture
features[] = search
features[] = favicon
; These last two disabled by redefining the
; above defaults with only the needed features.
; features[] = primary_links
; features[] = secondary_links
Traditionally, themes default to using style.css automatically and could add additional stylesheets by calling drupal_add_css() in their template.php file. Starting in 6, themes can also add style sheets through their .info file.
stylesheets[all][] = theStyle.css
Traditionally, themes could add javascripts by calling drupal_add_js() in their template.php file. Starting in 6.x, themes can also add javascripts by adding lines to their .info file:
scripts[] = script.js
in the drupal documentaiton now:
Theming hooks implemented as functions provide speed. It is about five times faster than templates but they are difficult for designers who may be more familiar with working directly in xHTML.
For most theme developers, the registry does not have to be dealt with directly. Just remember to clear it when adding or removing theme functions and templates. Editing existing functions and templates does not require a registry rebuild.
(empty cache)
am rather confused by the themable functions becuase they don't actaully show up in the themes. it appears that they're usedi n modules not themes.
in the themes, what i'm seeing are phptemplate_ functions
the book says the main themable functions are:
theme_page
theme_node
theme_comment
theme_block
theme_box
in impelemtantion i think what actually happens is that the theme designer gturns these into .tpl.php files
so the overriding is sort of implicit. you're not actually calling the functions instead you overrie it by creating files called
page.tpl.php
node.tpl.php
comment.tpl.php
block.tpl.php
box.tpl.php
okay th ebook explains it better now:
the reason we see phptemplate_
when you want to call a themable function, you do
theme($function_name,[$params,...])
if you call:
theme('foo',$bar)
Then drupal looks in 3 namespaces:
1 - theme's namespace
fourseasons_foo($bar)
2 - theme engine's namespace
phptemplate_foo($bar)
3 - default namespace
theme_foo($bar)
#2 is recommended because it is portable. you can move the function to a difft theme or rename it. that's why everywher eyou see phptemplate_
good table on p158 showing examples of the above
it's good you can see here:
http://api.drupal.org/api/group/themeable/6
all the themable functions, with the default code. so you can actually just copy that code out and modify it rahte rthan starting from scratch. that would be hte best way.
i wish someone would turn the wordpress theme api documentation into an AIR app or perhaps a chm.
this is the default breadcrumbs:
function theme_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
return ' ';
}
}
?>
to override just copy and paste and modify it
function phptemplate_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
return ' ';
}
}
?>
or from fourseasons:
function phptemplate_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
return ' ';
}
}
very easy.
put in what you want. you can put an image in if you want.
and okay like i suspected, the template files are just a convenient way of doing it so that you don't have to put html into these functions.
page.tpl.php is required
PHPtemplate engine provides also:
block.tpl.php
box.tpl.php
comment.tpl.php
node.tpl.php
if these appear in your theme, they override the version in themes/engines/phptemplate -- not applicable to drupal 6
tags must be closed:
Theme engine provides to all:
------------------------------------
- $id -- e.g. allows each block to have unique id
- $zebra -- odd or even
- $is_front -- true if front page
in addition:
Variables available to specific templates
---------------------------------
block.tpl.php
--------------
- $block object
$block->content
$block->module -- name of module
$block->region -- left, right, etc.
$block->subject -- title
$block->delta -- number given to block by module
- $block_id -- uniquely identifies block w/in region
- $block_zebra -- like $zebra but rest for each block region
Apparently the default blocks used to be at engines/phptemplate/ but i don't se ethem so i think they must have taken them out of drupal 6
box.tpl.php
-------------
- $content
- $region
- $title
comment.tpl.php
--------
- $author
- $comment object
- $comment->subject
- $comment->comment (content)
- $comment->name (name of user)
- $comment->timestamp
- $comment->uid (user id)
- $comment->new (boolean) -- has user viewed before?
- $content
- $date -- formatted
- $links -- controls (reply,edit,delete) as single string
- $new -- says "new" or "" if not new
- $picture - authors picture
- $submitted -- "Submitted by user_link on date."
- $title -- permalink
These are all listed in the documentation so i won't copy out anymore. See:
http://drupal.org/node/11816
node.tpl.php
page.tpl.php
so the same templates as in the old version. see the drupal docs for the variables available.
the drupal page is actually for version 5, they haven't done drupal 6 tehme developers gide yet really. but here's what htey have:
http://drupal.org/node/226776
common to all:
id
The placement of the template. Each time the template is used, it is incremented by one.
$zebra
Either "odd" or "even". Alternate each time the template is used.
$directory
The theme path relative to the base install. example: "sites/all/themes/myTheme"
$is_admin
Boolean returns TRUE when the visitor is a site administrator.
$is_front
Boolean returns TRUE when viewing the front page of the site.
$logged_in
Boolean returns TRUE when the visitor is a member of the site, logged in and authenticated.
$db_is_active
Boolean returns TRUE when the database is active and running. This is only useful for theming in maintenance mode where the site may run into database problems.
$user
The user object containing data for the current visitor. Some of the data contained here may not be safe. Be sure to pass potentially dangerous strings through check_plain.
they say the variables specific to individual template files are:
Variables specific to the template are documented inside the file.
but dont' sepcify really which file. confusing. don't know wher eto look.
http://drupal.org/node/226776
okay here they are:
http://drupal.org/node/190815
they're now provided by core, not in phptemplate directory
for box:
http://api.drupal.org/api/file/modules/system/box.tpl.php/6/source
for comment:
http://api.drupal.org/api/file/modules/comment/comment.tpl.php/6/source
for page:
http://api.drupal.org/api/file/modules/system/page.tpl.php/6/source
for node:
http://api.drupal.org/api/file/modules/node/node.tpl.php/6/source
for block:
http://api.drupal.org/api/file/modules/system/block.tpl.php/6/source
awesome. so we'll take what we see in hte book with a grain of salt and rely ont he actual docmentation for that.
just use the book for an overview.
Suggestions only work when it is placed in the same directory as the base template. In other words, trying to get comment-blog.tpl.php to work, comment.tpl.php also needs to exist inside your theme and in the same directory.
Custom suggestions beyond the ones listed below can be created.
sugegstions are like since node.tpl.php is very general, you can do:
node-TYPE_.tpl.php
for example:
node-story.tpl.php
to pass extra variables to the template, use template.php:
function _phptemplate_variables($hook, $vars) {
..
return $vars;
}
the $vars are the exsting vars. you can do what you want with them or add new ones
for example:
function _phptemplate_variables($hook,$vars) {
switch($hook) {
case 'block':
// generate random color
$color = '#';
for ($i=0;$<3;$i++) {
$r=dechex(rand(0,255));
$color .= strlen($r) < 2? '0'.$r : $r;
}
// add $color variable to $vars array
$vars['color'] = $color;
break;
}
return $vars;
}
most page execution has been run by the time this gets called, so use this for superficial stuff--visual elements and layout.
An alternative to overriding a themable function using a function and if you can't use one of hte popular tpl.php files is to create your own. breadcrumb.tpl.php for exmaple.
to do this. create the template file, and then create a function inside yoru teme's template.php
function phptemplate_breadcrumb($breadcrumb) {
return _phptemplate_callback('breadcrumb', array('breadcrumb' => $breadcrumb));
}
callback function is phptemplate's way of finding tpl.php files.
the second parameter is the array of values you awnt to pass, usually the same as what the themable function requires
well i'm feeling good about drupal. i thik i understand the theming system now, whichi s very improtant.
Adding Custom Regions for BLocks
------------------------------
can't find any examples in our intalled themes
http://drupal.org/node/171224
In Drupal 5 and below, regions were declared with ThemeName_regions() or EngineName_regions(). It has been deprecated in Drupal 6.
the book has us do that. in template.php, for example do:
function bluemarine_regions() {
return array('content_top' => t('content top'));
}
and then you do inside the page.tpl.php where you want it
apparently that's deprecated now.
i think now they want you to do all that in the .info file
The block regions available to the theme are defined within .info files. It must be specified with the key of 'regions' followed by the internal "machine" readable name in square brackets and the human readable name as the value, e.g., regions[theRegion] = The region label. If none are defined, the following values are assumed.
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
Adding a custom region prevents the defaults from being used. If you want to keep the defaults in addition to custom regions, manually add in the defaults.
let's try adding a custom region to four seasons.
well it ididn't seem to work.
# The contents of the .info file is cached in the database so altering it will not be noticed by Drupal. (Do not confuse this with the theme registry.) To clear it, do one of the following:
1. Clear button located at "Administer > Site configuration > Performance".
2. With devel block enabled (comes with devel module), click the "Empty cache" link.
3. Simply visit the theme select page at "Administer > Site building > Themes".
now it shows up. let's see if it works though.
uyeah it works. awesome. that means we can put blocks anywhere on the page and can make a real site then. awesome.
CSS
---
style.css is automatically included
if you want additional stylesheets, not sure. i think what he tells us is probably dated now. he said in template.php do
theme_add_style($stylesheet,$media='all');
that's the simple way. but the way he recommends is to to add it to _phptemplate_variables() function
switch($hook) {
// theme('block') gets called on every apge load so we use 'block'
theme_add_style(drupal_get_path('theme',$theme) . '/layout.css');
break;
don't know if that's recommended anymore.
in all the themes i looked at when they had ie fixes, they just hardcoded the .css file location into the page.tpl.php
putting it inside conditional comments
drupal.css
-----
apparently no such hting abmore but ther earea lot of default css stylesheets. don't delete any of them you'll get a 404 and problems. instead override them if necessary in template.php file
well ignore it for now. p180 if eer needed
favicon
---
apparently just putting a favicon.ico file in your theme folder will do the trick
Sections Module
------
- lets difft sections of site have difft themes
Taxonomy_Theme module let's you do smoething simliar based on the taxonomy but there's no versoin for drupal 6
http://drupal.org/project/taxonomy_theme
Labels: cms, drupal, drupal6, php
Posted at 8:21 AM | 2 comments read on
Drupal Contributed Modules ( Drupal 6 Introduction - Part 3)
Quick and dirty notes for:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
==================================================================================
Chapter 4 - Adding Contributed Modules
======================================
Useful modules:
- Flexinode
- TinyMCE
- Event
- Location
- Organic Groups
- Spam
- Devel
- Database Adminisration
Installing Modules
-------
- ALWAYS back up database before installing especially if module modifies database
- update database schema with the mysql file that comes with the module
- mysql -u user -p drupal < module.mysql (for example)
- if using prefixes, may need to update database defnition file directly
- apply needed patches
Tpyical files in a module:
- update.php -- can be used to update from one version to newer version
- .patch -- if any patches needed
TinyMCE Module
------------
3 wysiwig editors available to drupal
- tinymce
- htmlarea
- fckeditor
TinyMCE is recommended
- integrate well with Image Assist, Upload modules
Installing tinymce:
- two parts
- module
- project itself (sourceforge)
- module will tlel you which sourceforge file to download
- make sure they are compatible, reada carefully
Instrux:
- install module ot the directory
- backup site and datbase
- follow direx in install.txt for approipriate copy of project
- put sourceforge tinymce folder into modules/tinymce
- end up with modules/tinymce/tinymce
- enable
I think it's pretty stupid tha they don't include tinymce in the module. why download spearately??? it must be tinymce's requirement ot somering. because it does'nt make sense. thats wher eyou end up with incompatibilities.
yeah read the installation instrux. it gives instrux for spellechekcinig etc. wehich we'll ingore for now.
wonder if it did break my site because it's not loading anymore. it's timing out.
well non admin pages seem to be working fine. but admin is stlaling
so it doens't work anymore the admin section breaks. so i removed it. and may try again. i'll also drop the tables in the database.
trying a fresh install of the devel version. let's see if it works.
nope it just doesn't work. it times out. something is stuck. doens't work. the whole admin page times out.
maybe rhe version of drupal i have is unstable or needs to be updated
this is terrible because we need this module. this is an important module.
we were able to install it one time. i mean sort of we were able to enable it as a module at one point. and then we added the other files that wer supposed toimprove performance. and at that point i think it crashed all the admin pages. and then we removed it.
and now if we try to put it back in it breaks all the admin pages.
damnit.
maybe we need a fresh install of drupal???
i thik i'll do a fresh install and copy the theme over.
a fresh install of drupal
just did a fresh install of drupal and installed tinymce module into it. this time admin doesn't time out or anything but the tinymce isn't showing up on any of the input areas.
i guess for now it doesn't work. i guess the wya oyull get formatting inside of the post is to use raw html. upload your picture and set to don't dispaly then use the url you're given to input into the body of thepost.
obvioysly normal users won't know how to do all this.
so tinymce is improtant.
and it doesn't work so what do we do? i think the rest of hte chapter sort of dependds on it.
but why isn't anybody else complaining? maybe i'm doing somehtign wrong??
what coudl i be doing wrong?
is there anything else you need to do to get it work?
maybe the version of tinymce i downloaded is somehow incompatbiel with the plugin?
that's what i'm trying now, the older version of tinymce version 2.1.3 instead of the version 3.0.7
still doesn't work.
okay now it shows up. you actuall hav eto configure it.
http://localhost/drupal2/admin/settings/tinymce
you need to createa profile on that page
let's go back and see if we can install it to the old drupal installation
no it doesn't like it for some reason. it's like something must have happend the first time itinstalled and i removed it. that must have broken something or somethign rather. i dont' know. but can't put it back in. wonder hwat traces have been left. is hould have backed up the database as they instructed.
so basically fine. let's do all the tinymce stuff in this book in the second install of drupal. that'll be fine.
on p101 he talks about having to create an input format for use with tinymce, which is strange. dont' know if tht's true or not. it's not mentioned in he intallation.txt file.
you have multitude of css options p105
ignore for now.
Image Module
----------
- configure your galleries and stuff. read the instrux
- images are nodes
- grant permissions
- uses GD by default (comes with drupal)
- install imagemagick ifyou want
- cron to clear out your temp files occasionally
Image Assist
------------
- backup database before installing
always read install.txt
not workign right now. can't get it working yet. it doesn't isnert the picture into the post.
you need to configure each of the input filters so that they will accept inline images. it's a checkbox on their config page
still not working though.
and totally does not work in IE7
can't get it to work. nope.
so we'll skip it for now and come back. maybe we'll need to do a fresh install later.
let's move on to flexinode
Flexinode
----------
- create your own nodes with their own fields
- guess this differs from regular nodes in that regular nodes don't come with their own fields
- virtually any info collected online can be modeled with flexinodes
last release is from feb/2007 for version 4.7x of drupal. i think this is probably obsolete now.
i think it has been repalced by CCK
CCK for drupal 6 is not yet ready
skip the whole flexinode section then and wait for CCK for drupal 6.
Event Module
-----------
currently version for drupal 6 is still in development
maybe i shouod have used drupal 5
so skip this section too then for now until a version for drupal 6 is ready
probably should have used drupal 5 then we would have versions for eerything.
Location Module
--------------
likewise no version for drupal 6. still in development
Organic Groups Module
----------------
version for drupal 6 still in develompent
so later we'll have to install drupal 5 so we can use all this stuff.
skip it for now
Spam Module
------------
again looks like no version for drupal 6
wow, so remember when you depend on modules always install the older version of core.
Database Administration Module
-----------
skip it
Devel Module
----------
skip for now
yeah basically the thing to do is to go do a fresh install of drupal 5.x and use that for all the tuts and stuff. and probably for deployment too until the modules for drupal 6 come out.
but you can use drupal for very simple sites right now. where you dnt' need a lot of the outsid modules then you'll be fine with the newest drupal.
but not if you need older stuff.
Labels: cms, drupal, drupal6, php
Posted at 8:14 AM | 0 comments read on
Drupal Core Modules ( Drupal 6 Introduction - Part 2)
Rough and tumble notes from:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
==================================================================================
Chapter 3 - Using the Drupal Core Modules
=========================================
These all come with the standard install
Aggregator Module
---------------
aggreagtes rss feeds
having problem fetching some RSS feeds:
HTTP request status Fails
Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.
hmmm.it's funny how it works for jessica's blog only
http://drupal.org/node/222454
http://drupal.org/node/227791
i guess we'll have to figure tha tout later. but being able to grab rss feeds like that is really cool.
the only thig is that it doesn't turn it into nodes apparently.
okay managed to put a picture into a post but a clunky way of doing it. uploaded and then manually linked it in, but it's brittle because we used an absolute path.
okay tried this and it worked:
This is a test of putting a picture in a page.
had to enable uploads by the way to make that possible. looks like everyting is a module that needs to be enabled.
the book mentions an Archive Module but nowhere to be seen here.
Block module is also apparently no longer something that can be turned off or on. doesn't appear on our page, so i think it's just a part of core now.
Blog Module
----------
other blog modules
- trackback module
- blog theme module
- blogroll module
i'll ignore BlogAPI module for now
Book Module
-----------
very important stuff that one should know before one gets into the API
why isn't admin a role? i want stuff to be shown only to admin but it doesn't let me do that.
hmmm Books are a way of creating hierarchical pages. i suppose it may be easier to do it this way then any other way...
they don't have parent pages? in the normal page creation process?
i guess that wasn't an option before. okay. so you basically need to use book module in order to get the sort of hierarchy you have in wordpress for free.
intrersting. but once you cenable the module, the book option (hierarchy) seems to appear in all the content types.
you get pseudo-pagination out of it: previous, next, up
showing or hiding author is done via theme configuration
book module comes with a block that you can activate
he says users can enable their personal contact form in their account section but i dont' see that
it's actually under Site Building/Contact forms/settings
Forum Module
----------
Administer/Content Management/Forums
in order to do containers, organize, etc.
notice the set of icons that are used. by providing your own (using the same name) they willbe used in place of the default.
6 available icons:
-closed (comments disabled)
-default
-hot (comments and replies exceeds threshold set on forum config page)
-hot-new (hot and user hasn't viewed it)
-new
-sticky
Forum categories:
- listed in taxonomy like any other vocabulary
- it's possible to allow other content types to use the same vocab as the forum
Help Module
------
- gathers up each module's help and puts it at admin/help
- take a look at Help Edit module
Legacy module
------
- redirects pages for old versions of drupal to new pages
Locale Module
----
- authenticated users can change language
- affects built-in text
- for multilingual sites, use in combo with Internationalization module
drupal at time of writing had 30 languages
i'm skipping the rest of the translation stuff p76-79
Menu Module
---------
- can add pages to menus directly at page creation
- expanded means always show subitems (default is to show only if clicked on)
- new menus will be lised as block on block page
- can always add content to any menu at content creation time
- beware reset button. it will restore to original site, your custom menus will be lost
http://localhost/drupal/admin/build/menu/settings
he doen't say anything about dropdown menus. we still can't see any dropdown menus maybe try some diffterent thiemes and see what happens.
Node Module
-------
- common set of services to all node types
Page and Story module
----------------
- pages and stories nearly indistinguishable
- could use both jsut to create different settings for difft kinds of users (ie pages need moderation, etc.)
don't confuse with book!
Path Module
-----------
- SEO friendly - semantic urls (no node/2 etc)
- need to change permission for user to allow creating url aliases
- can't do absolute urls or links to other sites
what are the implications though? an alias basically means two urls pointing to the same place. sounds like google would penalize that.
but simple way to get rid of hte nodes. pretty cool. it's both powerful and sort of cumbersome because its not generatd automatically. so you haev to type it in by hand which can be inconvenient but it's also poewrful because you can have it named whatever you want. but problems will come if it's not unique. i suppose it will return an error. let's try that.
yeah it returns an error saying the path is already in use.
so which path does it use when you create a new node by default. if it puts hte node teaser on the front page, which url does it use to point to the article? the node or the alias?
it uses the alias. nice! and you can also arbitrarily create urls like shows/little_shop_of_horrors.html
again the url doesn't correspond to the file system, so that's cool. you can do whatever taxonomy you want then.
but if you go to http://localhost/drupal/shows you'll get a 404
so i think maybe you can create an aggregate page of shows somehow and put it that URL. how do you do that? you know you basically want a list of all the shows to go to that url.
all the shows. how do you get a list of all the shows?
you can get specific categorys of shows like comedy via taxonomy:
http://localhost/drupal/taxonomy/term/4
but how do you get shows. hmmmm...
besides doing it manually i mean. you could create a page and assign it to that URL presumably and then make that page execute PHP code (after enabling that module). that's fine that would work. but i would think that ther emight be some way to do it interlaly. to get all shows. yeah you could. you could do taxonomy for shows.
http://localhost/drupal/taxonomy/vocabulary/3
doens't work. so it doesn't seem to allow listing by vocabulary but it alows you to list by terms interesting.
i need to ask about that.
how do you get all shows? if shows is the vocabulary. i dont' think writing your own PHP and going to the database is the easiset or ideal way to do it but that's possible.
there must be a better way. i'm sure there is.
you can also create aliases for internal drupal paths to administrative sections etc.
Pathauto Module
------------
- makes auto URLs for nodes, categories, users even when not specified
- fully configurable patterns for urls
Ping Module
------
- pingomatic.com
Poll Module
-------------
- active or closed
- lilke any other regular content node -- can get promoted to front page
- better to use the block (Most Recent Poll)
- to prevent dupes, recommedned that only authenticated users can vote
- one vote per IP
Profile Module
------------
one of hte bad things about drupal is that it's hard to use, administer. it's like you enable a module and hten where do you goto configure it? i just enabled profile module but can't find the configuration page.
http://localhost/drupal/admin/by-module
that's the location not on a menu apparnetly. that was just al ink found on hte module page.
okay the profile module looks the most complicated so far of all the modules. let's see if we cna fonfgure this.
the other interesting thing i should note is that IE doesn't display the favicon for some reason.
actually not hard to set up. but we did one field that was homepage but when it renders in the profile page it doesn't show up as a link. so wonder how we can change that.
can be done via javascript but not ideal.
but othwerwise very nice module. highly configurable.
the url is because i didn't use the URL field. so have to use the URL field.
very nice. it has brwoser by tagging feature like flickr, etc. very nice.
the thing i don't undrstand here is hte visibility. what are 'member list pages?'
Search Module
---------
- pretty sophisticated
- more relevant appears higher
- h1 more weight than h2, etc.
- internal links boost position, etc.
there's also a search page:
http://localhost/drupal/search
need to run cron to index
Statistics Module
----------------
- counte rfor every node
- referring URL for every hit
- IP
- username
- enable and configure it!
do'nt ban yourself!!
Throttle Module
---------
- prepares for high load
- which blocks or modules to shut off at high load
- two possible triggers
- number of anonymous users
- number of registered users online
- monitors sessions table for number of people
tyer's also a
Auto-throttle probability limiter:
not improtant right now
but once you enable throttle, each module or block can be set to throttle (turn off) on high load via the block page or module page
Tracker Module
-------
- track recent posts (adds 'track' to profile page -- shows what they created/edited recently)
- adds 'recent posts' to navigation menu
- no config necesary
Upload Module
---------
- first uploaded file is enclosure in rss feed
- suitaible for podcasts
- when you don't want the file to be visible:
- when yhou're using Inline Module so that you just link to the file from your post or whatever
- use Img_assist Module to put inline images in posts
Watchdog Module
--------
- keeps track of logs
- size of watchdog table has significant influence on site performance
- dont' keep longe rhtan necessary
- discard occasionally
Labels: cms, drupal, drupal6, php
Posted at 8:05 AM | 2 comments read on
Drupal 6 Introduction
My rough and tumble notes for:BUILDING ONLINE COMMUNITIES WITH DRUPAL, PHPBB, AND WORDPRESS, 2006 Douglass et al.
Chapter 1 - Introducing Drupal
==============================
Changing the front page:
- create a node (page)
- http://localhost/drupal/admin/settings/site-information
that's the location for drupal 6
Okay, my question now is how do we create dropdown navigation in Drupal?
If the navigation is to be done using the web-based interface. how do you add an additional page, and add it to the navigation, etc.
Default configuration enables comments for all content types!
Basically, drupal does not have built in support for dropdown menus.
http://www.roopletheme.com/
those guys do have support for suckerfish that supposedly ties into the menu system. but otherwise peopel are just hardcoding the navigation, and divorcing it from the drupal menu system.
if yoiu do that though then you would want to make sure that users can't access the navigation. that's a good idea anyway because that's really a part of site architecture. jsut let htem maintain content, not information architecture like that.
also look at this:
http://www.thanhsiang.org/faqing/node/88
http://drupal.org/node/43047
the book says that the slogan can be displayed within the title attribute. but i guess that's up up to the theme, because it's now showing up in my theme right now.
As for the mission statement, it shows up in a regular div. it's not an h1 or anything so i don't it has much of an impact on seo.
drupal URL building is sort of similar to that of django i woudl say. there's no actual correlation it seems to physical location.
and everything is split on the slash
default url:
http://mysite.com/?q=admin/access/rules
if clean it would be simply:
http://mysite.com/admin/access/rules
and then it splits on the slashes and routes appropriately according to its mapping rules.
on p26 is totally confusing about how to set 403 and 404 pages. all the info you need is not there!
cached pages are only served to annonymous visitors
2 ways to offer file downloading:
- public - hotlinking is possible
- private - directory is not visible on web, but accessible to scripts - slower
Cant change that setting after you've deployed, it iwll break links.
next question is how do you make a post or page with pictures? see no contorl for that. how do you upload pictures and include them in a post etc.
okay so file uploading and error pages and stuff is all in the admin/settings/ (which is site configuration)
all caching is under performance section of site configuration
RSS settings are under Administer/Content Mgmt
what i still dont' undrestand is how you enter HTML into the editor beaue ti's always adding
and stuff. and it's messing things up. you know? what do you do when you want pure html. even wordpress can figure this out and let you do raw html.
awesome.w e just need to create a new filter. which is under Site Configuration/Input formats
input filtering modules to look at include:
markdown with smartypants
textile
smiley face modules
codefilter (for sites that want to discuss PHP-embed code)
tinymce
etc.
teh bookd discusses a PHP evaluator filter that lets yo embed php code and run it. buti don't see it in the options on drupal 6. maybe it'll jsut work by default for the most liberal filter, i don't know. i sort of doubt it.
the order of the filters matters if later filters depend on earlier filters.
intgersegting cron needs to run in order for the search results to return anything. stuff only gets indexed by cron
can't find the page for configuring comments. the book and our version aren't the same. i think it still does exist. i recall seeing it. but i can't find it.
http://www.scribbledesigns.co.uk/2008/04/02/comment-configuration-in-drupal-6/
Basically, in contrast to previous editions of Drupal, comments are now configured by content type - allowing you to permit comments on blog entries, but not on image nodes.
Finding The Configuration Pages
To find the configuration page for each content type, browse to Admin -> Content Management -> Content Types and click Edit on the content type you want to set up comments on.
remember tha themes can be configured. so the slogan actually does show up in the title attribute if you want it to. all tha tcan be turned on or off.
confused on secondary links. what are they exactly and why can't i get them ot actually show up as secondary links associates with a particular primary link
[ on menu settings need to set source for primary and secondary links to primary in both fields ]
Tabbed menu - becoming more popular because it's a little more "gee-whiz" in its presentation. It is debatable as to whether it is any more effective for your visitors. In Drupal, it is divided into "Primary" (the tabs you always see) and "Secondary" (the part that drops down, or slides out). Not all themes support secondary links.
so i think the theme has to do with it.
[ actually tha tquote is misleading secondary is not hte same as 'the part that drops down' - the part that drops down should be submenu items, they are simply child items not secondary links, which have a specific meaning w/in drupal ]
http://nanwich.info/WorkingMenus.htm
URL vs. path
path is everything after hte ?q=
if clean url's aren't enabled.
optherwise it's everyting after site.com/
see the page for your term and it's rss feed:
http://localhost/drupal/taxonomy/term/5
simply figure out what the number of ht term is by hovering over it in the admin section.
if you want to do OR, that is one term OR another:
http://localhost/drupal/taxonomy/term/5+6
if you wnat to to do AND, where tis categoris under both terms:
http://localhost/drupal/taxonomy/term/5,6
but you can't mix + and , (AND and OR)
if you have a hierarchy see p58, you can also get children by doing stuff like
taxonomy/term/1/1
taxonomy/term/4+6/1
etc.
default i think has 0 at the end (meaning no children)
if you want the feed, simply add feed:
http://localhost/drupal/taxonomy/term/5/0/feed
powerful stuff!
Posted at 8:34 AM | 0 comments read on
MySpace Mail Warning
You spend the better part of an hour, maybe more composing the perfect message to another MySpace user. You click send, and it loads a page, saying the message was sent. But was it really??? NO, it timed out. Check your sent mail folder, and you'll see that the message was actually never sent!YOU JUST WASTED TWO HOURS.
Before you ever click send on a MySpace message, copy the contents of your message (CTRL-C) first. That way you can resend the message after you find out that it wasn't really sent.
Labels: mail, message, myspace
Posted at 12:28 AM | 0 comments read on
How to Install and Run Django on Windows (Vista)
Download the Django file from the website.It's tarred and gunzipped, so use 7-zip to extract it.
Put the extracted directory somewhere.
In your console, cd to the directory (Django-0.96.1 or whatever).
Run this command in the console:
python setup.py install
Start python by typing 'python' at the command line.
Then type:
>>> import django
>>> django.VERSION
(0, 96.099999999999994, None)
Add to your path (see my post about setting path in Vista):
c:\Django-0.96.1\django\bin
You may need to restart console if the path doesn't update (if you changed it via windows see my blog post.)
Then do:
C:\django_projects>django-admin.py startproject mysite
that creates the directory with 4 python files
mysite/
__init__.py
manage.py
settings.py
urls.py
Then start the server that it comes with:
C:\django_projects\mysite>python manage.py runserver
Validating models...
0 errors found.
Django version 0.96.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Now go to:
http://localhost:8000/
Now you have Django on Windows!
Labels: django, python, windows
Posted at 11:54 AM | 1 comments read on