Inline Callout in Autonomy Interwoven Teamsite

<inline>: Provides a method for making server-side inline callout programs that return multiple XML elements to the data capture form. It is like include method in any other anguage.

Syntax of  inline callout in Teamsite:

Example of inline callout in Teamsite:

The inline callout program should return a well-formed XML document. The document’s outermost element should be a <substitution> element. It should contain any XML that is valid according to datacapture.dtd. That <substitution> element will contain six <option> elements as follow

This simple callout outputs a static result. A more sophisticated callout program could query a database and return the query results as <option> elements. When a server-side inline callout program is executed, it inherits the following  environment variables:„

  • IW_DCT: The server-inclusive vpath to the datacapture.cfg in use (for example, //servername/default/main/development/WORKAREA/username/templatedata/press/events/datacapture.cfg).
  • „IW_ROLE: The role of the current data capture user (for example, editor).
  • IW_USER: The domain and full user name of the current templating user (for example, domain\username).
  • „ IW_WORKAREA: The vpath to the current workarea (for example, //servername/default/main/development/WORKAREA/username).

The exit status from a server-side inline callout should be 0 to indicate a successful execution. Normally an inline callout should not return a non-zero value. However, an example where a non-zero value may be needed to indicate an error condition is if you are populating a <select> menu by making a database query and the database is offline. Rather than displaying a form with no choices, you may prefer an exception be displayed.

Calling Perl file Using inline command:

Here first we need to pass the commnad that execute the perl file code and second is the path to the perl file to be executed. Perl file should return well-formed XML as per above example. Perl file can return any number of example.

Getting passed parameter value in perl variable:

You can set first parameter value to perl variable as follow

Second Parameter as

Like this you can get any number of parameter passed using $ARGV.

You can get IW Home, IW Mount, Current Workarea path and DCT Path as follow:

You can extract Server, Store, Branch, Workarea name, Category and Datatype in one line code as follow:

Please comment if this information is useful to you or any you have any queries.

Whatsapp Alternatives (Other Options)

Few months before, I bought a new android mobile and started using many apps for free. It is really great experience using android mobile. Whatsapp is really nice app to chat with friends using data line, it supports sharing photos, videos and audio. It have some nice features to broadcast messages, group chat etc.

Some of the available alternates for Whatsapp are as follow. Use which ever you like, Invite your friends and Enjoy free chatting and sharing.

eBuddy XMS:

eBuddy Messenger is even the very popular Social Media Chat application and this eBuddy XMS not only just a chat application but you can even share Photos, video and emoticon. The XMS allows you to stay connected with friends, family and other who are in your contact list.

Download it from Google Play.

ChatPlus:

ChatPlus is an  Android chatting service which allows you to chat with your friends easier and more enjoyably in various way. By fast and correct push notification, you can exchange not only text messages but also photos,videos and voice, locations and handwrites without having to pay for that. And also ChatPlus supports a language translation and posting to Twitter and Facebook. In addition, ChatPlus provides a group chat and mass broadcast.

Download ChatPlus for Android.

GroupMe:

GroupMe allows you to manage Groups and add your contacts from Social Media too.  In Group me you can send and receive messages using your data connection and in case if you have a poor connection, the app can switch you to SMS so you’ll never miss a message. The Location System in GroupMe is unique and it will show you all member’s who resides on Group on Map, Great !

Download GroupMe for Android:

ChatOn:

ChatOn App from Samsung is giving a strong competition to WhatsApp because of it’s Manufacturer and obviously cause of it’s features too. You can chat to your Buddies via personal chat or group chat and can easily share the Pictures, Videos and other Multimedia Formats. You can view all share of multimedia content on ChatOn through one simple option called Trunk.

Download ChatOn for Android:

Viber:

Viber is an application for that lets you make free phone calls to anyone that also has the application installed. When you use Viber, calls and text messages to any other Viber user are free, and the sound quality is much better than a regular call. You can call or text any Viber user, anywhere in the world, for free. All Viber Features are 100% FREE and do not require any additional “in application” purchase.

Download Viber for Android:

Kik Messenger:

Kik Messenger lets you make free messages like Whatsapp. Kik Messenger is not using phone number as identity user has its own identity on Kik messenger. It is fast, better graphics and organization of conversations and contacts, Finds contacts from your existing contact list (just like whatsapp) and completely free.

Download Kik Messenger for Android:

hike:

hike is a new messenger that lets you send free messages to your friends and family! With hike you can message friends that are on hike and also those who aren’t on hike too! You’ll never have to use another messaging app again. Better yet, it’s absolutely free!  It also support photos, Video and Audio sharing. It supports group messages.

Download hike for Android:

So here ends our list of WhatsApp alternatives (Other Options) for Android, if you liked this list, please share it on your social network profiles, If you would like to suggest any app our readers or would like to improve this list, please do let us know in comments section below.

 

Android background processing – AsyncTask

Developing on Android? Need to call the some services or sync with cloud servers or may be you need to do some time consuming task you need to do background processing

there are three ways to do that

AsyncTask

Service

Thread

Today we will see how AsyncTask works, AsyncTask is a wrapper around Threads. It allows to process something in background and post the results and progress on UI Thread in relatively very easy manner.

For implementing AsyncTask you need to extend

android.os.AsyncTask<Params, Progress, Result>

the three Type parameters that you can specify are

Params –  the type of the parameters sent to the task upon execution.

Progress –  the type of the progress units published during the background computation.

Result –  the type of the result of the background computation.

In AsyncTask you must implement the doInBackground (Params… params) method which needs to return the Result type parameter you have defined. You need to do or call the required background processing in this method. Other then that you can implement this following methods.

onPreExecute() – Runs on the UI thread before doInBackground. You can do any UI related update in this i. e. showing progressbar.

onProgressUpdate (Progress… values) – It runs on UI Thread when you call publishProgress (Progress… values) i. e. you can update your preogressbar for the progress being done in this method or may be adding fields to your layout.

OnCancelled() – is called after doInBackground (Params… params) when AsyncTask is cancelled by calling cancel(boolean) we should keep checking weather the task is cancelled using isCancelled() method inside doInBackground (Params… params).

onPostExecute (Result result) – It is executed after doInBackground the parameter Result is needed to be Type of Result you have set in your class header. The reault is what you have returned in doInBackground. onPostExecute runs on UI thread so you can reflect completion of your background processing according to the result you received. i.e. hiding the progressbar and showing the final outcome of processing.

Let us see an example on AsyncTask.

I assume you have already setup android and eclipse with adt and know how to create basic project. If not have a look here

First of all we will declare the AsycTask we want to use with following statement

To make the UI we will create the following structure within main.xml file

For representing this UI component in out Activity we will declare the following Fields

and here goes onCreate method of activity with helper method to show hide the ProgressBar

and to add actions on the two buttons we hace added the tags

and

So when this buttons are clicked the methods startTask and cancelTask will be called . We need to create this methods in our activity.

startTask will create task and run it while cancelTask will cancel the task if it is running.

 

 

Here inside startTask we create new instance of AsyncTask and assign its handle to myTask while inside cancelTask we just call cancel() method of myTask.

You can download the source code of this tutorial from here and run it for your self.

When you click startTask button it will create new AsyncTask and execute it with parameter String “This is asyncTask Demo.” and split the string in background and display at particular interval demonstrating updating UI with process update. You may do any other background processing here and reflect it to UI through onProgressUpdate method.

Thats it for AsyncTask. We will discuss Background processing with Services in Android in Upcoming Posts.

WordPress How to set SESSION Custom Variable While Login

Hello friends,

Sometimes we need to set custom session variable for using in our custom code or any other web application which also running parallely with our wordpress installation. Also some time there is need to set and destroy our session variable for our custom web application when wordpress user login or logout.

So first of all we need to enable session in wordpress. I have tested this code in wordpress 3.X. First we need to start the session every time wordpress initialize. To initialize session in wordpress we can use below code.

This will start the session every time wordpress loads. In this function you can write any other session variable that you need to set default. Then we also need to destroy the session when wordpress user logout. To destroy the session and unset any variable we can use below code:

In this function you can write any other session variable that you want to unset.

Now, How can we set user data into the session variable? Answer is very simple see the below code:

Here we add authentication filter of wordpress to set the session. Also we can use this authenticate filter to restrict certain user from login into the wordpress. This function will set the session and later we can use it any where in the wordpress. Also you can set other system session variable so that when any user logs in wordpress he also get logs in other Custom system but condition is both wordpress installation and custom system need to be on same server.

Please post your comment here if this information helps you. I will keep posting more as I come to know more things.

Thank you 🙂

 

 

 

6 Essential Business Tips To Grow Your Side Business

I’ve been creating websites for 10 years. I started my career knowing absolutely nothing about web design or development.

I went to school for graphic design and figured web design can’t be much different (though it is).

I’m your typical working class person. I traveled the traditional route of going to college then getting a job. Everyone and I mean EVERYONE would always tell me, “you need to get a good job”, “you need a nice paying 9 – 5″, “work on your resume so someone will hire you”. The person inside me always had to do the right safe thing and I always did.

You may have read books are heard stories of people that will tell you how to be successful, how to be a millionaire, business secrets of someone that’s already rich, and all the rest. Once you read these you realize that this is all coming from a perspective of someone whose already there or has been there for some time.

I bet you’ve heard this before too “You don’t get anywhere without taking risks.” I just want you to know that I hate that saying. I’m married with a newborn baby. Am I really going to “risk” the well being of my family for sake of my dream?

If you’re like me, you can’t just quit your day job and do what you want. However, you still want to do something. Well, I’ve been doing something since I started my career in web design and I’m slowly starting to see the efforts pay off.

I’m going to share with you what I’ve learned in my career so far and how I continue to move forward. I’ve never done this before as I always felt that selfish attitude like “Oh, look what I found, now I’ll keep it for me.” But as I grow, I realize that that is something I just can’t do. I’ll get more into that in another topic, but let’s start off with my opinions on the basics.

1. The Best Time To Start A Business

I think the best time to start a business is once you graduate, whether it’s high school or college. Like most people, when you graduate high school or college you live at home.

When my kid is older he’s going to read this and I’m going to kick myself for writing it, but when you live at home MILK YOUR PARENTS FOR EVERYTHING IT’S WORTH! I’m serious! You really don’t have any responsibilities yet. You may pay a bill here or there, but you’re not paying rent or mortgage. When you don’t pay rent or mortgage, or grocery shop, or (add any one of the many expenses home owners/renters pay), you can live like a king with such a tiny bit of money!

The sad thing for me as an adult, is I didn’t realize this until I was already moved out in an apartment with my wife. But fret not fellow readers, that doesn’t mean it’s too late to start a business. That only means you have to start getting creative and seeing what kind of business you can manage. As a full time web designers/developer, this decision was clear.

The business really doesn’t have any overhead. These were my total expenses

  • Buy a computer for working (if you don’t have one) – $2k (Yeah I splurged a little but you know what, you need a good computer. Plus this was like 6 years ago and it’s still running nice!)
  • Buy a domain – $10 a year, if that.
  • Get a hosting account – $10 bucks a month.

That’s it.

Now you can start at any time, at any point, and your monthly overhead is nothing.

2. Start somewhere

You may not know where you want to be in 5 years, but the key is to start somewhere, anywhere. It doesn’t matter, just do something, even if it’s writing ideas down. I have SO many ideas in my head and topics that my problem is I don’t know where to start. Pick one and roll with it!

If you get caught up with multiple ideas, figure out which one will be the most beneficial to you and start there. Even though you think all of your ideas are million dollar ideas, the reality is, you can’t do everything.

Find what’s practical and push it full throttle.

3. Network your ass off

This is definitely one of, if not the, most important rule of all. What you do now will pay off years down the line. People you meet, events that you go to – these all play a huge factor in getting people to know you. Carry business cards or some type of trinket that you can leave with everyone you meet, and I mean EVERYONE!

When you go to the doctor, leave some cards. If you meet a new person from a friend, leave them a card. Leave cards everywhere you go and with everyone you meet. Make sure they know exactly what you do.

I’ve received calls and emails from people that I barely spoke to saying they had one of my cards and they needs a website. Most of the time this turns into new jobs for me, which means more money! Network and don’t stop networking.

4. Read and Learn as much as you can, as often as you can

Diversify yourself and at the same time keep your niche. What I mean by that is learn a little about everything and apply it to what you already know. Experiment with everything you learn and always remember…You Will Fail –It’s perfectly OK to fail. As a matter of fact, if you never fail, you’ll never learn anything.

Read how experienced professionals do things and see how you can apply it. Learn new techniques to solve common tasks. As long as you keep on learning, you’ll always have an opinion and can figure out how to tweak strategies, techniques, amongst many other things to your benefit.

The best part is you’ll always be able to regurgitate certain things to YOUR audience in your own words… great for blogging!

5. Your business should reflect who you are

You’ll hear stories of how certain people manage their time, and howtheygot money, etc. What you need to do is focus on you. Take everythingtheydid and see how it relates to what you want to do. A lot of times, things don’t work out and certain requirements/capabilities are out of your means. That’s normal.

Your business has to be YOUR success, not someone else’s. Build it how you want it. If something isn’t working, find ways to change it, but you have to remain happy. After all, this is something that you want to do and hopefully have a passion for.

6. Don’t be selfish

Probably the hardest thing to do in any business is share what you’re doing. We hold on to words like “proprietary” or “non-disclosure”. This is my idea and my idea is going to make a million dollars and I can’t share it with anyone because then they will do it.

You’re not going to like me for this but…WHO CARES?!

If you don’t make a move on YOUR idea and someone else does it before you because you shared it, guess what, that’s life. Yes, it may suck but in the time I’ve been creating websites, I’ve realized something.

No one cares about your idea. People are wrapped up with there own ideas and day to day life that they probably don’t even have time to work on your idea. Even still, when you release your idea to the public, guess what, people are probably going to steal it. Sorry to be so blunt but here’s an example:

  • Pepsi – Coke
  • Seagrams Ginger Ale – Schweppes Ginger Ale
  • Windows – Mac
  • Ford – Nissan, Toyota, Hyndai

The list can go on. There can be more than one of something, and most of the time there usually is.

The way to deal with it is simple. It’s your idea, so you though of it, therefore, no one will be able to do it like you. Plus, since itisyouridea, you can always change it and you’ll ALWAYS be one step ahead of the person who took it from you.

I understand that this is hard to do because I’m definitely guilty of it myself. By writing this article, I’m basically pouring out my 10 years of experience in business (side business) and letting you in my head. In the future, I’ll also be sharing my “million dollar” ideas and I hope when someone takes them, they give me some cred =).

So there you have it! Those are my 6 essential business tips to grow your side business. If your a full time working person and need some cash on the side, these tips will definitely keep it flowing. If you decide that you want to take your side business and go full time, then these business tips will definitely help your side business grow into a full on business.

About the author:

My name is Jonathan and I’ve been creating websites for about 10 years now.

I love to use the Genesis Framework and have been working in depth with WordPress for the last couple of years. I’m an expert in front-end HTML and CSS as well as a successful web designer and graduate of Ben’s Pro Web Design Course.

You can visit my blog any time at SureFireWebServices.com to find practical uses of html, wordpress, css, and jquery as well as some of my insight to the web world.

 

Note: I have taken this Post from Here http://www.webdesignfromscratch.com/business/6-essential-business-tips-to-grow-your-side-business/ ,

Thanks to post such a lovely post. I am posting it here again for my and my friends reference.

Thank you

WordPress query posts by page id

It is very simple just use page_id argument and pass the page_id to query post.

 

Thanks

What is Content Management?

Now a days, Many CMSs (Content Management Systems) are available. Many of them are in PHP, .Net, Java and other computer web languages. Every time we came accross the CMS in day life. So the question is what is content management exactly? So I write an article on it. Hope this will Help you…!

Understanding Content

Before We go into content management, We should take a moment to better understand
the concept of content itself. Only in this way we can more fully understand content management, the impact it has had in modern-day e-business, and the effectiveness, usefulness, and vital role of CMSs.

We define content in an organization as any organizational informational asset that exists in an electronic medium. Although it can be argued that any physical information resource can be classified as content, in the context of this article and content management systems we will not consider any source as content until it exists in an electronic form. Some typical examples of content include e-books, manuals, publications, web pages, video files, music, instructional material, promotional material, help text…the list goes on and on. You can classify anything as content for an organization if it fits into all of the following sections.

Content Has a Classification Type

Typically the classification type is organizational; in other words, content can be categorized by an organizational unit such as marketing content, legal content, general content, privacy content, and so forth. A company that performs only legal services may use contracts, wills, deeds of trust, billing invoices, summons, and other legal type content, while a medical publishing company may depend upon drug data sheets, patient handouts, medical books, and drug news as content

Content Has a File Type/MIME Type

Any piece of content has an associated file type, that is, the file extension that is tied to a particular program or standard. On the Windows platforms, file extensions tell the operating system the program or application to launch to service the specific file type. For example, an image file will generally have an extension such as .gif, .jpeg, .jpg, .bmp, .png, or .tif. In a CMS, file types are important to drive storage placement and delivery requirements, as well as to determine how certain files will be viewed. For example, in CMSs, the file type may control whether certain files are displayed in an iframe, a separate window, or the current window.

Content Has Metadata

Content has data attributes that describe it. These data attributes are described collectively as metadata. Metadata is used for many functions within a CMS:

Indexing data for search-related capabilities: You can intelligently add keywords to each content type via a defined taxonomy. A taxonomy is an intelligent mapping of taxons (the highest-level grouping) and taxa (subgroups under each taxon) that are unambiguous and, when taken together, consider all the possible values. For example, have you ever played the guessing game 20 Questions? This game usually starts with someone thinking of something that you then have to guess based on the responses of the 20 questions you get to ask. Usually you start by asking something similar to “Is it an animal, vegetable, or mineral?” If the other person playing with you answers your question by saying “Animal,” then you may ask “Is it a dog, cat, or human?” You will then continue until you guess the subject or you run out of questions. Each of those high-level categories of Animal, Vegetable, or Mineral would be a taxon. The taxa would then stem from the higher-level taxon; for example, the taxa for the Animal taxon might be Dog, Cat, and Bird.

Clustering on metadata and exposing that clustering to search: For example, by clustering metadata, you can list all books or all documents from the marketing department or list all the content about a certain topic. With clustering metadata, you can capture important information such as the author name or publish date. When exposed to a search engine, you then provide the ability to list all books published by a certain author or, for example, all books published from 1995 to 2001. You could also capture the subject for specific topicbased searching. By clustering with metadata, you can accomplish advanced searches such as retrieving all the books published by a certain author, of a certain subject, and published from 1995 to 2001. By having clustering data available, you can group search results and create dynamic drill-down capabilities by dynamically rebuilding the search query.

Automating system-created content using an intelligent method: You can create new and complete content dynamically, where pieces of content are combined or aggregated into an entirely new piece of content based on system requirements or at run time. If content authoring is performed where content is created at the smallest possible level, then this is possible but still difficult to accomplish. Synthesizing content is especially useful for content such as marketing collateral and presentations that should be shared across an organization or several diverse sales teams.

Determining when data should be archived and when data should be removed: These topics are often overlooked in a CMS application. By setting metadata attributes and associating those attributes with content, you can manage the demotion or deletion of content. Additionally, if your corporation has retention standards, you can programmatically control when content is archived and even where the archived content is stored.
Determining when content is promoted or published: By associating metadata with your content, you can program that content’s promotion date and time. A business content review process will control when the content has reached an acceptable publishing state, but why not also control when that content is made live?

Content Requires Storage

Simply put, content takes up space, which is typically database space or space on a file system. Some examples of storage space used to store content include network-attached storage devices such as those provided by EMC, relational databases such as Oracle or SQL Server, and file systems such as the Unix file system or NTFS. No matter what the content or the content’s type, you must have adequate space in which to store it. All content has a certain number of bits and bytes that compose it. This collection of bits and bytes takes up disk space and must be accounted for in a CMS

Content Has a Purpose Not Related to the CMS

Configuration files, templates, or any other files that are used by the CMS should not be considered actual content. Basically, any file that does not provide value to a consumer of the content is not considered content. People who use content are also known as content consumers.

Content Management Defination

Content management is the organizing, directing, controlling, manipulating, promoting, and
demoting of content and/or digital informational assets within an organization. Promoting
content means deploying content from the authoring environment to the content delivery
environment, which is usually a web server. Demoting content means removing or rolling
back content from the content delivery environment to the content authoring environment.

A CMS manages those various pieces of content described earlier. This is extremely important for organizations because as a business grows, so do the complexities of its content. Businesses have hundreds, thousands, and sometimes millions of pages of content, and with the overwhelming flood of this content, they need help! A CMS is much more than an off-theshelf piece of software that a company purchases and configures for its specific needs. To understand content management, you not only have to have a view of the proverbial forest but also need to know where each tree belongs. Implemented properly, content management and a CMS can do the following:

  • Improve delivery time from content creation to content promotion
  • Improve content quality
  • Reduce the cost of managing an organization’s global or departmental content
  • Reduce redundancies in content and reduce human error
  • Eliminate orphaned files and broken links
  • Automate content notifications and the review process
  • Enforce legal and branding standards
  • Improve content visibility and accountability throughout the delivery chain

Implemented poorly, a CMS system can be a virtual money pit, where no efficiencies are gained and many hours are wasted on a project that may provide little to no value to end users or consumers. You must understand two important facts regarding a CMS:

  1. A CMS will not improve your business process. You will have to expend some analysis cycles and rethink existing processes and procedures to enhance your business flow. Only by improving your existing process will you realize the true benefit of content management.
  2. A CMS is not free. Skipping the cost of the solution itself, you will be burning hours to implement a system. Once everyone starts to use the system and find out what the system can do, they will want more. This will also lead to additional implementations and maintenance. This is a topic we cannot reinforce strongly enough: setting up a CMS is more expensive than just building an initial website. You must be willing to accept the initial cost of building and deploying a CMS before you experience a return on investment. But you will have to trust that all of the hard work, project hours, and budget allotments will pay off in the end.

Please comment below if you have any queries. We always here to help you.

WordPress Insert Post from Front End

Hi, In this article I will show one example plugin for making post entry from wordpress front end.

Screenshot:

Below is the sample code for the plugin

We can insert post in wordpress using wp_insert_post which is explained Here

In this sample I have created one sample shortcode for displaying plugin on front and in short code function I have added form to display and before that if post is submitted we will insert the post into database.

 Download | Source Code

 

WordPress Admin listing Table and Paging

Almost svery wordpress plugin developer needs to make Admin side listing for any custom table. This table generally store information that is gather from website and/or end users. Listing of table help to view the data in list format. It also allow admin to add, edit and Delete the data. It also allow bulk action for delete.

During my plugin development, I always wonder that how to make admin side listing for custom table which looks same as post and page listing. Also how can I make pagination for the table. I have searched for pagination and found many class to use that you can also found in my previous post. But I want to make it looks like as below:

 

 

After Searching for this I come to know that wordpress also providing the class for listing and paging for custom table. Class Name is Wp_List_Table. Wp_List_Table class is used to create admin screens for the wordpress. We need to extends this class and overload its method to use it.

Now the question is how to use this class and create admin side listing for our created custom table.

WordPress is providing one very good example plugin to see how we can create admin side listing for the custom table. You can find the example plugin Here

This example display code using Array of data. Instead of data we can use any database table. For creating your own table listing copy paste data into your file and follow below steps

Step 1: Create a new file under your plugin directory

Step 2: Include WP_List_Table class file into your file as follow:

Step 3: Create class for your custom table and extends it to WP_List_Table.

For this you can copy whole class from example plugin and paste it in your plugin file and rename the class name from TT_Example_List_Table to something else which is preferable for your plugin.

Step 4: If you are using database table for fetching data which will always a case in real life,  then delete the example data array.

We will fetch the data from database when it will be needed. Remove the below code:

Step 5: Setting up the naming and some configs for table listing.

Step 6: Set Default common value display for the every column using.

This method is called when the parent class can’t find a method  specifically build for a given column. Generally, it’s recommended to include one method for each column you want to render, keeping your package class neat and organized. For example, if the class needs to process a column named ‘title’, it would first see if a method named $this->column_title() exists – if it does, that method will be used. If it doesn’t, this one will be used. Generally, you should try to use custom column methods as much as  possible.

Step 7: If you have any column column which need to be display diffidently from other in the view. We can create this by below syntax

In example below is given

step 8: Display Check boxes for the bulk action.

step 9: get all column. here we specify which column to get for display.

This method dictates the table’s columns and titles. This should return an array where the key is the column slug (and class) and the value  is the column’s title text. If you need a checkbox for bulk actions, refer to the $columns array below.

Step 10: Decide which column to make sortable. This Method is optional.

If you want one or more columns to be sortable (ASC/DESC toggle), you will need to register it here. This should return an array where the key is the column that needs to be sortable, and the value is db column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).
This method merely defines which columns should be sortable and makes them clickable – it does not handle the actual sorting. You still need to detect the ORDERBY and ORDER query string variables within prepare_items() and sort your data accordingly (usually by modifying your query).

