Archive for the ‘Wordpress’ Category

Wp-NicEdit Updated version 1.0 released

Tuesday, November 11th, 2008

It is more than a week since I released my last plugin  for associating unique header image with each single article of wordpress.

This time I am back again with another plugin “WP-NicEdit”.It’s is a wysiwyg type rich text editor for comments section.

As you may see from the original website of NicEdit(by Brian Kirchoff) http://nicedit.com,He has released a newer version of NicEdit,which has a better well defined API for  extending it.

So I integrated it again to wordpress and that too much more easier than the previous version.

Current features include

1.wysiwyg editor(Choose whether you want default or you want a full panel from admin->settings->Wp NicEdit Settings page.

Settings for Wp-NicEdit

Settings for Wp-NicEdit


2.It allows you to do copy paste using keyboard shortcuts(not available in the older version).

For general information about the wp-nicedit ,please visit my post here http://geekytalks.com/2008/07/wp-nicedit-a-wysiwyg-comment-editor-for-wordpress.html.There you will find the help on installation.Or use readme.txt included as a guide.

The current version of wp-NicEdit allows you to choose either the editor in default mode or in Extended mode from admin->settings->Wp NicEdit settings page.

Download the plugin from official plugin directory of wordpress here http://wordpress.org/extend/plugins/wp-nicedit

here are some more screenshots of the nic edit.

Default mode enabled

Default mode enabled

Extended mode enabled

Extended mode enabled

Please see the comment area of this page for a real world view of Wp NicEdit(note:I have enabled default mode)

if you liked it or  you have any issue,please drop a message here ,I will help you in all possible ways and love to see your messages here.


Wp Unique Article Header Image Plugin for Wordpress

Monday, September 22nd, 2008

hi all.here I am back with another brand new plugin to enhance your blog.Ok,If you have ever thought of the following,then this plugin is for you.

  • You wanted to show unique header image on each single article page of your wordpress(or may be on some of the single article pages)
  • You wanted to have a unique background image for each of your single article page(or may be just on some of them)

If your answer is yes,Then this plugin is for you.It allows you to upload an image using the wordpress new post/edit post/page window.It adds a file uploading button just below the title of the post as shown below

New Post window
2

Now select an Image and when you click publish/save the default image is changed with the current image.

Browse Header Image to upload
2008-09-17_055340

Once you click save/publish,Go to manage->posts->your post and click to edit.you will see that the default image is changed with the new image uploaded.

Post edit window
edit-screen-gt-unique-header

How to use

For your use there is a method gt_get_image_url(), it returns unique image associated with each post.you may use it in any way you want.here is an example,how I modified the default theme on the demo server to show unique header images on each post.

Now,let us edit our themes header.php to make use of unique header on each of the page.we add following snippet of code to our header .php

Code snippet to be modified

Code snippet to be modified

[Please not this is for the default theme Kuberick,which comes with wordpress,depending upon your theme and header you may need to use custom css here]

See the live demo here [Click on the articles on the demo site to see the use of unique header thing)

NOTE:It seems ,someone has deleted all the posts from the demo site,as i mistakenly provided the test user rights to edit/delete posts.well,I will be correcting my mistake tomorrow.For the time being,I encourage you to login and try uploading some image of your choice on the demo site and looking at it in action.

http://plugins.wpdemos.com/gt-unique-header-image/

Do you want to try it yourself,well use following credentials

http://plugins.wpdemos.com/gt-unique-header-image/wp-admin/

User: test

Password: test

Try,posting some new posts with any image of your choice and then click to view the page.
ok,so you need a download link now.Here goes the download link
http://downloads.wordpress.org/plugin/wp-unique-article-header-image.zip


get_userdatabylogin

Saturday, September 13th, 2008

I am going to describe here some of the methods which can come handy for a theme developer or plugin developer,but are not documented at Wordpress Codex.Today, I am beginning the series with get_userdatabylogin($login_name)

Description

It is one of the important but not documented method on codex(as of now),It provides same information as the get_userdata() except the fact that it takes the login name(e.g. “admin” as an argument rather than the ID of user).It returns an object with the information pertaining to the user whose login name is passed to it. Properties map directly to wp_users table in the database.

Usage

The call to get_userdatabylogin() returns the user’s data, where it can be retrieved using member variables.

<?php $user_info=get_userdatabylogin("admin");
echo ('Username:',$user_info->user_login . '\n');
      echo('User level: ' . $user_info->user_level . '\n');
      echo('User ID: ' . $user_info->ID . '\n');
?>

Username: admin
User level: 10
User ID: 1

Accessing Usermeta Data

<?php $user_info=get_userdatabylogin("admin");
echo ($user_info->last_name .  ", " . $user_info->first_name . "\n");
?>

Singh,Brajesh

Parameters

$login_id

(String) (required) The Login_name(Login Id) of the user whose data should be retrieved.

Default: None

Values in users & user_meta table

Here are the values in the users table you can access via this function:

users

  • ID
  • user_login
  • user_pass
  • user_nicename
  • user_email
  • user_url
  • user_registered
  • user_activation_key
  • user_status
  • display_name

useful in user_meta

  • first_name
  • last_name
  • nickname
  • user_level
  • admin_color (Theme of your admin page. Default is fresh.)
  • closedpostboxes_page
  • nickname
  • primary_blog
  • rich_editing
  • source_domain
  • It works in the same manner as get_userdata() ,except that the argument passed in get_userdata() is an integer(The ID of User),while In the case of get_userdatabylogin() ,the argument passed is string(The Login name e.g. “admin”)

See as a reference :http://codex.wordpress.org/Function_Reference/get_userdata


Wordpress 2.6 problems in installing on addon domain

Sunday, August 17th, 2008

For the last two days,I was just wondering.I tried to install wordpress 2.6 and 2.6.1 both my add on domain with no luck.I have my hosting with BlueHost.com,The addon site was http://TheTurningBrain.com, and my main domain was http://BloggingVibe.com.I uploaded wordpress 2.6(later 2.6.1 too) to the TheTurningBrain.com folder,and tried to access the installation screen by typing in the url bar http://TheTurningBrain.com after one or 2 second,Instead of getting the installation screen,I was getting redirected to my main domain BloggingVibe.com. I tried it more than once(Let me mention here,I don’t use auto script installer,provided by the web host).

one time,twice,thrice,I just got wondered,Is there a problem with redirection mechanism.I deleted the files(wordpress files and folders) from TheTurningBrain.com folder and now,I was able to view the http://TheTurningBrain.com .I was not getting redirected now.So I again uploaded and tried but again the same result.I contacted the technical support person of bluehost.This guy called Anthony,Just annoyed me with his bloody naive answers.I was looking for the technical details and he was saying he is not a wordpress support and so.Anyway,I made my mind to change my hosting and re host at hostgator.I was planning that but also looking for other alternatives like DreamHost and yellowPages.

Suddenly,After two days,I don’t know what happened,Just for my curiosity I uploaded wordpress2.5.1 to my add on domain folder and tried to install.1.2.3. ….here is the famous five minute installation screen.OMG,I just found,It was a problem with wordpress 2.6.x which was not allowing me to install it on my add on domain.ahh..sorry bluehost guys for bothering you with the problem.

So what,Do I have to remain with the older version of wordpress?

No,not at all.I installed wordpress 2.5.1 successfully on my add on domain.After that I just downloaded worpress Auto Upgrade plugin and upgraded the site to wordpress2.6.1.Yes, It’s working and I have got a work around.


WP NIcEdit-A WYSIWYG comment editor for wordpress

Sunday, July 13th, 2008

“UPDATE:The version 1.0 of the plugin is available on wordpress,please use following link to download

http://wordpress.org/extend/plugins/wp-nicedit/

and go to this page for updated information on the plugin http://geekytalks.com/2008/11/wp-nicedit-updated-version-10-released.html

Well,After working for the last 30 minutes,finally I am done with the plugin.WP NicEdit is a wordpress plugin which integrates Brian Kirchoff’s Nic Edit(a javascript based rich text editor) to wordpress comments area making it visully pleasing and enhancing its capability.it makes the Comments section feature rich.Once you Install this plugin you(Your visitors) get a visual editor for posting their comments.So it’s pleasing to have all this.

To See a demo, please look at the comment section of this page.still I am posting one of the pic to show how it looks like.

NicEditor How it Looks Like:–well here is a pic to depict how it looks like….

Nic Editor

Now how it looks when integrated to the Comments..Good question…

Integrated to comments

Now you Can choose the font-family,size,formatting and various other options while writing comments..wow..sounds Great..

Ahh..I forgot.. I need to put here ..how to install it…well..it’s damn simple…

Download:Update file is available here http://wordpress.org/extend/plugins/wp-nicedit/

For the updates,please visit my post http://geekytalks.com/2008/11/wp-nicedit-updated-version-10-released.html

Installation:

  1. Unzip wp-nicedit.zip
  2. Upload the wp-nic`edit folder to your wp-content/plugins/ directory
  3. Log in to your admin.Go to Plugins menu
  4. Find the “WP NicEdit” there and click activate.
  5. Congrats,You are done.Go and check your comments on any page/post it is working now :)

Please Note:IE6 is having a little trouble while integrating this plugin.The Visula editor will appear but it will not be enabled.i.e. you may not use the functionalities of NiCEditor.


How to OverCome it:Well the reason of this trouble is,there is a p tag wraping the text area in your comments.php file

Follow the following steps( only required for making it work in IE)
1.Open the Comments.php of your theme(found in your theme folder) in any of the text editor
2.Locate the line which says something like…

<p><textarea id=”comment” name=”comment”></textarea></p>

and replace it with <textarea id=”comment” name=”comment”></textarea>

i.e. we have removed the wrapping p tags.

That’s all we are done now.

If you have any problem with the plugin or wish to add some features please let me know.I am always open to your suggestions and will love to add the feature.Further please leave your comment below for any support i will reply within 24 hour.

Credits:

All the credit for the editor goes to Brian Kirchoff for making the wonderful editor.

I will also like to thank Michael for his great post 10 Best Plugins To Get More Comments from where i got to know about the NicEdit.


Bans Integration with wordpress for CrazyRChelicopters.com

Friday, July 4th, 2008

hi Chris

here is the detailed instruction on how to integrate wordpress and Bans.First of all you need to decide whether you want to use wordpress on your main domain and Bans on sub folder or vice-versa.

Here in this tutorial I am assuming that we have wordpress on our main domain and bans on the sub folder.

The structure of websites are something like

www.example.com –wodpress installed on main domain

www.example.com/bans //the bans folder ,where bans is installed

in our case the website structure are as

crazyrchelicopters.com
crazyrchelicopters.com/buy-rc-helis/

Now to make a seamless integration,we need to create a wordpress theme and then using the same layout as a Bans theme.

In our case , you don’t have to do anything,as i have already created the bans theme.

1. Upload wordpress theme to themes directory, in our case in wp-content/themes/

2. Upload the bans theme in /buy-rc-helis/themes/chris-theme //bans theme uploaded

3. Activate the wordpress theme.

4. Activate the bans theme ,and you are done, but stop , you are not done yet,

There are 2-3 minor modifications that you have to do to make the themes functional.

1. Open the wp-chris-theme //i.e. the wordpress theme to be integrated.

2. Open the file bansinclude.php from the theme folder,I have included this in wp-chris-theme

3.Go to Line number 2 and locate something like below

2
$rel_path_to_bans="/buy-rc-helis/";

Change the value with the relative path of the bans folder from public_html directory(i.e. from main domain).

4.Go to line number 14 and locate

14
define("BLOG_BANS_PATH","/buy-rc-helis/");

Change the value with the relative path of the Bans installation from wordpress root directory.In our case it is same as the relative path from domain root directory.

5.Save the file and upload it to the themes directory (wp_chris_theme),overwriting the earlier one.

Congrats, you have completed the first part of integration.Now you are done, and Bans is integrated to wordpres

Now you are able to display the Bans categories in the Wordpress sidebar.

Part2:

Integrating wordpress to bans Store(i.e. we will dynamically display all the wordpress categories in the sidebar of bans store).

1.Go to bans theme directory(open chris-theme)

2.Open the file wpbans.php
3.Go to line number 4

4
$wp_path="/";//path of wordpress installation from root directory of domain

Change the value with the relative path of the wordpress main installation from the serveres web root.

4.Go to line 17, and locate

17
define("BLOG_BANS_PATH","/buy-rc-helis/");//modify this line with the relative url of bans store

Change the value with the relative path of the BANS store from the wordpress installation.

Wow, seems like I am done.uff no, yet,there exists a problem.Your wordpress Installation and integration will work fine, but when you will try to access yor store you will get something error like

Can not redeclare get_extended() in cont/xml.php ,allready declared in wp-include/posts.php

Well this is a conflict caused by wordpress integration to Bans Store,wordpress and Bans both uses a function with name, get_extended(),so there is a fatal error.

After an experiment of a few hour, i found that the get_extended() function is used in BANS in only one file cont/xml.php and there are four calls of it in the file.i manually changed the name get_extended() to get_extended2() and changed all the calls in xml.php appropriately.Wow, now everything is functional and working great.

Ins summary, I will mention again the steps.

1.Upload the wordpress theme wp-chris theme to wordpres theme directory

2.Upload the chris-theme to bans theme directory

3.Activate wordpres theme.

4.Activate the Bans theme

5.Modify the bansinclude.php in wp-chris-theme folder and upload

6.Modify the wpbans.php in chris-theme(bans theme ) and upload

4.Overwrite the /bans/cont/xml.php with the modyfied xml.php in order to avoid the conflict.

5.Go visit the website,you are done.