Amazon products on Content Management Systems and PHP-MySQL

Tuesday, May 27, 2008

A fully automated, dynamic website without operator intervention

If only web maintenance could be this easy...

"Eureka! Science News just launched – it is a site dedicated to provide the very latest science news, but with a special twist – it is entirely automated! There is no human editor behind it - it finds relationships between news stories from all major science sites and regroups, categorizes, ranks, tags, finds related press releases and publishes them directly on the site. The result is an efficient overview of everything happening in science, right when it happens..."

The following details on how they built the site here: cool stuff!

Google Analytics in Drupal

Been cracking my head in installing the Google Analytics script in my drupal sites. Have this drupal version 7 site, unfortunately the Google Analytics module available as of this writing is for versions 5 and up only. A dilemma for dynamic sites... Tried posting the script in the following as advised in www.drupal.org forum threads: template pages (page.tpl.php), index and incluldes, etc.

However, I think the best method that work for a test site is perhaps creating a block and publishing the google analytics script in there. To best have accurate analysis reports, publish analytics block accordingly, e.g. excluding the /node/edit* pages or /admin* pages. This way only anonymous visits are logged and recorded. On the other hand, reverse the publishing to determine administrative behaviors. Neat! Worked like a charm!

P.S.

Generated reports didn't come until after 24 hours... or a disclaimer from google that due to technical problems it may not generate some reports at all, somethin' like that... the adage, patience is a virtue... indeed!

Wednesday, May 7, 2008

Need to install Apache, MySQL, and PHP (Linux, Mac OC, Solaris or Windows)?

I was reminded of a friend who asked me the other day about installing a CMS package, as well as installation of Apache to his server... Thus, this article... He was asking for feedback on manually installing each application needed: Apache web server app, mysql and php... Manually installing each package separately may be the best, effective way. However, personally, I have had no problem in installing the three in a bundled package like most LAMP packages offer... Besides, I tried the manual installs and found it to be a tedious process... Personally tested XAMPP, a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package also includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin.

Download XAMPP and other add-ons at these links (for Linux, Mac OC, Solaris or Windows):

Tuesday, April 29, 2008

New or recent content not updated (and not searcheable) after publishing (drupal reindexing)

Perhaps the most basic questions asked by newbies might be on why after editing content, and after publishing, edited and recent contents are not updated. Or, why pages or stories are not searcheable after having been created or edited.

Recent versions of Drupal may not encounter these anymore, however just in case, this is simply a matter of reindexing your site. The ff. may be checked:

- within drupal's administer page: administer > search > reindex your site, or check desired / appropriate settings