Step 11: Set up bulk action for selected check boxes. This method is optional

If you need to include bulk actions in your list table, this is the place to define them. Bulk actions are an associative array in the format ‘slug’=>’Visible Title’

If this method returns an empty value, no bulk action will be rendered. If you specify any bulk actions, the bulk actions box will be rendered with the table automatically on display().

Also note that list tables are not automatically wrapped in <form> elements, so you will need to create those manually in order for bulk actions to function.

Now we also need to set up what to do when any one of the bulk action has been called. This can done using below method. This method is optional.

step 12: This is most important step for the listing the table and fetching the database values.

Here find and delete the code

Below that there is function

Also delete this code this code is now no more needed as we are sorting through database query. Add The below Code here

Here first we have called global variable which is available in wordpress for the database operation. ‘$wpdb’ . Then set order by and order values and get the data.

Every things else remain as it is in this function no need to change.

step 13: Now we need to create function which will be called when page is going to display. We just need to create object of our newly created class.

And Display the data

Conclusion

This will create both listing and pagination for custom table in wordpress. I think this is really easy to use it rather creating table by self and searching for the pagination class and adding them to the code.

This helps developers to create very neat and clean code. Also, This code is fully compatible with wordpress.

Please comment your queries, Suggestion, Like or Dislike post here.

