About zFacts

Welcome to zFacts!   Fair and Sensible

Rarely are two sides equally right, and "balanced" has come to mean finding a nit to balance a lie. Get z Facts and then decide. (newsletter)

zFacts is a project of Steven Stoft. Launched in January 2003 upon the realization that Bush really was going to invade Iraq. It focuses mainly on economic policy, energy and climate, foreign policy and domestic politics. Having a science background, I'm more skeptical than liberals or conservatives. Being an economist I favor more market oriented approaches than liberals, but don't buy the free-market religion of conservatives. And I think personal and social (government) responsibility are equally important in the design of public policy. More info here.

Sign Up

If you like zFacts be sure to get The Reality App for your mobile. Or view it here on your PC.

New, Oct. 29, 2012. You can now stay in touch with zFacts through it's Facebook page by clicking below.

More About zFacts

Write us at help

help at zfacts dot kom

Material on zFacts.com may be used freely provided its meaning is not deliberately distorted and zFacts is cited (however you wish). If used on another web site, zFacts.com must be given a normal HTML link however tiny. The following is always acceptable:  
ZFacts Material licensed under
Creative Commons License
Attribution 2.5 License
<a href='http://zfacts.com'> Any Text</a>  

Who’s behind zFacts, oil companies or what?  Nope.  I’m Steve Stoft and this is my web site. I’m building it with a little help from my friends and volunteers, but so far, it’s mostly my work. I’m a Ph.D. economist and my day job is consulting for public electricity markets—California, PJM, ISO-NE, some private generators, and occasionally the World Bank, DOE and the UK Department of Energy and Climate Change. My professional web sites are stoft.com and www.global-energy.com. My books are Power System Economics, and Carbonomics: How to Fix the Climate and Charge It to OPEC. I started out in physics and I still find that field more simpatico.

What are your biases?  At heart, I’m a scientist; that means I’m a skeptic. I don’t trust easy answers especially from politicians. I also don’t trust extremists, either left or right. But I don’t think these are biases; they’re based on observation. It’s hard to know your own biases, but I believe openness, information, and clear thinking are helpful—maybe those are my bias. I tend to be hard headed and soft hearted.

Why are you building zFacts?  I like to figure things out, and I don’t like deceptions or misunderstandings, especially ones that harm people. So with zFacts, I get to investigate many of my interests, expose some deceptions and clear up some misperceptions.

Are you opposed to alternative energy?  No, I love the idea of harnessing wind and solar. I’m just opposed to hyping things to well-meaning people, that don't do what's claimed. Corn ethanol is not working. Brazilian ethanol may be. Home-based solar voltaics are a rip off.* The better hybrid cars are a great idea. With my physics and economics background, I’m sorting this out for myself and posting it on zFacts.

What about global warming? I've spent about three years with almost no pay working on how to forge policies that will work to curb global warming—unlike Kyoto and cap-and-trade, which were sure-fire political failures from the start. In spite of that, I'm stil a skeptic. Climate science is still unsettled. But we know one thing for sure, there's a 50/50 chance, more or less, that it's going to be bad. That's all we need to know right now. It's idiotic to take that kind of a risk with our only planet and do nothing. With a 1/200 chance that your house will catch fire this year, you buy insurance, so don't be an idiot.

What about markets? Markets are amazing for what they can do, but they are no more of a cure-all than antibiotics. Corporations are basically sociopaths—they have no conscience. But, we need them. What we don't need is a bunch of billionaire sociopaths (corporations) fooling with our government—but that's what we've got and the conservatives are supporting it. Conservative are right that liberals are not careful with government money, but they are dead wrong that we should trust corporations and trash the American government. That's also not patriotic.

What’s on the zFacts agenda?  As of August 2011, I'm planning on trying out a newsletter, and see if we can figure out how to make zFacts more effective, and perhaps get some research help. My next focus is the $12 trillion dollar Republican debt. Blaming that on the Dems or Obama is the biggest political lie of my lifetime.

* Solar PV. OK, a lot of people ask about this. Here's the math:
Right now Scientific American (and others, who are pro alternative energy) put the cost of solar at $0.55/kWh. Wind is about $0.08/kWh and new fossil is about $0.05. So for 3 cents a kWh we can subsidize wind into the system but it takes $0.50 to subsidize in 1 kWh of PV. So if you have a buck to spend on global warming you can get 2 kWh or solar or 33 kWh of wind. They both save about the same carbon per kWh. If your an environmentalist, why would you choose 2 kWh of green power when you could get 33 kWh for the same money. I work with these people and I can tell you the answer—it's a good cause, but they've become religious about it. Green power is sacred and its sacrilegious to make tradeoffs regarding green power that involve money.

Individuals can do better then 55¢/kWh, but only because they get subsidized. But these subsidies give greens a bad name by subsidizing better-off folks out of public coffers so they can feel green. Progressives must learn how to shop wisely. That's good economics and a basic American value and the conservatives are right, that the left often ignores this because they feel their cause is just. In my view that's a sin. OK, I'm an economics, but this is just home economics.

And by the wa,y the $0.55 cost is the low end of the range and it's for centralized PV which is much cheaper per kWh than home-roof solar.

Privacy Policy
Google, as a third party vendor, uses cookies to serve ads on zFacts.
Google's use of the DART cookie enables it to serve ads to zFacts users based on your visits to zFacts and other sites on the Internet.
Users may opt out of the use of the DART cookies by visiting the Google ad and content network privacy policy.

zFacts collects no personal data from visitors, except those emails of those who sign up for the newsletter, and those will never be given away or sold, period, no exceptions.



Help Out

  1. Short, revealing quotes form politicians opposed to social security.
  2. Same for Medicare.
  3. The Libertarian platform from 1980 when David Koch ran as VP against Reagan

New Associates

You can become an associate of zFacts by invitation only. This is a help page for those who have been given a login.

  • To log in, Click "Login" (faint) in the upper right corner of any page.
  • To change your user name, password, or emails:
    • When logged in, "Hello your-name" in the upper right
  • For help editing look here.
  • .
  • On the 2nd menu bar,
    • "Ideas" will get you to a page where you can leave ideas for other associates.
    • Don't use "Add content.
  • To add a page: Click "Add Child Page" near the bottom of the page you want the new page to go under.

