Showing posts from December, 2011

site-wide bbPress forum for buddyPress

BuddyPress claims to be able to offer site-wide forums without being group-specific. However, when I install site-wide forums, nothing on my site changes. The “Forums” link doesn’t appear, and if I navigate to /forums, there’s nothing available. In the bbPress settings, the “forums base” is set at “forums”, which then gives a message of “Possible BuddyPress conflict: Forums page”. This is how it is with a fresh install of bbPress and buddyPress and without changing any options. To solve the problem, do the following.  go to your settings | forums (on the bottom) You’ll see archive slug and Single Slugs. rename both "forum base" and "forum slug". Because they are actually conflict with the sitewide forum. Go to "Forums" and make a new forum. Copy the forum's link. Suppose the link is Go to the Appearance | Menus section.  Create a custom menu.  In this custom menu, add a custom link to it. This custom…

Chitika pays you to use its Maps

Mark it. May use it if I need it in the future.

Chitika's website:
We’ll Pay You to Use Our Maps. Chitika provides a profitable solution for publishers looking for alternative map providers. Users can opt to include ads within the map units, helping to further monetize traffic on their site. Chitika Maps gives you the opportunity to tap into a new revenue stream!Our maps include a variety of features not available with other map services, including:Ability to monetize your map with integrated ad pinsUnlimited UsageHourly Location UpdatesDirections (coming soon!)

FACELETS_SKIP_COMMENTS "trick" in NetBeans JSF project

When we create a JSF application in NetBeans, .FACELETS_SKIP_COMMENTS is
This will execute those comments in your facelets.
If this is not what you want, set it to true in web.xml:<context-param>

JSF example: event before loading

              <f:event type="preRenderView" listener="#{showController.pc()}"/>

Google analytic profile id usage example

For OLD VERSION analytics page, the ID=xxxxxxxx is the profile ID

For the NEW VERSION analytic page it is the number at the end of the ERL starting with p

An example to use the profile Id in the Analytics API:

//Building an API query
        Get apiQuery =
                "ga:54014919",//TABLE_ID, // "ga:" + Profile Id.
                "2011-09-01", // Start date.
                "2011-09-30", // End date.
                "ga:visits,ga:pageviews");      // Metrics.


Using property file with GlassFish

One way:URL url = this.getClass().getResource("/");
Properties p = new Properties();
p.load(new FileInputStream(new File(url.getFile())));The other way:InputStream in =
Properties properties = new Properties();
properties.load(in);I put the property file under the resource folder in
NetBean web application project.

RVSiteBuilder: add code in the head section

If you need to add code such as Google Analytics code, you need to export the current template at step2 and edit file index.htm. After that, import back to the system.

Email campaign with Google Analytics Example

First step: create a web page as a destination web page. put your Google Analytics tracking code in that page.

use Tool: URL Builder to tag the url

redirect the root path to sub directory using Apache redirect

The following shows how I redirect the root path to sub directory using Apache redirect
Put the following under your html root folder's .htaccess file
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteCond %{REQUEST_URI} !^/yourSubDirectory1/yourSubDirectory2/
# The following does not redirect on existing file and directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# It defaults to temporary if you don't specify permanent
RewriteRule ^(.*)$ /yourSubDirectory1/yourSubDirectory2/$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ yourSubDirectory1/yourSubDirectory2/index.php [L]

Wordpress installation: multi language support

To install Wordpress with multi-language support, we need to set up wordpress database to support multi-language.
So before Openwp-admin/install.phpin your browser,  make sure your wp-config.php has the following setting:

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', 'utf8_general_ci');

Search the following:
define ('WPLANG', '');
    Edit this line according to the .mo file you've just downloaded, e.g. for the Portuguese spoken in Brazil you must add:

define ('WPLANG', 'pt_BR'); For simplified Chinese, it is:
define ('WPLANG', 'zh_CN');
Openwp-admin/install.phpin your browser.

additional ssh security

For additional ssh security, you can configure key forwarding. The following linkcovers the extra functionality of agent key forwarding within ssh:


Parked Domain You have two the domain of your website and you want to want them both to go to thesame place. In other words, when someone types will go to thesamepage(s) on your website.Add-On Domains You have two want the two domains to betotally separate/independentwebsites.For one account, multiple domains, if is your main domain. can be setup on public_html/marrycomhomefolder or any other folder name. While setting up an Addon domain, you can specify the folder name, folder location. If user visits directly then it will show the same site too. We can use .htaccess file to allow only my-other-site to visit its folder.edit .htaccess file in your my-other-site-root-folderRewriteEngine On RewriteCond %{HTTP_HOST} ! Rewri…

Path in Java 7

with Java 7 : Path path =FileSystems.getDefault().getPath(".", "tweet.txt"); To make the migration from earlier Java version easier, the File class has a new method toPath() that allows you to transform File to Path : Path path =newFile(