Enjoy..!!!

Note: This example which I have used which is already available in wordpress listing table plugin. I have explained using database connection which was missing in the plugin. Hope this will helps every wordpress developers.

Thank you….

Add Pagination Into WordPress Admin For Plugin

Often in many application, such as in WordPress Plugin, we will need to deal with list of records. As the records grow, more records will need to be displayed. There is a catch though, if you retrieve all the records at one go because it will slow the system down.

In order to have a better user experience for record listing, paging comes into play. It’ll not only help to organize the records by limiting the number of records you want to show per page, it also cuts the down the time of retrieving records. Therefore, pagination plays a very important part in providing a great user experience when interacting with the data.

Imaging if you have a list of 1000 or more records that you want to display. Without pagination, listing all the records will definitely take quite awhile and also increase the load for the database server when executing the query. This is not very efficient, even though retrieving records from database can be cheap.

Now let’s say we want to add in pagination into the 1000 records, by specifying the limit, it will only shows the exact amount of records you want to view. This is a huge benefit for the database server load, because we are not retrieving all the records at once.

Below examples are 2 different type of pagination and a demo on how to add pagination into WordPress Plugin.

Simple PHP Pagination Class

Copy the following code and save as pager.php, this file will be the pagination class. With this pagination classfrom Happycodings, it’d help us add pagination to the list of records easily.