- check out and download poormanscron module, a croning (reindexing) module for drupal with userfriendly settings page (administer > modules > poorman's cron)

- lastly, the fastest and most basic drupal re-indexing in the frontend (layman's: using the web browser directly): append to your site's url this... /cron.php (this will start the script in cron.php reloading the database content on the frontend)... e.g www.sitename/cron.php

Monday, April 21, 2008

Forgot your admin password in Drupal, Joomla, or any other php run cms with mysql database (with management in phpmyadmin)?

Forgot your password in Joomla, Drupal, or any other php run cms with mysql database (with management in phpmyadmin)?

In the event you forget your administrator password or passwords in in Joomla, Drupal, mediawiki, coppermine, etc. (or any opensource php-driven cms with mysql database manageable in phpmyadmin for that matter), a workaround is fortunately available. For newbies, forgetting one's administrator user account's password the only solution will have to be re-installing the entire cms from scratch thus re-creating an administrator account in the process. A solution is as follows:

- Go to site/phpmyadmin (login, of course assuming you have the necessary rights to the database/s)- Browse for the database, then the table (in the case of Joomla, Drupal, etc. this is commoonly the table 'users') intended to be edited

- click edit user, then under the 'Function' column (dropdown list) choose MD5, edit the 'Value' or your password (you will initially see the encrypted version of your original password), then type in the desired, new password of your choice

- Lastly, don't ever forget your password again, silly! :D

Thanks to pete avila and michael perido for the tip! cool guys from the pacific rim, philippines :p...

Wednesday, April 9, 2008

What is TCPDF - PDF class for PHP?

Below is a followup article to pdf module employed in drupal.

What is TCPDF - PDF class for PHP?

TCPDF is a PHP 5 class for generating PDF files on-the-fly without requiring external extensions. TCPDF is an extension and improvement of the FPDF class (www.fpdf.org). Supports UTF-8, Unicode, HTML and XHTML.

With regards to drupal it is a third party apps for php used in pdfview module which enables a pdf view or download as pdf option for nodes or pages. Simply extract the folder where the readme files instructs you to. Warning though, read a few forum on installation issues... reading the readme and install files thoroughly is a must! :D

Download TCPDF here:

for php 4:
http://sourceforge.net/project/showfiles.php?group_id=128076&package_id=140231&release_id=577068

for php5:
http://sourceforge.net/project/showfiles.php?group_id=128076&package_id=140403&release_id=577072

Wednesday, February 20, 2008

View Drupal page (or node) as pdf or download page as pdf module in drupal

Pdfview in Drupal is a module that generates simple PDF version of pages from Drupal nodes/pages. The nodes can contain images. It appears as a breadcrumb beside other items like email this page, printer-friendly version, etc., below each page, story, or node.

The 4.7 version supports UTF8 and relies on TCPDF. Older versions require FPDF from http://www.fpdf.org.

Steps:
1. Download pdfview module from drupal modules (http://drupal.org/project/pdfview), check corresponding version appropriate.

2. Extract (install) in site/modules directory... enable in administer > modules... apply necessary roles and permissions

3. Download another required third party extension, TCPDF (choose corresponding version for php of your webhost, either 4 or 5, currently)... extract this to site/modules/pdfview/ directory... rename to 'tcpdf'.

4. Double check with documentations for errors... useful thread here http://drupal.org/node/130779#comment-738033 ... using this thread post add the ff. to tcpdf/config/tcpdf_config.php:

5. That's it.. test it in your browser, enjoy!

Note: works fine for IE, however current Firefox version doesn't seem to support adobe features/add-ons... Please test with other browsers like Safari, Opera, etc. accordingly, thanks!

------------------------------------------
Drupal Group: http://groups.drupal.org/pdf

Tuesday, February 12, 2008

Printer friendly pages in drupal: customizing formatting options

To edit the fonts (fontsize, font style, etc) and other text properties (or html attributes and properties) of printable friendly page of drupal sites 4.7,

Go to:
- site/modules/print/
- open print.tpl.php
- edit accordingly

I thought editing site/misc/print.css is enough... can't seem to have it done the way i want it to be though... obviously, text font and other formatting should be done in print.tpl.php not (only in) print.css...

simply put... treat this php page with htm tags, attributes, etc. for the desired formatting of your printerfriendly drupal page.

------------------------------

Friday, February 8, 2008

"Make sure you have a working image toolkit installed and enabled" error in Drupal

Having installed image module for Drupal, I began having this error in admin pages:

"Make sure you have a working image toolkit installed and enabled"

it says "for more information see settings page"

Solution would be to enable the ImageMagick toolkit in the settings page (don't be surprised if this is not available in the drupal forum before):

Go to settings > image handling > enable imagemagick or gd2

afterwhich the image handling option will not be made available anymore (not viewable from the settings page)

See other suggestions here from the drupal forum
- http://drupal.org/node/60927

Tuesday, January 22, 2008

Installing tinymce WYSIWYG editor in drupal

Originally posted in: Installing tinymce WYSIWYG editor in drupal Jan 22 '08 12:37 AM

Drupal TinyMCE vers. tinymce-4.7.x-1.x-dev.tar.gz

The following are taken from the default drupal tinymce module INSTALL.txt that *I think* needs detailing for newbies and first-timers (I have omitted instructions on the optional javascript tinymce compressor and AJAX spellchecker):
---------------------------------------------------------------
NOTE: During this installation process you'll be asked to also
install the official TinyMCE package from
tinymce.moxiecode.com.

1. Place the entire tinymce directory into your Drupal modules/
directory.

2. Download TinyMCE 2.0 from
http://tinymce.moxiecode.com/
Remember to uncompress the file and make sure the folder is named
'tinymce'.

3. Place the entire 'tinymce' engine folder inside your modules/tinymce
directory. So the TinyMCE engine will live in modules/tinymce/tinymce

4. Enable this module by navigating to:
administer > modules
*note - all database tables will be automatically created during this step

5. Setup role based tinymce profiles via
administer > settings > tinymce

Personal notes:

I think it is necessary to clear a few things here in the instructions particularly for those who are freshly starting with drupal and drupal modules... I have encountered problems in installation and reinstallation of the tinymce module, not because of the engine itself, but because of the instructions found therein. Of course, don't blame the install.txt if newbies and dummies (such as I) fail to read a few more notes and resources, or fail to experiment with a few things and tricks...

Here's a few things to those having a hard time installing the tinymce module. This is not a troubleshooting issue, since there is nothing wrong with this important and essential drupal module:

1. First things off, you need to know there are two tinymce's you have to download:

- tinymce module from the engine developer http://tinymce.moxiecode.com/... links below may have updated versions as of this writing:

Tar GZip compressed file: tinymce_2_1_3.tgz
Zip compressed file: tinymce_2_1_3.zip

- tinymce (development) module from drupal itself, http://drupal.org/project/tinymce:

5.x-1.x-dev2007-Dec-1736.08 KB
4.7.x-1.x-dev2007-Mar-3134.9 KB

Note it is critical to use the corresponding modules with each version of drupal!

There! It's clear now you need the two downloads of tinymce, from drupal and moxicode...

2. Install the tinymce (drupal module)...
The files contained in the module should be extracted into site/modules/tinymce/tinymce... yes there should be two (folders of tinymce at this point, one a subfolder of the other)

3. Install the tinymce (moxicode engine)...
Extract the files of this module inside site/modules/tinymce/tinymce/tinymce...
and yes! there should be three folders of tinymce at this point... 2 tinymce sublfoders of 1 tinymce folder... if this is confusing let me try to clear it in heirarchially:

site/
site/modules/
site/modules/tinymce/ (drupal's)
site/modules/tinymce/tinymce/ (drupal's) (contains drupal tinymce files)
site/modules/tinymce/tinymce/tinymce/ (moxicode's) (with moxicode tinymce files)

4. Follow the rest of the instructions found in INSTALL.txt found therein...

Hope this article helps!

The search (and the wait) for a contact directory or business directory module... (in Drupal 4.7.x)

Posted from my other blog http://drupalexperiences.multiply.com "The search (and the wait) for a contact directory or business directory module..." - Jan 15, '08 3:43 AM

Again, following have been based in Drupal 4.7.x

Sad to say people... to those looking for a contact directory module for drupal, there are but developments of a directory listing module for this cms. As of this writing, there are two directory modules listed for the purpose of managing, viewing and listing of one's contacts and contact directory. These are as follows:

1. contact directory module for drupal 4.7.x

Download drupal contact directory module

This module allows users to manage their own contact list in drupal. Some constraints can be applied like max number of contacts per user, private or public directories and administration permissions.

Requirements
- Drupal 4.5.x
- PHP 4.3.0 or greater

However... after downloading , installing, and enabling the said directory, then applying the permissions, going to Contact directory admin page results to the error below:

Fatal error: Call to undefined function: tablesort_pager() in /home/portal/html/main/modules/contact_dir/contact_dir.module on line 568

Populating the database with the contact directory tables ('contact_category' and 'contact_directory') needed still produces the same error. Otherwise, without the sql below error can be seen in the admin pages:
  • user warning: Table 'pooch.contact_category' doesn't exist query: SELECT cid, name FROM contact_category ORDER BY name in /home/portal/html/main/includes/database.mysql.inc on line 121.
  • warning: Invalid argument supplied for foreach() in /home/portal/html/main/modules/contact_dir/contact_dir.module on line 401
Clearly, we need to wait up for more developments for a more stable module...
else...follow this thread on contact directory module forum and support threads in drupal.... and work on it, guys hehe...

2. business directory module for drupal 4.7.x and 5.x (threads to business directory in http://www.drupal.org)

This module is clearly under-development as of this writing... Looking forward for it, though! :D

If there are any modules suited for a contact management or business directory or listings for drupal please drop your comments... thanks!




"Unpublished Items or nodes" in Drupal 4.x not viewable? How to access them...

It just dawned on me that everytime we submit articles unpublished in our drupal 4.7.x are only accessible in the logs (watchdog, the module)... To access unpublished articles, logged in users and moderators may check the logs, identify unpublished items (these are mixed in here with the rest of the published stuff), do the necessary filtering like per author (user), content messages, etc. From thereon, edit and do necessary changes, then publish if that's what intended...

In drupal 4.7.x : log entries can be found here ---> http://drupalsite/admin/logs

searches found patches that need to be applied to drupal 4.7.x... not sure though with current versions. A notification of unpublished items to admin and moderators, pending for publication, would be nice, too!

just a trivial thing for dupal users :D

Drupal Products