Posts

Showing posts from 2011

Custom Twitter Feed in Webpage using Twitter API and Javascript

You can easily integrate live tweets of user/company using Twitter API. For this purpose, use the following two javascripts. http://twitter.com/javascripts/blogger.js http://twitter.com/statuses/user_timeline/your_user_or_company.json?callback=twitterCallback2&count=3 Please note that these both javascripts will need to be inserted before the closing body tag (</body>). The first script has two functions who are responsible for processing the JSON returned by the second script. You will need to replace "your_user_or_company.json" of second javascript with your desired user or company name what you want to get the tweets from. For example, if you want to get tweets from google on twitter then the your javascript url will be http://twitter.com/statuses/user_timeline/google.json?callback=twitterCallback2&count=3 Here  'twitterCallback2' is the callback function where the data will be thrown to process further once we get data by the above url ...

Changing Master Page ContentPlaceHolder Contents From Content Pages

We always need to have dynamic pages for our website and very often we generally use templates for them. In master-content page concepts we have them already where master page have the layout of the site and content pages supplies dynamic contents to master page. But it's not possible to manage master page content place holders from the content pages code-behind for dynamic contents because content place holders are placed in master pages. So we need to create similar environment of master pages in content pages by creating WebControls such as ContentPlaceHolder, Label, TextBoxes etc. To get controls of master pages we can use FindControl("ContenPlaceHolderID") and create similar WebControls in content pages code-behind so that we can manage controls easily. Suppose we want dynamic page header title in a webpage. The initial page url might be some thing like http://somedomain.com/demo.aspx?action=add and later we want to use the same page for edit function some th...

Adding and posting custom field values using WHMCS API

Yes, It's another achievement, another milestone for someone who are getting tired by searching solution for sending input values of client custom fields ( Eg. from a registration form) or submitting product/service custom fields (eg. from an order form)  through WHMCS API. It was good to play with the API until some confusion arose while submitting custom fields from input forms. WHMCS has a well documentation around the API Functions. It specifies that custom fields can be posted as a base64 encoded serialized array of custom field values. Like all other attributes it has to be bind with a post field variable, something like $postfields["customfields"]. So according to one WHMCS API Function: Add Order has the sample: $postfields["customfields"] = base64_encode(serialize(array("1"=>"Google"))); But confusion may come with these array values (array("1"=>"Google")). What does that "1" mean and why ...