Once you have the pager.php, instantiate the class as below. Change the $limit to your desired number of records to show per page and finally get the page list by echoing it out.

Digg Style Pagination

As the above simple pagination class is enough for us to display a list of page numbering for the records, but what will happen if there are a few hundreds of pages, isn’t the row of page numbering going to be very long too?

Here is another nice Digg Style Pagination class that you can consider if you think there will be a lot of pages for your records.

Download the pagination.class.php.

Go through the guide to customize the style or desired output for the paging you want. Now, to give you a clearer view on how to add this Digg Style Pagination class. Check out below to find out how to add the Digg Style Pagination to a WordPress Plugin.

How To Add Pagination To WordPress Plugin?

If you are building a WordPress plugin that require to display a list of records from database. As records get huge, you will need to have pagination so that you can organize your records well.

First, you will need to download the pagination.class.php and save it in your WordPress Plugin folder.

Next, in the PHP file that you want to list your records, insert the following code. Below are some of the methods we used from the pagination class. For the full list of methods, please refer to Digg Style Pagination Class Help Page.

Note that you will need to change the SQL query, pagination class configuration and table fields, in order to work nicely with your WordPress Plugin.

Now you know How to Add a Digg Style Pagination to a WordPress Plugin, it should make your listing of data much more efficient. Pagination saves your time and bandwidth so you can concentrate more on other implementing issues.

Still not sure about this tutorial on adding pagination? Or simply have an idea to share? Feel free to contact us or leave a comment here!