Page Not Found

We apologize for moving your page. 

This is the new zfacts site. The old zfacts site is at:   zfacts.com/zfacts.com/

Here's How to Find an Old Page that Is Not Part of this New Site: 

Look in your browser's location (URL) bar. Suppose you see this:

zfacts.com/p/783.html                             Then, change it to this:

zfacts.com/zfacts.com/p/783.html            Hit enter.

That should take you to your page on the old site. You can browse the old zFacts site, here.

You may also find similar material on this new site by using the table of contents or search form on the left.

Best regards,



Leave notes here.


Help for Contributors to zFacts

  • Basic login, edit, save. (make links)
  • Paragraphs: How to make 'em and control indents
  • PopNotes:  How to make footnotes that pop up.
  • Add Image:  And make it float right / add a caption.

It's good to save often. If you try save and get a horrible red error message, open another window and go here. But if your changes were minor, just do them over.

How to Edit

  1. Click "Login" (faint) in the upper right corner of any page.
  2. Log in. (you must already have name & password)
  3. Use the table of contents to go to the page you want to edit.
  4. Under the page's title click the edit tab.
  5. In the "Body" make corrections.
    • Occationally there is a "Summary window for front-page teasers above the Body window. Ignore it.
  6. Save your work:
    • Warning:  Clicking the "View" tab will discard any unsaved work (it's dumb).
    • Click the floppy-disk Icon at the right end of the 3rd row of icons
    • Or, scroll to the very bottom and click "Save."
  7. If you mess up, don't save your work
    • Hit your browsers back arrow, or
    • Click the X near the "outline" tab in the upper right.
  8. Linking:
    • To link zfacts.com/node/4, select keywords, click the "link icon," enter  /node/4  Note that "<other>" will appear. Example:  Link to node 4
    • To link the page zfacts.com/about, use this:   /about  Example: double click this in edit mode:  Link to about
    • An external link should be followe by  xlnk.gif, found a image/xlink.gif  (use the IMCE Picture icon)
    • Tricks:
    • If you are on a node page you any of these:
      • /node/4   ../node/4   or  ./4
      • because  ..  means go up one level from where you are (at /node)
      • and   .   means go from here
      • Starting with  /  means start from the base path:  zfacts.com

Wysiwig Editing

Normally, put the editor in "Full HTML" text format mode (just below Body-edit window.

Paragraphs:  Assumes that pgraph Creation Modes is set to <br>, <p>, using
Configuration / CKEditor / Full edit / Cleanup and Output
  • There are 5 types of paragraph:
    • "Null" -- just line break, <br />, at the end of a line
    • Normal:     <p>
    • Division:    <div>
    • No-Indent:  <p style="text-indent:0px;">
    • Indented:    <p style="text-indent:2em;">
  • Using normal paragraphs:
    • The first Normal will look like "no-indent"
    • The following ones will look like "indented" paragraphs.
    • But the HTML will still just show: <p> .  The trick is in the hidden CSS.
  • Typing normal paragraphs:
    • If you just type and hit "enter" you will get a Normal paragraph.
    • If you hit Shift-Enter you will get Division paragraphs
  • Overriding Indents
    • No-indent and Indent can be found in "Styles," and they will override <p> or <div>.
  • Switching Types:
    • Use the "Paragraph Format" drop-down just right of "Styles" 
    • Check It's Label before you hit the drop down arrow
      • "Format"  means it's in <br /> mode.
      • "Normal"  means it's in <p>  mode
      • "Normal ..."  means it's in <div> mode
      • It will produce a paragraph of its mode.
      • If it is in <p> and you type 3 lines with Enters after the first 2, you will get a normal paragraph with breaks after the first 2 lines.
    • Switch Null >> Normal.    Click "Normal"            in Format drop-down
    • Switch Null >> Division.   Click "Normal (Div)"  in Format drop-down
    • Switch Normal >> Null.    Click "Normal"            in Format drop-down
    • Switch Division >> Null.   Click "Normal (Div)"  in Format drop-down
    • Switch Normal ⇔ Division    Click the other one 
  • You might need to click  Source  and see what's going on.


PopNotes pop open when the mouse goes over the reference. To make this happen the footnote reference and the footnote's number (in the note) must match and be formatted precisely. For footnote NN these formats are:

  • [ #NN]  <= this is the reference format.[#1]  Underline Required!
  • [ =NN]  <= the same number in the note itself. No underline.
  • [ #Gross National Product]  <= Another OK reference.  Underline Required!
  • [ =Gross National Product]  <= Another footnote number. Must match perfectly -- caps and all.

These formats will not be shown to the visitor, but you will see them when editing. Here are the other rules for making popNotes work:

  1. NN can be any number or words and most symbols, e.g. NN could be "GNP(1999)". But [#there's a limit].
  2. Do not put  [ or ] inside the NN.
  3. Do not us  [ #  or  [ =  anywhere except for marking references and foonotes.
  4. PopNotes can include links, pictures and formatting.
  5. Put each footnotes in it's own row of a table at the bottom of the page.
  6. The footnote [#delimited] footnote number [#should] go at the start of footnote. The space after [=NN] is optional.

Some hints about making the table and the notes:

  • Set the Text format to "Full HTML"
  • Make the table by using the table button near the end of the top button row.[#3]
  • Set the number of collums to 1 and the number of rows to about the number of footnotes you expect.
  • Add a row when needed (or delete one) by right-clicking the row and choosing from the "Row" menu.
  • "Edit" this page and look at the PopNotes: table to see what it should like.

HoverNotes Title

  • The hover notes should have a title as shown below.
  • Put the underline on before the bold and then make it a normal paragraph.


[=1] Note that NN can be just one digit.
[=there's a limit] NN can be no more than 50 characters long.


are funny characters used to mark the begginng and end of some more normal string of characters. In this case they set of the popNote number, word or phrase.

[=reference] Brackets are fine in the footnote itself.
[=3] It's the button just to the right of the red circle with an "f" inside.
[=should]  Should, but this is not necessary. The footnote # can go anywhere in the footnote.
[=PopNotes] Just hover over green-underline links above to see the "pop" notes.


Copy This Table


[=1] Sample
[=PopNotes] Just hover over green-underline links above to see the "pop" notes.


Add Image

Bush Employment

Position your cursor before the paragraph that the image goes to the right of.

Image with No Caption
  1. Cick IMCE icon (2nd row)
  2. Choose Image
  3. Alignment: Right
  4. Alternative Text, and Advanced / Advisory-Title  are both a good idea. 

Image with a Caption -- use a table

  1. Make a Table with 1 Col and 2 Rows.
    1. Set Width smaller than the image -- ~50px
    2. Border = 0
    3. Align: Right
    4. Optional:  Go to "Advanced" tab and after  "width: 5px"
      • add  " ; margin: 0 -8px 0 5px; "  (Note the initial " ; " )
  2. Add the Image with IMCE (picture icon in 2nd row).
    1. Click Inside the table.
    2. Click the IMCE icon.
    3. Select your imaged and click "Insert"
    4. Set the width you want (make sure litle lock is locked).
    5. Go to "Link" tab if you want to link the image to, e.g. ../p/416
    6. Click   OK
  3. Add a Caption
    1. Type caption and center it.

See Files/IMCE Setup for tech stuff

Add Image with a Popup Window Link

  1. Just link any phrase and select "popup window" from the Target menue in CK editor.
  2. The links should be the url of the image.
  3. Good to put the width and heigth in for the window.

Magic Content

The "Magically Transfer Content" box in the edit screen allows

  1. Content to be place in difficult locations (header and sidebar).
  2. Difficult content (widgets) to be placed in the body at view time.

How it works:

  1. Place special content in a magic box:
    • <div class="zMagic zReplace" ref="target ID" > content to transfer </div>
  2. Make a target div or span, e.g.:
    • <div id="target ID"> empty or not </div>
  3. When the page loads, the content replaces the target div or span, and the magic box is deleted.
  4. class="zMagic zInsert" will cause the content to go inside the target div or span.

Headers and Right Sidebar:

  1. These have pre-set target-ID's:  id="magicHeader",  and  id="magicSidebar"
  2. It's best to use "insert" with the header.

Widgets, Gizmos and Javascript:

  1. These will tend to execute before the move, so Javascript must be disabled.
  2. This is done by replace both "<"s with "[=" like so:
    •     <script ...>maybe some JS</script>
    •     [=script ...>maybe some JS[=/script>
  3. Then inclose the broken script tags in magic span tags:
    • <span class="zScript"> broken JS script </span>
  4. The repare will be made after the move.
  5. Some gizmos need this (e.g. Iraq war quotes), some don't (e.g. Republican Debt), and some cannot tolerate it (e.g. National Debt Gizmo#05).

Example:  Edit this page and check the "Magically Transferred Content" editing box below the regular Body editing box.

Be sure to use Text format = PHP code

Magically in the Header
Magically in the
Right Sidebar

Site Structure

The Home Page:

  1. A "sticky" entry at the top the introduces the site
    1. Publishing Options: Check "Promote to Front Page," "Sticky."
    2. Top entyr is the About page and it contains jQuery code to suppress it's title/header on the home page.
  2. 10 most recent site entries listed below
    1. Configuration / System / Front page / Number of posts
    2. At the bottom of any node, in edit mode, find "Publishing Options." Check "Promote to Front Page."
    3. It's good to use a "Drupal Teaser Break" (ckEditor button) for Front-Page Stories
  3. Druapal automatically provides a page-overflow system.


  1. The "Main Menu" provides the Navigation Bar across the top.
    • A page can be added to it with the menus below the edit window
    • The Main Menu can be organized at:    Home » Administration » Structure » Menus / List-Links
  2. The Left-Bar Content:
    • Go to the bottom of an editing-version of the page
    • Use the Book Outline
    • Make the page a book and set its weight to determine its position.


  1. The rest of the site is divided into drupal "books."
  2. Each book can have one drupal blog -- the last chapter of the book.
  3. "Add Child Page" selects a "My Book Page," but "Add Content" alows other types of pages to be added.


  1. Each blog must have a different (ficticious author).

Page Structure

The Structure of a page is mainly controle by:  Structure / Blocks. However the theme itself puts that Main Menu into the top Navigation Region. See zframe/!Notes on zframe.txt.

The Header contains a block, "Micro Login for Top Right" that contains both the login and the magicHeader div that can be loaded by using the Magic-Block-Input.

Paragraphs:  The first paragraph is not indented, but the next one, and subsequent ones are. However, if a table or some non-paragraph occurs, then the next one is not indented. See Wysiwyg editing.

The Left-Hand Sidebar can only be changed by editing the Don't-Miss block.
The Right-Hand Sidebar has these blocks in this order:
  1. Magic Block
  2. Zero or more Widgets
  3. Google ad

The Magic Blocks will contain whatever is inside these divs in the Magic-Block-Input box (below Body input box when editing).

  • <div id="sideMagic"> This page's unique sidebar stuff. </div>
  • <div id="headerMagic"> This page's unique header stuff. </div>

The Magic-Block-Input must be used with "PHP code" as the text format. Do not style the magic divs; they disappear. Put any HTML, PHP, JS inside of them.

To turn on a widget/gizmo:  Structure / Blocks / Configure / Show block on specific pages (at the bottom).

The Google ad shows up automatically.

There Column Layout:   10+220+525+20+175+10 = 960. pad+Col#1+Body+space+Col#2+pad.

From sideMagic Div.
From headerMagic div.

Bugs and Gotchas

  • Saving after editing may give a Huge Red Error Message
    • Inside the message is the full html of your page.
    • It contains some bad characters.
    • Copy the full html and paste in a good text editor -- which will reject the bad characters.
    • Reload the page (all your changes will be lost).
    • Edit the page, click "Source" and replace all the html with what you have in your text editor.
    • Works with Edit Pad Lite 7, and ??

The Table Border Bug:

Why does a table have a gray top border with either border=1 or border=0?

top right top left
bottom right bottom left
top right top left
bottom right bottom left

It can be fixed by using a style (such as style="border: 0px;" ) inside of <tbody>

top right top left
bottom right bottom left


top right top left
bottom right bottom left

Displaying HTML for visitors to copy.

Google displays code in a <textarea>. The trouble is that CK editor tampers with what's in this area unless it's using PHP mode. But then you can't do regular editing.

If you use PHP text formatting and then switch to Full HTML and back, CK will change > and > etc into &lt; or whatever. UNLESS, you change  <textarea>stufff</textarea>  to <pre>stufff</pre>.

Then you can change to Full HTML and back and then switch to textarea. 

test editing

Why does a table have a gray top border with either border=1 or border=0?

top right top left
bottom right bottom left
top right top left
bottom right bottom left

It can be fixed by using a style inside of <tbody>

top right top left
bottom right bottom left


top right top left
bottom right bottom left




goofy CK editor

something else



Needed: (on HM)

  1. check on zfacts email help & steven should work, but not everything.
  2. find link to node/161.html page and correct
  3. control Watchdog
  4. control caches in db
  5. compare HotDrupal
  6. CDN for speed. Ameer Ghanie gameer@netdna.com at MaxCDN

Maintenance Checklist:

  • After a re-install or upgraded:
  1. ini_set('session.gc_maxlifetime', 100000);  (in sites/default/settings.php. 1-day login sessions)



Theme & Setting

  • The Theme "z-Framework," is set as the default under "Appearance."
  • It is a subtheme of Framework, and is found in:  sites/all/themes/zframe.
  • The "! Notes" file in the folder tells some about how z-Framework has been tweaked, and there are comments in some zframe files.
  • Here's more info organized by looking at the page
  • .
  • Page layout
    • Column width is in zframe/styles.css [styles]. If a column is used, it appears.
    • Coumn widths = 220 0 525 20 175, with 10px of padding on the outside. Total width=960.
    • All the formatting is also in styles.
    • $site_name and $site_slogan are set by drupal / Configuration / System
    • favicon, logo, and header_image, are located in zframe/
      • header_image is named and controlled in zframe/styles.css in the Header section.
    • Main menu, is turned off in zframe/page.tpl.php. (It would run across the bottom of the header.)
  • Blocks
    • Structure > blocks
    • The Google Ad blocks contain PHP to turn them off when editing.
    • The Search form Block has two sets of permissions (dumb and hard to control).
      • Set #1:  People > Permissions-tab > use search, OR, Modules > Search-Permissions > use search
      • Set #2:  Blocks > Search form > Configure > Roles (near bottom)
      • Anonymous users need to have permission both places
  • Front page
    • The Read More footers have been turned off with jQuery in the About page. They looked funny and took too much space.
    • The top entry is from the about page, and it's header has been turned off with jQuery in that page.
  1. Theme Tweaks
    • /sites/all/themes/zframe     a subtheme of framework
    • zframe.info        creates the subtheme
    • style.css            contains most tweaks
    • my-jquery.js      contains js for Magic Blocks and popNotes
    • html.tpl.php       contains home page html-title
    • logo.png,  favicon.ico
    • reset                  essential, perhaps because it over-rides the updated reset
    • page.tpl.php     preventserror in top menu appearance -- why? blocks update?
    • The Horizontal Rule <hr /> gets a wide bottom margine.



Backup & Update

Move and Duplicate sites with unix:


To transfer files:
scp local-file-name carbonomics.org:new-file-name
This is a "Get" version that worked:   scp carbonom@carbonomics.org:file ./

The command that duplicated old zFacts:  time wget --limit-rate=600k -m -k -K -E http://zfacts.com -o log

Backup with Drupal

  1. How:   Configuration  /  System  / Backup & Migrate  or click here
  2. What:   This just backs up the MySQL DB (to the drupal server) in 
  3. Where:   /home/carbonom/public_html/private/backup_migrate/manual

Backup with C-Panel

  1. Start C-Panel ( see Google spreadsheet "Computer Notes" tab=Web Sites)
  2. Choose:  Files / Backups:
    1. Backup Home Directory (all Drupal except MySql)  160MB, Sept. 2011
    2. Download to:  MyDocuments  /  ! Web  /  Drupal Backup  /  Date
    3. Backup MySQL dbase.  Very small

Update Modules

  1. Click:   Modules / Update tab / Check the boxes /  "Download these updates" button
  2. Configuration / Development / Performance / Clear Cache    click here

Update Drupal Core (minor, e.g. 7.5 to 7.7)

  1. Download the tar.gz file
  2. upload it to Home/carbonom  and unpack it with the C-panel / Files / Extract to  publich_html.   It will land in it's own folder.
  3. Make a drupal_old folder and copy .htaccess and the six drupal folders (but not /sites).
  4. .htaccess has been modified a lot, but setting.php in sites/default/ has not been modified.
  5. Some instruction in google sheet: ComputerNotes / Drupal on how to get through setup if necessary.
  6. Overview of what's needed:
    1. Replace the drupal code folders: includes, mis, modules, profiles, scripts, themes.
    2. Replace the files in public_html except for .htaccess
    3. Replace /sites/default/default.setting.php   (this is needed)
    4. Don't replace the rest of the stuff in /sites
    5. Perhaps go through drupal set up and tell in the MySQL dbase name, owner, passwd

CK Editor

From Dan: file upload capabilities, and thought that I would pay $59 for the CKFinder file browser. But I had a lot of trouble getting it to work, and in searching for solutions to my difficulties, came across others with the same difficulties who solved them by using "KCFinder"

Double Quotes Bug:  They turn into "\&quot; in CKeditor. This is caused by PHP. See Drupal Installing


  1. Do not install the Drupal's WysiWig module, only the Drupal ckEditor Module.
  2. Install the ckEditor drupal modual using the drupal modual installer (http://drupal.org/project/ckeditor), and read the README file.
  3. Put the files from http://ckeditor.com/download in all    /sites/all/libraries/ckeditor/
  4. Modify Toolbars for Filtered and Full HTML: ( http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar )
    1. Configuration > CKEditor > edit > Editor Appearance 
    2. Add:  ['DrupalPageBreak']  (the Drupal Teaser Break is already there.)
    3. Add:  ['mediaembed','IMCE'] (since the Plugins / IMCE check box does not seem to work.)
    4. Add:  Styles:   ['Styles','Format','Font','FontSize'],
  5. Other configurations:
    1. Configuration > CKEditor > edit > Advanced Options
    2. Spell checker is turned off (good--it times out in 30 days) (this might be due to the ABC SCAYT button in the toolbar. 
    3. Now at this " CKEDITOR.config.disableNativeSpellChecker = false; " to the bottom of   modules/ckeditor/ckeditor.config.js
    4. Some JS configuration and info about ckeditor.config.js is here.
  6. Add 'DrupalPageBreak'  and 'DrupalBreak' if missing.   Configure > CKEditor > Appearance > edit.  But DrupalPageBreak Need Paging module, which is not in 7 yet (maybe silly).
  7. Uncomment 2 pair of lines at bottom of ckeditor/ckeditor.config.js   for  mediaembed and IMCE. Then  Configure > CKEditor > Appearance > edit  ['mediaembed','IMCE']


  • sites/all/modules/ckeditor/ckeditor.styles.js
    • This file defines custom styles used with drop-down styles button while editing.
  • sites/all/modules/ckeditor/ckeditor.config.js
    • This file defines classes and styles that will be used in the CKEdidtor window to make it more wysiwig.
    • E.g. define CK style "DateLine" to apply class "dateline." Then define class .dateline in (1) themes/zframe/style.css and in (2) ckeditor.config.js
    • #1 styles the date for drupal users and #2 styles it the same in the CK editor window.
  • Alternative:  instead of modules/ckeditor/ckeditor.config.js, use  libraries/ckeditor/contents.css
    • I used this instead because I can cut and paste into it without any modification.
  • Paragraphs fully justified
  • Titles not indented

Full Toolbar:


    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
    ['Maximize', 'ShowBlocks']

Test CKEditor Styles

a fparjf
and break

Book Making

To Re-Organize a Book:

Login  /  Content  /  Click the "Books" tab  /  Click on "edit order & titles" 

To Re-Order the Books:

Select a book and then select its "Outine tab:

To Re-Order the Main-Menue (navigation bar)

Structure / Menus / Main Menue

To leave short titles in the TOC, but have long titles on the pages, I added a field to all of the content types: Node-Page (visible) Title, field_npagetitle.

Then I hacked   themes/bartik/templates/page.tpl.php  as follows:

<?php if (key($node->field_npagetitle)=='und') print $node->field_npagetitle['und'][0]['safe_value']; // <======= HACK 
else print $title ?>
This is the page I got the clue from: http://drupal.org/node/49768   There must be a better way.

Possibly helpful contributed modules:

For the html page title:  http://drupal.org/project/page_title  7.x-2.4-beta1, Nov, 2010. 55000 use it (1,400 D-7). 

For the html page title:  http://drupal.org/project/simple_page_title,  I think you can write your own. Not in  D-7, only 33 users.


File Storage

  • Images & IMCE
  • Configure IMCE -- #1 specify where the image files ae
    • <root> seems to be any of the three standard "files" folders all/files, default/files or [multiuser]/files
  • How to include images
  • Drupal Image Fields
    • Their problem is they give you almost no control over where the image goes.


  • File-System Standards
    • Folders:  ( <root> = sites/all/ files )
      • Documents:  /doc
      • Images: /image
    • Subfolders for doc and image = one for each "book" -- debt, econ, climate, energy, politics, war
    • General (zFacts / About / Iinfo / Free) files go directly into /doc or /image
    • File names:
      • Graphs, etc.,  that get updated don't include a date in the name
      • Docs start with creation date, e.g. 2011-09


Blogs & Users

Users: "User 1" owns the sight. Be careful. See who is user 1 at URL user/1

Don't blog as user 1 if you are ever going to let someone else help write the blog under your name.

User zFacts owns the only active blog (for now). It's listed as  zFacts Bog under "Don't Miss."

Supposedly the Bog module will compile all the user blogs into one big blog.

Blogs: Each user has one blog with all posts at user/whoever.

  • Each post has it's own page.
  • Each post can be promoted to the front page, or not.



Clearing Caches:

  1. Ctrl R, or maybe Sht-Ctrl-reload
  2. Open a new Incognito window
  3. in Chrome: Tools / Clear Browsing Data -- Shft-Ctrl-Del
  4. Clear Caches in Drupal

Widgets / Gizmos

  • See "Magic Content" under "About / Help Editing"

Making Pages to Teach Vistors How to Install Gizmos.

  • To display code for copying, first make a table cell
  • Style it in Editing Source Mode with:  style="font-size: 12px; background-color:#eeeeee; border:1px solid black;"
  • Return to normal editing moder
  • Copy code in using the "Paste as plain text" Icon.
  • Select the text and Style it "Computer Code."



  • Inline CSS can be used in an HTML tag:  <p style="font-size: 16pt;" >
  • Embedded CSS can be used in the head of an HTML file (for the whole file, like this:
    • <style type="text/CSS">
    • p {color:blue;}      /* This will turn all paragraphs blue. (This comment is OK in CSS.) */
    • </style>
  • Linked CSS is used for themes, and the CSS in in  file_name.css  files.
  • Link from an HTML file like so:  <link href="style_sheet.css" type="text/css" />
  • Link from a CSS file like so:  @import "file.css";
  • CSS "statements" look like this:

what-to-style { some styles; }
what-else-to-style {
  style 1;
  style 2;

  • What to Style can be defined in may ways. Some examples
  • p     All paragraphs
  • a     All anchors
  • p, em     All paragraphs and all emphasize tags
  • p em      All emphasize tags that occur within paragraph tags (children, grand-children, etc.)
  • p>em      All em tags that are childred (not grandchildren, etc) of paragraph tags
  • p * em      All em tags that are grand-, or great-grand-children, etc. of pragraph tags (but not children).
  • h1 + p       Paragraph tags that directly follow h1 tags.
  • .myclass     All tags that contain class="myclass"  (note the initial period).
  • p.myclass     All paragraphs with class="myclass"
  • p.mine.yours     All paragraphs with class="mine yours & possibly others"
  • #myid        The one and only tag that contains  id="myid"
  • a:link    All inactive links (link is a pseudo class, and you don't have to use class= )
    • a:visited, a:hover, a:active  --  these work as expected.
  • p:first-child     The first-child tag inside a pragraph
  • input:focus      An input field of a form that has focus
  • Some Styles
  • Most of these are easily understood from reading the theme CSS files you need to modify.
  • color: #00F; color: #1234EF; color:blue;
  • margin: 0 10px 0 20px;   (top, right, bottom, left)
  • border: 1px solid #ccc; 
  • font-family: Lucida Grande, Verdana, Arial, sans-serif;
  • font-size: 1.5em; line-height: 2em;
  • text-align: justify;   Or: left, center, right
  • Units: must go right next to the numbers (no space)
  • Units: in (1), cm (2.54), mm (25.4), pt (72), pc (6), px (72) --- (number of units per inch)
  • Units: em (the height of the character box), ex (the height of a lowercase x), %

jQuery, JS, PHP, unix

jQuery for mobile.

jQuery sites:  jQuery.com   jQuery4u.com   W3schools   jQuery Tools

JS:  Mozilla

  • Use Text format: PHP code for either PHP or JS
  • They both just work, but jQuery is prefered to JS.
  • In case of an error, the page (node) may only show an error message. To edit node 89:  www.site.com/89/edit

  PHP Snippets (and some about JS snippets):  http://drupal.org/node/337959 JavaScript in Drupal: http://drupal.org/node/121997 more on drupal_add_js() a php function to add JS to the head. JS in a block seems to just work. A JS-CSS Injection module:  http://drupal.org/project/customcssjs (not for 7 yet) A JS Injection module:  http://drupal.org/project/js_injector  (not for 7 yet)

How to program the unix BASH


jQuery Examples

Paragraph one.

Paragraph two

Paragraph three



Unfortunately the Google Analytics method (below) avoids delaying image loads etc. But it still delays window- and body-loads and anything that depends on them. However, if the gizmo script is just completely missing (and not just slow) it does not delay anything. I think this seems good enough.

<script type="text/javascript">

var x = 2;
function f() { 
alert("inside x = " + x); 
alert("z = " + z);
var z=4;
if (f.s == undefined ) f.s = 5;
alert("f.s = " + f.s);
f.s = f.s + 1;
alert("outside y = " + y);
alert("outside z = " + typeof(z));
alert("outside f.s = " + f.s);
This demonstrates that:
x, y and f.s  are global and permanent
z is local to function f().
Note:  f(q) { }  also make q a local variable within f().

The function statement is magic and causes its identifier to be bound before anything in its code-block* is executed. This differs from the function expression which is evaluated in normal top-down order, so if you changed the example to say:

internalFoo= function() { return true; };   It won't work the same


best lessons on basic objects and arrays,  object creation,  closures

Google jQuery

Google Ad, Stats, etc.

https://www.google.com/webmasters/tools/home?hl=en https://www.google.com/analytics/settings/ https://www.google.com/adsense/report/overview

Google Ads need a PHP window, and should only run not editing. Like so:
<?php if (!user_is_logged_in())
echo <<<END
<br /><br />
<div style="text-align: right;">
  - - - Google Ad Goes Here - - -


Google Analytics     G Webmaster Tools


  • Constructed by the XML Sitemap module and its associated XML sm Node module.
  • The associated XML sm engines module will submit it to Google and Bing
  • Use Configuration / Search / XML to set up, recompute or send out.
  • Everything is set to happen once per day (I think).
  • Check on Google sitemap here

I'm already using Google Analytics Asynchronous Tracking Code

For Filtering my out of the stats, my IP address is, but it varies, so I need to recheck several times.

AdSense: All ads below content except for one 468x15 link unit.

  • Left SB:
  • #1 Link unit below search
  • Content:
  • #2 468x15 link unit in content
  • #3 300x250 display below content
  • #4 728x90 Leader board at very bottom
  • Right SB:
  • #5 small link unit at top
  • #6 wide skyscraper below my gizmos

On important pages: Install #2, move #3 into my content body, turn off default #3

Google Speed Tools

Google Analytics

How I exclude myself from Google Analytic.

  1. Visit the page gAnalytics.html, which includes some Javascript that sets a cookie
    •  <body onLoad="javascript:pageTracker._setVar('test_value');">
    • Google help link 
  2. There is a Custom Google analytics filter to exclude me.
    • Filter Type: Custom filter > Exclude // Filter Field: User Defined // Filter Pattern: test_value // Case Sensitive: No
    • To set up a filter in Google Analytics Click "Admin" then click the "Filters" tab.

The PHP checks if you are logged in and if you are not then it adds the Google-Analytics JS to the HTML header.

<?php if (!user_is_logged_in())
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4419146-5']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
", "inline");  <=This is the end of the drupal_add_js( ) function (a PHP function)
This code must be added with  "PHP code" Text format.
It is added to a block (I put the block in the left footer).

Making Videos


library of congress
jamendo/music/creative commons ??


Adobe Premiere Elements
Song Vegas Elements
Pinnacle Studio Plus

Page Forwards

  • Select a bit extras at the top.
  • View source, view normal -- see if the font is OK.
  • Delete top empty paragrph
  • Delete side paddinig cells:   <td width="19">&nbsp;</td>  (use shift enter for a line break)
  • 10px => 0px ,   5px => 0px  (reduces vertical spacing between rows)

  Site setting for zfacts:  Left margin = right margin = 19, cell space height = 0.  


zFacts pages that are aliased by Drupal
(Aliased pages that have external links.) (alias created on page: URL Path Setting)
1 /p/461.html Debt Clock /p/35.html Gas Price
3 196.html Oil Price 318 Debt Graph
5 green-energy Green Energy 194 Carbon Dioxide
7 447 Cost of Iraq empty Home
9 784 SS Crisis 63 Eth Subsidies
11 1195 Debt % Graphs 576 CRS
13 1170 ReaganBush Debt 60 Ethanol
15 57 Reagan's Budgets 436 Eth = 2/3 Gas
17 775 Reason for Iraq 480 Presidents+Debt
19 49 Global Warming 486 Leninist SS strat
21 226 CO2 is cause 64 Fentun is here
23 789 National Debt Clock 85 Cellulose Ethanol
25 519 Bush Deficit 252 Iraq War
27 139 A Clean Break 1159 Depression ?
29 voodoo Voodoo Econ gross-nat... National Debt
31 1197 Video and Slides 477 Social Security
33 783 Top 10 GW facts    


zFacts pages with 301 Redirects in .htaccess
(Redirects are for pages that are much visited, but not aliased.)
1 581 iraq-war-quotes: WMD 108 242: Katrina Date
3 426 243: ADM & Ethanol 1117 85: Stimulus
5 1165 130: Save or Borrow 416 244: Wind
7 790 245: Debt Data 126 246: Stop Warming
9 364 247: Iraq Giz Instruct 222 249: Polar Melting
11 679 251: Bomb Cambodia 1136 164: Wars
13 190 253: Gulf Stream 202 280: Temperature
15 990 255: OPEC gas tax 483 193: Is SS safe?
17 54 89: Energy Policy 330 US-economy
19 87 iraq-war-quotes: 1196 p/1197.html: videos
21 800 220: ND clock 205 161: warming effects
23 295 286: Nuclear    



The Chron Jobs that run daily and keep the gizmos up to date are in /giz/G02.

The get_debt.php chron job updates:
/G26/GND_clock1.js";  /G26/GND_clock3.js";  /G05ndc.js";  /G12ndc.js";  /G04acct.js";
The National Debt Clock page runs on G04acct.js




zFacts runs on Drupal, an open-source content management system (CSM). Basically, Drupal is the big brother of WordPress. Drupal does, blogs, books, forums, galleries etc. on a mix-and-match basis. It's much more flexible but hard to learn.

How Drupal got its name. Dries Buytaert was looking to buy a URL, and mistyped dorp, meaning village in Dutch. So he bought drop.org. The Dutch word for drop is druppel, which English speakers pronounce "droo-puhl," and which Dries transliterated to Drupal when he released the first version of the software publicly in January 2001. Now the White House web site runs on Dries' drops.

Drupal hosting


  1. Three Titles
    • /sites/default/modules/three_titles
    • This allows content type with two added fields to accept 3 titles: for TC, page, and Google
  2. PopNotes
    • /gizmo/jquery-tools/tooltipsy.min.js
  3. Magic Blocks
    • JS is in my-jquery.js of sub-theme folder
    • tooltipsy is in gizmo folder
  4. .htaccess redirects
  5. CKEditor
    • /sites/all/modules/ckeditor/ckeditor.config.js
    • disableNativeSpellChecker = false;  // allow brownser spellchecking in edit mode
  6. Folders
    • ebooks
    • giz
    • gizmo
    • metaPage     Contains the old zFacts library
    • private



The site can use either www. or not. If  www  is used, it redirects to not (just zfacts.com). This is set in .htaccess about line 93.  

This is the Drupal page about redirects and 301:  http://drupal.org/node/38960

A simple redirect: 

RewriteRule ^p/54.html$ http://carbonomics.org/node/89 [R=301,L]

L means "this is the last re-write"


Theme switching module: http://drupal.org/project/themekey.   Fusion:  http://fusiondrupalthemes.com/

Main Drupal.org Sub-theme page:  http://drupal.org/node/225125

Sub-theme for Zen:  http://drupal.org/node/1010576, help: http://drupal.org/node/193318

Over-riding style sheets from base themes:  http://drupal.org/node/263967    

Drupal Themeing Guide  http://drupal.org/documentation/themes/bartik

Good links to theming pages  http://drupal.org/node/341628


The width for the various regions are set in bartik/css/layout.css. Remember to decrease the width of the other regions by the same amount that #sidebar-first was increased. The region selectors are:

.one-sidebar #content
.two-sidebars #content
#sidebar-first (left)
#sidebar-second (right)


Mulitisite Installs:

magic_quotes_gpc = Off

  • Magic quotes should be turned off by .htacces
  • But on April 27th, 2012 this failed
  • So I had to create php.ini in public_html and turn it off with the ini file.
  • Create this with C-Panel  /  PHP-Config.

Faster PHP:

  • PHP-Config can also select a faster kind of PHP deployment.
  • I intend to turn that on.

Content Types, Fields

Content Types, articles, book pages, etc., are comprised of fields.

  • A field may appear multiple times in Edit mode: Structure > Content Types > Manage Fields > Edit > Number of Values.
    • If the Number of Values is increased, say from 1 to 2, and data is enetered in "value" 2, and then the # of Vals is decreased to 1, the data in #2 will no longer be visible, but it is not lost. If the # of Vals is increased to 2 again, it will return to view.
  • If a field, e.g. "Body," is deleted from one content type, all the data for that field and that content type is lost, but other content types that use the field are not affected.
  • To get a text-area field to be small, set it to one line and to Plain Text format.



  1. Navigate drupal to "Modules"
  2. Click "Add modual" near the top of the page.
  3. Goto  http://drupal.org/project/modules, find your module page, scroll down to "Download," right click and save address of the tar file you want.
  4. Paste the address in to the module installer, and click install.
  5. Do NOT hit the "back arrow" on your browser.
  6. Go to the Modules page and activate it.



  • (for placing breakpoints in modules though, currently xdebug_break() does the trick.
  • A simple way that works for me is to use drupal_set_message('Some text') which ends up displaying in the message area on the page. So for printing a simple variable I might use something like drupal_set_message('Variable name: ' . $variable) or if the variable is an array or object something like drupal_set_message('Variable name: <pre>' . print_r($variable, TRUE) . '</pre>');
  • Good debugging page:  https://ratatosk.backpackit.com/pub/1836982-debugging-drupal

Links to Info:

Example Code:


1022 * Implements MODULE_preprocess_node().
1023 */
1024 function media_gallery_preprocess_node(&$variables) {
1025 // Do not show the title when a node is being displayed in a media gallery
1026 // block.
1027 if ($variables['view_mode'] == 'media_gallery_block') {
1028 $variables['title'] = '';
1029 }
1031 // Gallery teasers (for example, the ones that appear on the Galleries page)
1032 // require special theming of their content. We set that up here instead of as
1033 // part of hook_node_view_alter() or similar, because we want the node itself
1034 // to have #theme='node' as normal, and only want to add special theming for
1035 // the node content, but the content element isn't created until
1036 // template_preprocess_node().
1037 if ($variables['node']->type == 'media_gallery' && $variables['view_mode'] == 'teaser') {
1038 $variables['content']['#theme'] = 'media_gallery_teaser';
1039 $variables['content']['#node'] = $variables['node'];
1040 }
1041 }




Big picture: Drupal Core Default Theme  =>   Real Theme


  • HOOK:  A placehoder that must be replaced by, 'node', 'page', ect, or by a user theme name or user module name.
  • $vars:  An array of variables and arrays.  $vars[title] == $vars['title'] will turn into $title when it is handed to the template file or theme function (not sure how).
  • Template file: Mix of HTML & PHP and produces HTML output  shown on web page. HOOKname.tpl.php. The core template HOOKnames are: html, page, block, node, field, etc etc.
  • Theme function: Equivalent to a template file but for programmers instead of designers. Generates HTML output. Core theme functions are named theme_HOOK($vars), theme_breadcrumb(), etc. . API
  • theme($hook, $var): THE theme function (not one of the template-file equivalents). E.g. if $hook='node' it will call either the node template file or the node theme function and pass it $var from which it will generate HTML. API
  • Override: A template file of the same name in sites/all/themes/ will be run instead of the core template file. page--article.tpl.php will override core page.tpl.php for article nodes.

Three Scenarios:

  1. Build something (e.g. myblock) and theme it with a theme function in a module
  2. Build something and theme it with a template
  3. Tamper with the default or real theme

Scenario #1: Theme function. Define:   function theme_myblock($vars) { ... }

  • $vars = array( items => array('cat' => $cat; 'dog' => $dog,), 'title' => $title, type => $type, attributes => $attribs);
  • Never call function  theme_myblocks($vars).  Instead call:
  • theme('myblocks', $vars);
  • And drupal will call your function at the right time.


Info about head_title http://drupal.org/node/655742

Testing page


A very simple body.

Another page i


level 8

one to go

The Bottom Line

Non-Node Pages


How to put various types of content onto one page.

The front page allows this. Promote any node to the front page.  This only works for the official front page. If you re-direct and make a different page your home page, it won't work.


  • Nodes are given a special keyword, then Drupal makes a page for them.

Techie Stuff

Drush:  http://www.opc.com.au/web-development/introduction-drush-drupal-power-tool

What are the public_html/  folders for?

cig-bin Hot Drupal
drupal_prior Previous installed version. Used during upgrade
ebooks zFacts ebooks, emails etc.
zFacts gizmos
gizmo jquerry tools (should be relocated)
includes Drupal


Drupal & zFacts Folders

Folder in:   /home/carbonom/public_html
cig-bin Hot Drupal
drupal_prior Previous installed version. Used during upgrade
ebooks zFacts ebooks, emails etc.
zFacts gizmos, jQuerry tooltipsy, energy calculator
includes Drupal
metaPage zFacts library (old but still used)
misc Drupal
modules Drupal
private MySQL backups made by Drupal
profiles Drupal
scripts Drupal
sites My websites
themes Drupal
zfacts.com duplicate of old zfacts
../scripts My scripts in /home/carbonom
Backed Up: sites, ebooks, giz, ../scripts


News Widget

  1. Login and edit this page.
  2. Enter your News story in box below.
  3. Push the "Publish" button.
  4. Continued below ...
Super Catchy Headline
All the news

Does he cave in to Republicans? Is Obama too bipartisan. He does offer compromise and avoid divisive rhetoric, but there are two possibilities.

  1. He sincerely tries to make peace and compromise but stands his ground.
  2. He just has no backbone and needlessly caves in.

Progressives try to figure out which describes the real Obama by listening to his words. And, those don't sound tough, so they think he has no backbone. But what did Teddy say? "Speak softly but carry a big stick." There are two reasons to speak softly, (1) strategy and (2) weakness. Look beyond the surface to tell which is at play.

I say, there's a damn good chance—no a certainty—that Obama's bipartisanship is [#strategic], not weak. This doesn't mean he's deceptive. He really does think extremism is a bad thing, and he knows most American's agree. So sincerely trying for bipartisanship is good strategy—the middle is sick of extremism. It's also what Obama believes. But he knows that when the extreme right blocks all progress, his bipartisan stance (his strategy) pays off.  See the irrefutable evidence.


  • Now, reload this page and your news story should show up in the "remote widget" below. (After you clear your browser's cache!)



Warning: Two non-problems:

  1. Browsers cache files like the znews.html file that shows up in the widget. Next time the browser needs that file, it gets it from the cache to save time. If the file has changed, too bad, you will see the old cached version. Remote viewers will experience little if any problem. The news publisher can over-come this problem by learning about 3 keystrokes to clear the browser's cache manually. It looks like there is a way to prevent the publisher from needing to do this, but it will probably take 2 -- 8 hours to get it working.
  2. The formatting looks different in the publisher's window than in the widget window. This is because the publisher's window above is embedded in this Drupal page and Drupal uses CCS to modify the meaning of standard HTML. The widget shows standard HTML. Once the publisher's window is installed in a plain HTML page, the publisher will see standard HTML, and the two will look the same

Here's the Remote News Widget:

<iframe src="http://zfacts.com/giz/G28/znews.html" style="border:2px solid #900; width:400px; height:100px;"></iframe>

The Publisher's Setup:

The publishers web page will need to install a "<div>" for the news-entry box followed by a second one that contains the Publish button. The HTML for those is the following:

<div id="NewsStart" style="border:2px solid #393; padding:6px; width:500px; ">
<div id="NewsEnd" style="text-align:right; border:1px solid #DFE; padding:0 6px 0 6px; width:500px; ">
<input onclick="zpublish()" type="button" value="Publish" /></div>